text
stringlengths
107
2.17M
Require Import basis. Require Import part1. Require Import part2. Require Import part3. Axiom constructed_parallel : forall (l : Line) (a : Point), {l' : Line | Par l' l /\ Incident a l'}. Definition par : Line -> Point -> Line. Proof. (* Goal: forall (_ : Line) (_ : Point), Line *) intros l a; elim (constructed_parallel l a). (* Goal: forall (x : Line) (_ : and (Par x l) (Incident a x)), Line *) intros x H; exact x. Qed. Axiom constructive_uniqueness_for_parallels : forall (l m : Line) (a : Point), DiLn l m -> (Apart a l \/ Apart a m) \/ ConLn l m. Theorem Ax1_i : forall (l : Line) (a : Point), Par (par l a) l. Proof. (* Goal: forall (l : Line) (a : Point), Par (par l a) l *) intros l a. (* Goal: Par (par l a) l *) unfold par at 1 in |- *. (* Goal: Par (@sig_rec Line (fun l' : Line => and (Par l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Par l' l) (Incident a l')) => Line) (fun (x : Line) (_ : and (Par x l) (Incident a x)) => x) (constructed_parallel l a)) l *) elim (constructed_parallel l a). (* Goal: forall (x : Line) (p : and (Par x l) (Incident a x)), Par (@sig_rec Line (fun l' : Line => and (Par l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Par l' l) (Incident a l')) => Line) (fun (x0 : Line) (_ : and (Par x0 l) (Incident a x0)) => x0) (@exist Line (fun l' : Line => and (Par l' l) (Incident a l')) x p)) l *) simpl in |- *; tauto. Qed. Theorem Ax1_ii : forall (l : Line) (a : Point), Incident a (par l a). Proof. (* Goal: forall (l : Line) (a : Point), Incident a (par l a) *) intros l a. (* Goal: Incident a (par l a) *) unfold par at 1 in |- *. (* Goal: Incident a (@sig_rec Line (fun l' : Line => and (Par l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Par l' l) (Incident a l')) => Line) (fun (x : Line) (_ : and (Par x l) (Incident a x)) => x) (constructed_parallel l a)) *) elim (constructed_parallel l a). (* Goal: forall (x : Line) (p : and (Par x l) (Incident a x)), Incident a (@sig_rec Line (fun l' : Line => and (Par l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Par l' l) (Incident a l')) => Line) (fun (x0 : Line) (_ : and (Par x0 l) (Incident a x0)) => x0) (@exist Line (fun l' : Line => and (Par l' l) (Incident a l')) x p)) *) simpl in |- *; tauto. Qed. Hint Resolve Ax1_i Ax1_ii. Theorem thm7_1 : forall (l m : Line) (a : Point), Incident a l /\ Par l m -> EqLn l (par m a). Proof. (* Goal: forall (l m : Line) (a : Point) (_ : and (Incident a l) (Par l m)), EqLn l (par m a) *) intros l m a H'; elim H'; intros H'0 H'1; try exact H'1; clear H'. (* Goal: EqLn l (par m a) *) generalize (Ax1_i m a); intro H'2. (* Goal: EqLn l (par m a) *) elim equiv_Par. (* Goal: forall (_ : Reflexive Line Par) (_ : Symmetric Line Par) (_ : Transitive Line Par), EqLn l (par m a) *) intros H'3 H'4 H'5. (* Goal: EqLn l (par m a) *) red in H'5. (* Goal: EqLn l (par m a) *) assert (H'8 := H'5 (par m a) m l); lapply H'8; [ intro H'9; lapply H'9; [ intro H'10; clear H'9 H'8 | clear H'9 H'8 ] | clear H'8 ]; auto. (* Goal: EqLn l (par m a) *) red in |- *; red in |- *; red in |- *; intro H'6. (* Goal: False *) lapply (constructive_uniqueness_for_parallels l (par m a) a); [ intro H'11 | assumption ]. (* Goal: False *) elim H'11; [ intro H'; elim H'; [ idtac | intro H'7; clear H' H'11 ] | idtac ]; auto. (* Goal: False *) elim (Ax1_ii m a); auto. Qed. Hint Resolve thm7_1. Theorem thm7_3 : forall (l m : Line) (a : Point), Incident a l -> Incident a m -> Par l m -> EqLn l m. Proof. (* Goal: forall (l m : Line) (a : Point) (_ : Incident a l) (_ : Incident a m) (_ : Par l m), EqLn l m *) elim equiv_EqLn. (* Goal: forall (_ : Reflexive Line EqLn) (_ : Symmetric Line EqLn) (_ : Transitive Line EqLn) (l m : Line) (a : Point) (_ : Incident a l) (_ : Incident a m) (_ : Par l m), EqLn l m *) intros H' H'0 H'1 l m a H'2 H'3 H'4. (* Goal: EqLn l m *) unfold Transitive at 1 in H'1. (* Goal: EqLn l m *) apply H'1 with (y := par m a); auto. (* Goal: EqLn (par m a) m *) apply H'0. (* Goal: EqLn m (par m a) *) elim equiv_Par; auto. Qed. Theorem thm7_4 : forall (l m n : Line) (a : Point), Apart a l -> Incident a m -> Incident a n -> Par n l -> Par m l -> EqLn m n. Proof. (* Goal: forall (l m n : Line) (a : Point) (_ : Apart a l) (_ : Incident a m) (_ : Incident a n) (_ : Par n l) (_ : Par m l), EqLn m n *) intros l m n a H' H'0 H'1 H'2 H'3; try assumption. (* Goal: EqLn m n *) apply thm7_3 with (a := a); auto. (* Goal: Par m n *) elim equiv_Par. (* Goal: forall (_ : Reflexive Line Par) (_ : Symmetric Line Par) (_ : Transitive Line Par), Par m n *) intros H'4 H'5 H'6; red in H'6. (* Goal: Par m n *) apply H'6 with (y := l); auto. Qed. Theorem DiLn_qimp_con : forall l m : Line, DiLn l m -> ex (fun b : Point => Incident b l /\ Incident b m) -> ConLn l m. Proof. (* Goal: forall (l m : Line) (_ : DiLn l m) (_ : @ex Point (fun b : Point => and (Incident b l) (Incident b m))), ConLn l m *) unfold Incident, Negation in |- *. (* Goal: forall (l m : Line) (_ : DiLn l m) (_ : @ex Point (fun b : Point => and (not (Apart b l)) (not (Apart b m)))), ConLn l m *) intros l m H' H'0; elim H'0; intros b E; elim E; intros H'1 H'2; clear E H'0. (* Goal: ConLn l m *) lapply (constructive_uniqueness_for_parallels l m b); [ intro H'5 | trivial ]. (* Goal: ConLn l m *) tauto. Qed. Theorem strict_parallel : forall (a : Point) (l : Line), Apart a l -> DiLn l (par l a). Proof. (* Goal: forall (a : Point) (l : Line) (_ : Apart a l), DiLn l (par l a) *) intros a l H'. (* Goal: DiLn l (par l a) *) lapply (cmp_apt_diln a l (par l a)); [ intro H'3 | trivial ]. (* Goal: DiLn l (par l a) *) elim H'3; [ trivial | intro H'0; clear H'3 ]. (* Goal: DiLn l (par l a) *) elim (Ax1_ii l a); auto. Qed. Hint Resolve strict_parallel. Theorem spar : forall (a : Point) (l : Line), Apart a l -> SPar l (par l a). Proof. (* Goal: forall (a : Point) (l : Line) (_ : Apart a l), SPar l (par l a) *) intros a l H'; red in |- *; auto. Qed. Hint Resolve spar.
Require Import nat_trees. Require Import search_trees. Require Import Arith. Inductive RMAX (t t' : nat_tree) (n : nat) : Prop := rmax_intro : occ t n -> (forall p : nat, occ t p -> p <= n) -> (forall q : nat, occ t' q -> occ t q) -> (forall q : nat, occ t q -> occ t' q \/ n = q) -> ~ occ t' n -> search t' -> RMAX t t' n. Hint Resolve rmax_intro: searchtrees. Lemma rmax_nil_nil : forall n : nat, RMAX (bin n NIL NIL) NIL n. Proof. (* Goal: forall n : nat, RMAX (bin n NIL NIL) NIL n *) intro n; split; auto with searchtrees arith. (* Goal: forall (q : nat) (_ : occ (bin n NIL NIL) q), or (occ NIL q) (@eq nat n q) *) (* Goal: forall (p : nat) (_ : occ (bin n NIL NIL) p), le p n *) intros p H; inversion_clear H; auto with searchtrees arith. (* Goal: forall (q : nat) (_ : occ (bin n NIL NIL) q), or (occ NIL q) (@eq nat n q) *) (* Goal: le p n *) (* Goal: le p n *) absurd (occ NIL p); auto with searchtrees arith. (* Goal: forall (q : nat) (_ : occ (bin n NIL NIL) q), or (occ NIL q) (@eq nat n q) *) (* Goal: le p n *) absurd (occ NIL p); auto with searchtrees arith. (* Goal: forall (q : nat) (_ : occ (bin n NIL NIL) q), or (occ NIL q) (@eq nat n q) *) intros q H; inversion_clear H; auto with searchtrees arith. Qed. Lemma rmax_t_NIL : forall (t : nat_tree) (n : nat), search (bin n t NIL) -> RMAX (bin n t NIL) t n. Proof. (* Goal: forall (t : nat_tree) (n : nat) (_ : search (bin n t NIL)), RMAX (bin n t NIL) t n *) intros t n H; split; auto with searchtrees arith. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) (* Goal: forall (p : nat) (_ : occ (bin n t NIL) p), le p n *) intros p H0. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) (* Goal: le p n *) elim (occ_inv n p t NIL H0); intro H1. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) (* Goal: le p n *) (* Goal: le p n *) elim H1; auto with searchtrees arith. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) (* Goal: le p n *) elim H1; intro H2. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) (* Goal: le p n *) (* Goal: le p n *) apply lt_le_weak. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) (* Goal: le p n *) (* Goal: lt p n *) elim (maj_l n t NIL H); auto with searchtrees arith. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) (* Goal: le p n *) absurd (occ NIL p); auto with searchtrees arith. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall (q : nat) (_ : occ (bin n t NIL) q), or (occ t q) (@eq nat n q) *) intros q H1; elim (occ_inv n q t NIL H1); intros; auto with searchtrees arith. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: or (occ t q) (@eq nat n q) *) elim H0. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall _ : occ NIL q, or (occ t q) (@eq nat n q) *) (* Goal: forall _ : occ t q, or (occ t q) (@eq nat n q) *) auto with searchtrees arith. (* Goal: search t *) (* Goal: not (occ t n) *) (* Goal: forall _ : occ NIL q, or (occ t q) (@eq nat n q) *) intro H'; absurd (occ NIL q); auto with searchtrees arith. (* Goal: search t *) (* Goal: not (occ t n) *) apply not_left with n NIL; auto with searchtrees arith. (* Goal: search t *) apply search_l with n NIL; auto with searchtrees arith. Qed. Hint Resolve rmax_t_NIL: searchtrees. Section RMAX_np. Variable n p q : nat. Variable t1 t2 t3 t' : nat_tree. Hypothesis S1 : search (bin n t1 (bin p t2 t3)). Hypothesis R1 : RMAX (bin p t2 t3) t' q. Hint Resolve S1 R1: searchtrees. Remark rmax_1 : occ (bin n t1 (bin p t2 t3)) q. Proof. (* Goal: occ (bin n t1 (bin p t2 t3)) q *) elim R1; auto with searchtrees arith. Qed. Hint Resolve rmax_1: searchtrees. Remark rmax_2 : n < p. Proof. (* Goal: lt n p *) elim (min_r _ _ _ S1); auto with searchtrees arith. Qed. Hint Resolve rmax_2: searchtrees. Remark rmax_3 : min n t'. Proof. (* Goal: min n t' *) apply min_intro. (* Goal: forall (q : nat) (_ : occ t' q), lt n q *) intros q' H. (* Goal: lt n q' *) elim R1; intros. (* Goal: lt n q' *) elim (min_r _ _ _ S1); auto with searchtrees arith. Qed. Hint Resolve rmax_3: searchtrees. Remark rmax_4 : search (bin n t1 t'). Proof. (* Goal: search (bin n t1 t') *) apply bin_search. (* Goal: min n t' *) (* Goal: maj n t1 *) (* Goal: search t' *) (* Goal: search t1 *) apply search_l with n (bin p t2 t3); auto with searchtrees arith. (* Goal: min n t' *) (* Goal: maj n t1 *) (* Goal: search t' *) elim R1; auto with searchtrees arith. (* Goal: min n t' *) (* Goal: maj n t1 *) apply maj_l with (bin p t2 t3); auto with searchtrees arith. (* Goal: min n t' *) auto with searchtrees arith. Qed. Hint Resolve rmax_4: searchtrees. Remark rmax_5 : n < q. Proof. (* Goal: lt n q *) elim R1; intros; apply lt_le_trans with p; auto with searchtrees arith. Qed. Hint Resolve rmax_5: searchtrees. Remark rmax_6 : forall p0 : nat, occ (bin n t1 (bin p t2 t3)) p0 -> p0 <= q. Proof. (* Goal: forall (p0 : nat) (_ : occ (bin n t1 (bin p t2 t3)) p0), le p0 q *) intros p0 H. (* Goal: le p0 q *) elim R1. (* Goal: forall (_ : occ (bin p t2 t3) q) (_ : forall (p0 : nat) (_ : occ (bin p t2 t3) p0), le p0 q) (_ : forall (q : nat) (_ : occ t' q), occ (bin p t2 t3) q) (_ : forall (q0 : nat) (_ : occ (bin p t2 t3) q0), or (occ t' q0) (@eq nat q q0)) (_ : not (occ t' q)) (_ : search t'), le p0 q *) intros H0 H1 H2 H3 H4 H5. (* Goal: le p0 q *) elim (occ_inv _ _ _ _ H); intro H6. (* Goal: le p0 q *) (* Goal: le p0 q *) elim H6; auto with searchtrees arith. (* Goal: le p0 q *) elim H6; intro H7. (* Goal: le p0 q *) (* Goal: le p0 q *) elim (maj_l _ _ _ S1). (* Goal: le p0 q *) (* Goal: forall _ : forall (q : nat) (_ : occ t1 q), lt q n, le p0 q *) intro H8. (* Goal: le p0 q *) (* Goal: le p0 q *) cut (p0 < n); auto with searchtrees arith. (* Goal: le p0 q *) (* Goal: forall _ : lt p0 n, le p0 q *) intro; apply lt_le_weak. (* Goal: le p0 q *) (* Goal: lt p0 q *) apply lt_trans with n; auto with searchtrees arith. (* Goal: le p0 q *) elim (min_r _ _ _ S1); auto with searchtrees arith. Qed. Hint Resolve rmax_6: searchtrees. Remark rmax_7 : forall q' : nat, occ (bin n t1 t') q' -> occ (bin n t1 (bin p t2 t3)) q'. Proof. (* Goal: forall (q' : nat) (_ : occ (bin n t1 t') q'), occ (bin n t1 (bin p t2 t3)) q' *) intros q' H; elim (occ_inv _ _ _ _ H); intro H0. (* Goal: occ (bin n t1 (bin p t2 t3)) q' *) (* Goal: occ (bin n t1 (bin p t2 t3)) q' *) elim H0; auto with searchtrees arith. (* Goal: occ (bin n t1 (bin p t2 t3)) q' *) elim H0; auto with searchtrees arith. (* Goal: forall _ : occ t' q', occ (bin n t1 (bin p t2 t3)) q' *) intro H1; elim R1; auto with searchtrees arith. Qed. Hint Resolve rmax_7: searchtrees. Remark rmax_8 : ~ occ (bin n t1 t') q. Proof. (* Goal: not (occ (bin n t1 t') q) *) unfold not in |- *; intro F. (* Goal: False *) elim (occ_inv _ _ _ _ F). (* Goal: forall _ : or (occ t1 q) (occ t' q), False *) (* Goal: forall _ : @eq nat n q, False *) intro eg; absurd (n < q); auto with searchtrees arith. (* Goal: forall _ : or (occ t1 q) (occ t' q), False *) (* Goal: not (lt n q) *) elim eg; auto with searchtrees arith. (* Goal: forall _ : or (occ t1 q) (occ t' q), False *) simple induction 1; intro H1. (* Goal: False *) (* Goal: False *) absurd (occ t1 q); auto with searchtrees arith. (* Goal: False *) (* Goal: not (occ t1 q) *) apply not_left with n (bin p t2 t3); auto with searchtrees arith. (* Goal: False *) elim R1; auto with searchtrees arith. Qed. Hint Resolve rmax_8: searchtrees. Remark rmax_9 : forall q0 : nat, occ (bin n t1 (bin p t2 t3)) q0 -> occ (bin n t1 t') q0 \/ q = q0. Proof. (* Goal: forall (q0 : nat) (_ : occ (bin n t1 (bin p t2 t3)) q0), or (occ (bin n t1 t') q0) (@eq nat q q0) *) intros q0 H. (* Goal: or (occ (bin n t1 t') q0) (@eq nat q q0) *) elim (occ_inv _ _ _ _ H). (* Goal: forall _ : or (occ t1 q0) (occ (bin p t2 t3) q0), or (occ (bin n t1 t') q0) (@eq nat q q0) *) (* Goal: forall _ : @eq nat n q0, or (occ (bin n t1 t') q0) (@eq nat q q0) *) simple induction 1; left; auto with searchtrees arith. (* Goal: forall _ : or (occ t1 q0) (occ (bin p t2 t3) q0), or (occ (bin n t1 t') q0) (@eq nat q q0) *) simple induction 1; intro H'. (* Goal: or (occ (bin n t1 t') q0) (@eq nat q q0) *) (* Goal: or (occ (bin n t1 t') q0) (@eq nat q q0) *) left; auto with searchtrees arith. (* Goal: or (occ (bin n t1 t') q0) (@eq nat q q0) *) elim R1; intros H1 H2 H3 H4 H5 H6. (* Goal: or (occ (bin n t1 t') q0) (@eq nat q q0) *) elim (H4 _ H'); auto with searchtrees arith. Qed. Hint Resolve rmax_9: searchtrees. Lemma rmax_t1_t2t3 : RMAX (bin n t1 (bin p t2 t3)) (bin n t1 t') q. Proof. (* Goal: RMAX (bin n t1 (bin p t2 t3)) (bin n t1 t') q *) apply rmax_intro; auto with searchtrees arith. Qed. End RMAX_np. Hint Resolve rmax_t1_t2t3: searchtrees. Lemma rmax : forall t : nat_tree, search t -> binp t -> {q : nat & {t' : nat_tree | RMAX t t' q}}. Proof. (* Goal: forall (t : nat_tree) (_ : search t) (_ : binp t), @sigT nat (fun q : nat => @sig nat_tree (fun t' : nat_tree => RMAX t t' q)) *) simple induction t; [ intros s b; exists 0; exists NIL | intros n t1 hr1 t2; case t2; [ intros hr2 s b; exists n; exists t1 | intros n' t1' t2' hr2 s b; elim hr2; [ intros num ex; elim ex; intros tr htr; exists num; exists (bin n t1 tr) | idtac | idtac ] ] ]; auto with searchtrees arith. (* Goal: search (bin n' t1' t2') *) (* Goal: RMAX NIL NIL O *) absurd (binp NIL); auto with searchtrees arith. (* Goal: search (bin n' t1' t2') *) eapply search_r; eauto with searchtrees arith. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglesreflexive. Require Export GeoCoq.Elements.OriginalProofs.lemma_angleorderrespectscongruence. Require Export GeoCoq.Elements.OriginalProofs.lemma_crossbar. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_angleordertransitive : forall A B C D E F P Q R, LtA A B C D E F -> LtA D E F P Q R -> LtA A B C P Q R. Proof. (* Goal: forall (A B C D E F P Q R : @Point Ax0) (_ : @LtA Ax0 A B C D E F) (_ : @LtA Ax0 D E F P Q R), @LtA Ax0 A B C P Q R *) intros. (* Goal: @LtA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists U V W, (BetS U W V /\ Out Q P U /\ Out Q R V /\ CongA D E F P Q W)) by (conclude_def LtA );destruct Tf as [U[V[W]]];spliter. (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA P Q W D E F) by (conclude lemma_equalanglessymmetric). (* Goal: @LtA Ax0 A B C P Q R *) assert (neq D E) by (forward_using lemma_angledistinct). (* Goal: @LtA Ax0 A B C P Q R *) assert (neq E D) by (conclude lemma_inequalitysymmetric). (* Goal: @LtA Ax0 A B C P Q R *) assert (neq E F) by (forward_using lemma_angledistinct). (* Goal: @LtA Ax0 A B C P Q R *) assert (neq Q U) by (conclude lemma_raystrict). (* Goal: @LtA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists G, (Out E D G /\ Cong E G Q U)) by (conclude lemma_layoff);destruct Tf as [G];spliter. (* Goal: @LtA Ax0 A B C P Q R *) assert (neq Q W) by (forward_using lemma_angledistinct). (* Goal: @LtA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists J, (Out E F J /\ Cong E J Q W)) by (conclude lemma_layoff);destruct Tf as [J];spliter. (* Goal: @LtA Ax0 A B C P Q R *) assert (nCol D E F) by (conclude lemma_equalanglesNC). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA D E F D E F) by (conclude lemma_equalanglesreflexive). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA D E F G E J) by (conclude lemma_equalangleshelper). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA G E J D E F) by (conclude lemma_equalanglessymmetric). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA G E J P Q W) by (conclude lemma_equalanglestransitive). (* Goal: @LtA Ax0 A B C P Q R *) assert (eq W W) by (conclude cn_equalityreflexive). (* Goal: @LtA Ax0 A B C P Q R *) assert (Out Q W W) by (conclude lemma_ray4). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA G E J U Q W) by (conclude lemma_equalangleshelper). (* Goal: @LtA Ax0 A B C P Q R *) assert (nCol G E J) by (conclude lemma_equalanglesNC). (* Goal: @LtA Ax0 A B C P Q R *) assert (nCol U Q W) by (conclude lemma_equalanglesNC). (* Goal: @LtA Ax0 A B C P Q R *) assert (Triangle G E J) by (conclude_def Triangle ). (* Goal: @LtA Ax0 A B C P Q R *) assert (Triangle U Q W) by (conclude_def Triangle ). (* Goal: @LtA Ax0 A B C P Q R *) assert (Cong G J U W) by (conclude proposition_04). (* Goal: @LtA Ax0 A B C P Q R *) assert (eq W W) by (conclude cn_equalityreflexive). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA D E F U Q W) by (conclude lemma_equalangleshelper). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA U Q W D E F) by (conclude lemma_equalanglessymmetric). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA D E F U Q W) by (conclude lemma_equalangleshelper). (* Goal: @LtA Ax0 A B C P Q R *) assert (LtA A B C U Q W) by (conclude lemma_angleorderrespectscongruence). (* Goal: @LtA Ax0 A B C P Q R *) rename_H H; let Tf:=fresh in assert (Tf:exists H S T, (BetS S H T /\ Out Q U S /\ Out Q W T /\ CongA A B C U Q H)) by (conclude_def LtA );destruct Tf as [H[S[T]]];spliter. (* Goal: @LtA Ax0 A B C P Q R *) assert (Out Q U P) by (conclude lemma_ray5). (* Goal: @LtA Ax0 A B C P Q R *) assert (neq Q H) by (forward_using lemma_angledistinct). (* Goal: @LtA Ax0 A B C P Q R *) assert (eq H H) by (conclude cn_equalityreflexive). (* Goal: @LtA Ax0 A B C P Q R *) assert (Out Q H H) by (conclude lemma_ray4). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA A B C P Q H) by (conclude lemma_equalangleshelper). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA D E F P Q T) by (conclude lemma_equalangleshelper). (* Goal: @LtA Ax0 A B C P Q R *) assert (nCol P Q T) by (conclude lemma_equalanglesNC). (* Goal: @LtA Ax0 A B C P Q R *) assert (Triangle P Q T) by (conclude_def Triangle ). (* Goal: @LtA Ax0 A B C P Q R *) assert (neq Q P) by (conclude lemma_ray2). (* Goal: @LtA Ax0 A B C P Q R *) assert (Out Q T W) by (conclude lemma_ray5). (* Goal: @LtA Ax0 A B C P Q R *) assert (~ Col S Q T). (* Goal: @LtA Ax0 A B C P Q R *) (* Goal: not (@Col Ax0 S Q T) *) { (* Goal: not (@Col Ax0 S Q T) *) intro. (* Goal: False *) assert (Col Q U S) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col U Q S) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col Q P U) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col U Q P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq Q U) by (conclude lemma_raystrict). (* Goal: False *) assert (neq U Q) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col Q S P) by (conclude lemma_collinear4). (* Goal: False *) assert (Col S Q P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq Q S) by (conclude lemma_raystrict). (* Goal: False *) assert (neq S Q) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col Q T P) by (conclude lemma_collinear4). (* Goal: False *) assert (Col P Q T) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @LtA Ax0 A B C P Q R *) } (* Goal: @LtA Ax0 A B C P Q R *) assert (Triangle S Q T) by (conclude_def Triangle ). (* Goal: @LtA Ax0 A B C P Q R *) assert (Out Q S U) by (conclude lemma_ray5). (* Goal: @LtA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists K, (Out Q H K /\ BetS U K W)) by (conclude lemma_crossbar);destruct Tf as [K];spliter. (* Goal: @LtA Ax0 A B C P Q R *) assert (BetS U K V) by (conclude lemma_3_6b). (* Goal: @LtA Ax0 A B C P Q R *) assert (eq P P) by (conclude cn_equalityreflexive). (* Goal: @LtA Ax0 A B C P Q R *) assert (Out Q P P) by (conclude lemma_ray4). (* Goal: @LtA Ax0 A B C P Q R *) assert (CongA A B C P Q K) by (conclude lemma_equalangleshelper). (* Goal: @LtA Ax0 A B C P Q R *) assert (LtA A B C P Q R) by (conclude_def LtA ). (* Goal: @LtA Ax0 A B C P Q R *) close. Qed. End Euclid.
Require Import Terms. Require Import Reduction. Require Import Confluence. Inductive conv1 : lambda -> lambda -> Prop := | red1_conv : forall M N : lambda, red1 M N -> conv1 M N | exp1_conv : forall M N : lambda, red1 N M -> conv1 M N. Inductive conv : lambda -> lambda -> Prop := | one_step_conv : forall M N : lambda, conv1 M N -> conv M N | refl_conv : forall M : lambda, conv M M | trans_conv : forall M N P : lambda, conv M N -> conv N P -> conv M P. Lemma sym_conv : forall M N : lambda, conv M N -> conv N M. Proof. (* Goal: forall (M N : lambda) (_ : conv M N), conv N M *) simple induction 1. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : conv N M) (_ : conv N P) (_ : conv P N), conv P M *) (* Goal: forall M : lambda, conv M M *) (* Goal: forall (M N : lambda) (_ : conv1 M N), conv N M *) simple induction 1; intros; apply one_step_conv. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : conv N M) (_ : conv N P) (_ : conv P N), conv P M *) (* Goal: forall M : lambda, conv M M *) (* Goal: conv1 N1 M1 *) (* Goal: conv1 N1 M1 *) apply exp1_conv; trivial. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : conv N M) (_ : conv N P) (_ : conv P N), conv P M *) (* Goal: forall M : lambda, conv M M *) (* Goal: conv1 N1 M1 *) apply red1_conv; trivial. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : conv N M) (_ : conv N P) (_ : conv P N), conv P M *) (* Goal: forall M : lambda, conv M M *) intro; apply refl_conv; trivial. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : conv N M) (_ : conv N P) (_ : conv P N), conv P M *) intros; apply trans_conv with N0; trivial. Qed. Require Import Confluence. Theorem Church_Rosser : forall M N : lambda, conv M N -> exists P : lambda, red M P /\ red N P. Proof. (* Goal: forall (M N : lambda) (_ : conv M N), @ex lambda (fun P : lambda => and (red M P) (red N P)) *) simple induction 1. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : @ex lambda (fun P0 : lambda => and (red M P0) (red N P0))) (_ : conv N P) (_ : @ex lambda (fun P0 : lambda => and (red N P0) (red P P0))), @ex lambda (fun P0 : lambda => and (red M P0) (red P P0)) *) (* Goal: forall M : lambda, @ex lambda (fun P : lambda => and (red M P) (red M P)) *) (* Goal: forall (M N : lambda) (_ : conv1 M N), @ex lambda (fun P : lambda => and (red M P) (red N P)) *) simple induction 1; intros. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : @ex lambda (fun P0 : lambda => and (red M P0) (red N P0))) (_ : conv N P) (_ : @ex lambda (fun P0 : lambda => and (red N P0) (red P P0))), @ex lambda (fun P0 : lambda => and (red M P0) (red P P0)) *) (* Goal: forall M : lambda, @ex lambda (fun P : lambda => and (red M P) (red M P)) *) (* Goal: @ex lambda (fun P : lambda => and (red M1 P) (red N1 P)) *) (* Goal: @ex lambda (fun P : lambda => and (red M1 P) (red N1 P)) *) exists N1; split; [ apply one_step_red; trivial | apply refl_red; trivial ]. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : @ex lambda (fun P0 : lambda => and (red M P0) (red N P0))) (_ : conv N P) (_ : @ex lambda (fun P0 : lambda => and (red N P0) (red P P0))), @ex lambda (fun P0 : lambda => and (red M P0) (red P P0)) *) (* Goal: forall M : lambda, @ex lambda (fun P : lambda => and (red M P) (red M P)) *) (* Goal: @ex lambda (fun P : lambda => and (red M1 P) (red N1 P)) *) exists M1; split; [ apply refl_red; trivial | apply one_step_red; trivial ]. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : @ex lambda (fun P0 : lambda => and (red M P0) (red N P0))) (_ : conv N P) (_ : @ex lambda (fun P0 : lambda => and (red N P0) (red P P0))), @ex lambda (fun P0 : lambda => and (red M P0) (red P P0)) *) (* Goal: forall M : lambda, @ex lambda (fun P : lambda => and (red M P) (red M P)) *) intro M0; exists M0; split; apply refl_red; trivial. (* Goal: forall (M N P : lambda) (_ : conv M N) (_ : @ex lambda (fun P0 : lambda => and (red M P0) (red N P0))) (_ : conv N P) (_ : @ex lambda (fun P0 : lambda => and (red N P0) (red P P0))), @ex lambda (fun P0 : lambda => and (red M P0) (red P P0)) *) intros; elim H1; intros P0 C0; elim H3; intros P1 C1; elim C0; elim C1; intros. (* Goal: @ex lambda (fun P0 : lambda => and (red M0 P0) (red P P0)) *) elim confluence_beta_reduction with N0 P0 P1; trivial. (* Goal: forall (x : lambda) (_ : and (red P0 x) (red P1 x)), @ex lambda (fun P0 : lambda => and (red M0 P0) (red P P0)) *) intros Q C3; exists Q; elim C3; split. (* Goal: red P Q *) (* Goal: red M0 Q *) apply trans_red with P0; trivial. (* Goal: red P Q *) apply trans_red with P1; trivial. Qed.
Set Implicit Arguments. Unset Strict Implicit. Require Export Ring_cat. Require Export Operation_of_monoid. Section Def. Variable R : RING. Section Module_def. Variable Mod : abelian_group. Variable op : operation (ring_monoid R) Mod. Definition op_lin_left := forall (a b : R) (x : Mod), Equal (op (sgroup_law R a b) x) (sgroup_law Mod (op a x) (op b x)). Definition op_lin_right := forall (a : R) (x y : Mod), Equal (op a (sgroup_law Mod x y)) (sgroup_law Mod (op a x) (op a y)). End Module_def. Record module_on (M : abelian_group) : Type := {module_op : operation (ring_monoid R) M; module_op_lin_left_prf : op_lin_left module_op; module_op_lin_right_prf : op_lin_right module_op}. Record module : Type := {module_carrier :> abelian_group; module_on_def :> module_on module_carrier}. Coercion Build_module : module_on >-> module. Definition module_mult (B : module) (a : R) (x : B) := module_op B a x. Section Hom. Variable E F : module. Definition module_hom_prop (f : E -> F) := forall (a : R) (x : E), Equal (f (module_mult a x)) (module_mult a (f x)). Record module_hom : Type := {module_monoid_hom :> monoid_hom E F; module_hom_prf : module_hom_prop module_monoid_hom}. End Hom. Definition module_hom_comp : forall E F Mod : module, module_hom F Mod -> module_hom E F -> module_hom E Mod. Proof. (* Goal: forall (E F Mod : module) (_ : module_hom F Mod) (_ : module_hom E F), module_hom E Mod *) intros E F Mod g f; try assumption. (* Goal: module_hom E Mod *) apply (Build_module_hom (E:=E) (F:=Mod) (module_monoid_hom:=monoid_hom_comp g f)). (* Goal: @module_hom_prop E Mod (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier Mod))) (@monoid_hom_comp (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g) (@module_monoid_hom E F f))))) *) unfold module_hom_prop in |- *; auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier Mod))) (@monoid_hom_comp (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g) (@module_monoid_hom E F f)))) (@module_mult E a x)) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier Mod))) (@monoid_hom_comp (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g) (@module_monoid_hom E F f)))) x)) *) simpl in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x)) (@module_mult Mod a (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x)) *) unfold comp_map_fun in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) intros a x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) apply Trans with (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f))) x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) cut (Equal (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f))) (module_mult a x)) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f))) x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x)) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x)) *) (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x)) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) (@module_mult E a x)) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x)) *) apply (module_hom_prf f). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@module_mult F a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) (@module_mult Mod a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier F))) (group_monoid (abelian_group_group (module_carrier Mod))) (@module_monoid_hom F Mod g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier F))) (@module_monoid_hom E F f))) x))) *) apply (module_hom_prf g). Qed. Definition module_id : forall E : module, module_hom E E. Proof. (* Goal: forall E : module, module_hom E E *) intros E; try assumption. (* Goal: module_hom E E *) apply (Build_module_hom (module_monoid_hom:=monoid_id E)). (* Goal: @module_hom_prop E E (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier E))) (monoid_id (group_monoid (abelian_group_group (module_carrier E))))))) *) red in |- *. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier E))) (monoid_id (group_monoid (abelian_group_group (module_carrier E)))))) (@module_mult E a x)) (@module_mult E a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier E))) (group_monoid (abelian_group_group (module_carrier E))) (monoid_id (group_monoid (abelian_group_group (module_carrier E)))))) x)) *) simpl in |- *; auto with algebra. Qed. Definition MODULE : category. Proof. (* Goal: category *) apply (subcat (C:=MONOID) (C':=module) (i:=module_carrier) (homC':=fun E F : module => Build_subtype_image (E:=Hom (c:=ABELIAN_GROUP) E F) (subtype_image_carrier:=module_hom E F) (module_monoid_hom (E:=E) (F:=F))) (CompC':=module_hom_comp) (idC':=module_id)). (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) (* Goal: forall a : module, @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier a)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier a)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier a)) (module_hom a a) (@module_monoid_hom a a)) (module_id a)) (@Hom_id MONOID (group_monoid (abelian_group_group (module_carrier a)))) *) simpl in |- *. (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) (* Goal: forall a : module, @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) *) intros a; try assumption. (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) *) red in |- *. (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))))) x) *) auto with algebra. (* Goal: forall (a b c : module) (g : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) b c)) (f : Carrier (@subcat_Hom MONOID module (fun m : module => group_monoid (abelian_group_group (module_carrier m))) (fun E F : module => @Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier E) (module_carrier F)) (module_hom E F) (@module_monoid_hom E F)) a b)), @Equal (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier c)) (module_hom a c) (@module_monoid_hom a c)) (@module_hom_comp a b c g f)) (@comp_hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier b) (module_carrier c)) (module_hom b c) (@module_monoid_hom b c)) g) (@subtype_image_inj (@Hom MONOID (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b)))) (@Build_subtype_image (@Hom ABELIAN_GROUP (module_carrier a) (module_carrier b)) (module_hom a b) (@module_monoid_hom a b)) f)) *) simpl in |- *. (* Goal: forall (a b c : module) (g : module_hom b c) (f : module_hom a b), @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) *) intros a b c g f; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier b))) (group_monoid (abelian_group_group (module_carrier c))) (@module_monoid_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (module_carrier a)))) (monoid_sgroup (group_monoid (abelian_group_group (module_carrier b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (module_carrier a))) (group_monoid (abelian_group_group (module_carrier b))) (@module_monoid_hom a b f)))) x) *) auto with algebra. Qed. End Def.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq path div fintype. From mathcomp Require Import finfun bigop finset prime binomial fingroup morphism perm. From mathcomp Require Import automorphism action quotient gfunctor gproduct ssralg finalg. From mathcomp Require Import zmodp cyclic pgroup gseries nilpotent sylow. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope. Section AbelianDefs. Variable gT : finGroupType. Implicit Types (x : gT) (A B : {set gT}) (pi : nat_pred) (p n : nat). Definition Ldiv n := [set x : gT | x ^+ n == 1]. Definition exponent A := \big[lcmn/1%N]_(x in A) #[x]. Definition abelem p A := [&& p.-group A, abelian A & exponent A %| p]. Definition is_abelem A := abelem (pdiv #|A|) A. Definition pElem p A := [set E : {group gT} | E \subset A & abelem p E]. Definition pnElem p n A := [set E in pElem p A | logn p #|E| == n]. Definition nElem n A := \bigcup_(0 <= p < #|A|.+1) pnElem p n A. Definition pmaxElem p A := [set E | [max E | E \in pElem p A]]. Definition p_rank p A := \max_(E in pElem p A) logn p #|E|. Definition rank A := \max_(0 <= p < #|A|.+1) p_rank p A. Definition gen_rank A := #|[arg min_(B < A | <<B>> == A) #|B|]|. End AbelianDefs. Arguments exponent {gT} A%g. Arguments abelem {gT} p%N A%g. Arguments is_abelem {gT} A%g. Arguments pElem {gT} p%N A%g. Arguments pnElem {gT} p%N n%N A%g. Arguments nElem {gT} n%N A%g. Arguments pmaxElem {gT} p%N A%g. Arguments p_rank {gT} p%N A%g. Arguments rank {gT} A%g. Arguments gen_rank {gT} A%g. Notation "''Ldiv_' n ()" := (Ldiv _ n) (at level 8, n at level 2, format "''Ldiv_' n ()") : group_scope. Notation "''Ldiv_' n ( G )" := (G :&: 'Ldiv_n()) (at level 8, n at level 2, format "''Ldiv_' n ( G )") : group_scope. Prenex Implicits exponent. Notation "p .-abelem" := (abelem p) (at level 2, format "p .-abelem") : group_scope. Notation "''E_' p ( G )" := (pElem p G) (at level 8, p at level 2, format "''E_' p ( G )") : group_scope. Notation "''E_' p ^ n ( G )" := (pnElem p n G) (at level 8, p, n at level 2, format "''E_' p ^ n ( G )") : group_scope. Notation "''E' ^ n ( G )" := (nElem n G) (at level 8, n at level 2, format "''E' ^ n ( G )") : group_scope. Notation "''E*_' p ( G )" := (pmaxElem p G) (at level 8, p at level 2, format "''E*_' p ( G )") : group_scope. Notation "''m' ( A )" := (gen_rank A) (at level 8, format "''m' ( A )") : group_scope. Notation "''r' ( A )" := (rank A) (at level 8, format "''r' ( A )") : group_scope. Notation "''r_' p ( A )" := (p_rank p A) (at level 8, p at level 2, format "''r_' p ( A )") : group_scope. Section Functors. Variables (n : nat) (gT : finGroupType) (A : {set gT}). Definition Ohm := <<[set x in A | x ^+ (pdiv #[x] ^ n) == 1]>>. Definition Mho := <<[set x ^+ (pdiv #[x] ^ n) | x in A & (pdiv #[x]).-elt x]>>. Canonical Ohm_group : {group gT} := Eval hnf in [group of Ohm]. Canonical Mho_group : {group gT} := Eval hnf in [group of Mho]. Lemma pdiv_p_elt (p : nat) (x : gT) : p.-elt x -> x != 1 -> pdiv #[x] = p. Proof. (* Goal: forall (_ : is_true (@p_elt gT (nat_pred_of_nat p) x)) (_ : is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT))))), @eq nat (pdiv (@order gT x)) p *) move=> p_x; rewrite /order -cycle_eq1. (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle gT x) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))), @eq nat (pdiv (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x))))) p *) by case/(pgroup_pdiv p_x)=> p_pr _ [k ->]; rewrite pdiv_pfactor. Qed. Lemma OhmPredP (x : gT) : reflect (exists2 p, prime p & x ^+ (p ^ n) = 1) (x ^+ (pdiv #[x] ^ n) == 1). Proof. (* Goal: Bool.reflect (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (oneg (FinGroup.base gT)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))) *) have [-> | nt_x] := eqVneq x 1. (* Goal: Bool.reflect (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (oneg (FinGroup.base gT)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))) *) (* Goal: Bool.reflect (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (oneg (FinGroup.base gT)) (expn p n)) (oneg (FinGroup.base gT)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (oneg (FinGroup.base gT)) (expn (pdiv (@order gT (oneg (FinGroup.base gT)))) n)) (oneg (FinGroup.base gT))) *) by rewrite expg1n eqxx; left; exists 2; rewrite ?expg1n. (* Goal: Bool.reflect (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (oneg (FinGroup.base gT)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))) *) apply: (iffP idP) => [/eqP | [p p_pr /eqP x_pn]]. (* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))) *) (* Goal: forall _ : @eq (Equality.sort (FinGroup.eqType (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT)), @ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (oneg (FinGroup.base gT))) *) by exists (pdiv #[x]); rewrite ?pdiv_prime ?order_gt1. (* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))) *) rewrite (@pdiv_p_elt p) //; rewrite -order_dvdn in x_pn. (* Goal: is_true (@p_elt gT (nat_pred_of_nat p) x) *) by rewrite [p_elt _ _](pnat_dvd x_pn) // pnat_exp pnat_id. Qed. Lemma Mho_p_elt (p : nat) x : x \in A -> p.-elt x -> x ^+ (p ^ n) \in Mho. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (_ : is_true (@p_elt gT (nat_pred_of_nat p) x)), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Mho))) *) move=> Ax p_x; case: (eqVneq x 1) => [-> | ntx]; first by rewrite groupX. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Mho))) *) by apply: mem_gen; apply/imsetP; exists x; rewrite ?inE ?Ax (pdiv_p_elt p_x). Qed. End Functors. Arguments Ohm n%N {gT} A%g. Arguments Ohm_group n%N {gT} A%g. Arguments Mho n%N {gT} A%g. Arguments Mho_group n%N {gT} A%g. Arguments OhmPredP {n gT x}. Notation "''Ohm_' n ( G )" := (Ohm n G) (at level 8, n at level 2, format "''Ohm_' n ( G )") : group_scope. Notation "''Ohm_' n ( G )" := (Ohm_group n G) : Group_scope. Notation "''Mho^' n ( G )" := (Mho n G) (at level 8, n at level 2, format "''Mho^' n ( G )") : group_scope. Notation "''Mho^' n ( G )" := (Mho_group n G) : Group_scope. Section ExponentAbelem. Variable gT : finGroupType. Implicit Types (p n : nat) (pi : nat_pred) (x : gT) (A B C : {set gT}). Implicit Types E G H K P X Y : {group gT}. Lemma LdivP A n x : reflect (x \in A /\ x ^+ n = 1) (x \in 'Ldiv_n(A)). Proof. (* Goal: Bool.reflect (and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (@eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x n) (oneg (FinGroup.base gT)))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (Ldiv gT n))))) *) by rewrite !inE; apply: (iffP andP) => [] [-> /eqP]. Qed. Lemma dvdn_exponent x A : x \in A -> #[x] %| exponent A. Proof. (* Goal: forall _ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))), is_true (dvdn (@order gT x) (@exponent gT A)) *) by move=> Ax; rewrite (biglcmn_sup x). Qed. Lemma expg_exponent x A : x \in A -> x ^+ exponent A = 1. Proof. (* Goal: forall _ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (@exponent gT A)) (oneg (FinGroup.base gT)) *) by move=> Ax; apply/eqP; rewrite -order_dvdn dvdn_exponent. Qed. Lemma exponentS A B : A \subset B -> exponent A %| exponent B. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))), is_true (dvdn (@exponent gT A) (@exponent gT B)) *) by move=> sAB; apply/dvdn_biglcmP=> x Ax; rewrite dvdn_exponent ?(subsetP sAB). Qed. Lemma exponentP A n : reflect (forall x, x \in A -> x ^+ n = 1) (exponent A %| n). Proof. (* Goal: Bool.reflect (forall (x : FinGroup.arg_sort (FinGroup.base gT)) (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x n) (oneg (FinGroup.base gT))) (dvdn (@exponent gT A) n) *) apply: (iffP (dvdn_biglcmP _ _ _)) => eAn x Ax. (* Goal: is_true (dvdn (@order gT x) n) *) (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x n) (oneg (FinGroup.base gT)) *) by apply/eqP; rewrite -order_dvdn eAn. (* Goal: is_true (dvdn (@order gT x) n) *) by rewrite order_dvdn eAn. Qed. Arguments exponentP {A n}. Lemma trivg_exponent G : (G :==: 1) = (exponent G %| 1). Proof. (* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (dvdn (@exponent gT (@gval gT G)) (S O)) *) rewrite -subG1. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (dvdn (@exponent gT (@gval gT G)) (S O)) *) by apply/subsetP/exponentP=> trG x /trG; rewrite expg1 => /set1P. Qed. Lemma exponent1 : exponent [1 gT] = 1%N. Proof. (* Goal: @eq nat (@exponent gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (S O) *) by apply/eqP; rewrite -dvdn1 -trivg_exponent eqxx. Qed. Lemma exponent_dvdn G : exponent G %| #|G|. Proof. (* Goal: is_true (dvdn (@exponent gT (@gval gT G)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *) by apply/dvdn_biglcmP=> x Gx; apply: order_dvdG. Qed. Lemma exponent_gt0 G : 0 < exponent G. Proof. (* Goal: is_true (leq (S O) (@exponent gT (@gval gT G))) *) exact: dvdn_gt0 (exponent_dvdn G). Qed. Hint Resolve exponent_gt0 : core. Lemma pnat_exponent pi G : pi.-nat (exponent G) = pi.-group G. Lemma exponentJ A x : exponent (A :^ x) = exponent A. Proof. (* Goal: @eq nat (@exponent gT (@conjugate gT A x)) (@exponent gT A) *) rewrite /exponent (reindex_inj (conjg_inj x)). (* Goal: @eq nat (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun j : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) j (@Monoid.operator nat (S O) (@Monoid.com_operator nat (S O) lcmn_comoid)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT j x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@conjugate gT A x)))) (@order gT (@conjg gT j x)))) (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (@order gT x))) *) by apply: eq_big => [y | y _]; rewrite ?orderJ ?memJ_conjg. Qed. Lemma exponent_witness G : nilpotent G -> {x | x \in G & exponent G = #[x]}. Proof. (* Goal: forall _ : is_true (@nilpotent gT (@gval gT G)), @sig2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq nat (@exponent gT (@gval gT G)) (@order gT x)) *) move=> nilG; have [//=| /= x Gx max_x] := @arg_maxP _ 1 (mem G) order. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@exponent gT (@gval gT G)) (@order gT x)) *) exists x => //; apply/eqP; rewrite eqn_dvd dvdn_exponent // andbT. (* Goal: is_true (dvdn (@exponent gT (@gval gT G)) (@order gT x)) *) apply/dvdn_biglcmP=> y Gy; apply/dvdn_partP=> //= p. (* Goal: forall _ : is_true (@in_mem nat p (@mem nat nat_pred_pred (pi_of (@order gT y)))), is_true (dvdn (partn (@order gT y) (nat_pred_of_nat p)) (@order gT x)) *) rewrite mem_primes => /andP[p_pr _]; have p_gt1: p > 1 := prime_gt1 p_pr. (* Goal: is_true (dvdn (partn (@order gT y) (nat_pred_of_nat p)) (@order gT x)) *) rewrite p_part pfactor_dvdn // -(leq_exp2l _ _ p_gt1) -!p_part. (* Goal: is_true (leq (partn (@order gT y) (nat_pred_of_nat p)) (partn (@order gT x) (nat_pred_of_nat p))) *) rewrite -(leq_pmul2r (part_gt0 p^' #[x])) partnC // -!order_constt. (* Goal: is_true (leq (muln (@order gT (@constt gT y (nat_pred_of_nat p))) (@order gT (@constt gT x (negn (nat_pred_of_nat p))))) (@order gT x)) *) rewrite -orderM ?order_constt ?coprime_partC // ?max_x ?groupM ?groupX //. (* Goal: @commute (FinGroup.base gT) (@constt gT y (nat_pred_of_nat p)) (@constt gT x (negn (nat_pred_of_nat p))) *) case/dprodP: (nilpotent_pcoreC p nilG) => _ _ cGpGp' _. (* Goal: @commute (FinGroup.base gT) (@constt gT y (nat_pred_of_nat p)) (@constt gT x (negn (nat_pred_of_nat p))) *) have inGp := mem_normal_Hall (nilpotent_pcore_Hall _ nilG) (pcore_normal _ _). (* Goal: @commute (FinGroup.base gT) (@constt gT y (nat_pred_of_nat p)) (@constt gT x (negn (nat_pred_of_nat p))) *) by red; rewrite -(centsP cGpGp') // inGp ?p_elt_constt ?groupX. Qed. Lemma exponent_cycle x : exponent <[x]> = #[x]. Proof. (* Goal: @eq nat (@exponent gT (@cycle gT x)) (@order gT x) *) by apply/eqP; rewrite eqn_dvd exponent_dvdn dvdn_exponent ?cycle_id. Qed. Lemma exponent_cyclic X : cyclic X -> exponent X = #|X|. Proof. (* Goal: forall _ : is_true (@cyclic gT (@gval gT X)), @eq nat (@exponent gT (@gval gT X)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X)))) *) by case/cyclicP=> x ->; apply: exponent_cycle. Qed. Lemma primes_exponent G : primes (exponent G) = primes (#|G|). Proof. (* Goal: @eq (list nat) (primes (@exponent gT (@gval gT G))) (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *) apply/eq_primes => p; rewrite !mem_primes exponent_gt0 cardG_gt0 /=. (* Goal: @eq bool (andb (prime p) (dvdn p (@exponent gT (@gval gT G)))) (andb (prime p) (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) *) by apply: andb_id2l => p_pr; apply: negb_inj; rewrite -!p'natE // pnat_exponent. Qed. Lemma pi_of_exponent G : \pi(exponent G) = \pi(G). Proof. (* Goal: @eq nat_pred (pi_of (@exponent gT (@gval gT G))) (pi_of (unwrap_pi_arg (@pi_arg_of_fin_pred (FinGroup.arg_finType (FinGroup.base gT)) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *) by rewrite /pi_of primes_exponent. Qed. Lemma partn_exponentS pi H G : H \subset G -> #|G|`_pi %| #|H| -> (exponent H)`_pi = (exponent G)`_pi. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : is_true (dvdn (partn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) pi) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))), @eq nat (partn (@exponent gT (@gval gT H)) pi) (partn (@exponent gT (@gval gT G)) pi) *) move=> sHG Gpi_dvd_H; apply/eqP; rewrite eqn_dvd. (* Goal: is_true (andb (dvdn (partn (@exponent gT (@gval gT H)) pi) (partn (@exponent gT (@gval gT G)) pi)) (dvdn (partn (@exponent gT (@gval gT G)) pi) (partn (@exponent gT (@gval gT H)) pi))) *) rewrite partn_dvd ?exponentS ?exponent_gt0 //=; apply/dvdn_partP=> // p. (* Goal: forall _ : is_true (@in_mem nat p (@mem nat nat_pred_pred (pi_of (partn (@exponent gT (@gval gT G)) pi)))), is_true (dvdn (partn (partn (@exponent gT (@gval gT G)) pi) (nat_pred_of_nat p)) (partn (@exponent gT (@gval gT H)) pi)) *) rewrite pi_of_part ?exponent_gt0 // => /andP[_ /= pi_p]. (* Goal: is_true (dvdn (partn (partn (@exponent gT (@gval gT G)) pi) (nat_pred_of_nat p)) (partn (@exponent gT (@gval gT H)) pi)) *) have sppi: {subset (p : nat_pred) <= pi} by move=> q /eqnP->. (* Goal: is_true (dvdn (partn (partn (@exponent gT (@gval gT G)) pi) (nat_pred_of_nat p)) (partn (@exponent gT (@gval gT H)) pi)) *) have [P sylP] := Sylow_exists p H; have sPH := pHall_sub sylP. (* Goal: is_true (dvdn (partn (partn (@exponent gT (@gval gT G)) pi) (nat_pred_of_nat p)) (partn (@exponent gT (@gval gT H)) pi)) *) have{sylP} sylP: p.-Sylow(G) P. (* Goal: is_true (dvdn (partn (partn (@exponent gT (@gval gT G)) pi) (nat_pred_of_nat p)) (partn (@exponent gT (@gval gT H)) pi)) *) (* Goal: is_true (@pHall gT (nat_pred_of_nat p) (@gval gT G) (@gval gT P)) *) rewrite pHallE (subset_trans sPH) //= (card_Hall sylP) eqn_dvd andbC. (* Goal: is_true (dvdn (partn (partn (@exponent gT (@gval gT G)) pi) (nat_pred_of_nat p)) (partn (@exponent gT (@gval gT H)) pi)) *) (* Goal: is_true (andb (dvdn (partn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (nat_pred_of_nat p)) (partn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (nat_pred_of_nat p))) (dvdn (partn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (nat_pred_of_nat p)) (partn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (nat_pred_of_nat p)))) *) by rewrite -{1}(partn_part _ sppi) !partn_dvd ?cardSg ?cardG_gt0. (* Goal: is_true (dvdn (partn (partn (@exponent gT (@gval gT G)) pi) (nat_pred_of_nat p)) (partn (@exponent gT (@gval gT H)) pi)) *) rewrite partn_part ?partn_biglcm //. (* Goal: is_true (dvdn (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (partn (@order gT i) (nat_pred_of_nat p)))) (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (partn (@order gT i) pi)))) *) apply: (@big_ind _ (dvdn^~ _)) => [|m n|x Gx]; first exact: dvd1n. (* Goal: is_true (dvdn (partn (@order gT x) (nat_pred_of_nat p)) (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (partn (@order gT i) pi)))) *) (* Goal: forall (_ : is_true (dvdn m (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (partn (@order gT i) pi))))) (_ : is_true (dvdn n (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (partn (@order gT i) pi))))), is_true (dvdn (lcmn m n) (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (partn (@order gT i) pi)))) *) by rewrite dvdn_lcm => ->. (* Goal: is_true (dvdn (partn (@order gT x) (nat_pred_of_nat p)) (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (S O) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i lcmn (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (partn (@order gT i) pi)))) *) rewrite -order_constt; have p_y := p_elt_constt p x; set y := x.`_p in p_y *. have sYG: <[y]> \subset G by rewrite cycle_subG groupX. have [z _ Pyz] := Sylow_Jsub sylP sYG p_y. rewrite (bigD1 (y ^ z)) ?(subsetP sPH) -?cycle_subG ?cycleJ //=. by rewrite orderJ part_pnat_id ?dvdn_lcml // (pi_pnat p_y). Qed. Qed. Lemma exponent_Hall pi G H : pi.-Hall(G) H -> exponent H = (exponent G)`_pi. Proof. (* Goal: forall _ : is_true (@pHall gT pi (@gval gT G) (@gval gT H)), @eq nat (@exponent gT (@gval gT H)) (partn (@exponent gT (@gval gT G)) pi) *) move=> hallH; have [sHG piH _] := and3P hallH. (* Goal: @eq nat (@exponent gT (@gval gT H)) (partn (@exponent gT (@gval gT G)) pi) *) rewrite -(partn_exponentS sHG) -?(card_Hall hallH) ?part_pnat_id //. (* Goal: is_true (pnat pi (@exponent gT (@gval gT H))) *) by apply: pnat_dvd piH; apply: exponent_dvdn. Qed. Lemma exponent_Zgroup G : Zgroup G -> exponent G = #|G|. Proof. (* Goal: forall _ : is_true (@Zgroup gT (@gval gT G)), @eq nat (@exponent gT (@gval gT G)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) move/forall_inP=> ZgG; apply/eqP; rewrite eqn_dvd exponent_dvdn. (* Goal: is_true (andb true (dvdn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@exponent gT (@gval gT G)))) *) apply/(dvdn_partP _ (cardG_gt0 _)) => p _. (* Goal: is_true (dvdn (partn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (nat_pred_of_nat p)) (@exponent gT (@gval gT G))) *) have [S sylS] := Sylow_exists p G; rewrite -(card_Hall sylS). (* Goal: is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT S)))) (@exponent gT (@gval gT G))) *) have /cyclicP[x defS]: cyclic S by rewrite ZgG ?(p_Sylow sylS). (* Goal: is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT S)))) (@exponent gT (@gval gT G))) *) by rewrite defS dvdn_exponent // -cycle_subG -defS (pHall_sub sylS). Qed. Lemma cprod_exponent A B G : A \* B = G -> lcmn (exponent A) (exponent B) = (exponent G). Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A B) (@gval gT G), @eq nat (lcmn (@exponent gT A) (@exponent gT B)) (@exponent gT (@gval gT G)) *) case/cprodP=> [[K H -> ->{A B}] <- cKH]. (* Goal: @eq nat (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H))) (@exponent gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) *) apply/eqP; rewrite eqn_dvd dvdn_lcm !exponentS ?mulG_subl ?mulG_subr //=. (* Goal: is_true (dvdn (@exponent gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H))) (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H)))) *) apply/exponentP=> _ /imset2P[x y Kx Hy ->]. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H)))) (oneg (FinGroup.base gT)) *) rewrite -[1]mulg1 expgMn; last by red; rewrite -(centsP cKH). (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@expgn (FinGroup.base gT) x (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H)))) (@expgn (FinGroup.base gT) y (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H))))) (@mulg (FinGroup.base gT) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT))) *) congr (_ * _); apply/eqP; rewrite -order_dvdn. (* Goal: is_true (dvdn (@order gT y) (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H)))) *) (* Goal: is_true (dvdn (@order gT x) (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H)))) *) by rewrite (dvdn_trans (dvdn_exponent Kx)) ?dvdn_lcml. (* Goal: is_true (dvdn (@order gT y) (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H)))) *) by rewrite (dvdn_trans (dvdn_exponent Hy)) ?dvdn_lcmr. Qed. Lemma dprod_exponent A B G : A \x B = G -> lcmn (exponent A) (exponent B) = (exponent G). Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) (@gval gT G), @eq nat (lcmn (@exponent gT A) (@exponent gT B)) (@exponent gT (@gval gT G)) *) case/dprodP=> [[K H -> ->{A B}] defG cKH _]. (* Goal: @eq nat (lcmn (@exponent gT (@gval gT K)) (@exponent gT (@gval gT H))) (@exponent gT (@gval gT G)) *) by apply: cprod_exponent; rewrite cprodE. Qed. Lemma sub_LdivT A n : (A \subset 'Ldiv_n()) = (exponent A %| n). Proof. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (Ldiv gT n)))) (dvdn (@exponent gT A) n) *) by apply/subsetP/exponentP=> eAn x /eAn; rewrite inE => /eqP. Qed. Lemma LdivT_J n x : 'Ldiv_n() :^ x = 'Ldiv_n(). Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (Ldiv gT n) x) (Ldiv gT n) *) apply/setP=> y; rewrite !inE mem_conjg inE -conjXg. (* Goal: @eq bool (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@conjg gT (@expgn (FinGroup.base gT) y n) (@invg (FinGroup.base gT) x)) (oneg (FinGroup.base gT))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) y n) (oneg (FinGroup.base gT))) *) by rewrite (canF_eq (conjgKV x)) conj1g. Qed. Lemma LdivJ n A x : 'Ldiv_n(A :^ x) = 'Ldiv_n(A) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@setI (FinGroup.finType (FinGroup.base gT)) (@conjugate gT A x) (Ldiv gT n)) (@conjugate gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (Ldiv gT n)) x) *) by rewrite conjIg LdivT_J. Qed. Lemma sub_Ldiv A n : (A \subset 'Ldiv_n(A)) = (exponent A %| n). Proof. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (Ldiv gT n))))) (dvdn (@exponent gT A) n) *) by rewrite subsetI subxx sub_LdivT. Qed. Lemma group_Ldiv G n : abelian G -> group_set 'Ldiv_n(G). Lemma abelian_exponent_gen A : abelian A -> exponent <<A>> = exponent A. Proof. (* Goal: forall _ : is_true (@abelian gT A), @eq nat (@exponent gT (@generated gT A)) (@exponent gT A) *) rewrite -abelian_gen; set n := exponent A; set G := <<A>> => cGG. (* Goal: @eq nat (@exponent gT G) n *) apply/eqP; rewrite eqn_dvd andbC exponentS ?subset_gen //= -sub_Ldiv. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) G)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) G (Ldiv gT n))))) *) rewrite -(gen_set_id (group_Ldiv n cGG)) genS // subsetI subset_gen /=. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (Ldiv gT n)))) *) by rewrite sub_LdivT. Qed. Lemma abelem_pgroup p A : p.-abelem A -> p.-group A. Proof. (* Goal: forall _ : is_true (@abelem gT p A), is_true (@pgroup gT (nat_pred_of_nat p) A) *) by case/andP. Qed. Lemma abelem_abelian p A : p.-abelem A -> abelian A. Proof. (* Goal: forall _ : is_true (@abelem gT p A), is_true (@abelian gT A) *) by case/and3P. Qed. Lemma abelem1 p : p.-abelem [1 gT]. Proof. (* Goal: is_true (@abelem gT p (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) *) by rewrite /abelem pgroup1 abelian1 exponent1 dvd1n. Qed. Lemma abelemE p G : prime p -> p.-abelem G = abelian G && (exponent G %| p). Proof. (* Goal: forall _ : is_true (prime p), @eq bool (@abelem gT p (@gval gT G)) (andb (@abelian gT (@gval gT G)) (dvdn (@exponent gT (@gval gT G)) p)) *) move=> p_pr; rewrite /abelem -pnat_exponent andbA -!(andbC (_ %| _)). (* Goal: @eq bool (andb (dvdn (@exponent gT (@gval gT G)) p) (andb (pnat (nat_pred_of_nat p) (@exponent gT (@gval gT G))) (@abelian gT (@gval gT G)))) (andb (dvdn (@exponent gT (@gval gT G)) p) (@abelian gT (@gval gT G))) *) by case: (dvdn_pfactor _ 1 p_pr) => // [[k _ ->]]; rewrite pnat_exp pnat_id. Qed. Lemma abelemP p G : prime p -> reflect (abelian G /\ forall x, x \in G -> x ^+ p = 1) (p.-abelem G). Proof. (* Goal: forall _ : is_true (prime p), Bool.reflect (and (is_true (@abelian gT (@gval gT G))) (forall (x : FinGroup.arg_sort (FinGroup.base gT)) (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)))) (@abelem gT p (@gval gT G)) *) by move=> p_pr; rewrite abelemE //; apply: (iffP andP) => [] [-> /exponentP]. Qed. Lemma abelem_order_p p G x : p.-abelem G -> x \in G -> x != 1 -> #[x] = p. Proof. (* Goal: forall (_ : is_true (@abelem gT p (@gval gT G))) (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT))))), @eq nat (@order gT x) p *) case/and3P=> pG _ eG Gx; rewrite -cycle_eq1 => ntX. (* Goal: @eq nat (@order gT x) p *) have{ntX} [p_pr p_x _] := pgroup_pdiv (mem_p_elt pG Gx) ntX. (* Goal: @eq nat (@order gT x) p *) by apply/eqP; rewrite eqn_dvd p_x andbT order_dvdn (exponentP eG). Qed. Lemma cyclic_abelem_prime p X : p.-abelem X -> cyclic X -> X :!=: 1 -> #|X| = p. Proof. (* Goal: forall (_ : is_true (@abelem gT p (@gval gT X))) (_ : is_true (@cyclic gT (@gval gT X))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X)))) p *) move=> abelX cycX; case/cyclicP: cycX => x -> in abelX *. by rewrite cycle_eq1; apply: abelem_order_p abelX (cycle_id x). Qed. Qed. Lemma cycle_abelem p x : p.-elt x || prime p -> p.-abelem <[x]> = (#[x] %| p). Proof. (* Goal: forall _ : is_true (orb (@p_elt gT (nat_pred_of_nat p) x) (prime p)), @eq bool (@abelem gT p (@cycle gT x)) (dvdn (@order gT x) p) *) move=> p_xVpr; rewrite /abelem cycle_abelian /=. (* Goal: @eq bool (andb (@pgroup gT (nat_pred_of_nat p) (@cycle gT x)) (dvdn (@exponent gT (@cycle gT x)) p)) (dvdn (@order gT x) p) *) apply/andP/idP=> [[_ xp1] | x_dvd_p]. (* Goal: and (is_true (@pgroup gT (nat_pred_of_nat p) (@cycle gT x))) (is_true (dvdn (@exponent gT (@cycle gT x)) p)) *) (* Goal: is_true (dvdn (@order gT x) p) *) by rewrite order_dvdn (exponentP xp1) ?cycle_id. (* Goal: and (is_true (@pgroup gT (nat_pred_of_nat p) (@cycle gT x))) (is_true (dvdn (@exponent gT (@cycle gT x)) p)) *) split; last exact: dvdn_trans (exponent_dvdn _) x_dvd_p. (* Goal: is_true (@pgroup gT (nat_pred_of_nat p) (@cycle gT x)) *) by case/orP: p_xVpr => // /pnat_id; apply: pnat_dvd. Qed. Lemma exponent2_abelem G : exponent G %| 2 -> 2.-abelem G. Lemma prime_abelem p G : prime p -> #|G| = p -> p.-abelem G. Proof. (* Goal: forall (_ : is_true (prime p)) (_ : @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) p), is_true (@abelem gT p (@gval gT G)) *) move=> p_pr oG; rewrite /abelem -oG exponent_dvdn. (* Goal: is_true (andb (@pgroup gT (nat_pred_of_nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@gval gT G)) (andb (@abelian gT (@gval gT G)) true)) *) by rewrite /pgroup cyclic_abelian ?prime_cyclic ?oG ?pnat_id. Qed. Lemma abelem_cyclic p G : p.-abelem G -> cyclic G = (logn p #|G| <= 1). Lemma abelemS p H G : H \subset G -> p.-abelem G -> p.-abelem H. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : is_true (@abelem gT p (@gval gT G))), is_true (@abelem gT p (@gval gT H)) *) move=> sHG /and3P[cGG pG Gp1]; rewrite /abelem. (* Goal: is_true (andb (@pgroup gT (nat_pred_of_nat p) (@gval gT H)) (andb (@abelian gT (@gval gT H)) (dvdn (@exponent gT (@gval gT H)) p))) *) by rewrite (pgroupS sHG) // (abelianS sHG) // (dvdn_trans (exponentS sHG)). Qed. Lemma abelemJ p G x : p.-abelem (G :^ x) = p.-abelem G. Proof. (* Goal: @eq bool (@abelem gT p (@conjugate gT (@gval gT G) x)) (@abelem gT p (@gval gT G)) *) by rewrite /abelem pgroupJ abelianJ exponentJ. Qed. Lemma cprod_abelem p A B G : A \* B = G -> p.-abelem G = p.-abelem A && p.-abelem B. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A B) (@gval gT G), @eq bool (@abelem gT p (@gval gT G)) (andb (@abelem gT p A) (@abelem gT p B)) *) case/cprodP=> [[H K -> ->{A B}] defG cHK]. (* Goal: @eq bool (@abelem gT p (@gval gT G)) (andb (@abelem gT p (@gval gT H)) (@abelem gT p (@gval gT K))) *) apply/idP/andP=> [abelG | []]. (* Goal: forall (_ : is_true (@abelem gT p (@gval gT H))) (_ : is_true (@abelem gT p (@gval gT K))), is_true (@abelem gT p (@gval gT G)) *) (* Goal: and (is_true (@abelem gT p (@gval gT H))) (is_true (@abelem gT p (@gval gT K))) *) by rewrite !(abelemS _ abelG) // -defG (mulG_subl, mulG_subr). (* Goal: forall (_ : is_true (@abelem gT p (@gval gT H))) (_ : is_true (@abelem gT p (@gval gT K))), is_true (@abelem gT p (@gval gT G)) *) case/and3P=> pH cHH expHp; case/and3P=> pK cKK expKp. (* Goal: is_true (@abelem gT p (@gval gT G)) *) rewrite -defG /abelem pgroupM pH pK abelianM cHH cKK cHK /=. (* Goal: is_true (dvdn (@exponent gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) p) *) apply/exponentP=> _ /imset2P[x y Hx Ky ->]. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) p) (oneg (FinGroup.base gT)) *) rewrite expgMn; last by red; rewrite -(centsP cHK). (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@expgn (FinGroup.base gT) x p) (@expgn (FinGroup.base gT) y p)) (oneg (FinGroup.base gT)) *) by rewrite (exponentP expHp) // (exponentP expKp) // mul1g. Qed. Lemma dprod_abelem p A B G : A \x B = G -> p.-abelem G = p.-abelem A && p.-abelem B. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) (@gval gT G), @eq bool (@abelem gT p (@gval gT G)) (andb (@abelem gT p A) (@abelem gT p B)) *) move=> defG; case/dprodP: (defG) => _ _ _ tiHK. (* Goal: @eq bool (@abelem gT p (@gval gT G)) (andb (@abelem gT p A) (@abelem gT p B)) *) by apply: cprod_abelem; rewrite -dprodEcp. Qed. Lemma is_abelem_pgroup p G : p.-group G -> is_abelem G = p.-abelem G. Proof. (* Goal: forall _ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G)), @eq bool (@is_abelem gT (@gval gT G)) (@abelem gT p (@gval gT G)) *) rewrite /is_abelem => pG. (* Goal: @eq bool (@abelem gT (pdiv (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@gval gT G)) (@abelem gT p (@gval gT G)) *) case: (eqsVneq G 1) => [-> | ntG]; first by rewrite !abelem1. (* Goal: @eq bool (@abelem gT (pdiv (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@gval gT G)) (@abelem gT p (@gval gT G)) *) by have [p_pr _ [k ->]] := pgroup_pdiv pG ntG; rewrite pdiv_pfactor. Qed. Lemma is_abelemP G : reflect (exists2 p, prime p & p.-abelem G) (is_abelem G). Proof. (* Goal: Bool.reflect (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => is_true (@abelem gT p (@gval gT G)))) (@is_abelem gT (@gval gT G)) *) apply: (iffP idP) => [abelG | [p p_pr abelG]]. (* Goal: is_true (@is_abelem gT (@gval gT G)) *) (* Goal: @ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => is_true (@abelem gT p (@gval gT G))) *) case: (eqsVneq G 1) => [-> | ntG]; first by exists 2; rewrite ?abelem1. (* Goal: is_true (@is_abelem gT (@gval gT G)) *) (* Goal: @ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => is_true (@abelem gT p (@gval gT G))) *) by exists (pdiv #|G|); rewrite ?pdiv_prime // ltnNge -trivg_card_le1. (* Goal: is_true (@is_abelem gT (@gval gT G)) *) by rewrite (is_abelem_pgroup (abelem_pgroup abelG)). Qed. Lemma pElemP p A E : reflect (E \subset A /\ p.-abelem E) (E \in 'E_p(A)). Proof. (* Goal: Bool.reflect (and (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (is_true (@abelem gT p (@gval gT E)))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A)))) *) by rewrite inE; apply: andP. Qed. Arguments pElemP {p A E}. Lemma pElemS p A B : A \subset B -> 'E_p(A) \subset 'E_p(B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))), is_true (@subset (group_of_finType gT) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A))) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p B)))) *) by move=> sAB; apply/subsetP=> E; rewrite !inE => /andP[/subset_trans->]. Qed. Lemma pElemI p A B : 'E_p(A :&: B) = 'E_p(A) :&: subgroups B. Proof. (* Goal: @eq (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (@pElem gT p (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B)) (@setI (group_of_finType gT) (@pElem gT p A) (@subgroups gT B)) *) by apply/setP=> E; rewrite !inE subsetI andbAC. Qed. Lemma pElemJ x p A E : ((E :^ x)%G \in 'E_p(A :^ x)) = (E \in 'E_p(A)). Proof. (* Goal: @eq bool (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@conjG_group gT E x) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@conjugate gT A x))))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A)))) *) by rewrite !inE conjSg abelemJ. Qed. Lemma pnElemP p n A E : reflect [/\ E \subset A, p.-abelem E & logn p #|E| = n] (E \in 'E_p^n(A)). Proof. (* Goal: Bool.reflect (and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (is_true (@abelem gT p (@gval gT E))) (@eq nat (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n)) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n A)))) *) by rewrite !inE -andbA; apply: (iffP and3P) => [] [-> -> /eqP]. Qed. Arguments pnElemP {p n A E}. Lemma pnElemPcard p n A E : E \in 'E_p^n(A) -> [/\ E \subset A, p.-abelem E & #|E| = p ^ n]%N. Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n A)))), and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (is_true (@abelem gT p (@gval gT E))) (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p n)) *) by case/pnElemP=> -> abelE <-; rewrite -card_pgroup // abelem_pgroup. Qed. Lemma card_pnElem p n A E : E \in 'E_p^n(A) -> #|E| = (p ^ n)%N. Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n A)))), @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p n) *) by case/pnElemPcard. Qed. Lemma pnElem0 p G : 'E_p^0(G) = [set 1%G]. Proof. (* Goal: @eq (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (@pnElem gT p O (@gval gT G)) (@set1 (group_of_finType gT) (one_group gT)) *) apply/setP=> E; rewrite !inE -andbA; apply/and3P/idP=> [[_ pE] | /eqP->]. (* Goal: and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (one_group gT)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@abelem gT p (@gval gT (one_group gT)))) (is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (one_group gT)))))) O)) *) (* Goal: forall _ : is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) O), is_true (@eq_op (Finite.eqType (group_of_finType gT)) E (one_group gT)) *) apply: contraLR; case/(pgroup_pdiv (abelem_pgroup pE)) => p_pr _ [k ->]. (* Goal: and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (one_group gT)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@abelem gT p (@gval gT (one_group gT)))) (is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (one_group gT)))))) O)) *) (* Goal: is_true (negb (@eq_op nat_eqType (logn p (expn p (S k))) O)) *) by rewrite pfactorK. (* Goal: and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (one_group gT)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@abelem gT p (@gval gT (one_group gT)))) (is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (one_group gT)))))) O)) *) by rewrite sub1G abelem1 cards1 logn1. Qed. Lemma pnElem_prime p n A E : E \in 'E_p^n.+1(A) -> prime p. Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S n) A)))), is_true (prime p) *) by case/pnElemP=> _ _; rewrite lognE; case: prime. Qed. Lemma pnElemE p n A : prime p -> 'E_p^n(A) = [set E in 'E_p(A) | #|E| == (p ^ n)%N]. Proof. (* Goal: forall _ : is_true (prime p), @eq (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (@pnElem gT p n A) (@SetDef.finset (group_of_finType gT) (fun E : Finite.sort (group_of_finType gT) => andb (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A)))) (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p n)))) *) move/pfactorK=> pnK; apply/setP=> E; rewrite 3!inE. (* Goal: @eq bool (andb (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (@abelem gT p (@gval gT E))) (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n)) (andb (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (@abelem gT p (@gval gT E))) (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p n))) *) case: (@andP (E \subset A)) => //= [[_]] /andP[/p_natP[k ->] _]. (* Goal: @eq bool (@eq_op nat_eqType (logn p (expn p k)) n) (@eq_op nat_eqType (expn p k) (expn p n)) *) by rewrite pnK (can_eq pnK). Qed. Lemma pnElemS p n A B : A \subset B -> 'E_p^n(A) \subset 'E_p^n(B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))), is_true (@subset (group_of_finType gT) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n A))) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n B)))) *) move=> sAB; apply/subsetP=> E. (* Goal: forall _ : is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n A)))), is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n B)))) *) by rewrite !inE -!andbA => /andP[/subset_trans->]. Qed. Lemma pnElemI p n A B : 'E_p^n(A :&: B) = 'E_p^n(A) :&: subgroups B. Proof. (* Goal: @eq (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (@pnElem gT p n (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B)) (@setI (group_of_finType gT) (@pnElem gT p n A) (@subgroups gT B)) *) by apply/setP=> E; rewrite !inE subsetI -!andbA; do !bool_congr. Qed. Lemma pnElemJ x p n A E : ((E :^ x)%G \in 'E_p^n(A :^ x)) = (E \in 'E_p^n(A)). Proof. (* Goal: @eq bool (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@conjG_group gT E x) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@conjugate gT A x))))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n A)))) *) by rewrite inE pElemJ cardJg !inE. Qed. Lemma abelem_pnElem p n G : p.-abelem G -> n <= logn p #|G| -> exists E, E \in 'E_p^n(G). Proof. (* Goal: forall (_ : is_true (@abelem gT p (@gval gT G))) (_ : is_true (leq n (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT G)))))) *) case: n => [|n] abelG lt_nG; first by exists 1%G; rewrite pnElem0 set11. (* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S n) (@gval gT G)))))) *) have p_pr: prime p by move: lt_nG; rewrite lognE; case: prime. (* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S n) (@gval gT G)))))) *) case/(normal_pgroup (abelem_pgroup abelG)): lt_nG => // E [sEG _ oE]. (* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S n) (@gval gT G)))))) *) by exists E; rewrite pnElemE // !inE oE sEG (abelemS sEG) /=. Qed. Lemma card_p1Elem p A X : X \in 'E_p^1(A) -> #|X| = p. Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) X (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) A)))), @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X)))) p *) exact: card_pnElem. Qed. Lemma p1ElemE p A : prime p -> 'E_p^1(A) = [set X in subgroups A | #|X| == p]. Lemma TIp1ElemP p A X Y : X \in 'E_p^1(A) -> Y \in 'E_p^1(A) -> reflect (X :&: Y = 1) (X :!=: Y). Proof. (* Goal: forall (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) X (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) A))))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) Y (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) A))))), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X) (@gval gT Y)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT Y : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) *) move=> EpX EpY; have p_pr := pnElem_prime EpX. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X) (@gval gT Y)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X) (@gval gT Y))) *) have [oX oY] := (card_p1Elem EpX, card_p1Elem EpY). (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X) (@gval gT Y)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X) (@gval gT Y))) *) have [<- |] := altP eqP. (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X) (@gval gT Y))), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X) (@gval gT Y)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (negb false) *) (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X) (@gval gT X)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (negb true) *) by right=> X1; rewrite -oX -(setIid X) X1 cards1 in p_pr. (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X) (@gval gT Y))), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT X) (@gval gT Y)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (negb false) *) by rewrite eqEcard oX oY leqnn andbT; left; rewrite prime_TIg ?oX. Qed. Lemma card_p1Elem_pnElem p n A E : E \in 'E_p^n(A) -> #|'E_p^1(E)| = (\sum_(i < n) p ^ i)%N. Lemma card_p1Elem_p2Elem p A E : E \in 'E_p^2(A) -> #|'E_p^1(E)| = p.+1. Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S (S O)) A)))), @eq nat (@card (group_of_finType gT) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT E))))) (S p) *) by move/card_p1Elem_pnElem->; rewrite big_ord_recl big_ord1. Qed. Lemma p2Elem_dprodP p A E X Y : E \in 'E_p^2(A) -> X \in 'E_p^1(E) -> Y \in 'E_p^1(E) -> reflect (X \x Y = E) (X :!=: Y). Proof. (* Goal: forall (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S (S O)) A))))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) X (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT E)))))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) Y (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT E)))))), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT X) (@gval gT Y)) (@gval gT E)) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT Y : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) *) move=> Ep2E EpX EpY; have [_ abelE oE] := pnElemPcard Ep2E. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT X) (@gval gT Y)) (@gval gT E)) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT X) (@gval gT Y))) *) apply: (iffP (TIp1ElemP EpX EpY)) => [tiXY|]; last by case/dprodP. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT X) (@gval gT Y)) (@gval gT E) *) have [[sXE _ oX] [sYE _ oY]] := (pnElemPcard EpX, pnElemPcard EpY). (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT X) (@gval gT Y)) (@gval gT E) *) rewrite dprodE ?(sub_abelian_cent2 (abelem_abelian abelE)) //. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT X) (@gval gT Y)) (@gval gT E) *) by apply/eqP; rewrite eqEcard mul_subG //= TI_cardMg // oX oY oE. Qed. Lemma nElemP n G E : reflect (exists p, E \in 'E_p^n(G)) (E \in 'E^n(G)). Proof. (* Goal: Bool.reflect (@ex nat (fun p : nat => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT G))))))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT G))))) *) rewrite ['E^n(G)]big_mkord. (* Goal: Bool.reflect (@ex nat (fun p : nat => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT G))))))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@BigOp.bigop (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (@set0 (group_of_finType gT)) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun i : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) i (@setU (group_of_finType gT)) true (@pnElem gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) i) n (@gval gT G))))))) *) apply: (iffP bigcupP) => [[[p /= _] _] | [p]]; first by exists p. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT G))))), @ex2 (Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun _ : Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) => is_true true) (fun i : Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) => is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) i) n (@gval gT G)))))) *) case: n => [|n EpnE]; first by rewrite pnElem0; exists ord0; rewrite ?pnElem0. (* Goal: @ex2 (Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun _ : Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) => is_true true) (fun i : Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) => is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) i) (S n) (@gval gT G)))))) *) suffices lepG: p < #|G|.+1 by exists (Ordinal lepG). (* Goal: is_true (leq (S p) (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) *) have:= EpnE; rewrite pnElemE ?(pnElem_prime EpnE) // !inE -andbA ltnS. (* Goal: forall _ : is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (andb (@abelem gT p (@gval gT E)) (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S n))))), is_true (leq p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *) case/and3P=> sEG _ oE; rewrite dvdn_leq // (dvdn_trans _ (cardSg sEG)) //. (* Goal: is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) *) by rewrite (eqP oE) dvdn_exp. Qed. Arguments nElemP {n G E}. Lemma nElem0 G : 'E^0(G) = [set 1%G]. Lemma nElem1P G E : reflect (E \subset G /\ exists2 p, prime p & #|E| = p) (E \in 'E^1(G)). Proof. (* Goal: Bool.reflect (and (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) p))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT (S O) (@gval gT G))))) *) apply: (iffP nElemP) => [[p pE] | [sEG [p p_pr oE]]]. (* Goal: @ex nat (fun p : nat => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT G)))))) *) (* Goal: and (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) p)) *) have p_pr := pnElem_prime pE; rewrite pnElemE // !inE -andbA in pE. (* Goal: @ex nat (fun p : nat => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT G)))))) *) (* Goal: and (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@ex2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) p)) *) by case/and3P: pE => -> _ /eqP; split; last exists p. (* Goal: @ex nat (fun p : nat => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT G)))))) *) exists p; rewrite pnElemE // !inE sEG oE eqxx abelemE // -oE exponent_dvdn. (* Goal: is_true (andb (andb true (andb (@abelian gT (@gval gT E)) true)) true) *) by rewrite cyclic_abelian // prime_cyclic // oE. Qed. Lemma nElemS n G H : G \subset H -> 'E^n(G) \subset 'E^n(H). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))), is_true (@subset (group_of_finType gT) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT G)))) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT H))))) *) move=> sGH; apply/subsetP=> E /nElemP[p EpnG_E]. (* Goal: is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT H))))) *) by apply/nElemP; exists p; rewrite // (subsetP (pnElemS _ _ sGH)). Qed. Lemma nElemI n G H : 'E^n(G :&: H) = 'E^n(G) :&: subgroups H. Proof. (* Goal: @eq (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (@nElem gT n (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H))) (@setI (group_of_finType gT) (@nElem gT n (@gval gT G)) (@subgroups gT (@gval gT H))) *) apply/setP=> E; apply/nElemP/setIP=> [[p] | []]. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT G)))))) (_ : is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@subgroups gT (@gval gT H)))))), @ex nat (fun p : nat => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT (@setI_group gT G H))))))) *) (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT (@setI_group gT G H)))))), and (is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT G)))))) (is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@subgroups gT (@gval gT H)))))) *) by rewrite pnElemI; case/setIP; split=> //; apply/nElemP; exists p. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT G)))))) (_ : is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@subgroups gT (@gval gT H)))))), @ex nat (fun p : nat => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT (@setI_group gT G H))))))) *) by case/nElemP=> p EpnG_E sHE; exists p; rewrite pnElemI inE EpnG_E. Qed. Lemma def_pnElem p n G : 'E_p^n(G) = 'E_p(G) :&: 'E^n(G). Proof. (* Goal: @eq (@set_of (group_of_finType gT) (Phant (Finite.sort (group_of_finType gT)))) (@pnElem gT p n (@gval gT G)) (@setI (group_of_finType gT) (@pElem gT p (@gval gT G)) (@nElem gT n (@gval gT G))) *) apply/setP=> E; rewrite inE in_setI; apply: andb_id2l => /pElemP[sEG abelE]. (* Goal: @eq bool (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n) (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@nElem gT n (@gval gT G))))) *) apply/idP/nElemP=> [|[q]]; first by exists p; rewrite !inE sEG abelE. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT q n (@gval gT G))))), is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n) *) rewrite !inE -2!andbA => /and4P[_ /pgroupP qE _]. (* Goal: forall _ : is_true (@eq_op nat_eqType (logn q (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n), is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n) *) case: (eqVneq E 1%G) => [-> | ]; first by rewrite cards1 !logn1. (* Goal: forall (_ : is_true (negb (@eq_op (Finite.eqType (group_of_finType gT)) E (one_group gT)))) (_ : is_true (@eq_op nat_eqType (logn q (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n)), is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n) *) case/(pgroup_pdiv (abelem_pgroup abelE)) => p_pr pE _. (* Goal: forall _ : is_true (@eq_op nat_eqType (logn q (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n), is_true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) n) *) by rewrite (eqnP (qE p p_pr pE)). Qed. Lemma pmaxElemP p A E : reflect (E \in 'E_p(A) /\ forall H, H \in 'E_p(A) -> E \subset H -> H :=: E) (E \in 'E*_p(A)). Proof. (* Goal: Bool.reflect (and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p A)))) *) by rewrite [E \in 'E*_p(A)]inE; apply: (iffP maxgroupP). Qed. Lemma pmaxElem_exists p A D : D \in 'E_p(A) -> {E | E \in 'E*_p(A) & D \subset E}. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (group_of_finType gT)) D (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A)))), @sig2 (Finite.sort (group_finType gT)) (fun E : Finite.sort (group_finType gT) => is_true (@in_mem (Finite.sort (group_finType gT)) E (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p A))))) (fun E : Finite.sort (group_finType gT) => is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) *) move=> EpD; have [E maxE sDE] := maxgroup_exists (EpD : mem 'E_p(A) D). (* Goal: @sig2 (Finite.sort (group_finType gT)) (fun E : Finite.sort (group_finType gT) => is_true (@in_mem (Finite.sort (group_finType gT)) E (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p A))))) (fun E : Finite.sort (group_finType gT) => is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) *) by exists E; rewrite // inE. Qed. Lemma pmaxElem_LdivP p G E : prime p -> reflect ('Ldiv_p('C_G(E)) = E) (E \in 'E*_p(G)). Proof. (* Goal: forall _ : is_true (prime p), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E))) (Ldiv gT p)) (@gval gT E)) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G))))) *) move=> p_pr; apply: (iffP (pmaxElemP p G E)) => [[] | defE]. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: forall (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E))) (Ldiv gT p)) (@gval gT E) *) case/pElemP=> sEG abelE maxE; have [_ cEE eE] := and3P abelE. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E))) (Ldiv gT p)) (@gval gT E) *) apply/setP=> x; rewrite !inE -andbA; apply/and3P/idP=> [[Gx cEx xp] | Ex]. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: and3 (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT E)))))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) *) rewrite -(maxE (<[x]> <*> E)%G) ?joing_subr //. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: and3 (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT E)))))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)))) *) (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing_group gT (@cycle gT x) (@gval gT E)) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@joing_group gT (@cycle gT x) (@gval gT E)))))) *) by rewrite -cycle_subG joing_subl. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: and3 (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT E)))))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)))) *) (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing_group gT (@cycle gT x) (@gval gT E)) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) rewrite inE join_subG cycle_subG Gx sEG /=. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: and3 (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT E)))))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)))) *) (* Goal: is_true (@abelem gT p (@joing gT (@cycle gT x) (@gval gT E))) *) rewrite (cprod_abelem _ (cprodEY _)); last by rewrite centsC cycle_subG. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: and3 (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT E)))))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)))) *) (* Goal: is_true (andb (@abelem gT p (@gval gT (@cycle_group gT x))) (@abelem gT p (@gval gT E))) *) by rewrite cycle_abelem ?p_pr ?orbT // order_dvdn xp. (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) (* Goal: and3 (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT E)))))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)))) *) by rewrite (subsetP sEG) // (subsetP cEE) // (exponentP eE). (* Goal: and (is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E)) *) split=> [|H]; last first. (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) (* Goal: forall (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E) *) case/pElemP=> sHG /abelemP[// | cHH Hp1] sEH. (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT E) *) apply/eqP; rewrite eqEsubset sEH andbC /= -defE; apply/subsetP=> x Hx. (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E))) (Ldiv gT p))))) *) by rewrite 3!inE (subsetP sHG) // Hp1 ?(subsetP (centsS _ cHH)) /=. (* Goal: is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) apply/pElemP; split; first by rewrite -defE -setIA subsetIl. (* Goal: is_true (@abelem gT p (@gval gT E)) *) apply/abelemP=> //; rewrite /abelian -{1 3}defE setIAC subsetIr. (* Goal: and (is_true true) (forall (x : FinGroup.arg_sort (FinGroup.base gT)) (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT p)) (@centraliser gT (@gval gT E))))))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT))) *) by split=> //; apply/exponentP; rewrite -sub_LdivT setIAC subsetIr. Qed. Lemma pmaxElemS p A B : A \subset B -> 'E*_p(B) :&: subgroups A \subset 'E*_p(A). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))), is_true (@subset (group_finType gT) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@setI (group_finType gT) (@pmaxElem gT p B) (@subgroups gT A)))) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p A)))) *) move=> sAB; apply/subsetP=> E; rewrite !inE. (* Goal: forall _ : is_true (andb (@maxgroup gT (@gval gT E) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p B))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))), is_true (@maxgroup gT (@gval gT E) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A))))) *) case/andP=> /maxgroupP[/pElemP[_ abelE] maxE] sEA. (* Goal: is_true (@maxgroup gT (@gval gT E) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A))))) *) apply/maxgroupP; rewrite inE sEA; split=> // D EpD. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT D) (@gval gT E) *) by apply: maxE; apply: subsetP EpD; apply: pElemS. Qed. Lemma pmaxElemJ p A E x : ((E :^ x)%G \in 'E*_p(A :^ x)) = (E \in 'E*_p(A)). Lemma grank_min B : 'm(<<B>>) <= #|B|. Proof. (* Goal: is_true (leq (@gen_rank gT (@generated gT B)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))) *) by rewrite /gen_rank; case: arg_minP => [|_ _ -> //]; rewrite genGid. Qed. Lemma grank_witness G : {B | <<B>> = G & #|B| = 'm(G)}. Proof. (* Goal: @sig2 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT B) (@gval gT G)) (fun B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))) (@gen_rank gT (@gval gT G))) *) rewrite /gen_rank; case: arg_minP => [|B defG _]; first by rewrite genGid. (* Goal: @sig2 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun B : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT B) (@gval gT G)) (fun B0 : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B0))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))) *) by exists B; first apply/eqP. Qed. Lemma p_rank_witness p G : {E | E \in 'E_p^('r_p(G))(G)}. Proof. (* Goal: @sig (Finite.sort (group_of_finType gT)) (fun E : Finite.sort (group_of_finType gT) => is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)))))) *) have [E EG_E mE]: {E | E \in 'E_p(G) & 'r_p(G) = logn p #|E| }. (* Goal: @sig (Finite.sort (group_of_finType gT)) (fun E : Finite.sort (group_of_finType gT) => is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)))))) *) (* Goal: @sig2 (Finite.sort (group_of_finType gT)) (fun E : Finite.sort (group_of_finType gT) => is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G)))))) (fun E : Finite.sort (group_of_finType gT) => @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) *) by apply: eq_bigmax_cond; rewrite (cardD1 1%G) inE sub1G abelem1. (* Goal: @sig (Finite.sort (group_of_finType gT)) (fun E : Finite.sort (group_of_finType gT) => is_true (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)))))) *) by exists E; rewrite inE EG_E -mE /=. Qed. Lemma p_rank_geP p n G : reflect (exists E, E \in 'E_p^n(G)) (n <= 'r_p(G)). Lemma p_rank_gt0 p H : ('r_p(H) > 0) = (p \in \pi(H)). Proof. (* Goal: @eq bool (leq (S O) (@p_rank gT p (@gval gT H))) (@in_mem nat p (@mem nat nat_pred_pred (pi_of (unwrap_pi_arg (@pi_arg_of_fin_pred (FinGroup.arg_finType (FinGroup.base gT)) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))))) *) rewrite mem_primes cardG_gt0 /=; apply/p_rank_geP/andP=> [[E] | [p_pr]]. (* Goal: forall _ : is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT H)))))) *) (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT H))))), and (is_true (prime p)) (is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) *) case/pnElemP=> sEG _; rewrite lognE; case: and3P => // [[-> _ pE] _]. (* Goal: forall _ : is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT H)))))) *) (* Goal: and (is_true true) (is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) *) by rewrite (dvdn_trans _ (cardSg sEG)). (* Goal: forall _ : is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p (S O) (@gval gT H)))))) *) case/Cauchy=> // x Hx ox; exists <[x]>%G; rewrite 2!inE [#|_|]ox cycle_subG. (* Goal: is_true (andb (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@abelem gT p (@gval gT (@cycle_group gT x)))) (@eq_op nat_eqType (logn p p) (S O))) *) by rewrite Hx (pfactorK 1) ?abelemE // cycle_abelian -ox exponent_dvdn. Qed. Lemma p_rank1 p : 'r_p([1 gT]) = 0. Proof. (* Goal: @eq nat (@p_rank gT p (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) O *) by apply/eqP; rewrite eqn0Ngt p_rank_gt0 /= cards1. Qed. Lemma logn_le_p_rank p A E : E \in 'E_p(A) -> logn p #|E| <= 'r_p(A). Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A)))), is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (@p_rank gT p A)) *) by move=> EpA_E; rewrite (bigmax_sup E). Qed. Lemma p_rank_le_logn p G : 'r_p(G) <= logn p #|G|. Proof. (* Goal: is_true (leq (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) *) have [E EpE] := p_rank_witness p G. (* Goal: is_true (leq (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) *) by have [sEG _ <-] := pnElemP EpE; apply: lognSg. Qed. Lemma p_rank_abelem p G : p.-abelem G -> 'r_p(G) = logn p #|G|. Proof. (* Goal: forall _ : is_true (@abelem gT p (@gval gT G)), @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *) move=> abelG; apply/eqP; rewrite eqn_leq andbC (bigmax_sup G) //. (* Goal: is_true (@in_mem (Finite.sort (group_of_finType gT)) G (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) (* Goal: is_true (andb true (leq (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) *) by apply/bigmax_leqP=> E; rewrite inE => /andP[/lognSg->]. (* Goal: is_true (@in_mem (Finite.sort (group_of_finType gT)) G (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))) *) by rewrite inE subxx. Qed. Lemma p_rankS p A B : A \subset B -> 'r_p(A) <= 'r_p(B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))), is_true (leq (@p_rank gT p A) (@p_rank gT p B)) *) move=> sAB; apply/bigmax_leqP=> E /(subsetP (pElemS p sAB)) EpB_E. (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (@p_rank gT p B)) *) by rewrite (bigmax_sup E). Qed. Lemma p_rankElem_max p A : 'E_p^('r_p(A))(A) \subset 'E*_p(A). Lemma p_rankJ p A x : 'r_p(A :^ x) = 'r_p(A). Proof. (* Goal: @eq nat (@p_rank gT p (@conjugate gT A x)) (@p_rank gT p A) *) rewrite /p_rank (reindex_inj (act_inj 'JG x)). (* Goal: @eq nat (@BigOp.bigop nat (Finite.sort (group_of_finType gT)) O (index_enum (group_of_finType gT)) (fun j : Finite.sort (group_of_finType gT) => @BigBody nat (Finite.sort (group_of_finType gT)) j (@Monoid.operator nat O (@Monoid.com_operator nat O maxn_comoid)) (@in_mem (Finite.sort (group_of_finType gT)) (@act gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort (group_of_finType gT)) (conjG_action gT) j x) (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@conjugate gT A x))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@act gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort (group_of_finType gT)) (conjG_action gT) j x)))))))) (@BigOp.bigop nat (Finite.sort (group_of_finType gT)) O (index_enum (group_of_finType gT)) (fun E : Finite.sort (group_of_finType gT) => @BigBody nat (Finite.sort (group_of_finType gT)) E maxn (@in_mem (Finite.sort (group_of_finType gT)) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p A)))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))))) *) by apply: eq_big => [E | E _]; rewrite ?cardJg ?pElemJ. Qed. Lemma p_rank_Sylow p G H : p.-Sylow(G) H -> 'r_p(H) = 'r_p(G). Proof. (* Goal: forall _ : is_true (@pHall gT (nat_pred_of_nat p) (@gval gT G) (@gval gT H)), @eq nat (@p_rank gT p (@gval gT H)) (@p_rank gT p (@gval gT G)) *) move=> sylH; apply/eqP; rewrite eqn_leq (p_rankS _ (pHall_sub sylH)) /=. (* Goal: is_true (leq (@p_rank gT p (@gval gT G)) (@p_rank gT p (@gval gT H))) *) apply/bigmax_leqP=> E; rewrite inE => /andP[sEG abelE]. (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (@p_rank gT p (@gval gT H))) *) have [P sylP sEP] := Sylow_superset sEG (abelem_pgroup abelE). (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (@p_rank gT p (@gval gT H))) *) have [x _ ->] := Sylow_trans sylP sylH. (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (@p_rank gT p (@conjugate gT (@gval gT P) x))) *) by rewrite p_rankJ -(p_rank_abelem abelE) (p_rankS _ sEP). Qed. Lemma p_rank_Hall pi p G H : pi.-Hall(G) H -> p \in pi -> 'r_p(H) = 'r_p(G). Proof. (* Goal: forall (_ : is_true (@pHall gT pi (@gval gT G) (@gval gT H))) (_ : is_true (@in_mem nat p (@mem nat nat_pred_pred pi))), @eq nat (@p_rank gT p (@gval gT H)) (@p_rank gT p (@gval gT G)) *) move=> hallH pi_p; have [P sylP] := Sylow_exists p H. (* Goal: @eq nat (@p_rank gT p (@gval gT H)) (@p_rank gT p (@gval gT G)) *) by rewrite -(p_rank_Sylow sylP) (p_rank_Sylow (subHall_Sylow hallH pi_p sylP)). Qed. Lemma p_rank_pmaxElem_exists p r G : 'r_p(G) >= r -> exists2 E, E \in 'E*_p(G) & 'r_p(E) >= r. Proof. (* Goal: forall _ : is_true (leq r (@p_rank gT p (@gval gT G))), @ex2 (Finite.sort (group_finType gT)) (fun E : Finite.sort (group_finType gT) => is_true (@in_mem (Finite.sort (group_finType gT)) E (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))))) (fun E : Finite.sort (group_finType gT) => is_true (leq r (@p_rank gT p (@gval gT E)))) *) case/p_rank_geP=> D /setIdP[EpD /eqP <- {r}]. (* Goal: @ex2 (Finite.sort (group_finType gT)) (fun E : Finite.sort (group_finType gT) => is_true (@in_mem (Finite.sort (group_finType gT)) E (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))))) (fun E : Finite.sort (group_finType gT) => is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (@p_rank gT p (@gval gT E)))) *) have [E EpE sDE] := pmaxElem_exists EpD; exists E => //. (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (@p_rank gT p (@gval gT E))) *) case/pmaxElemP: EpE => /setIdP[_ abelE] _. (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (@p_rank gT p (@gval gT E))) *) by rewrite (p_rank_abelem abelE) lognSg. Qed. Lemma rank1 : 'r([1 gT]) = 0. Proof. (* Goal: @eq nat (@rank gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) O *) by rewrite ['r(1)]big1_seq // => p _; rewrite p_rank1. Qed. Lemma p_rank_le_rank p G : 'r_p(G) <= 'r(G). Proof. (* Goal: is_true (leq (@p_rank gT p (@gval gT G)) (@rank gT (@gval gT G))) *) case: (posnP 'r_p(G)) => [-> //|]; rewrite p_rank_gt0 mem_primes. (* Goal: forall _ : is_true (andb (prime p) (andb (leq (S O) (unwrap_pi_arg (@pi_arg_of_fin_pred (FinGroup.arg_finType (FinGroup.base gT)) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (dvdn p (unwrap_pi_arg (@pi_arg_of_fin_pred (FinGroup.arg_finType (FinGroup.base gT)) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))), is_true (leq (@p_rank gT p (@gval gT G)) (@rank gT (@gval gT G))) *) case/and3P=> p_pr _ pG; have lepg: p < #|G|.+1 by rewrite ltnS dvdn_leq. (* Goal: is_true (leq (@p_rank gT p (@gval gT G)) (@rank gT (@gval gT G))) *) by rewrite ['r(G)]big_mkord (bigmax_sup (Ordinal lepg)). Qed. Lemma rank_gt0 G : ('r(G) > 0) = (G :!=: 1). Lemma rank_witness G : {p | prime p & 'r(G) = 'r_p(G)}. Proof. (* Goal: @sig2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq nat (@rank gT (@gval gT G)) (@p_rank gT p (@gval gT G))) *) have [p _ defmG]: {p : 'I_(#|G|.+1) | true & 'r(G) = 'r_p(G)}. (* Goal: @sig2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq nat (@rank gT (@gval gT G)) (@p_rank gT p (@gval gT G))) *) (* Goal: @sig2 (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (fun _ : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => is_true true) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @eq nat (@rank gT (@gval gT G)) (@p_rank gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@gval gT G))) *) by rewrite ['r(G)]big_mkord; apply: eq_bigmax_cond; rewrite card_ord. (* Goal: @sig2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq nat (@rank gT (@gval gT G)) (@p_rank gT p (@gval gT G))) *) case: (eqsVneq G 1) => [-> | ]; first by exists 2; rewrite // rank1 p_rank1. (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))), @sig2 nat (fun p : nat => is_true (prime p)) (fun p : nat => @eq nat (@rank gT (@gval gT G)) (@p_rank gT p (@gval gT G))) *) by rewrite -rank_gt0 defmG p_rank_gt0 mem_primes; case/andP; exists p. Qed. Lemma rank_pgroup p G : p.-group G -> 'r(G) = 'r_p(G). Proof. (* Goal: forall _ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G)), @eq nat (@rank gT (@gval gT G)) (@p_rank gT p (@gval gT G)) *) move=> pG; apply/eqP; rewrite eqn_leq p_rank_le_rank andbT. (* Goal: is_true (leq (@rank gT (@gval gT G)) (@p_rank gT p (@gval gT G))) *) rewrite ['r(G)]big_mkord; apply/bigmax_leqP=> [[q /= _] _]. (* Goal: is_true (leq (@p_rank gT q (@gval gT G)) (@p_rank gT p (@gval gT G))) *) case: (posnP 'r_q(G)) => [-> // |]; rewrite p_rank_gt0 mem_primes. (* Goal: forall _ : is_true (andb (prime q) (andb (leq (S O) (unwrap_pi_arg (@pi_arg_of_fin_pred (FinGroup.arg_finType (FinGroup.base gT)) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (dvdn q (unwrap_pi_arg (@pi_arg_of_fin_pred (FinGroup.arg_finType (FinGroup.base gT)) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))), is_true (leq (@p_rank gT q (@gval gT G)) (@p_rank gT p (@gval gT G))) *) by case/and3P=> q_pr _ qG; rewrite (eqnP (pgroupP pG q q_pr qG)). Qed. Lemma rank_Sylow p G P : p.-Sylow(G) P -> 'r(P) = 'r_p(G). Proof. (* Goal: forall _ : is_true (@pHall gT (nat_pred_of_nat p) (@gval gT G) (@gval gT P)), @eq nat (@rank gT (@gval gT P)) (@p_rank gT p (@gval gT G)) *) move=> sylP; have pP := pHall_pgroup sylP. (* Goal: @eq nat (@rank gT (@gval gT P)) (@p_rank gT p (@gval gT G)) *) by rewrite -(p_rank_Sylow sylP) -(rank_pgroup pP). Qed. Lemma rank_abelem p G : p.-abelem G -> 'r(G) = logn p #|G|. Proof. (* Goal: forall _ : is_true (@abelem gT p (@gval gT G)), @eq nat (@rank gT (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *) by move=> abelG; rewrite (rank_pgroup (abelem_pgroup abelG)) p_rank_abelem. Qed. Lemma nt_pnElem p n E A : E \in 'E_p^n(A) -> n > 0 -> E :!=: 1. Proof. (* Goal: forall (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n A))))) (_ : is_true (leq (S O) n)), is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT E : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) *) by case/pnElemP=> _ /rank_abelem <- <-; rewrite rank_gt0. Qed. Lemma rankJ A x : 'r(A :^ x) = 'r(A). Proof. (* Goal: @eq nat (@rank gT (@conjugate gT A x)) (@rank gT A) *) by rewrite /rank cardJg; apply: eq_bigr => p _; rewrite p_rankJ. Qed. Lemma rankS A B : A \subset B -> 'r(A) <= 'r(B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))), is_true (leq (@rank gT A) (@rank gT B)) *) move=> sAB; rewrite /rank !big_mkord; apply/bigmax_leqP=> p _. (* Goal: is_true (leq (@p_rank gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) p) A) (@BigOp.bigop nat (Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))))) O (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))))) (fun i : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))) => @BigBody nat (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))))) i maxn true (@p_rank gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))) i) B)))) *) have leAB: #|A| < #|B|.+1 by rewrite ltnS subset_leq_card. (* Goal: is_true (leq (@p_rank gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) p) A) (@BigOp.bigop nat (Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))))) O (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))))) (fun i : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))) => @BigBody nat (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))))) i maxn true (@p_rank gT (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))) i) B)))) *) by rewrite (bigmax_sup (widen_ord leAB p)) // p_rankS. Qed. Lemma rank_geP n G : reflect (exists E, E \in 'E^n(G)) (n <= 'r(G)). End ExponentAbelem. Arguments LdivP {gT A n x}. Arguments exponentP {gT A n}. Arguments abelemP {gT p G}. Arguments is_abelemP {gT G}. Arguments pElemP {gT p A E}. Arguments pnElemP {gT p n A E}. Arguments nElemP {gT n G E}. Arguments nElem1P {gT G E}. Arguments pmaxElemP {gT p A E}. Arguments pmaxElem_LdivP {gT p G E}. Arguments p_rank_geP {gT p n G}. Arguments rank_geP {gT n G}. Section MorphAbelem. Variables (aT rT : finGroupType) (D : {group aT}) (f : {morphism D >-> rT}). Implicit Types (G H E : {group aT}) (A B : {set aT}). Lemma exponent_morphim G : exponent (f @* G) %| exponent G. Proof. (* Goal: is_true (dvdn (@exponent rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@exponent aT (@gval aT G))) *) apply/exponentP=> _ /morphimP[x Dx Gx ->]. (* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@expgn (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) (@exponent aT (@gval aT G))) (oneg (FinGroup.base rT)) *) by rewrite -morphX // expg_exponent // morph1. Qed. Lemma morphim_LdivT n : f @* 'Ldiv_n() \subset 'Ldiv_n(). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (Ldiv aT n)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (Ldiv rT n)))) *) apply/subsetP=> _ /morphimP[x Dx xn ->]; rewrite inE in xn. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (Ldiv rT n)))) *) by rewrite inE -morphX // (eqP xn) morph1. Qed. Lemma morphim_Ldiv n A : f @* 'Ldiv_n(A) \subset 'Ldiv_n(f @* A). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (Ldiv aT n))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (Ldiv rT n))))) *) by apply: subset_trans (morphimI f A _) (setIS _ _); apply: morphim_LdivT. Qed. Lemma morphim_abelem p G : p.-abelem G -> p.-abelem (f @* G). Proof. (* Goal: forall _ : is_true (@abelem aT p (@gval aT G)), is_true (@abelem rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) case: (eqsVneq G 1) => [-> | ntG] abelG; first by rewrite morphim1 abelem1. (* Goal: is_true (@abelem rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) have [p_pr _ _] := pgroup_pdiv (abelem_pgroup abelG) ntG. (* Goal: is_true (@abelem rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) case/abelemP: abelG => // abG elemG; apply/abelemP; rewrite ?morphim_abelian //. (* Goal: and (is_true true) (forall (x : FinGroup.arg_sort (FinGroup.base rT)) (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)))))), @eq (FinGroup.sort (FinGroup.base rT)) (@expgn (FinGroup.base rT) x p) (oneg (FinGroup.base rT))) *) by split=> // _ /morphimP[x Dx Gx ->]; rewrite -morphX // elemG ?morph1. Qed. Lemma morphim_pElem p G E : E \in 'E_p(G) -> (f @* E)%G \in 'E_p(f @* G). Proof. (* Goal: forall _ : is_true (@in_mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) E (@mem (Finite.sort (group_of_finType aT)) (predPredType (Finite.sort (group_of_finType aT))) (@SetDef.pred_of_set (group_of_finType aT) (@pElem aT p (@gval aT G))))), is_true (@in_mem (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) E) (@mem (Finite.sort (group_of_finType rT)) (predPredType (Finite.sort (group_of_finType rT))) (@SetDef.pred_of_set (group_of_finType rT) (@pElem rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))))) *) by rewrite !inE => /andP[sEG abelE]; rewrite morphimS // morphim_abelem. Qed. Lemma morphim_pnElem p n G E : E \in 'E_p^n(G) -> {m | m <= n & (f @* E)%G \in 'E_p^m(f @* G)}. Proof. (* Goal: forall _ : is_true (@in_mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) E (@mem (Finite.sort (group_of_finType aT)) (predPredType (Finite.sort (group_of_finType aT))) (@SetDef.pred_of_set (group_of_finType aT) (@pnElem aT p n (@gval aT G))))), @sig2 nat (fun m : nat => is_true (leq m n)) (fun m : nat => is_true (@in_mem (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) E) (@mem (Finite.sort (group_of_finType rT)) (predPredType (Finite.sort (group_of_finType rT))) (@SetDef.pred_of_set (group_of_finType rT) (@pnElem rT p m (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))))) *) rewrite inE => /andP[EpE /eqP <-]. (* Goal: @sig2 nat (fun m : nat => is_true (leq m (logn p (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT E))))))) (fun m : nat => is_true (@in_mem (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) E) (@mem (Finite.sort (group_of_finType rT)) (predPredType (Finite.sort (group_of_finType rT))) (@SetDef.pred_of_set (group_of_finType rT) (@pnElem rT p m (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))))) *) by exists (logn p #|f @* E|); rewrite ?logn_morphim // inE morphim_pElem /=. Qed. Lemma morphim_grank G : G \subset D -> 'm(f @* G) <= 'm(G). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), is_true (leq (@gen_rank rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@gen_rank aT (@gval aT G))) *) have [B defG <-] := grank_witness G; rewrite -defG gen_subG => sBD. (* Goal: is_true (leq (@gen_rank rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@generated aT B))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)))) *) by rewrite morphim_gen ?morphimEsub ?(leq_trans (grank_min _)) ?leq_imset_card. Qed. End MorphAbelem. Section InjmAbelem. Variables (aT rT : finGroupType) (D G : {group aT}) (f : {morphism D >-> rT}). Hypotheses (injf : 'injm f) (sGD : G \subset D). Let defG : invm injf @* (f @* G) = G := morphim_invm injf sGD. Lemma exponent_injm : exponent (f @* G) = exponent G. Proof. (* Goal: @eq nat (@exponent rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@exponent aT (@gval aT G)) *) by apply/eqP; rewrite eqn_dvd -{3}defG !exponent_morphim. Qed. Lemma injm_Ldiv n A : f @* 'Ldiv_n(A) = 'Ldiv_n(f @* A). Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (Ldiv aT n))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (Ldiv rT n)) *) apply/eqP; rewrite eqEsubset morphim_Ldiv. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (Ldiv rT n)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (Ldiv aT n))))))) *) rewrite -[f @* 'Ldiv_n(A)](morphpre_invm injf). (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (Ldiv rT n)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphpre rT aT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@invm_morphism aT rT D f injf) (@MorPhantom rT aT (@invm aT rT D f injf)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (Ldiv aT n))))))) *) rewrite -sub_morphim_pre; last by rewrite subIset ?morphim_sub. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (@morphim rT aT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) D)) (@invm_morphism aT rT D f injf) (@MorPhantom rT aT (@mfun rT aT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) D)) (@invm_morphism aT rT D f injf))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (Ldiv rT n))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (Ldiv aT n)))))) *) rewrite injmI ?injm_invm // setISS ?morphim_LdivT //. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (@morphim rT aT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) D)) (@invm_morphism aT rT D f injf) (@MorPhantom rT aT (@mfun rT aT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) D)) (@invm_morphism aT rT D f injf))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) A))) *) by rewrite sub_morphim_pre ?morphim_sub // morphpre_invm. Qed. Lemma injm_abelem p : p.-abelem (f @* G) = p.-abelem G. Proof. (* Goal: @eq bool (@abelem rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@abelem aT p (@gval aT G)) *) by apply/idP/idP; first rewrite -{2}defG; apply: morphim_abelem. Qed. Lemma injm_pElem p (E : {group aT}) : E \subset D -> ((f @* E)%G \in 'E_p(f @* G)) = (E \in 'E_p(G)). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@in_mem (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) E) (@mem (Finite.sort (group_of_finType rT)) (predPredType (Finite.sort (group_of_finType rT))) (@SetDef.pred_of_set (group_of_finType rT) (@pElem rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))))) (@in_mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) E (@mem (Finite.sort (group_of_finType aT)) (predPredType (Finite.sort (group_of_finType aT))) (@SetDef.pred_of_set (group_of_finType aT) (@pElem aT p (@gval aT G))))) *) move=> sED; apply/idP/idP=> EpE; last exact: morphim_pElem. (* Goal: is_true (@in_mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) E (@mem (Finite.sort (group_of_finType aT)) (predPredType (Finite.sort (group_of_finType aT))) (@SetDef.pred_of_set (group_of_finType aT) (@pElem aT p (@gval aT G))))) *) by rewrite -defG -(group_inj (morphim_invm injf sED)) morphim_pElem. Qed. Lemma injm_pnElem p n (E : {group aT}) : E \subset D -> ((f @* E)%G \in 'E_p^n(f @* G)) = (E \in 'E_p^n(G)). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@in_mem (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) E) (@mem (Finite.sort (group_of_finType rT)) (predPredType (Finite.sort (group_of_finType rT))) (@SetDef.pred_of_set (group_of_finType rT) (@pnElem rT p n (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))))) (@in_mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) E (@mem (Finite.sort (group_of_finType aT)) (predPredType (Finite.sort (group_of_finType aT))) (@SetDef.pred_of_set (group_of_finType aT) (@pnElem aT p n (@gval aT G))))) *) by move=> sED; rewrite inE injm_pElem // card_injm ?inE. Qed. Lemma injm_nElem n (E : {group aT}) : E \subset D -> ((f @* E)%G \in 'E^n(f @* G)) = (E \in 'E^n(G)). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@in_mem (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) E) (@mem (Finite.sort (group_of_finType rT)) (predPredType (Finite.sort (group_of_finType rT))) (@SetDef.pred_of_set (group_of_finType rT) (@nElem rT n (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))))) (@in_mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) E (@mem (Finite.sort (group_of_finType aT)) (predPredType (Finite.sort (group_of_finType aT))) (@SetDef.pred_of_set (group_of_finType aT) (@nElem aT n (@gval aT G))))) *) move=> sED; apply/nElemP/nElemP=> [] [p EpE]; by exists p; rewrite injm_pnElem in EpE *. Qed. Qed. Lemma injm_pmaxElem p (E : {group aT}) : E \subset D -> ((f @* E)%G \in 'E*_p(f @* G)) = (E \in 'E*_p(G)). Lemma injm_grank : 'm(f @* G) = 'm(G). Proof. (* Goal: @eq nat (@gen_rank rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@gen_rank aT (@gval aT G)) *) by apply/eqP; rewrite eqn_leq -{3}defG !morphim_grank ?morphimS. Qed. Lemma injm_p_rank p : 'r_p(f @* G) = 'r_p(G). Proof. (* Goal: @eq nat (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@p_rank aT p (@gval aT G)) *) apply/eqP; rewrite eqn_leq; apply/andP; split. (* Goal: is_true (leq (@p_rank aT p (@gval aT G)) (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) (* Goal: is_true (leq (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@p_rank aT p (@gval aT G))) *) have [fE] := p_rank_witness p (f @* G); move: 'r_p(_) => n Ep_fE. (* Goal: is_true (leq (@p_rank aT p (@gval aT G)) (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) (* Goal: is_true (leq n (@p_rank aT p (@gval aT G))) *) apply/p_rank_geP; exists (f @*^-1 fE)%G. (* Goal: is_true (leq (@p_rank aT p (@gval aT G)) (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) (* Goal: is_true (@in_mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (@morphpre_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) fE) (@mem (Finite.sort (group_of_finType aT)) (predPredType (Finite.sort (group_of_finType aT))) (@SetDef.pred_of_set (group_of_finType aT) (@pnElem aT p n (@gval aT G))))) *) rewrite -injm_pnElem ?subsetIl ?(group_inj (morphpreK _)) //. (* Goal: is_true (leq (@p_rank aT p (@gval aT G)) (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT fE))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))) *) by case/pnElemP: Ep_fE => sfEG _ _; rewrite (subset_trans sfEG) ?morphimS. (* Goal: is_true (leq (@p_rank aT p (@gval aT G)) (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) have [E] := p_rank_witness p G; move: 'r_p(_) => n EpE. (* Goal: is_true (leq n (@p_rank rT p (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) apply/p_rank_geP; exists (f @* E)%G; rewrite injm_pnElem //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) *) by case/pnElemP: EpE => sEG _ _; rewrite (subset_trans sEG). Qed. Lemma injm_rank : 'r(f @* G) = 'r(G). Proof. (* Goal: @eq nat (@rank rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@rank aT (@gval aT G)) *) apply/eqP; rewrite eqn_leq; apply/andP; split. (* Goal: is_true (leq (@rank aT (@gval aT G)) (@rank rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) (* Goal: is_true (leq (@rank rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@rank aT (@gval aT G))) *) by have [p _ ->] := rank_witness (f @* G); rewrite injm_p_rank p_rank_le_rank. (* Goal: is_true (leq (@rank aT (@gval aT G)) (@rank rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) by have [p _ ->] := rank_witness G; rewrite -injm_p_rank p_rank_le_rank. Qed. End InjmAbelem. Section IsogAbelem. Variables (aT rT : finGroupType) (G : {group aT}) (H : {group rT}). Hypothesis isoGH : G \isog H. Lemma exponent_isog : exponent G = exponent H. Proof. (* Goal: @eq nat (@exponent aT (@gval aT G)) (@exponent rT (@gval rT H)) *) by case/isogP: isoGH => f injf <-; rewrite exponent_injm. Qed. Lemma isog_abelem p : p.-abelem G = p.-abelem H. Proof. (* Goal: @eq bool (@abelem aT p (@gval aT G)) (@abelem rT p (@gval rT H)) *) by case/isogP: isoGH => f injf <-; rewrite injm_abelem. Qed. Lemma isog_grank : 'm(G) = 'm(H). Proof. (* Goal: @eq nat (@gen_rank aT (@gval aT G)) (@gen_rank rT (@gval rT H)) *) by case/isogP: isoGH => f injf <-; rewrite injm_grank. Qed. Lemma isog_p_rank p : 'r_p(G) = 'r_p(H). Proof. (* Goal: @eq nat (@p_rank aT p (@gval aT G)) (@p_rank rT p (@gval rT H)) *) by case/isogP: isoGH => f injf <-; rewrite injm_p_rank. Qed. Lemma isog_rank : 'r(G) = 'r(H). Proof. (* Goal: @eq nat (@rank aT (@gval aT G)) (@rank rT (@gval rT H)) *) by case/isogP: isoGH => f injf <-; rewrite injm_rank. Qed. End IsogAbelem. Section QuotientAbelem. Variables (gT : finGroupType) (p : nat). Implicit Types E G K H : {group gT}. Lemma exponent_quotient G H : exponent (G / H) %| exponent G. Proof. (* Goal: is_true (dvdn (@exponent (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) (@exponent gT (@gval gT G))) *) exact: exponent_morphim. Qed. Lemma quotient_LdivT n H : 'Ldiv_n() / H \subset 'Ldiv_n(). Proof. (* Goal: is_true (@subset (@coset_finType gT (@gval gT H)) (@mem (Finite.sort (@coset_finType gT (@gval gT H))) (predPredType (Finite.sort (@coset_finType gT (@gval gT H)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT H)) (@quotient gT (Ldiv gT n) (@gval gT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (Ldiv (@coset_groupType gT (@gval gT H)) n)))) *) exact: morphim_LdivT. Qed. Lemma quotient_Ldiv n A H : 'Ldiv_n(A) / H \subset 'Ldiv_n(A / H). Proof. (* Goal: is_true (@subset (@coset_finType gT (@gval gT H)) (@mem (Finite.sort (@coset_finType gT (@gval gT H))) (predPredType (Finite.sort (@coset_finType gT (@gval gT H)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT H)) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (Ldiv gT n)) (@gval gT H)))) (@mem (Finite.sort (@coset_finType gT (@gval gT H))) (predPredType (Finite.sort (@coset_finType gT (@gval gT H)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT H)) (@setI (@coset_finType gT (@gval gT H)) (@quotient gT A (@gval gT H)) (Ldiv (@coset_groupType gT (@gval gT H)) n))))) *) exact: morphim_Ldiv. Qed. Lemma quotient_abelem G H : p.-abelem G -> p.-abelem (G / H). Proof. (* Goal: forall _ : is_true (@abelem gT p (@gval gT G)), is_true (@abelem (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))) *) exact: morphim_abelem. Qed. Lemma quotient_pElem G H E : E \in 'E_p(G) -> (E / H)%G \in 'E_p(G / H). Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pElem gT p (@gval gT G))))), is_true (@in_mem (@group_of (@coset_groupType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient_group gT E (@gval gT H)) (@mem (Finite.sort (group_of_finType (@coset_groupType gT (@gval gT H)))) (predPredType (Finite.sort (group_of_finType (@coset_groupType gT (@gval gT H))))) (@SetDef.pred_of_set (group_of_finType (@coset_groupType gT (@gval gT H))) (@pElem (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H)))))) *) exact: morphim_pElem. Qed. Lemma logn_quotient G H : logn p #|G / H| <= logn p #|G|. Proof. (* Goal: is_true (leq (logn p (@card (@coset_finType gT (@gval gT H)) (@mem (Finite.sort (@coset_finType gT (@gval gT H))) (predPredType (Finite.sort (@coset_finType gT (@gval gT H)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) *) exact: logn_morphim. Qed. Lemma quotient_pnElem G H n E : E \in 'E_p^n(G) -> {m | m <= n & (E / H)%G \in 'E_p^m(G / H)}. Proof. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@pnElem gT p n (@gval gT G))))), @sig2 nat (fun m : nat => is_true (leq m n)) (fun m : nat => is_true (@in_mem (@group_of (@coset_groupType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient_group gT E (@gval gT H)) (@mem (Finite.sort (group_of_finType (@coset_groupType gT (@gval gT H)))) (predPredType (Finite.sort (group_of_finType (@coset_groupType gT (@gval gT H))))) (@SetDef.pred_of_set (group_of_finType (@coset_groupType gT (@gval gT H))) (@pnElem (@coset_groupType gT (@gval gT H)) p m (@quotient gT (@gval gT G) (@gval gT H))))))) *) exact: morphim_pnElem. Qed. Lemma quotient_grank G H : G \subset 'N(H) -> 'm(G / H) <= 'm(G). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))), is_true (leq (@gen_rank (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) (@gen_rank gT (@gval gT G))) *) exact: morphim_grank. Qed. Lemma p_rank_quotient G H : G \subset 'N(H) -> 'r_p(G) - 'r_p(H) <= 'r_p(G / H). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))), is_true (leq (subn (@p_rank gT p (@gval gT G)) (@p_rank gT p (@gval gT H))) (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H)))) *) move=> nHG; rewrite leq_subLR. (* Goal: is_true (leq (@p_rank gT p (@gval gT G)) (addn (@p_rank gT p (@gval gT H)) (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))))) *) have [E EpE] := p_rank_witness p G; have{EpE} [sEG abelE <-] := pnElemP EpE. (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (addn (@p_rank gT p (@gval gT H)) (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))))) *) rewrite -(LagrangeI E H) lognM ?cardG_gt0 //. (* Goal: is_true (leq (addn (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@gval gT H)))))) (logn p (@indexg gT (@gval gT E) (@gval gT H)))) (addn (@p_rank gT p (@gval gT H)) (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))))) *) rewrite -card_quotient ?(subset_trans sEG) // leq_add ?logn_le_p_rank // !inE. (* Goal: is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT E (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (@quotient gT (@gval gT G) (@gval gT H))))) (@abelem (@coset_groupType gT (@gval gT H)) p (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT E (@gval gT H))))) *) (* Goal: is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@setI_group gT E H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@abelem gT p (@gval gT (@setI_group gT E H)))) *) by rewrite subsetIr (abelemS (subsetIl E H)). (* Goal: is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT E (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (@quotient gT (@gval gT G) (@gval gT H))))) (@abelem (@coset_groupType gT (@gval gT H)) p (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT E (@gval gT H))))) *) by rewrite quotientS ?quotient_abelem. Qed. Lemma p_rank_dprod K H G : K \x H = G -> 'r_p(K) + 'r_p(H) = 'r_p(G). Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@gval gT G), @eq nat (addn (@p_rank gT p (@gval gT K)) (@p_rank gT p (@gval gT H))) (@p_rank gT p (@gval gT G)) *) move=> defG; apply/eqP; rewrite eqn_leq -leq_subLR andbC. (* Goal: is_true (andb (leq (subn (@p_rank gT p (@gval gT G)) (@p_rank gT p (@gval gT K))) (@p_rank gT p (@gval gT H))) (leq (addn (@p_rank gT p (@gval gT K)) (@p_rank gT p (@gval gT H))) (@p_rank gT p (@gval gT G)))) *) have [_ defKH cKH tiKH] := dprodP defG; have nKH := cents_norm cKH. (* Goal: is_true (andb (leq (subn (@p_rank gT p (@gval gT G)) (@p_rank gT p (@gval gT K))) (@p_rank gT p (@gval gT H))) (leq (addn (@p_rank gT p (@gval gT K)) (@p_rank gT p (@gval gT H))) (@p_rank gT p (@gval gT G)))) *) rewrite {1}(isog_p_rank (quotient_isog nKH tiKH)) /= -quotientMidl defKH. (* Goal: is_true (andb (leq (subn (@p_rank gT p (@gval gT G)) (@p_rank gT p (@gval gT K))) (@p_rank (@coset_groupType gT (@gval gT K)) p (@quotient gT (@gval gT G) (@gval gT K)))) (leq (addn (@p_rank gT p (@gval gT K)) (@p_rank gT p (@gval gT H))) (@p_rank gT p (@gval gT G)))) *) rewrite p_rank_quotient; last by rewrite -defKH mul_subG ?normG. (* Goal: is_true (andb true (leq (addn (@p_rank gT p (@gval gT K)) (@p_rank gT p (@gval gT H))) (@p_rank gT p (@gval gT G)))) *) have [[E EpE] [F EpF]] := (p_rank_witness p K, p_rank_witness p H). (* Goal: is_true (andb true (leq (addn (@p_rank gT p (@gval gT K)) (@p_rank gT p (@gval gT H))) (@p_rank gT p (@gval gT G)))) *) have [[sEK abelE <-] [sFH abelF <-]] := (pnElemP EpE, pnElemP EpF). (* Goal: is_true (andb true (leq (addn (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (@p_rank gT p (@gval gT G)))) *) have defEF: E \x F = E <*> F. (* Goal: is_true (andb true (leq (addn (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (@p_rank gT p (@gval gT G)))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT E) (@gval gT F)) (@joing gT (@gval gT E) (@gval gT F)) *) by rewrite dprodEY ?(centSS sFH sEK) //; apply/trivgP; rewrite -tiKH setISS. (* Goal: is_true (andb true (leq (addn (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (@p_rank gT p (@gval gT G)))) *) apply/p_rank_geP; exists (E <*> F)%G; rewrite !inE (dprod_abelem p defEF). (* Goal: is_true (andb (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@joing_group gT (@gval gT E) (@gval gT F))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (andb (@abelem gT p (@gval gT E)) (@abelem gT p (@gval gT F)))) (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@joing_group gT (@gval gT E) (@gval gT F))))))) (addn (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))))) *) rewrite -lognM ?cargG_gt0 // (dprod_card defEF) abelE abelF eqxx. (* Goal: is_true (andb (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@joing_group gT (@gval gT E) (@gval gT F))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (andb true true)) true) *) by rewrite -(genGid G) -defKH genM_join genS ?setUSS. Qed. Lemma p_rank_p'quotient G H : (p : nat)^'.-group H -> G \subset 'N(H) -> 'r_p(G / H) = 'r_p(G). Proof. (* Goal: forall (_ : is_true (@pgroup gT (negn (nat_pred_of_nat (p : nat))) (@gval gT H))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H)))))), @eq nat (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))) (@p_rank gT p (@gval gT G)) *) move=> p'H nHG; have [P sylP] := Sylow_exists p G. (* Goal: @eq nat (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))) (@p_rank gT p (@gval gT G)) *) have [sPG pP _] := and3P sylP; have nHP := subset_trans sPG nHG. (* Goal: @eq nat (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))) (@p_rank gT p (@gval gT G)) *) have tiHP: H :&: P = 1 := coprime_TIg (p'nat_coprime p'H pP). (* Goal: @eq nat (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))) (@p_rank gT p (@gval gT G)) *) rewrite -(p_rank_Sylow sylP) -(p_rank_Sylow (quotient_pHall nHP sylP)). (* Goal: @eq nat (@p_rank (@coset_groupType gT (@gval gT H)) p (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT P (@gval gT H)))) (@p_rank gT p (@gval gT P)) *) by rewrite (isog_p_rank (quotient_isog nHP tiHP)). Qed. End QuotientAbelem. Section OhmProps. Section Generic. Variables (n : nat) (gT : finGroupType). Implicit Types (p : nat) (x : gT) (rT : finGroupType). Implicit Types (A B : {set gT}) (D G H : {group gT}). Lemma Ohm_sub G : 'Ohm_n(G) \subset G. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by rewrite gen_subG; apply/subsetP=> x /setIdP[]. Qed. Lemma Ohm_id G : 'Ohm_n('Ohm_n(G)) = 'Ohm_n(G). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm n gT (@Ohm n gT (@gval gT G))) (@Ohm n gT (@gval gT G)) *) apply/eqP; rewrite eqEsubset Ohm_sub genS //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT)))))))) *) by apply/subsetP=> x /setIdP[Gx oxn]; rewrite inE mem_gen // inE Gx. Qed. Lemma Ohm_cont rT G (f : {morphism G >-> rT}) : f @* 'Ohm_n(G) \subset 'Ohm_n(f @* G). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@Ohm n gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Ohm n rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G)))))) *) rewrite morphim_gen ?genS //; last by rewrite -gen_subG Ohm_sub. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G))))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (oneg (FinGroup.base rT)))))))) *) apply/subsetP=> fx /morphimP[x Gx]; rewrite inE Gx /=. (* Goal: forall (_ : is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT)))) (_ : @eq (FinGroup.arg_sort (FinGroup.base rT)) fx (@mfun gT rT (@gval gT G) f x)), is_true (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) fx (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : FinGroup.arg_sort (FinGroup.base rT) => andb (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) x (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G))))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (oneg (FinGroup.base rT)))))))) *) case/OhmPredP=> p p_pr xpn_1 -> {fx}. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) (@mfun gT rT (@gval gT G) f x) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : FinGroup.arg_sort (FinGroup.base rT) => andb (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) x (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G))))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (oneg (FinGroup.base rT)))))))) *) rewrite inE morphimEdom mem_imset //=; apply/OhmPredP; exists p => //. (* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@expgn (FinGroup.base rT) (@mfun gT rT (@gval gT G) f x) (expn p n)) (oneg (FinGroup.base rT)) *) by rewrite -morphX // xpn_1 morph1. Qed. Lemma OhmS H G : H \subset G -> 'Ohm_n(H) \subset 'Ohm_n(G). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) *) move=> sHG; apply: genS; apply/subsetP=> x; rewrite !inE => /andP[Hx ->]. (* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) true) *) by rewrite (subsetP sHG). Qed. Lemma OhmE p G : p.-group G -> 'Ohm_n(G) = <<'Ldiv_(p ^ n)(G)>>. Proof. (* Goal: forall _ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm n gT (@gval gT G)) (@generated gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT (expn p n)))) *) move=> pG; congr <<_>>; apply/setP=> x; rewrite !inE; apply: andb_id2l => Gx. (* Goal: @eq bool (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (oneg (FinGroup.base gT))) *) case: (eqVneq x 1) => [-> | ntx]; first by rewrite !expg1n. (* Goal: @eq bool (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (oneg (FinGroup.base gT))) *) by rewrite (pdiv_p_elt (mem_p_elt pG Gx)). Qed. Lemma OhmEabelian p G : p.-group G -> abelian 'Ohm_n(G) -> 'Ohm_n(G) = 'Ldiv_(p ^ n)(G). Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (@abelian gT (@Ohm n gT (@gval gT G)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm n gT (@gval gT G)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT (expn p n))) *) move=> pG; rewrite (OhmE pG) abelian_gen => cGGn; rewrite gen_set_id //. (* Goal: is_true (@group_set gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT (expn p n)))) *) rewrite -(setIidPr (subset_gen 'Ldiv_(p ^ n)(G))) setIA. (* Goal: is_true (@group_set gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT (expn p n)))) (@gval gT G)) (Ldiv gT (expn p n)))) *) by rewrite [_ :&: G](setIidPl _) ?gen_subG ?subsetIl // group_Ldiv ?abelian_gen. Qed. Lemma Ohm_p_cycle p x : p.-elt x -> 'Ohm_n(<[x]>) = <[x ^+ (p ^ (logn p #[x] - n))]>. Lemma Ohm_dprod A B G : A \x B = G -> 'Ohm_n(A) \x 'Ohm_n(B) = 'Ohm_n(G). Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@Ohm n gT A) (@Ohm n gT B)) (@Ohm n gT (@gval gT G)) *) case/dprodP => [[H K -> ->{A B}]] <- cHK tiHK. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@Ohm n gT (@gval gT H)) (@Ohm n gT (@gval gT K))) (@Ohm n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) rewrite dprodEY //; last first. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K)))) (@Ohm n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT K))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (@Ohm_group n gT (@gval gT H))))))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) - (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K)))) (@Ohm n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT K))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (@Ohm_group n gT (@gval gT H))))))) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by apply/trivgP; rewrite -tiHK setISS ?Ohm_sub. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K)))) (@Ohm n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT K))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (@Ohm_group n gT (@gval gT H))))))) *) - (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K)))) (@Ohm n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT K))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (@Ohm_group n gT (@gval gT H))))))) *) by rewrite (subset_trans (subset_trans _ cHK)) ?centS ?Ohm_sub. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K)))) (@Ohm n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) apply/eqP; rewrite -(cent_joinEr cHK) eqEsubset join_subG /=. (* Goal: is_true (andb (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT H)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@joing gT (@gval gT H) (@gval gT K)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT K)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@joing gT (@gval gT H) (@gval gT K))))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@joing gT (@gval gT H) (@gval gT K))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@Ohm n gT (@gval gT H)) (@Ohm n gT (@gval gT K))))))) *) rewrite !OhmS ?joing_subl ?joing_subr //= cent_joinEr //= -genM_join genS //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (oneg (FinGroup.base gT))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K))))))) *) apply/subsetP=> _ /setIdP[/imset2P[x y Hx Ky ->] /OhmPredP[p p_pr /eqP]]. (* Goal: forall _ : is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (expn p n)) (oneg (FinGroup.base gT))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K))))))) *) have cxy: commute x y by red; rewrite -(centsP cHK). (* Goal: forall _ : is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (expn p n)) (oneg (FinGroup.base gT))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K))))))) *) rewrite ?expgMn // -eq_invg_mul => /eqP def_x. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K))))))) *) have ypn1: y ^+ (p ^ n) = 1. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K))))))) *) (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y (expn p n)) (oneg (FinGroup.base gT)) *) by apply/set1P; rewrite -[[set 1]]tiHK inE -{1}def_x groupV !groupX. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K))))))) *) have xpn1: x ^+ (p ^ n) = 1 by rewrite -[x ^+ _]invgK def_x ypn1 invg1. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Ohm_group n gT (@gval gT H))) (@gval gT (@Ohm_group n gT (@gval gT K))))))) *) by rewrite mem_mulg ?mem_gen // inE (Hx, Ky); apply/OhmPredP; exists p. Qed. Lemma Mho_sub G : 'Mho^n(G) \subset G. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) rewrite gen_subG; apply/subsetP=> _ /imsetP[x /setIdP[Gx _] ->]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) exact: groupX. Qed. Lemma morphim_Mho rT D G (f : {morphism D >-> rT}) : G \subset D -> f @* 'Mho^n(G) = 'Mho^n(f @* G). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho n gT (@gval gT G))) (@Mho n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) *) move=> sGD; have sGnD := subset_trans (Mho_sub G) sGD. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho n gT (@gval gT G))) (@Mho n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) *) apply/eqP; rewrite eqEsubset {1}morphim_gen -1?gen_subG // !gen_subG. (* Goal: is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@p_elt gT (nat_pred_of_nat (pdiv (@order gT x))) x))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@Mho_group n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))))) (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base rT)) (FinGroup.finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))) (@p_elt rT (nat_pred_of_nat (pdiv (@order rT x))) x)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho_group n gT (@gval gT G)))))))) *) apply/andP; split; apply/subsetP=> y. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base rT)) (FinGroup.finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))) (@p_elt rT (nat_pred_of_nat (pdiv (@order rT x))) x))))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho_group n gT (@gval gT G))))))) *) (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@p_elt gT (nat_pred_of_nat (pdiv (@order gT x))) x)))))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@Mho_group n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))))) *) case/morphimP=> xpn _ /imsetP[x /setIdP[Gx]]. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base rT)) (FinGroup.finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))) (@p_elt rT (nat_pred_of_nat (pdiv (@order rT x))) x))))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho_group n gT (@gval gT G))))))) *) (* Goal: forall (_ : is_true (@p_elt gT (nat_pred_of_nat (pdiv (@order gT x))) x)) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) xpn (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) n))) (_ : @eq (FinGroup.arg_sort (FinGroup.base rT)) y (@mfun gT rT (@gval gT D) f xpn)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@Mho_group n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))))) *) set p := pdiv _ => p_x -> -> {xpn y}; have Dx := subsetP sGD x Gx. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base rT)) (FinGroup.finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))) (@p_elt rT (nat_pred_of_nat (pdiv (@order rT x))) x))))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho_group n gT (@gval gT G))))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@mfun gT rT (@gval gT D) f (@expgn (FinGroup.base gT) x (expn p n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@Mho_group n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))))) *) by rewrite morphX // Mho_p_elt ?morph_p_elt ?mem_morphim. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base rT)) (FinGroup.finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @expgn (FinGroup.base rT) x (expn (pdiv (@order rT x)) n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))) (@p_elt rT (nat_pred_of_nat (pdiv (@order rT x))) x))))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho_group n gT (@gval gT G))))))) *) case/imsetP=> _ /setIdP[/morphimP[x Dx Gx ->]]. (* Goal: forall (_ : is_true (@p_elt rT (nat_pred_of_nat (pdiv (@order rT (@mfun gT rT (@gval gT D) f x)))) (@mfun gT rT (@gval gT D) f x))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@expgn (FinGroup.base rT) (@mfun gT rT (@gval gT D) f x) (expn (pdiv (@order rT (@mfun gT rT (@gval gT D) f x))) n))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho_group n gT (@gval gT G))))))) *) set p := pdiv _ => p_fx ->{y}; rewrite -(constt_p_elt p_fx) -morph_constt //. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@expgn (FinGroup.base rT) (@mfun gT rT (@gval gT D) f (@constt gT x (nat_pred_of_nat p))) (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho_group n gT (@gval gT G))))))) *) by rewrite -morphX ?mem_morphim ?Mho_p_elt ?groupX ?p_elt_constt. Qed. Lemma Mho_cont rT G (f : {morphism G >-> rT}) : f @* 'Mho^n(G) \subset 'Mho^n(f @* G). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@Mho n gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Mho n rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G)))))) *) by rewrite morphim_Mho. Qed. Lemma MhoS H G : H \subset G -> 'Mho^n(H) \subset 'Mho^n(G). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G))))) *) move=> sHG; apply: genS; apply: imsetS; apply/subsetP=> x. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@p_elt gT (nat_pred_of_nat (pdiv (@order gT x))) x)))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@p_elt gT (nat_pred_of_nat (pdiv (@order gT x))) x)))))) *) by rewrite !inE => /andP[Hx]; rewrite (subsetP sHG). Qed. Lemma MhoE p G : p.-group G -> 'Mho^n(G) = <<[set x ^+ (p ^ n) | x in G]>>. Lemma MhoEabelian p G : p.-group G -> abelian G -> 'Mho^n(G) = [set x ^+ (p ^ n) | x in G]. Lemma trivg_Mho G : 'Mho^n(G) == 1 -> 'Ohm_n(G) == G. Lemma Mho_p_cycle p x : p.-elt x -> 'Mho^n(<[x]>) = <[x ^+ (p ^ n)]>. Proof. (* Goal: forall _ : is_true (@p_elt gT (nat_pred_of_nat p) x), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho n gT (@cycle gT x)) (@cycle gT (@expgn (FinGroup.base gT) x (expn p n))) *) move=> p_x. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho n gT (@cycle gT x)) (@cycle gT (@expgn (FinGroup.base gT) x (expn p n))) *) apply/eqP; rewrite (MhoE p_x) eqEsubset cycle_subG mem_gen; last first. (* Goal: is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @expgn (FinGroup.base gT) x (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT x)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT (@expgn (FinGroup.base gT) x (expn p n)))))) true) *) (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @expgn (FinGroup.base gT) x (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT x)))))))) *) by apply: mem_imset; apply: cycle_id. (* Goal: is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @expgn (FinGroup.base gT) x (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT x)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT (@expgn (FinGroup.base gT) x (expn p n)))))) true) *) rewrite gen_subG andbT; apply/subsetP=> _ /imsetP[_ /cycleP[k ->] ->]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@expgn (FinGroup.base gT) x k) (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT (@expgn (FinGroup.base gT) x (expn p n))))))) *) by rewrite -expgM mulnC expgM mem_cycle. Qed. Lemma Mho_cprod A B G : A \* B = G -> 'Mho^n(A) \* 'Mho^n(B) = 'Mho^n(G). Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A B) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@Mho n gT A) (@Mho n gT B)) (@Mho n gT (@gval gT G)) *) case/cprodP => [[H K -> ->{A B}]] <- cHK; rewrite cprodEY //; last first. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@gval gT (@Mho_group n gT (@gval gT H))) (@gval gT (@Mho_group n gT (@gval gT K)))) (@Mho n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Mho_group n gT (@gval gT K))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (@Mho_group n gT (@gval gT H))))))) *) by rewrite (subset_trans (subset_trans _ cHK)) ?centS ?Mho_sub. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@gval gT (@Mho_group n gT (@gval gT H))) (@gval gT (@Mho_group n gT (@gval gT K)))) (@Mho n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *) apply/eqP; rewrite -(cent_joinEr cHK) eqEsubset join_subG /=. (* Goal: is_true (andb (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT H)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@joing gT (@gval gT H) (@gval gT K)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT K)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@joing gT (@gval gT H) (@gval gT K))))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@joing gT (@gval gT H) (@gval gT K))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@Mho n gT (@gval gT H)) (@Mho n gT (@gval gT K))))))) *) rewrite !MhoS ?joing_subl ?joing_subr //= cent_joinEr // -genM_join. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Mho_group n gT (@gval gT H))) (@gval gT (@Mho_group n gT (@gval gT K)))))))) *) apply: genS; apply/subsetP=> xypn /imsetP[_ /setIdP[/imset2P[x y Hx Ky ->]]]. (* Goal: forall (_ : is_true (@p_elt gT (nat_pred_of_nat (pdiv (@order gT (@mulg (FinGroup.base gT) x y)))) (@mulg (FinGroup.base gT) x y))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) xypn (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (expn (pdiv (@order gT (@mulg (FinGroup.base gT) x y))) n))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) xypn (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Mho_group n gT (@gval gT H))) (@gval gT (@Mho_group n gT (@gval gT K))))))) *) move/constt_p_elt; move: (pdiv _) => p <- ->. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@constt gT (@mulg (FinGroup.base gT) x y) (nat_pred_of_nat p)) (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Mho_group n gT (@gval gT H))) (@gval gT (@Mho_group n gT (@gval gT K))))))) *) have cxy: commute x y by red; rewrite -(centsP cHK). (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) (@constt gT (@mulg (FinGroup.base gT) x y) (nat_pred_of_nat p)) (expn p n)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Mho_group n gT (@gval gT H))) (@gval gT (@Mho_group n gT (@gval gT K))))))) *) rewrite consttM // expgMn; last exact: commuteX2. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) (@expgn (FinGroup.base gT) (@constt gT x (nat_pred_of_nat p)) (expn p n)) (@expgn (FinGroup.base gT) (@constt gT y (nat_pred_of_nat p)) (expn p n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@Mho_group n gT (@gval gT H))) (@gval gT (@Mho_group n gT (@gval gT K))))))) *) by rewrite mem_mulg ?Mho_p_elt ?groupX ?p_elt_constt. Qed. Lemma Mho_dprod A B G : A \x B = G -> 'Mho^n(A) \x 'Mho^n(B) = 'Mho^n(G). Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@Mho n gT A) (@Mho n gT B)) (@Mho n gT (@gval gT G)) *) case/dprodP => [[H K -> ->{A B}]] defG cHK tiHK. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@Mho n gT (@gval gT H)) (@Mho n gT (@gval gT K))) (@Mho n gT (@gval gT G)) *) rewrite dprodEcp; first by apply: Mho_cprod; rewrite cprodE. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT H)) (@Mho n gT (@gval gT K))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by apply/trivgP; rewrite -tiHK setISS ?Mho_sub. Qed. End Generic. Canonical Ohm_igFun i := [igFun by Ohm_sub i & Ohm_cont i]. Canonical Ohm_gFun i := [gFun by Ohm_cont i]. Canonical Ohm_mgFun i := [mgFun by OhmS i]. Canonical Mho_igFun i := [igFun by Mho_sub i & Mho_cont i]. Canonical Mho_gFun i := [gFun by Mho_cont i]. Canonical Mho_mgFun i := [mgFun by MhoS i]. Section char. Variables (n : nat) (gT rT : finGroupType) (D G : {group gT}). Lemma Ohm_char : 'Ohm_n(G) \char G. Proof. exact: gFchar. Qed. Proof. (* Goal: is_true (@characteristic gT (@Ohm n gT (@gval gT G)) (@gval gT G)) *) exact: gFchar. Qed. Lemma Mho_char : 'Mho^n(G) \char G. Proof. exact: gFchar. Qed. Proof. (* Goal: is_true (@characteristic gT (@Mho n gT (@gval gT G)) (@gval gT G)) *) exact: gFchar. Qed. Lemma morphim_Ohm (f : {morphism D >-> rT}) : G \subset D -> f @* 'Ohm_n(G) \subset 'Ohm_n(f @* G). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D)))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Ohm n gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Ohm n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)))))) *) exact: morphimF. Qed. Lemma injm_Ohm (f : {morphism D >-> rT}) : 'injm f -> G \subset D -> f @* 'Ohm_n(G) = 'Ohm_n(f @* G). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Ohm n gT (@gval gT G))) (@Ohm n rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) *) by move=> injf; apply: injmF. Qed. Lemma isog_Ohm (H : {group rT}) : G \isog H -> 'Ohm_n(G) \isog 'Ohm_n(H). Proof. (* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT H)), is_true (@isog gT rT (@Ohm n gT (@gval gT G)) (@Ohm n rT (@gval rT H))) *) exact: gFisog. Qed. Lemma isog_Mho (H : {group rT}) : G \isog H -> 'Mho^n(G) \isog 'Mho^n(H). Proof. (* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT H)), is_true (@isog gT rT (@Mho n gT (@gval gT G)) (@Mho n rT (@gval rT H))) *) exact: gFisog. Qed. End char. Variable gT : finGroupType. Implicit Types (pi : nat_pred) (p : nat). Implicit Types (A B C : {set gT}) (D G H E : {group gT}). Lemma Ohm0 G : 'Ohm_0(G) = 1. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm O gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) apply/trivgP; rewrite /= gen_subG. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) O)) (oneg (FinGroup.base gT))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (one_group gT))))) *) by apply/subsetP=> x /setIdP[_]; rewrite inE. Qed. Lemma Ohm_leq m n G : m <= n -> 'Ohm_m(G) \subset 'Ohm_n(G). Proof. (* Goal: forall _ : is_true (leq m n), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm m gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) *) move/subnKC <-; rewrite genS //; apply/subsetP=> y. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) m)) (oneg (FinGroup.base gT)))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) (addn m (subn n m)))) (oneg (FinGroup.base gT)))))))) *) by rewrite !inE expnD expgM => /andP[-> /eqP->]; rewrite expg1n /=. Qed. Lemma OhmJ n G x : 'Ohm_n(G :^ x) = 'Ohm_n(G) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm n gT (@conjugate gT (@gval gT G) x)) (@conjugate gT (@Ohm n gT (@gval gT G)) x) *) rewrite -{1}(setIid G) -(setIidPr (Ohm_sub n G)). (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm n gT (@conjugate gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT G)) x)) (@conjugate gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@Ohm n gT (@gval gT G))) x) *) by rewrite -!morphim_conj injm_Ohm ?injm_conj. Qed. Lemma Mho0 G : 'Mho^0(G) = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho O gT (@gval gT G)) (@gval gT G) *) apply/eqP; rewrite eqEsubset Mho_sub /=. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho O gT (@gval gT G))))) *) apply/subsetP=> x Gx; rewrite -[x]prod_constt group_prod // => p _. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@constt gT x (nat_pred_of_nat p)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Mho_group O gT (@gval gT G)))))) *) exact: Mho_p_elt (groupX _ Gx) (p_elt_constt _ _). Qed. Lemma Mho_leq m n G : m <= n -> 'Mho^n(G) \subset 'Mho^m(G). Proof. (* Goal: forall _ : is_true (leq m n), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho m gT (@gval gT G))))) *) move/subnKC <-; rewrite gen_subG //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) (addn m (subn n m)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@p_elt gT (nat_pred_of_nat (pdiv (@order gT x))) x)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Mho_group m gT (@gval gT G)))))) *) apply/subsetP=> _ /imsetP[x /setIdP[Gx p_x] ->]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) x (expn (pdiv (@order gT x)) (addn m (subn n m)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Mho_group m gT (@gval gT G)))))) *) by rewrite expnD expgM groupX ?(Mho_p_elt _ _ p_x). Qed. Lemma MhoJ n G x : 'Mho^n(G :^ x) = 'Mho^n(G) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho n gT (@conjugate gT (@gval gT G) x)) (@conjugate gT (@Mho n gT (@gval gT G)) x) *) by rewrite -{1}(setIid G) -(setIidPr (Mho_sub n G)) -!morphim_conj morphim_Mho. Qed. Lemma extend_cyclic_Mho G p x : p.-group G -> x \in G -> 'Mho^1(G) = <[x ^+ p]> -> Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho (S O) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x p))) (k : nat) (_ : is_true (leq (S O) k)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho k gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (expn p k))) *) move=> pG Gx defG1 [//|k _]; have pX := mem_p_elt pG Gx. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Mho (S k) gT (@gval gT G)) (@cycle gT (@expgn (FinGroup.base gT) x (expn p (S k)))) *) apply/eqP; rewrite eqEsubset cycle_subG (Mho_p_elt _ Gx pX) andbT. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho (S k) gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT (@expgn (FinGroup.base gT) x (expn p (S k))))))) *) rewrite (MhoE _ pG) gen_subG; apply/subsetP=> ypk; case/imsetP=> y Gy ->{ypk}. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) y (expn p (S k))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT (@expgn (FinGroup.base gT) x (expn p (S k)))))))) *) have: y ^+ p \in <[x ^+ p]> by rewrite -defG1 (Mho_p_elt 1 _ (mem_p_elt pG Gy)). (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) y p) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT (@expgn (FinGroup.base gT) x p))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) y (expn p (S k))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT (@expgn (FinGroup.base gT) x (expn p (S k)))))))) *) rewrite !expnS /= !expgM => /cycleP[j ->]. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@expgn (FinGroup.base gT) (@expgn (FinGroup.base gT) x p) j) (expn p k)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT (@expgn (FinGroup.base gT) (@expgn (FinGroup.base gT) x p) (expn p k)))))) *) by rewrite -!expgM mulnCA mulnC expgM mem_cycle. Qed. Lemma Ohm1Eprime G : 'Ohm_1(G) = <<[set x in G | prime #[x]]>>. Lemma abelem_Ohm1 p G : p.-group G -> p.-abelem 'Ohm_1(G) = abelian 'Ohm_1(G). Proof. (* Goal: forall _ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G)), @eq bool (@abelem gT p (@Ohm (S O) gT (@gval gT G))) (@abelian gT (@Ohm (S O) gT (@gval gT G))) *) move=> pG; rewrite /abelem (pgroupS (Ohm_sub 1 G)) //. (* Goal: @eq bool (andb true (andb (@abelian gT (@Ohm (S O) gT (@gval gT G))) (dvdn (@exponent gT (@Ohm (S O) gT (@gval gT G))) p))) (@abelian gT (@Ohm (S O) gT (@gval gT G))) *) case abG1: (abelian _) => //=; apply/exponentP=> x. (* Goal: forall _ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G))))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)) *) by rewrite (OhmEabelian pG abG1); case/LdivP. Qed. Lemma Ohm1_abelem p G : p.-group G -> abelian G -> p.-abelem ('Ohm_1(G)). Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (@abelian gT (@gval gT G))), is_true (@abelem gT p (@Ohm (S O) gT (@gval gT G))) *) by move=> pG cGG; rewrite abelem_Ohm1 ?(abelianS (Ohm_sub 1 G)). Qed. Lemma Ohm1_id p G : p.-abelem G -> 'Ohm_1(G) = G. Proof. (* Goal: forall _ : is_true (@abelem gT p (@gval gT G)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@gval gT G) *) case/and3P=> pG cGG /exponentP Gp. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@gval gT G) *) apply/eqP; rewrite eqEsubset Ohm_sub (OhmE 1 pG) sub_gen //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT (expn p (S O))))))) *) by apply/subsetP=> x Gx; rewrite !inE Gx Gp /=. Qed. Lemma abelem_Ohm1P p G : abelian G -> p.-group G -> reflect ('Ohm_1(G) = G) (p.-abelem G). Proof. (* Goal: forall (_ : is_true (@abelian gT (@gval gT G))) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@gval gT G)) (@abelem gT p (@gval gT G)) *) move=> cGG pG. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@gval gT G)) (@abelem gT p (@gval gT G)) *) by apply: (iffP idP) => [| <-]; [apply: Ohm1_id | apply: Ohm1_abelem]. Qed. Lemma TI_Ohm1 G H : H :&: 'Ohm_1(G) = 1 -> H :&: G = 1. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@Ohm (S O) gT (@gval gT G))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) move=> tiHG1; case: (trivgVpdiv (H :&: G)) => // [[p pr_p]]. (* Goal: forall _ : is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@setI_group gT H G)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) case/Cauchy=> // x /setIP[Hx Gx] ox. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) suffices x1: x \in [1] by rewrite -ox (set1P x1) order1 in pr_p. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) *) by rewrite -{}tiHG1 inE Hx Ohm1Eprime mem_gen // inE Gx ox. Qed. Lemma Ohm1_eq1 G : ('Ohm_1(G) == 1) = (G :==: 1). Proof. (* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@Ohm (S O) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) *) apply/idP/idP => [/eqP G1_1 | /eqP->]; last by rewrite -subG1 Ohm_sub. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by rewrite -(setIid G) TI_Ohm1 // G1_1 setIg1. Qed. Lemma meet_Ohm1 G H : G :&: H != 1 -> G :&: 'Ohm_1(H) != 1. Proof. (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))), is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@Ohm (S O) gT (@gval gT H))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) by apply: contraNneq => /TI_Ohm1->. Qed. Lemma Ohm1_cent_max G E p : E \in 'E*_p(G) -> p.-group G -> 'Ohm_1('C_G(E)) = E. Proof. (* Goal: forall (_ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))))) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E)))) (@gval gT E) *) move=> EpmE pG; have [G1 | ntG]:= eqsVneq G 1. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E)))) (@gval gT E) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E)))) (@gval gT E) *) case/pmaxElemP: EpmE; case/pElemP; rewrite G1 => /trivgP-> _ _. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E)))) (@gval gT E) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@centraliser gT (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by apply/trivgP; rewrite cent1T setIT Ohm_sub. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E)))) (@gval gT E) *) have [p_pr _ _] := pgroup_pdiv pG ntG. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E)))) (@gval gT E) *) by rewrite (OhmE 1 (pgroupS (subsetIl G _) pG)) (pmaxElem_LdivP _ _) ?genGid. Qed. Lemma Ohm1_cyclic_pgroup_prime p G : cyclic G -> p.-group G -> G :!=: 1 -> #|'Ohm_1(G)| = p. Proof. (* Goal: forall (_ : is_true (@cyclic gT (@gval gT G))) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G))))) p *) move=> cycG pG ntG; set K := 'Ohm_1(G). (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) K))) p *) have abelK: p.-abelem K by rewrite Ohm1_abelem ?cyclic_abelian. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) K))) p *) have sKG: K \subset G := Ohm_sub 1 G. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) K))) p *) case/cyclicP: (cyclicS sKG cycG) => x /=; rewrite -/K => defK. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) K))) p *) rewrite defK -orderE (abelem_order_p abelK) //= -/K ?defK ?cycle_id //. (* Goal: is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT)))) *) rewrite -cycle_eq1 -defK -(setIidPr sKG). (* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) K) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) by apply: contraNneq ntG => /TI_Ohm1; rewrite setIid => ->. Qed. Lemma cyclic_pgroup_dprod_trivg p A B C : p.-group C -> cyclic C -> A \x B = C -> Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) C)) (_ : is_true (@cyclic gT C)) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) C), or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B C)) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A C)) *) move=> pC cycC; case/cyclicP: cycC pC => x ->{C} pC defC. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (@cycle gT x))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A (@cycle gT x))) *) case/dprodP: defC => [] [G H -> ->{A B}] defC _ tiGH; rewrite -defC. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) case: (eqVneq <[x]> 1) => [|ntC]. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) (* Goal: forall _ : @eq (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (@cycle gT x) (oneg (group_set_of_baseGroupType (FinGroup.base gT))), or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) move/trivgP; rewrite -defC mulG_subG => /andP[/trivgP-> _]. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT H)))) *) by rewrite mul1g; left. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) have [pr_p _ _] := pgroup_pdiv pC ntC; pose K := 'Ohm_1(<[x]>). (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) have prK : prime #|K| by rewrite (Ohm1_cyclic_pgroup_prime _ pC) ?cycle_cyclic. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) case: (prime_subgroupVti G prK) => [sKG |]; last first. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT (@Ohm_group (S O) gT (@cycle gT x)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))), or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) move/TI_Ohm1; rewrite -defC (setIidPl (mulG_subl _ _)) => ->. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT H)))) *) by left; rewrite mul1g. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) case: (prime_subgroupVti H prK) => [sKH |]; last first. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT (@Ohm_group (S O) gT (@cycle gT x)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))), or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) move/TI_Ohm1; rewrite -defC (setIidPl (mulG_subr _ _)) => ->. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) *) by right; rewrite mulg1. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) have K1: K :=: 1 by apply/trivgP; rewrite -tiGH subsetI sKG. (* Goal: or (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT G) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)))) *) by rewrite K1 cards1 in prK. Qed. Lemma piOhm1 G : \pi('Ohm_1(G)) = \pi(G). Lemma Ohm1Eexponent p G : prime p -> exponent 'Ohm_1(G) %| p -> 'Ohm_1(G) = 'Ldiv_p(G). Proof. (* Goal: forall (_ : is_true (prime p)) (_ : is_true (dvdn (@exponent gT (@Ohm (S O) gT (@gval gT G))) p)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT p)) *) move=> p_pr expG1p; have pG: p.-group G. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT p)) *) (* Goal: is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G)) *) apply: sub_in_pnat (pnat_pi (cardG_gt0 G)) => q _. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT p)) *) (* Goal: forall _ : is_true (@in_mem nat q (@mem nat nat_pred_pred (pi_of (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))), is_true (@in_mem nat q (@mem nat nat_pred_pred (nat_pred_of_nat p))) *) rewrite -piOhm1 mem_primes; case/and3P=> q_pr _; apply: pgroupP q_pr. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT p)) *) (* Goal: is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT (@Ohm_group (S O) gT (@gval gT G)))) *) by rewrite -pnat_exponent (pnat_dvd expG1p) ?pnat_id. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT G)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (Ldiv gT p)) *) apply/eqP; rewrite eqEsubset {2}(OhmE 1 pG) subset_gen subsetI Ohm_sub. (* Goal: is_true (andb (andb true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (Ldiv gT p))))) true) *) by rewrite sub_LdivT expG1p. Qed. Lemma p_rank_Ohm1 p G : 'r_p('Ohm_1(G)) = 'r_p(G). Proof. (* Goal: @eq nat (@p_rank gT p (@Ohm (S O) gT (@gval gT G))) (@p_rank gT p (@gval gT G)) *) apply/eqP; rewrite eqn_leq p_rankS ?Ohm_sub //. (* Goal: is_true (andb true (leq (@p_rank gT p (@gval gT G)) (@p_rank gT p (@Ohm (S O) gT (@gval gT G))))) *) apply/bigmax_leqP=> E /setIdP[sEG abelE]. (* Goal: is_true (leq (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) (@p_rank gT p (@Ohm (S O) gT (@gval gT G)))) *) by rewrite (bigmax_sup E) // inE -{1}(Ohm1_id abelE) OhmS. Qed. Lemma rank_Ohm1 G : 'r('Ohm_1(G)) = 'r(G). Proof. (* Goal: @eq nat (@rank gT (@Ohm (S O) gT (@gval gT G))) (@rank gT (@gval gT G)) *) apply/eqP; rewrite eqn_leq rankS ?Ohm_sub //. (* Goal: is_true (andb true (leq (@rank gT (@gval gT G)) (@rank gT (@Ohm (S O) gT (@gval gT G))))) *) by have [p _ ->] := rank_witness G; rewrite -p_rank_Ohm1 p_rank_le_rank. Qed. Lemma p_rank_abelian p G : abelian G -> 'r_p(G) = logn p #|'Ohm_1(G)|. Proof. (* Goal: forall _ : is_true (@abelian gT (@gval gT G)), @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G)))))) *) move=> cGG; have nilG := abelian_nil cGG; case p_pr: (prime p); last first. (* Goal: @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G)))))) *) (* Goal: @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G)))))) *) by apply/eqP; rewrite lognE p_pr eqn0Ngt p_rank_gt0 mem_primes p_pr. (* Goal: @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G)))))) *) case/dprodP: (Ohm_dprod 1 (nilpotent_pcoreC p nilG)) => _ <- _ /TI_cardMg->. (* Goal: @eq nat (@p_rank gT p (@gval gT G)) (logn p (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group (S O) gT (@pcore (nat_pred_of_nat p) gT (@gval gT G))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group (S O) gT (@pcore (negn (nat_pred_of_nat p)) gT (@gval gT G))))))))) *) rewrite mulnC logn_Gauss; last first. (* Goal: @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group (S O) gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)))))))) *) (* Goal: is_true (coprime p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group (S O) gT (@pcore (negn (nat_pred_of_nat p)) gT (@gval gT G)))))))) *) rewrite prime_coprime // -p'natE // -/(pgroup _ _). (* Goal: @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group (S O) gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)))))))) *) (* Goal: is_true (@pgroup gT (negn (nat_pred_of_nat p)) (@gval gT (@Ohm_group (S O) gT (@pcore (negn (nat_pred_of_nat p)) gT (@gval gT G))))) *) exact: pgroupS (Ohm_sub _ _) (pcore_pgroup _ _). (* Goal: @eq nat (@p_rank gT p (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group (S O) gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)))))))) *) rewrite -(p_rank_Sylow (nilpotent_pcore_Hall p nilG)) -p_rank_Ohm1. (* Goal: @eq nat (@p_rank gT p (@Ohm (S O) gT (@gval gT (@pcore_group (nat_pred_of_nat p) gT (@gval gT G))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Ohm_group (S O) gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)))))))) *) rewrite p_rank_abelem // Ohm1_abelem ?pcore_pgroup //. (* Goal: is_true (@abelian gT (@gval gT (@pcore_group (nat_pred_of_nat p) gT (@gval gT G)))) *) exact: abelianS (pcore_sub _ _) cGG. Qed. Lemma rank_abelian_pgroup p G : p.-group G -> abelian G -> 'r(G) = logn p #|'Ohm_1(G)|. Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (@abelian gT (@gval gT G))), @eq nat (@rank gT (@gval gT G)) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@gval gT G)))))) *) by move=> pG cGG; rewrite (rank_pgroup pG) p_rank_abelian. Qed. End OhmProps. Section AbelianStructure. Variable gT : finGroupType. Implicit Types (p : nat) (G H K E : {group gT}). Lemma abelian_splits x G : x \in G -> #[x] = exponent G -> abelian G -> [splits G, over <[x]>]. Lemma abelem_splits p G H : p.-abelem G -> H \subset G -> [splits G, over H]. Proof. (* Goal: forall (_ : is_true (@abelem gT p (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) elim: {G}_.+1 {-2}G H (ltnSn #|G|) => // m IHm G H. (* Goal: forall (_ : is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (S m))) (_ : is_true (@abelem gT p (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) rewrite ltnS => leGm abelG sHG; case: (eqsVneq H 1) => [-> | ]. (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))), is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) (* Goal: is_true (@splits_over gT (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *) by apply/splitsP; exists G; rewrite inE mul1g -subG1 subsetIl /=. (* Goal: forall _ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))), is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) case/trivgPn=> x Hx ntx; have Gx := subsetP sHG x Hx. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) have [_ cGG eGp] := and3P abelG. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) have ox: #[x] = exponent G. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) (* Goal: @eq nat (@order gT x) (@exponent gT (@gval gT G)) *) by apply/eqP; rewrite eqn_dvd dvdn_exponent // (abelem_order_p abelG). (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) case/splitsP: (abelian_splits Gx ox cGG) => K; case/complP=> tixK defG. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) have sKG: K \subset G by rewrite -defG mulG_subr. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) have ltKm: #|K| < m. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) (* Goal: is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) m) *) rewrite (leq_trans _ leGm) ?proper_card //; apply/properP; split=> //. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) (* Goal: @ex2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))))) *) exists x => //; apply: contra ntx => Kx; rewrite -cycle_eq1 -subG1 -tixK. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT x)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x) (@gval gT K))))) *) by rewrite subsetI subxx cycle_subG. (* Goal: is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) case/splitsP: (IHm _ _ ltKm (abelemS sKG abelG) (subsetIr H K)) => L. (* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) L (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@complements_to_in gT (@gval gT (@setI_group gT H K)) (@gval gT K))))), is_true (@splits_over gT (@gval gT G) (@gval gT H)) *) case/complP=> tiHKL defK; apply/splitsP; exists L; rewrite inE. (* Goal: is_true (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT L)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT L)) (@gval gT G))) *) rewrite -subG1 -tiHKL -setIA setIS; last by rewrite subsetI -defK mulG_subr /=. (* Goal: is_true (andb true (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT L)) (@gval gT G))) *) by rewrite -(setIidPr sHG) -defG -group_modl ?cycle_subG //= setIC -mulgA defK. Qed. Fact abelian_type_subproof G : {H : {group gT} & abelian G -> {x | #[x] = exponent G & <[x]> \x H = G}}. Proof. (* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) *) case cGG: (abelian G); last by exists G. (* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true true, @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) *) have [x Gx ox] := exponent_witness (abelian_nil cGG). (* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true true, @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) *) case/splitsP/ex_mingroup: (abelian_splits Gx (esym ox) cGG) => H. (* Goal: forall _ : is_true (@mingroup gT (@gval gT H) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@complements_to_in gT (@cycle gT x) (@gval gT G)))))), @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true true, @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) *) case/mingroupp/complP=> tixH defG; exists H => _. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G)) *) exists x; rewrite ?dprodE // (sub_abelian_cent2 cGG) ?cycle_subG //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by rewrite -defG mulG_subr. Qed. Fixpoint abelian_type_rec n G := if n is n'.+1 then if abelian G && (G :!=: 1) then exponent G :: abelian_type_rec n' (tag (abelian_type_subproof G)) else [::] else [::]. Definition abelian_type (A : {set gT}) := abelian_type_rec #|A| <<A>>. Lemma abelian_type_dvdn_sorted A : sorted [rel m n | n %| m] (abelian_type A). Proof. (* Goal: is_true (@sorted nat_eqType (@rel_of_simpl_rel nat (@SimplRel nat (fun m n : nat => dvdn n m))) (abelian_type A)) *) set R := SimplRel _; pose G := <<A>>%G. (* Goal: is_true (@sorted nat_eqType (@rel_of_simpl_rel nat R) (abelian_type A)) *) suffices: path R (exponent G) (abelian_type A) by case: (_ A) => // m t /andP[]. (* Goal: is_true (@path nat (@rel_of_simpl_rel nat R) (@exponent gT (@gval gT G)) (abelian_type A)) *) rewrite /abelian_type -/G; elim: {A}#|A| G {2 3}G (subxx G) => // n IHn G M sGM. (* Goal: is_true (@path nat (@rel_of_simpl_rel nat R) (@exponent gT (@gval gT M)) (abelian_type_rec (S n) G)) *) simpl; case: ifP => //= /andP[cGG ntG]; rewrite exponentS ?IHn //=. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) (abelian_type_subproof G))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) case: (abelian_type_subproof G) => H /= [//| x _] /dprodP[_ /= <- _ _]. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@gval gT H))))) *) exact: mulG_subr. Qed. Lemma abelian_type_gt1 A : all [pred m | m > 1] (abelian_type A). Proof. (* Goal: is_true (@all nat (@pred_of_simpl nat (@SimplPred nat (fun m : nat => leq (S (S O)) m))) (abelian_type A)) *) rewrite /abelian_type; elim: {A}#|A| <<A>>%G => //= n IHn G. (* Goal: is_true (@all nat (@pred_of_simpl nat (@SimplPred nat (fun m : nat => leq (S (S O)) m))) (if andb (@abelian gT (@gval gT G)) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) then @cons nat (@exponent gT (@gval gT G)) (abelian_type_rec n (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) (abelian_type_subproof G))) else @nil nat)) *) case: ifP => //= /andP[_ ntG]; rewrite {n}IHn. (* Goal: is_true (andb (leq (S (S O)) (@exponent gT (@gval gT G))) true) *) by rewrite ltn_neqAle exponent_gt0 eq_sym -dvdn1 -trivg_exponent ntG. Qed. Lemma abelian_type_sorted A : sorted geq (abelian_type A). Proof. (* Goal: is_true (@sorted nat_eqType (@rel_of_simpl_rel nat geq) (abelian_type A)) *) have:= abelian_type_dvdn_sorted A; have:= abelian_type_gt1 A. (* Goal: forall (_ : is_true (@all nat (@pred_of_simpl nat (@SimplPred nat (fun m : nat => leq (S (S O)) m))) (abelian_type A))) (_ : is_true (@sorted nat_eqType (@rel_of_simpl_rel nat (@SimplRel nat (fun m n : nat => dvdn n m))) (abelian_type A))), is_true (@sorted nat_eqType (@rel_of_simpl_rel nat geq) (abelian_type A)) *) case: (abelian_type A) => //= m t; elim: t m => //= n t IHt m /andP[]. (* Goal: forall (_ : is_true (leq (S (S O)) m)) (_ : is_true (andb (leq (S (S O)) n) (@all nat (@pred_of_simpl nat (@SimplPred nat (fun m : nat => leq (S (S O)) m))) t))) (_ : is_true (andb (dvdn n m) (@path nat (@rel_of_simpl_rel nat (@SimplRel nat (fun m n : nat => dvdn n m))) n t))), is_true (andb (leq n m) (@path nat (@rel_of_simpl_rel nat geq) n t)) *) by move/ltnW=> m_gt0 t_gt1 /andP[n_dv_m /IHt->]; rewrite // dvdn_leq. Qed. Theorem abelian_structure G : abelian G -> {b | \big[dprod/1]_(x <- b) <[x]> = G & map order b = abelian_type G}. Proof. (* Goal: forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (abelian_type (@gval gT G))) *) rewrite /abelian_type genGidG. (* Goal: forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (abelian_type_rec (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) G)) *) elim: {G}#|G| {-2 5}G (leqnn #|G|) => /= [|n IHn] G leGn cGG. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (if andb (@abelian gT (@gval gT G)) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) then @cons nat (@exponent gT (@gval gT G)) (abelian_type_rec n (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) (abelian_type_subproof G))) else @nil nat)) *) (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (@nil nat)) *) by rewrite leqNgt cardG_gt0 in leGn. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (if andb (@abelian gT (@gval gT G)) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) then @cons nat (@exponent gT (@gval gT G)) (abelian_type_rec n (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) (abelian_type_subproof G))) else @nil nat)) *) rewrite {1}cGG /=; case: ifP => [ntG|/eqP->]; last first. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (@cons nat (@exponent gT (@gval gT G)) (abelian_type_rec n (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) (abelian_type_subproof G))))) *) (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (@nil nat)) *) by exists [::]; rewrite ?big_nil. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (@cons nat (@exponent gT (@gval gT G)) (abelian_type_rec n (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@gval gT G)), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@gval gT G))) (abelian_type_subproof G))))) *) case: (abelian_type_subproof G) => H /= [//|x ox xdefG]; rewrite -ox. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (@cons nat (@order gT x) (abelian_type_rec n H))) *) have [_ defG cxH tixH] := dprodP xdefG. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (@cons nat (@order gT x) (abelian_type_rec n H))) *) have sHG: H \subset G by rewrite -defG mulG_subr. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (@cons nat (@order gT x) (abelian_type_rec n H))) *) case/IHn: (abelianS sHG cGG) => [|b defH <-]. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b0 : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b0) (@cons nat (@order gT x) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) (* Goal: is_true (leq (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) n) *) rewrite -ltnS (leq_trans _ leGn) // -defG TI_cardMg // -orderE. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b0 : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b0) (@cons nat (@order gT x) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) (* Goal: is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) (muln (@order gT x) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) *) rewrite ltn_Pmull ?cardG_gt0 // ltn_neqAle order_gt0 eq_sym -dvdn1. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b0 : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b0) (@cons nat (@order gT x) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) (* Goal: is_true (andb (negb (dvdn (@order gT x) (S O))) true) *) by rewrite ox -trivg_exponent ntG. (* Goal: @sig2 (list (FinGroup.arg_sort (FinGroup.base gT))) (fun b : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (fun b0 : list (FinGroup.arg_sort (FinGroup.base gT)) => @eq (list nat) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b0) (@cons nat (@order gT x) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) by exists (x :: b); rewrite // big_cons defH xdefG. Qed. Lemma count_logn_dprod_cycle p n b G : \big[dprod/1]_(x <- b) <[x]> = G -> count [pred x | logn p #[x] > n] b = logn p #|'Ohm_n.+1(G) : 'Ohm_n(G)|. Lemma perm_eq_abelian_type p b G : p.-group G -> \big[dprod/1]_(x <- b) <[x]> = G -> 1 \notin b -> Proof. (* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G)) (_ : is_true (negb (@in_mem (FinGroup.sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@mem (Equality.sort (FinGroup.arg_eqType (FinGroup.base gT))) (seq_predType (FinGroup.arg_eqType (FinGroup.base gT))) b)))), is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b) (abelian_type (@gval gT G))) *) move: b => b1 pG defG1 ntb1. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) have cGG: abelian G. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: is_true (@abelian gT (@gval gT G)) *) elim: (b1) {pG}G defG1 => [_ <-|x b IHb G]; first by rewrite big_nil abelian1. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons (FinGroup.arg_sort (FinGroup.base gT)) x b) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G), is_true (@abelian gT (@gval gT G)) *) rewrite big_cons; case/dprodP=> [[_ H _ defH]] <-; rewrite defH => cxH _. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: is_true (@abelian gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@gval gT H))) *) by rewrite abelianM cycle_abelian IHb. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) have p_bG b: \big[dprod/1]_(x <- b) <[x]> = G -> all (p_elt p) b. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G), is_true (@all (FinGroup.arg_sort (FinGroup.base gT)) (@p_elt gT (nat_pred_of_nat p)) b) *) elim: b {defG1 cGG}G pG => //= x b IHb G pG; rewrite big_cons. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j)))) (@gval gT G), is_true (andb (@p_elt gT (nat_pred_of_nat p) x) (@all (FinGroup.arg_sort (FinGroup.base gT)) (@p_elt gT (nat_pred_of_nat p)) b)) *) case/dprodP=> [[_ H _ defH]]; rewrite defH andbC => defG _ _. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: is_true (andb (@all (FinGroup.arg_sort (FinGroup.base gT)) (@p_elt gT (nat_pred_of_nat p)) b) (@p_elt gT (nat_pred_of_nat p) x)) *) by rewrite -defG pgroupM in pG; case/andP: pG => p_x /IHb->. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) have [b2 defG2 def_t] := abelian_structure cGG. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) have ntb2: 1 \notin b2. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: is_true (negb (@in_mem (FinGroup.sort (FinGroup.base gT)) (oneg (FinGroup.base gT)) (@mem (Equality.sort (FinGroup.arg_eqType (FinGroup.base gT))) (seq_predType (FinGroup.arg_eqType (FinGroup.base gT))) b2))) *) apply: contraL (abelian_type_gt1 G) => b2_1. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: is_true (negb (@all nat (@pred_of_simpl nat (@SimplPred nat (fun m : nat => leq (S (S O)) m))) (abelian_type (@gval gT G)))) *) rewrite -def_t -has_predC has_map. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) (* Goal: is_true (@has (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) (@pred_of_simpl nat (@predC nat (@pred_of_simpl nat (@SimplPred nat (fun m : nat => leq (S (S O)) m))))))) b2) *) by apply/hasP; exists 1; rewrite //= order1. (* Goal: is_true (@perm_eq nat_eqType (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1) (abelian_type (@gval gT G))) *) rewrite -{}def_t; apply/allP=> m; rewrite -map_cat => /mapP[x b_x def_m]. (* Goal: is_true (@pred_of_simpl (Equality.sort nat_eqType) (@SimplPred (Equality.sort nat_eqType) (fun x : Equality.sort nat_eqType => @eq_op nat_eqType (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1)) (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b2)))) m) *) have{ntb1 ntb2} ntx: x != 1. (* Goal: is_true (@pred_of_simpl (Equality.sort nat_eqType) (@SimplPred (Equality.sort nat_eqType) (fun x : Equality.sort nat_eqType => @eq_op nat_eqType (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1)) (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b2)))) m) *) (* Goal: is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT)))) *) by apply: contraL b_x; move/eqP->; rewrite mem_cat negb_or ntb1 ntb2. (* Goal: is_true (@pred_of_simpl (Equality.sort nat_eqType) (@SimplPred (Equality.sort nat_eqType) (fun x : Equality.sort nat_eqType => @eq_op nat_eqType (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1)) (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b2)))) m) *) have p_x: p.-elt x by apply: allP (x) b_x; rewrite all_cat !p_bG. (* Goal: is_true (@pred_of_simpl (Equality.sort nat_eqType) (@SimplPred (Equality.sort nat_eqType) (fun x : Equality.sort nat_eqType => @eq_op nat_eqType (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1)) (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b2)))) m) *) rewrite -cycle_eq1 in ntx; have [p_pr _ [k ox]] := pgroup_pdiv p_x ntx. (* Goal: is_true (@pred_of_simpl (Equality.sort nat_eqType) (@SimplPred (Equality.sort nat_eqType) (fun x : Equality.sort nat_eqType => @eq_op nat_eqType (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b1)) (@count (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType x)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b2)))) m) *) apply/eqnP; rewrite {m}def_m orderE ox !count_map. (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) pose cnt_p k := count [pred x : gT | logn p #[x] > k]. (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) have cnt_b b: \big[dprod/1]_(x <- b) <[x]> = G -> count [pred x | #[x] == p ^ k.+1]%N b = cnt_p k b - cnt_p k.+1 b. (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G), @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@SimplPred (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq_op nat_eqType (@order gT x) (expn p (S k))))) b) (subn (cnt_p k b) (cnt_p (S k) b)) *) - (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G), @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@SimplPred (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq_op nat_eqType (@order gT x) (expn p (S k))))) b) (subn (cnt_p k b) (cnt_p (S k) b)) *) move/p_bG; elim: b => //= _ b IHb /andP[/p_natP[j ->] /IHb-> {IHb}]. (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) (* Goal: @eq nat (addn (nat_of_bool (@eq_op nat_eqType (expn p j) (expn p (S k)))) (subn (cnt_p k b) (cnt_p (S k) b))) (subn (addn (nat_of_bool (leq (S k) (logn p (expn p j)))) (cnt_p k b)) (addn (nat_of_bool (leq (S (S k)) (logn p (expn p j)))) (cnt_p (S k) b))) *) rewrite eqn_leq !leq_exp2l ?prime_gt1 // -eqn_leq pfactorK //. (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) (* Goal: @eq nat (addn (nat_of_bool (@eq_op nat_eqType j (S k))) (subn (cnt_p k b) (cnt_p (S k) b))) (subn (addn (nat_of_bool (leq (S k) j)) (cnt_p k b)) (addn (nat_of_bool (leq (S (S k)) j)) (cnt_p (S k) b))) *) case: ltngtP => // _ {j}; rewrite subSn // add0n; elim: b => //= y b IHb. (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) (* Goal: is_true (leq (addn (nat_of_bool (leq (S (S k)) (logn p (@order gT y)))) (cnt_p (S k) b)) (addn (nat_of_bool (leq (S k) (logn p (@order gT y)))) (cnt_p k b))) *) by rewrite leq_add // ltn_neqAle; case: (~~ _). (* Goal: @eq nat (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b1) (@count (FinGroup.arg_sort (FinGroup.base gT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base gT)) (@preim (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort nat_eqType) (@order gT) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (expn p (S k)))))) b2) *) by rewrite !cnt_b // /cnt_p !(@count_logn_dprod_cycle _ _ _ G). Qed. Lemma size_abelian_type G : abelian G -> size (abelian_type G) = 'r(G). Lemma mul_card_Ohm_Mho_abelian n G : abelian G -> (#|'Ohm_n(G)| * #|'Mho^n(G)|)%N = #|G|. Proof. (* Goal: forall _ : is_true (@abelian gT (@gval gT G)), @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) case/abelian_structure => b defG _. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) elim: b G defG => [_ <-|x b IHb G]. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons (FinGroup.arg_sort (FinGroup.base gT)) x b) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G), @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@nil (FinGroup.arg_sort (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@nil (FinGroup.arg_sort (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x)))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@nil (FinGroup.arg_sort (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x)))))) *) by rewrite !big_nil (trivgP (Ohm_sub _ _)) (trivgP (Mho_sub _ _)) !cards1. (* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons (FinGroup.arg_sort (FinGroup.base gT)) x b) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) x (direct_product gT) true (@cycle gT x))) (@gval gT G), @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) rewrite big_cons => defG; rewrite -(dprod_card defG). (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@gval gT G))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@gval gT G)))))) (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j))))))) *) rewrite -(dprod_card (Ohm_dprod n defG)) -(dprod_card (Mho_dprod n defG)) /=. (* Goal: @eq nat (muln (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j)))))))) (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j))))))))) (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j))))))) *) rewrite mulnCA -!mulnA mulnCA mulnA; case/dprodP: defG => [[_ H _ defH] _ _ _]. (* Goal: @eq nat (muln (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j))))))))) (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) b (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) j (direct_product gT) true (@cycle gT j))))))) *) rewrite defH {b G defH IHb}(IHb H defH); congr (_ * _)%N => {H}. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) elim: {x}_.+1 {-2}x (ltnSn #[x]) => // m IHm x; rewrite ltnS => lexm. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) case p_x: (p_group <[x]>); last first. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) case: (eqVneq x 1) p_x => [-> |]; first by rewrite cycle1 p_group1. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: forall (_ : is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT))))) (_ : @eq bool (@p_group gT (@cycle gT x)) false), @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) rewrite -order_gt1 /p_group -orderE; set p := pdiv _ => ntx p'x. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@order gT x) *) have def_x: <[x.`_p]> \x <[x.`_p^']> = <[x]>. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@order gT x) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@constt gT x (nat_pred_of_nat p))) (@cycle gT (@constt gT x (negn (nat_pred_of_nat p))))) (@cycle gT x) *) have ?: coprime #[x.`_p] #[x.`_p^'] by rewrite !order_constt coprime_partC. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@order gT x) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@constt gT x (nat_pred_of_nat p))) (@cycle gT (@constt gT x (negn (nat_pred_of_nat p))))) (@cycle gT x) *) have ?: commute x.`_p x.`_p^' by apply: commuteX2. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@order gT x) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT (@constt gT x (nat_pred_of_nat p))) (@cycle gT (@constt gT x (negn (nat_pred_of_nat p))))) (@cycle gT x) *) rewrite dprodE ?coprime_TIg -?cycleM ?consttC //. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@order gT x) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@cycle_group gT (@constt gT x (negn (nat_pred_of_nat p))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (@cycle_group gT (@constt gT x (nat_pred_of_nat p)))))))) *) by rewrite cent_cycle cycle_subG; apply/cent1P. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@order gT x) *) rewrite -(dprod_card (Ohm_dprod n def_x)) -(dprod_card (Mho_dprod n def_x)). (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT (@constt gT x (nat_pred_of_nat p))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT (@constt gT x (negn (nat_pred_of_nat p))))))))) (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT (@constt gT x (nat_pred_of_nat p))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT (@constt gT x (negn (nat_pred_of_nat p)))))))))) (@order gT x) *) rewrite mulnCA -mulnA mulnCA mulnA. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: @eq nat (muln (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT (@constt gT x (nat_pred_of_nat p))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT (@constt gT x (nat_pred_of_nat p)))))))) (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT (@constt gT x (negn (nat_pred_of_nat p)))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT (@constt gT x (negn (nat_pred_of_nat p)))))))))) (@order gT x) *) rewrite !{}IHm ?(dprod_card def_x) ?(leq_trans _ lexm) {m lexm}//. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: is_true (leq (S (@order gT (@constt gT x (nat_pred_of_nat p)))) (@order gT x)) *) (* Goal: is_true (leq (S (@order gT (@constt gT x (negn (nat_pred_of_nat p))))) (@order gT x)) *) rewrite /order -(dprod_card def_x) -!orderE !order_constt ltn_Pmull //. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: is_true (leq (S (@order gT (@constt gT x (nat_pred_of_nat p)))) (@order gT x)) *) (* Goal: is_true (leq (S (S O)) (partn (@order gT x) (nat_pred_of_nat p))) *) rewrite p_part -(expn0 p) ltn_exp2l 1?lognE ?prime_gt1 ?pdiv_prime //. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: is_true (leq (S (@order gT (@constt gT x (nat_pred_of_nat p)))) (@order gT x)) *) (* Goal: is_true (leq (S O) (if andb true (andb (leq (S O) (@order gT x)) (dvdn p (@order gT x))) then S (logn p (divn (@order gT x) p)) else O)) *) by rewrite order_gt0 pdiv_dvd. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: is_true (leq (S (@order gT (@constt gT x (nat_pred_of_nat p)))) (@order gT x)) *) rewrite proper_card // properEneq cycle_subG mem_cycle andbT. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) (* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle gT (@constt gT x (nat_pred_of_nat p))) (@cycle gT x))) *) by apply: contra (negbT p'x); move/eqP <-; apply: p_elt_constt. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) case/p_groupP: p_x => p p_pr p_x. (* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm n gT (@cycle gT x))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Mho n gT (@cycle gT x)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) *) rewrite (Ohm_p_cycle n p_x) (Mho_p_cycle n p_x) -!orderE. (* Goal: @eq nat (muln (@order gT (@expgn (FinGroup.base gT) x (expn p (subn (logn p (@order gT x)) n)))) (@order gT (@expgn (FinGroup.base gT) x (expn p n)))) (@order gT x) *) set k := logn p #[x]; have ox: #[x] = (p ^ k)%N by rewrite -card_pgroup. (* Goal: @eq nat (muln (@order gT (@expgn (FinGroup.base gT) x (expn p (subn k n)))) (@order gT (@expgn (FinGroup.base gT) x (expn p n)))) (@order gT x) *) case: (leqP k n) => [le_k_n | lt_n_k]. (* Goal: @eq nat (muln (@order gT (@expgn (FinGroup.base gT) x (expn p (subn k n)))) (@order gT (@expgn (FinGroup.base gT) x (expn p n)))) (@order gT x) *) (* Goal: @eq nat (muln (@order gT (@expgn (FinGroup.base gT) x (expn p (subn k n)))) (@order gT (@expgn (FinGroup.base gT) x (expn p n)))) (@order gT x) *) rewrite -(subnKC le_k_n) subnDA subnn expg1 expnD expgM -ox. (* Goal: @eq nat (muln (@order gT (@expgn (FinGroup.base gT) x (expn p (subn k n)))) (@order gT (@expgn (FinGroup.base gT) x (expn p n)))) (@order gT x) *) (* Goal: @eq nat (muln (@order gT x) (@order gT (@expgn (FinGroup.base gT) (@expgn (FinGroup.base gT) x (@order gT x)) (expn p (subn n k))))) (@order gT x) *) by rewrite expg_order expg1n order1 muln1. (* Goal: @eq nat (muln (@order gT (@expgn (FinGroup.base gT) x (expn p (subn k n)))) (@order gT (@expgn (FinGroup.base gT) x (expn p n)))) (@order gT x) *) rewrite !orderXgcd ox -{-3}(subnKC (ltnW lt_n_k)) expnD. (* Goal: @eq nat (muln (divn (muln (expn p n) (expn p (subn k n))) (gcdn (muln (expn p n) (expn p (subn k n))) (expn p (subn k n)))) (divn (muln (expn p n) (expn p (subn k n))) (gcdn (muln (expn p n) (expn p (subn k n))) (expn p n)))) (muln (expn p n) (expn p (subn k n))) *) rewrite gcdnC gcdnMl gcdnC gcdnMr. (* Goal: @eq nat (muln (divn (muln (expn p n) (expn p (subn k n))) (expn p (subn k n))) (divn (muln (expn p n) (expn p (subn k n))) (expn p n))) (muln (expn p n) (expn p (subn k n))) *) by rewrite mulnK ?mulKn ?expn_gt0 ?prime_gt0. Qed. Lemma grank_abelian G : abelian G -> 'm(G) = 'r(G). Lemma rank_cycle (x : gT) : 'r(<[x]>) = (x != 1). Proof. (* Goal: @eq nat (@rank gT (@cycle gT x)) (nat_of_bool (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT))))) *) have [->|ntx] := altP (x =P 1); first by rewrite cycle1 rank1. (* Goal: @eq nat (@rank gT (@cycle gT x)) (nat_of_bool (negb false)) *) apply/eqP; rewrite eqn_leq rank_gt0 cycle_eq1 ntx andbT. (* Goal: is_true (leq (@rank gT (@cycle gT x)) (nat_of_bool (negb false))) *) by rewrite -grank_abelian ?cycle_abelian //= -(cards1 x) grank_min. Qed. Lemma abelian_rank1_cyclic G : abelian G -> cyclic G = ('r(G) <= 1). Definition homocyclic A := abelian A && constant (abelian_type A). Lemma homocyclic_Ohm_Mho n p G : p.-group G -> homocyclic G -> 'Ohm_n(G) = 'Mho^(logn p (exponent G) - n)(G). Lemma Ohm_Mho_homocyclic (n p : nat) G : abelian G -> p.-group G -> 0 < n < logn p (exponent G) -> Lemma abelem_homocyclic p G : p.-abelem G -> homocyclic G. Proof. (* Goal: forall _ : is_true (@abelem gT p (@gval gT G)), is_true (homocyclic (@gval gT G)) *) move=> abelG; have [_ cGG _] := and3P abelG. (* Goal: is_true (homocyclic (@gval gT G)) *) rewrite /homocyclic cGG (@all_pred1_constant _ p) //. (* Goal: is_true (@all (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType p)) (abelian_type (@gval gT G))) *) case/abelian_structure: cGG (abelian_type_gt1 G) => b defG <- => b_gt1. (* Goal: is_true (@all (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType p)) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b)) *) apply/allP=> _ /mapP[x b_x ->] /=; rewrite (abelem_order_p abelG) //. (* Goal: is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT)))) *) (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) rewrite -cycle_subG -(bigdprodWY defG) ?sub_gen //. (* Goal: is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT)))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (FinGroup.arg_sort (FinGroup.base gT)) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) b (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (FinGroup.arg_sort (FinGroup.base gT)) i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@cycle gT i)))))) *) by rewrite bigcup_seq (bigcup_sup x). (* Goal: is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base gT)) x (oneg (FinGroup.base gT)))) *) by rewrite -order_gt1 [_ > 1](allP b_gt1) ?map_f. Qed. Lemma homocyclic1 : homocyclic [1 gT]. Proof. (* Goal: is_true (homocyclic (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))))) *) exact: abelem_homocyclic (abelem1 _ 2). Qed. Lemma Ohm1_homocyclicP p G : p.-group G -> abelian G -> Lemma abelian_type_homocyclic G : homocyclic G -> abelian_type G = nseq 'r(G) (exponent G). Proof. (* Goal: forall _ : is_true (homocyclic (@gval gT G)), @eq (list nat) (abelian_type (@gval gT G)) (@nseq nat (@rank gT (@gval gT G)) (@exponent gT (@gval gT G))) *) case/andP=> cGG; rewrite -size_abelian_type // /abelian_type. (* Goal: forall _ : is_true (@constant nat_eqType (abelian_type_rec (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@generated_group gT (@gval gT G)))), @eq (list nat) (abelian_type_rec (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@generated_group gT (@gval gT G))) (@nseq nat (@size nat (abelian_type_rec (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@generated_group gT (@gval gT G)))) (@exponent gT (@gval gT G))) *) rewrite -(prednK (cardG_gt0 G)) /=; case: andP => //= _; move: (tag _) => H. (* Goal: forall _ : is_true (@all nat (@pred_of_simpl nat (@pred1 nat_eqType (@exponent gT (@generated gT (@gval gT G))))) (abelian_type_rec (Nat.pred (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) H)), @eq (list nat) (@cons nat (@exponent gT (@generated gT (@gval gT G))) (abelian_type_rec (Nat.pred (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) H)) (@cons nat (@exponent gT (@gval gT G)) (@nseq nat (@size nat (abelian_type_rec (Nat.pred (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) H)) (@exponent gT (@gval gT G)))) *) by move/all_pred1P->; rewrite genGid size_nseq. Qed. Lemma abelian_type_abelem p G : p.-abelem G -> abelian_type G = nseq 'r(G) p. Proof. (* Goal: forall _ : is_true (@abelem gT p (@gval gT G)), @eq (list nat) (abelian_type (@gval gT G)) (@nseq nat (@rank gT (@gval gT G)) p) *) move=> abelG; rewrite (abelian_type_homocyclic (abelem_homocyclic abelG)). (* Goal: @eq (list nat) (@nseq nat (@rank gT (@gval gT G)) (@exponent gT (@gval gT G))) (@nseq nat (@rank gT (@gval gT G)) p) *) case: (eqVneq G 1%G) => [-> | ntG]; first by rewrite rank1. (* Goal: @eq (list nat) (@nseq nat (@rank gT (@gval gT G)) (@exponent gT (@gval gT G))) (@nseq nat (@rank gT (@gval gT G)) p) *) congr nseq; apply/eqP; rewrite eqn_dvd; have [pG _ ->] := and3P abelG. (* Goal: is_true (andb true (dvdn p (@exponent gT (@gval gT G)))) *) have [p_pr] := pgroup_pdiv pG ntG; case/Cauchy=> // x Gx <- _. (* Goal: is_true (andb true (dvdn (@order gT x) (@exponent gT (@gval gT G)))) *) exact: dvdn_exponent. Qed. Lemma max_card_abelian G : abelian G -> #|G| <= exponent G ^ 'r(G) ?= iff homocyclic G. Proof. (* Goal: forall _ : is_true (@abelian gT (@gval gT G)), leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (homocyclic (@gval gT G)) *) move=> cGG; have [b defG def_tG] := abelian_structure cGG. (* Goal: leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (homocyclic (@gval gT G)) *) have Gb: all (mem G) b. (* Goal: leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (homocyclic (@gval gT G)) *) (* Goal: is_true (@all (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@pred_of_simpl (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@pred_of_mem_pred (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) b) *) apply/allP=> x b_x; rewrite -(bigdprodWY defG); have [b1 b2] := splitPr b_x. (* Goal: leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (homocyclic (@gval gT G)) *) (* Goal: is_true (@pred_of_simpl (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@pred_of_mem_pred (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (FinGroup.arg_sort (FinGroup.base gT)) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@cat (Equality.sort (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT)))) b1 (@cons (Equality.sort (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT)))) x b2)) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (FinGroup.arg_sort (FinGroup.base gT)) i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@cycle gT i))))))) x) *) by rewrite big_cat big_cons /= mem_gen // setUCA inE cycle_id. (* Goal: leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (homocyclic (@gval gT G)) *) have ->: homocyclic G = all (pred1 (exponent G)) (abelian_type G). (* Goal: leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (@all (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (abelian_type (@gval gT G))) *) (* Goal: @eq bool (homocyclic (@gval gT G)) (@all (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (abelian_type (@gval gT G))) *) rewrite /homocyclic cGG /abelian_type; case: #|G| => //= n. (* Goal: leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (@all (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (abelian_type (@gval gT G))) *) (* Goal: @eq bool (@constant nat_eqType (if andb (@abelian gT (@generated gT (@gval gT G))) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@generated gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) then @cons nat (@exponent gT (@generated gT (@gval gT G))) (abelian_type_rec n (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@generated gT (@gval gT G))), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@generated gT (@gval gT G)))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@generated gT (@gval gT G)))) (abelian_type_subproof (@generated_group gT (@gval gT G))))) else @nil nat)) (@all nat (@pred_of_simpl nat (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (if andb (@abelian gT (@generated gT (@gval gT G))) (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@generated gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) then @cons nat (@exponent gT (@generated gT (@gval gT G))) (abelian_type_rec n (@tag (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : is_true (@abelian gT (@generated gT (@gval gT G))), @sig2 (FinGroup.arg_sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq nat (@order gT x) (@exponent gT (@generated gT (@gval gT G)))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cycle gT x) (@gval gT H)) (@generated gT (@gval gT G)))) (abelian_type_subproof (@generated_group gT (@gval gT G))))) else @nil nat)) *) by move: (_ (tag _)) => t; case: ifP => //= _; rewrite genGid eqxx. (* Goal: leqif (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) (@all (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (abelian_type (@gval gT G))) *) rewrite -size_abelian_type // -{}def_tG -{defG}(bigdprod_card defG) size_map. (* Goal: leqif (@BigOp.bigop nat (FinGroup.arg_sort (FinGroup.base gT)) (S O) b (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i muln true (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT i)))))) (expn (@exponent gT (@gval gT G)) (@size (FinGroup.arg_sort (FinGroup.base gT)) b)) (@all (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b)) *) rewrite unlock; elim: b Gb => //= x b IHb; case/andP=> Gx Gb. (* Goal: leqif (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) (@reducebig nat (FinGroup.arg_sort (FinGroup.base gT)) (S O) b (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i muln true (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT i))))))) (expn (@exponent gT (@gval gT G)) (S (@size (FinGroup.arg_sort (FinGroup.base gT)) b))) (andb (@eq_op nat_eqType (@order gT x) (@exponent gT (@gval gT G))) (@all nat (@pred_of_simpl nat (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) have eGgt0: exponent G > 0 := exponent_gt0 G. (* Goal: leqif (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) (@reducebig nat (FinGroup.arg_sort (FinGroup.base gT)) (S O) b (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i muln true (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT i))))))) (expn (@exponent gT (@gval gT G)) (S (@size (FinGroup.arg_sort (FinGroup.base gT)) b))) (andb (@eq_op nat_eqType (@order gT x) (@exponent gT (@gval gT G))) (@all nat (@pred_of_simpl nat (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) have le_x_G: #[x] <= exponent G by rewrite dvdn_leq ?dvdn_exponent. (* Goal: leqif (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) (@reducebig nat (FinGroup.arg_sort (FinGroup.base gT)) (S O) b (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i muln true (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT i))))))) (expn (@exponent gT (@gval gT G)) (S (@size (FinGroup.arg_sort (FinGroup.base gT)) b))) (andb (@eq_op nat_eqType (@order gT x) (@exponent gT (@gval gT G))) (@all nat (@pred_of_simpl nat (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) have:= leqif_mul (leqif_eq le_x_G) (IHb Gb). (* Goal: forall _ : leqif (muln (@order gT x) (@reducebig nat (FinGroup.arg_sort (FinGroup.base gT)) (S O) b (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i muln true (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT i))))))) (muln (@exponent gT (@gval gT G)) (expn (@exponent gT (@gval gT G)) (@size (FinGroup.arg_sort (FinGroup.base gT)) b))) (orb (@eq_op nat_eqType (muln (@exponent gT (@gval gT G)) (expn (@exponent gT (@gval gT G)) (@size (FinGroup.arg_sort (FinGroup.base gT)) b))) O) (andb (@eq_op nat_eqType (@order gT x) (@exponent gT (@gval gT G))) (@all nat (@pred_of_simpl nat (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b)))), leqif (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x)))) (@reducebig nat (FinGroup.arg_sort (FinGroup.base gT)) (S O) b (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody nat (FinGroup.arg_sort (FinGroup.base gT)) i muln true (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT i))))))) (expn (@exponent gT (@gval gT G)) (S (@size (FinGroup.arg_sort (FinGroup.base gT)) b))) (andb (@eq_op nat_eqType (@order gT x) (@exponent gT (@gval gT G))) (@all nat (@pred_of_simpl nat (@pred1 nat_eqType (@exponent gT (@gval gT G)))) (@map (FinGroup.arg_sort (FinGroup.base gT)) nat (@order gT) b))) *) by rewrite -expnS expn_eq0 eqn0Ngt eGgt0. Qed. Lemma card_homocyclic G : homocyclic G -> #|G| = (exponent G ^ 'r(G))%N. Proof. (* Goal: forall _ : is_true (homocyclic (@gval gT G)), @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (expn (@exponent gT (@gval gT G)) (@rank gT (@gval gT G))) *) by move=> homG; have [cGG _] := andP homG; apply/eqP; rewrite max_card_abelian. Qed. Lemma abelian_type_dprod_homocyclic p K H G : K \x H = G -> p.-group G -> homocyclic G -> Lemma dprod_homocyclic p K H G : K \x H = G -> p.-group G -> homocyclic G -> homocyclic K /\ homocyclic H. Proof. (* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (homocyclic (@gval gT G))), and (is_true (homocyclic (@gval gT K))) (is_true (homocyclic (@gval gT H))) *) move=> defG pG homG; have [cGG _] := andP homG. (* Goal: and (is_true (homocyclic (@gval gT K))) (is_true (homocyclic (@gval gT H))) *) have /mulG_sub[sKG sHG]: K * H = G by case/dprodP: defG. (* Goal: and (is_true (homocyclic (@gval gT K))) (is_true (homocyclic (@gval gT H))) *) have [abtK abtH] := abelian_type_dprod_homocyclic defG pG homG. (* Goal: and (is_true (homocyclic (@gval gT K))) (is_true (homocyclic (@gval gT H))) *) by rewrite /homocyclic !(abelianS _ cGG) // abtK abtH !constant_nseq. Qed. Lemma exponent_dprod_homocyclic p K H G : K \x H = G -> p.-group G -> homocyclic G -> K :!=: 1 -> Proof. (* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (homocyclic (@gval gT G))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @eq nat (@exponent gT (@gval gT K)) (@exponent gT (@gval gT G)) *) move=> defG pG homG ntK; have [homK _] := dprod_homocyclic defG pG homG. (* Goal: @eq nat (@exponent gT (@gval gT K)) (@exponent gT (@gval gT G)) *) have [] := abelian_type_dprod_homocyclic defG pG homG. (* Goal: forall (_ : @eq (list nat) (abelian_type (@gval gT K)) (@nseq nat (@rank gT (@gval gT K)) (@exponent gT (@gval gT G)))) (_ : @eq (list nat) (abelian_type (@gval gT H)) (@nseq nat (@rank gT (@gval gT H)) (@exponent gT (@gval gT G)))), @eq nat (@exponent gT (@gval gT K)) (@exponent gT (@gval gT G)) *) by rewrite abelian_type_homocyclic // -['r(K)]prednK ?rank_gt0 => [[]|]. Qed. End AbelianStructure. Arguments abelian_type {gT} A%g. Arguments homocyclic {gT} A%g. Section IsogAbelian. Variables aT rT : finGroupType. Implicit Type (gT : finGroupType) (D G : {group aT}) (H : {group rT}). Lemma isog_abelian_type G H : isog G H -> abelian_type G = abelian_type H. Lemma eq_abelian_type_isog G H : abelian G -> abelian H -> isog G H = (abelian_type G == abelian_type H). Lemma isog_abelem_card p G H : p.-abelem G -> isog G H = p.-abelem H && (#|H| == #|G|). Proof. (* Goal: forall _ : is_true (@abelem aT p (@gval aT G)), @eq bool (@isog aT rT (@gval aT G) (@gval rT H)) (andb (@abelem rT p (@gval rT H)) (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H)))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))) *) move=> abelG; apply/idP/andP=> [isoGH | [abelH eqGH]]. (* Goal: is_true (@isog aT rT (@gval aT G) (@gval rT H)) *) (* Goal: and (is_true (@abelem rT p (@gval rT H))) (is_true (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H)))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))) *) by rewrite -(isog_abelem isoGH) (card_isog isoGH). (* Goal: is_true (@isog aT rT (@gval aT G) (@gval rT H)) *) rewrite eq_abelian_type_isog ?(@abelem_abelian _ p) //. (* Goal: is_true (@eq_op (seq_eqType nat_eqType) (@abelian_type aT (@gval aT G)) (@abelian_type rT (@gval rT H))) *) by rewrite !(@abelian_type_abelem _ p) ?(@rank_abelem _ p) // (eqP eqGH). Qed. Variables (D : {group aT}) (f : {morphism D >-> rT}). Lemma morphim_rank_abelian G : abelian G -> 'r(f @* G) <= 'r(G). Lemma morphim_p_rank_abelian p G : abelian G -> 'r_p(f @* G) <= 'r_p(G). Lemma isog_homocyclic G H : G \isog H -> homocyclic G = homocyclic H. Proof. (* Goal: forall _ : is_true (@isog aT rT (@gval aT G) (@gval rT H)), @eq bool (@homocyclic aT (@gval aT G)) (@homocyclic rT (@gval rT H)) *) move=> isoGH. (* Goal: @eq bool (@homocyclic aT (@gval aT G)) (@homocyclic rT (@gval rT H)) *) by rewrite /homocyclic (isog_abelian isoGH) (isog_abelian_type isoGH). Qed. End IsogAbelian. Section QuotientRank. Variables (gT : finGroupType) (p : nat) (G H : {group gT}). Hypothesis cGG : abelian G. Lemma quotient_rank_abelian : 'r(G / H) <= 'r(G). Proof. (* Goal: is_true (leq (@rank (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) (@rank gT (@gval gT G))) *) exact: morphim_rank_abelian. Qed. Lemma quotient_p_rank_abelian : 'r_p(G / H) <= 'r_p(G). Proof. (* Goal: is_true (leq (@p_rank (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@gval gT H))) (@p_rank gT p (@gval gT G))) *) exact: morphim_p_rank_abelian. Qed. End QuotientRank. Section FimModAbelem. Import GRing.Theory FinRing.Theory. Lemma fin_lmod_char_abelem p (R : ringType) (V : finLmodType R): p \in [char R]%R -> p.-abelem [set: V]. Lemma fin_Fp_lmod_abelem p (V : finLmodType 'F_p) : prime p -> p.-abelem [set: V]. Proof. (* Goal: forall _ : is_true (prime p), is_true (@abelem (@FinRing.Lmodule.finGroupType (Zp_ringType (Zp_trunc (pdiv p))) (Phant (ordinal (S (S (Zp_trunc (pdiv p)))))) V) p (@setTfor (@FinRing.Lmodule.finType (Zp_ringType (Zp_trunc (pdiv p))) (Phant (ordinal (S (S (Zp_trunc (pdiv p)))))) V) (Phant (@FinRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (ordinal (S (S (Zp_trunc (pdiv p)))))) V)))) *) by move/char_Fp/fin_lmod_char_abelem->. Qed. Lemma fin_ring_char_abelem p (R : finRingType) : p \in [char R]%R -> p.-abelem [set: R]. Proof. (* Goal: forall _ : is_true (@in_mem nat p (@mem nat nat_pred_pred (@GRing.char (FinRing.Ring.ringType R) (Phant (FinRing.Ring.sort R))))), is_true (@abelem (FinRing.Ring.finGroupType R) p (@setTfor (FinRing.Ring.finType R) (Phant (FinRing.Ring.sort R)))) *) exact: fin_lmod_char_abelem [finLmodType R of R^o]. Qed. End FimModAbelem.
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCdistinct. Require Export GeoCoq.Elements.OriginalProofs.proposition_31short. Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearparallel. Require Export GeoCoq.Elements.OriginalProofs.proposition_29. Section Euclid. Context `{Ax:euclidean_euclidean}. Lemma proposition_32 : forall A B C D, Triangle A B C -> BetS B C D -> SumA C A B A B C A C D. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @BetS Ax0 B C D), @SumA Ax0 C A B A B C A C D *) intros. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq B A) by (forward_using lemma_NCdistinct). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq A B) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists F, (BetS B A F /\ Cong A F B A)) by (conclude lemma_extension);destruct Tf as [F];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B A F) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A B F) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A B B) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq B F) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq F B) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol F B C) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS F A B) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) rename_H H;let Tf:=fresh in assert (Tf:exists E H S, (BetS E C H /\ CongA E C A C A B /\ Par E H F B /\ BetS E S B /\ BetS C S A)) by (conclude proposition_31short);destruct Tf as [E[H[S]]];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq B C) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq C B) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists G, (BetS C B G /\ Cong B G C B)) by (conclude lemma_extension);destruct Tf as [G];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq C A) by (forward_using lemma_NCdistinct). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists J, (BetS C A J /\ Cong A J C A)) by (conclude lemma_extension);destruct Tf as [J];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq A C) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists K, (BetS A C K /\ Cong C K A C)) by (conclude lemma_extension);destruct Tf as [K];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists M, (BetS A B M /\ Cong B M A B)) by (conclude lemma_extension);destruct Tf as [M];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col F B A) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Par E H A B) by (conclude lemma_collinearparallel). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS K C A) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col C S A) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col C A S) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol A C B) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A C S) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq C S) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq S C) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A C C) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol S C B) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol B S C) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col E S B) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B S E) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B S B) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS B S E) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq B E) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol B E C) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B E S) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq E E) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B E E) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq S E) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol S E C) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol S C E) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col S C C) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col C S A) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col S C A) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq C A) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol C A E) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A B M) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B A M) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Par E H B A) by (forward_using lemma_parallelflip). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq A M) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq M A) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Par E H M A) by (conclude lemma_collinearparallel). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS H C E) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS M B A) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS F A B) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS D C B) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol B C A) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol A C B) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq B E) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS E C H) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS A S C) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol C E A) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col C E H) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col C E E) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq E H) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq H E) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol H E A) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol E H A) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists Q, (BetS A Q H /\ BetS E S Q)) by (conclude postulate_Pasch_outer);destruct Tf as [Q];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col E S Q) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col S E B) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col S E Q) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col E B Q) by (conclude lemma_collinear4). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B E Q) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq H E) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq C E) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists L, (BetS H E L /\ Cong E L C E)) by (conclude lemma_extension);destruct Tf as [L];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS L E H) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col L E H) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq L H) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq E H) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A B M) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq A M) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq A B) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (~ Meet A M L H). (* Goal: @SumA Ax0 C A B A B C A C D *) (* Goal: not (@Meet Ax0 A M L H) *) { (* Goal: not (@Meet Ax0 A M L H) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists c, (neq A M /\ neq L H /\ Col A M c /\ Col L H c)) by (conclude_def Meet );destruct Tf as [c];spliter. (* Goal: False *) assert (Col H E L) by (conclude_def Col ). (* Goal: False *) assert (Col L H E) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq H L) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq L H) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col H c E) by (conclude lemma_collinear4). (* Goal: False *) assert (Col E H c) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A B M) by (conclude_def Col ). (* Goal: False *) assert (Col M A B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col M A c) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq A M) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq M A) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col A B c) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B A F) by (conclude_def Col ). (* Goal: False *) assert (Col A B F) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B c F) by (conclude lemma_collinear4). (* Goal: False *) assert (Col F B c) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet E H F B) by (conclude_def Meet ). (* Goal: False *) assert (~ Meet E H F B) by (conclude_def Par ). (* Goal: False *) contradict. (* BG Goal: @SumA Ax0 C A B A B C A C D *) } (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS B Q E) by (conclude lemma_collinearbetween). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol A H E) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A Q H) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A H Q) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq H H) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A H H) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq Q H) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol Q H E) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol Q E H) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq E E) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col Q E E) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col Q E B) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol B E H) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists T, (BetS B T C /\ BetS H T Q)) by (conclude postulate_Pasch_inner);destruct Tf as [T];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS Q T H) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS A T H) by (conclude lemma_3_5b). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B T C) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col C B T) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol C B A) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (TS A C B H) by (conclude_def TS ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (TS H C B A) by (conclude lemma_oppositesidesymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Par H E M A) by (forward_using lemma_parallelflip). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA A C E B A C) by (conclude lemma_equalanglesflip). (* Goal: @SumA Ax0 C A B A B C A C D *) assert ((CongA H C B C B A /\ CongA D C E C B A /\ RT E C B C B A)) by (conclude proposition_29). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA C B A A B C) by (conclude lemma_ABCequalsCBA). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA D C E A B C) by (conclude lemma_equalanglestransitive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS T C D) by (conclude lemma_3_6a). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq T D) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol B C A) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B C T) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col B C D) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol T D A) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol A T D) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A T A) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A T H) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq A H) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol A H D) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol H A D) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS H T A) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS D C T) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) let Tf:=fresh in assert (Tf:exists R, (BetS D R A /\ BetS H C R)) by (conclude postulate_Pasch_outer);destruct Tf as [R];spliter. (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Out C E R) by (conclude_def Out ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Out C A A) by (conclude lemma_ray4). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq C D) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (BetS A R D) by (conclude axiom_betweennesssymmetry). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA B A C A C E) by (conclude lemma_equalanglessymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA B A C A C R) by (conclude lemma_equalangleshelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol C A B) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA C A B B A C) by (conclude lemma_ABCequalsCBA). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA C A B A C R) by (conclude lemma_equalanglestransitive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Out C D D) by (conclude lemma_ray4). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA A B C D C E) by (conclude lemma_equalanglessymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA A B C D C R) by (conclude lemma_equalangleshelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol A D H) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col D R A) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A D R) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col A D D) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq D R) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq R D) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol R D H) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol R H D) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col H C R) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col R H C) by (forward_using lemma_collinearorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (eq R R) by (conclude cn_equalityreflexive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (Col R H R) by (conclude_def Col ). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq C R) by (forward_using lemma_betweennotequal). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (neq R C) by (conclude lemma_inequalitysymmetric). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol R C D) by (conclude lemma_NChelper). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (nCol D C R) by (forward_using lemma_NCorder). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA D C R R C D) by (conclude lemma_ABCequalsCBA). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (CongA A B C R C D) by (conclude lemma_equalanglestransitive). (* Goal: @SumA Ax0 C A B A B C A C D *) assert (SumA C A B A B C A C D) by (conclude_def SumA ). (* Goal: @SumA Ax0 C A B A B C A C D *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.proposition_29B. Require Export GeoCoq.Elements.OriginalProofs.proposition_27B. Section Euclid. Context `{Ax:euclidean_euclidean}. Lemma proposition_33 : forall A B C D M, Par A B C D -> Cong A B C D -> BetS A M D -> BetS B M C -> Par A C B D /\ Cong A C B D. Proof. (* Goal: forall (A B C D M : @Point Ax0) (_ : @Par Ax0 A B C D) (_ : @Cong Ax0 A B C D) (_ : @BetS Ax0 A M D) (_ : @BetS Ax0 B M C), and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) intros. (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) let Tf:=fresh in assert (Tf:exists a b c d m, (neq A B /\ neq C D /\ Col A B a /\ Col A B b /\ neq a b /\ Col C D c /\ Col C D d /\ neq c d /\ ~ Meet A B C D /\ BetS a m d /\ BetS c m b)) by (conclude_def Par );destruct Tf as [a[b[c[d[m]]]]];spliter. (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Col B M C) by (conclude_def Col ). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Col B C M) by (forward_using lemma_collinearorder). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (~ Col B C A). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) (* Goal: not (@Col Ax0 B C A) *) { (* Goal: not (@Col Ax0 B C A) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: False *) assert (Col C D C) by (conclude_def Col ). (* Goal: False *) assert (Meet A B C D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) } (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (TS A B C D) by (conclude_def TS ). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (CongA A B C B C D) by (conclude proposition_29B). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (~ Col B C D). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) (* Goal: not (@Col Ax0 B C D) *) { (* Goal: not (@Col Ax0 B C D) *) intro. (* Goal: False *) assert (Col C D B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: False *) assert (Col A B B) by (conclude_def Col ). (* Goal: False *) assert (Meet A B C D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) } (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (CongA B C D D C B) by (conclude lemma_ABCequalsCBA). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (CongA A B C D C B) by (conclude lemma_equalanglestransitive). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Cong B C B C) by (conclude cn_congruencereflexive). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (nCol A B C) by (assert (nCol B C A) by auto; (forward_using lemma_NCorder)). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Cong B A C D) by (forward_using lemma_congruenceflip). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Cong B C C B) by (forward_using lemma_congruenceflip). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert ((Cong A C D B /\ CongA B A C C D B /\ CongA B C A C B D)) by (conclude proposition_04). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (nCol A C B) by (forward_using lemma_NCorder). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (CongA A C B B C A) by (conclude lemma_ABCequalsCBA). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (CongA A C B C B D) by (conclude lemma_equalanglestransitive). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Cong A C B D) by (forward_using lemma_congruenceflip). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Col C B M) by (forward_using lemma_collinearorder). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (nCol C B A) by (forward_using lemma_NCorder). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (TS A C B D) by (conclude_def TS ). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) assert (Par A C B D) by (conclude proposition_27B). (* Goal: and (@Par Ax0 A C B D) (@Cong Ax0 A C B D) *) close. Qed. End Euclid.
Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Algebra. Require Export Ring_util. Section Lemmas. Variable R : CRING. Variable A : algebra R. Lemma ALGEBRA_comp : forall x x' y y' : A, Equal x x' -> Equal y y' -> Equal (algebra_mult x y) (algebra_mult x' y'). Proof. (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x y) (@algebra_mult R A x' y') *) intros x x' y y' H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x y) (@algebra_mult R A x' y') *) unfold algebra_mult in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x')))) y') *) apply Ap_comp. (* Goal: @Equal (MAP (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x')))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) y y' *) auto with algebra. (* Goal: @Equal (MAP (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x')))) *) apply (Ap_comp (B:=Hom_module (algebra_carrier A) (algebra_carrier A)) (f:=algebra_bilinear_map (algebra_on_def A)) (g:=algebra_bilinear_map (algebra_on_def A)) H'). (* Goal: @Equal (MAP (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) *) auto with algebra. Qed. Lemma ALGEBRA_lin_right : forall x y z : A, Equal (algebra_mult x (sgroup_law A y z)) (sgroup_law A (algebra_mult x y) (algebra_mult x z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@algebra_mult R A x y) (@algebra_mult R A x z)) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@algebra_mult R A x y) (@algebra_mult R A x z)) *) unfold algebra_mult in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) z)) *) auto with algebra. Qed. Parameter ALGEBRA_lin_left : forall x y z : A, Equal (algebra_mult (sgroup_law A x y) z) (sgroup_law A (algebra_mult x z) (algebra_mult y z)). Lemma ALGEBRA_mult_lin_right : forall (x y : A) (a : R), Equal (algebra_mult x (module_mult a y)) (module_mult a (algebra_mult x y)). Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))))) (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (@module_mult (cring_ring R) (@algebra_carrier R A) a y)) (@module_mult (cring_ring R) (@algebra_carrier R A) a (@algebra_mult R A x y)) *) intros x y a; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@algebra_mult R A x (@module_mult (cring_ring R) (@algebra_carrier R A) a y)) (@module_mult (cring_ring R) (@algebra_carrier R A) a (@algebra_mult R A x y)) *) unfold algebra_mult in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) (@module_mult (cring_ring R) (@algebra_carrier R A) a y)) (@module_mult (cring_ring R) (@algebra_carrier R A) a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@algebra_carrier R A) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)))))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R A)))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A))))) (@module_monoid_hom (cring_ring R) (@algebra_carrier R A) (@Hom_module R (@algebra_carrier R A) (@algebra_carrier R A)) (@algebra_bilinear_map R (@algebra_carrier R A) (@algebra_on_def R A))))) x)))) y)) *) auto with algebra. Qed. Parameter ALGEBRA_mult_lin_left : forall (x y : A) (a : R), Equal (algebra_mult (module_mult a x) y) (module_mult a (algebra_mult x y)). End Lemmas. Hint Resolve ALGEBRA_comp ALGEBRA_lin_right ALGEBRA_lin_left ALGEBRA_mult_lin_right ALGEBRA_mult_lin_left: algebra. Section Lemmas2. Variable R : CRING. Variable A : ring_algebra R. Lemma RING_ALGEBRA_assoc : forall x y z : A, Equal (algebra_mult (algebra_mult x y) z) (algebra_mult x (algebra_mult y z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) exact (ring_algebra_assoc A). Qed. Lemma RING_ALGEBRA_unit_l : forall x : A, Equal (algebra_mult (ring_algebra_unit A) x) x. Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) exact (ring_algebra_unit_l A). Qed. Lemma RING_ALGEBRA_unit_r : forall x : A, Equal (algebra_mult x (ring_algebra_unit A)) x. Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) exact (ring_algebra_unit_r A). Qed. End Lemmas2. Hint Resolve RING_ALGEBRA_assoc RING_ALGEBRA_unit_l RING_ALGEBRA_unit_r: algebra. Section Ring_algebra_as_ring. Variable R : CRING. Variable A : ring_algebra R. Definition ring_algebra_ring : ring. Proof. (* Goal: ring *) apply (BUILD_RING (E:=A) (ringplus:=sgroup_law A) (ringmult:=algebra_mult (R:=R) (A:=A)) (zero:=monoid_unit A) (un:=ring_algebra_unit A) (ringopp:=group_inverse A)). (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x' y') *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y x) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) y) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x' y') *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x' y') *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y x) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) y) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x' y') *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y x) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) y) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) x *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x' y') *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y x) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) y) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x' y') *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y x) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x (group_inverse (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))) x)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x' y') *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y x) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x' y') *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@algebra_mult R (@ring_algebra_algebra R A) x y) z) (@algebra_mult R (@ring_algebra_algebra R A) x (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A))) x *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (@ring_algebra_unit R (@ring_algebra_algebra R A) (@ring_algebra_on_def R A)) x) x *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x y) (@algebra_mult R (@ring_algebra_algebra R A) x z)) *) auto with algebra. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A))))))) (@algebra_mult R (@ring_algebra_algebra R A) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) (@algebra_carrier R (@ring_algebra_algebra R A)))))) (@algebra_mult R (@ring_algebra_algebra R A) x z) (@algebra_mult R (@ring_algebra_algebra R A) y z)) *) auto with algebra. Qed. End Ring_algebra_as_ring. Coercion ring_algebra_ring : ring_algebra >-> ring.
From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat seq eqtype. From LemmaOverloading Require Import prelude prefix xfind heaps terms. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Section HeapReflection. Structure tagged_heap := Tag {untag :> heap}. Definition var_tag := Tag. Definition pts_tag := var_tag. Definition empty_tag := pts_tag. Canonical Structure union_tag hc := empty_tag hc. Definition invariant i j t h := [/\ interp j t = h, subctx i j & valid j t]. Structure ast (i j : ctx) (t : synheap) := Ast {heap_of :> tagged_heap; _ : invariant i j t heap_of}. Arguments Ast : clear implicits. Lemma union_pf i j k t1 t2 (f1 : ast i j t1) (f2 : ast j k t2) : invariant i k (t1 ++ t2) (union_tag (f1 :+ f2)). Proof. (* Goal: invariant i k (@cat elem t1 t2) (untag (union_tag (union2 (untag (@heap_of i j t1 f1)) (untag (@heap_of j k t2 f2))))) *) case: f1 f2=>h1 /= [<- S1 D1] [h2 /= [<- S2 D2]]. (* Goal: invariant i k (@cat elem t1 t2) (union2 (interp j t1) (interp k t2)) *) split; first by rewrite interp_cat (interp_subctx D1 S2). (* Goal: is_true (valid k (@cat elem t1 t2)) *) (* Goal: subctx i k *) - (* Goal: is_true (valid k (@cat elem t1 t2)) *) (* Goal: subctx i k *) by apply: (subctx_trans S1 S2). (* Goal: is_true (valid k (@cat elem t1 t2)) *) by rewrite valid_cat D2 andbT; apply: (valid_subctx S2). Qed. Canonical Structure union_struct i j k t1 t2 (f1 : ast i j t1) (f2 : ast j k t2) := Ast i k _ (union_tag (f1 :+ f2)) (union_pf f1 f2). Lemma empty_pf i : invariant i i [::] (empty_tag empty). Proof. (* Goal: invariant i i (@nil elem) (untag (empty_tag empty)) *) split; by [|apply: subctx_refl|]. Qed. Canonical Structure empty_struct i := Ast i i [::] (empty_tag empty) (empty_pf i). Lemma pts_pf A hs xs1 xs2 x (d : A) (xs : xfind xs1 xs2 x): invariant (Context hs xs1) (Context hs xs2) [:: Pts x (dyn d)] (pts_tag (xuntag xs :-> d)). Proof. (* Goal: invariant (Context hs xs1) (Context hs xs2) (@cons elem (Pts x (@Dyn.dyn A d)) (@nil elem)) (untag (pts_tag (@pts A (@xuntag ptr (@elem_of ptr xs1 xs2 x xs)) d))) *) case: xs=>[p /= [H P]]; split; first by rewrite /= H. (* Goal: is_true (valid (Context hs xs2) (@cons elem (Pts x (@Dyn.dyn A d)) (@nil elem))) *) (* Goal: subctx (Context hs xs1) (Context hs xs2) *) - (* Goal: is_true (valid (Context hs xs2) (@cons elem (Pts x (@Dyn.dyn A d)) (@nil elem))) *) (* Goal: subctx (Context hs xs1) (Context hs xs2) *) by split; [apply: prefix_refl|]. (* Goal: is_true (valid (Context hs xs2) (@cons elem (Pts x (@Dyn.dyn A d)) (@nil elem))) *) by apply/andP; rewrite /= (onth_size H). Qed. Canonical Structure pts_struct A hs xs1 xs2 x (d : A) (xs : xfind xs1 xs2 x) := Ast (Context hs xs1) (Context hs xs2) [:: Pts x (dyn d)] (pts_tag (xuntag xs :-> d)) (pts_pf hs _ xs). Lemma var_pf hs1 hs2 xs n (f : xfind hs1 hs2 n) : invariant (Context hs1 xs) (Context hs2 xs) [:: Var n] (var_tag (xuntag f)). Proof. (* Goal: invariant (Context hs1 xs) (Context hs2 xs) (@cons elem (Var n) (@nil elem)) (untag (var_tag (@xuntag heap (@elem_of heap hs1 hs2 n f)))) *) case:f=>p [H1 H2]; split; first by rewrite /= /hlook H1. (* Goal: is_true (valid (Context hs2 xs) (@cons elem (Var n) (@nil elem))) *) (* Goal: subctx (Context hs1 xs) (Context hs2 xs) *) - (* Goal: is_true (valid (Context hs2 xs) (@cons elem (Var n) (@nil elem))) *) (* Goal: subctx (Context hs1 xs) (Context hs2 xs) *) by split; [|apply: prefix_refl]. (* Goal: is_true (valid (Context hs2 xs) (@cons elem (Var n) (@nil elem))) *) by apply/andP; rewrite /= (onth_size H1). Qed. Canonical Structure var_struct hs1 hs2 xs n (f : xfind hs1 hs2 n) := Ast (Context hs1 xs) (Context hs2 xs) _ (var_tag (xuntag f)) (var_pf xs f). End HeapReflection. Theorem cancelR j k t1 t2 (f1 : ast empc j t1) (f2 : ast j k t2) : def (untag (heap_of f1)) -> untag (heap_of f1) = untag (heap_of f2) -> eval k (cancel k t1 t2). Proof. (* Goal: forall (_ : is_true (def (untag (@heap_of empc j t1 f1)))) (_ : @eq heap (untag (@heap_of empc j t1 f1)) (untag (@heap_of j k t2 f2))), eval k (cancel k t1 t2) *) case: f1 f2=>hp1 /= [<- _ I] [hp2 /= [<- S _]] D H. (* Goal: eval k (cancel k t1 t2) *) by apply: cancel_sound; rewrite -(interp_subctx I S). Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCorder. Section Euclid. Context `{Ax:euclidean_neutral}. Lemma lemma_oppositesideflip : forall A B P Q, TS P A B Q -> TS P B A Q. Proof. (* Goal: forall (A B P Q : @Point Ax) (_ : @TS Ax P A B Q), @TS Ax P B A Q *) intros. (* Goal: @TS Ax P B A Q *) let Tf:=fresh in assert (Tf:exists r, (BetS P r Q /\ Col A B r /\ nCol A B P)) by (conclude_def TS );destruct Tf as [r];spliter. (* Goal: @TS Ax P B A Q *) assert (nCol B A P) by (forward_using lemma_NCorder). (* Goal: @TS Ax P B A Q *) assert (Col B A r) by (forward_using lemma_collinearorder). (* Goal: @TS Ax P B A Q *) assert (TS P B A Q) by (conclude_def TS ). (* Goal: @TS Ax P B A Q *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_congruenceflip. Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence. Require Export GeoCoq.Elements.OriginalProofs.lemma_outerconnectivity. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_trichotomy1 : forall A B C D, ~ Lt A B C D -> ~ Lt C D A B -> neq A B -> neq C D -> Cong A B C D. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : not (@Lt Ax0 A B C D)) (_ : not (@Lt Ax0 C D A B)) (_ : @neq Ax0 A B) (_ : @neq Ax0 C D), @Cong Ax0 A B C D *) intros. (* Goal: @Cong Ax0 A B C D *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @Cong Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists P, (BetS B A P /\ Cong A P A B)) by (conclude lemma_extension);destruct Tf as [P];spliter. (* Goal: @Cong Ax0 A B C D *) assert (BetS P A B) by (conclude axiom_betweennesssymmetry). (* Goal: @Cong Ax0 A B C D *) assert (neq A P) by (forward_using lemma_betweennotequal). (* Goal: @Cong Ax0 A B C D *) assert (neq P A) by (conclude lemma_inequalitysymmetric). (* Goal: @Cong Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists E, (BetS P A E /\ Cong A E C D)) by (conclude lemma_extension);destruct Tf as [E];spliter. (* Goal: @Cong Ax0 A B C D *) assert (~ BetS A B E). (* Goal: @Cong Ax0 A B C D *) (* Goal: not (@BetS Ax0 A B E) *) { (* Goal: not (@BetS Ax0 A B E) *) intro. (* Goal: False *) assert (Cong A B A B) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt A B A E) by (conclude_def Lt ). (* Goal: False *) assert (Lt A B C D) by (conclude lemma_lessthancongruence). (* Goal: False *) contradict. (* BG Goal: @Cong Ax0 A B C D *) } (* Goal: @Cong Ax0 A B C D *) assert (~ BetS A E B). (* Goal: @Cong Ax0 A B C D *) (* Goal: not (@BetS Ax0 A E B) *) { (* Goal: not (@BetS Ax0 A E B) *) intro. (* Goal: False *) assert (Lt C D A B) by (conclude_def Lt ). (* Goal: False *) contradict. (* BG Goal: @Cong Ax0 A B C D *) } (* Goal: @Cong Ax0 A B C D *) assert (eq E B) by (conclude lemma_outerconnectivity). (* Goal: @Cong Ax0 A B C D *) assert (Cong A B A B) by (conclude cn_congruencereflexive). (* Goal: @Cong Ax0 A B C D *) assert (Cong A B A E) by (conclude cn_equalitysub). (* Goal: @Cong Ax0 A B C D *) assert (Cong A B C D) by (conclude lemma_congruencetransitive). (* Goal: @Cong Ax0 A B C D *) close. Qed. End Euclid.
Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Module_util. Require Export Ring_facts. Require Export Module_facts. Section Hom_module_def. Variable R : CRING. Variable Mod1 Mod2 : MODULE R. Definition add_hom_module : forall f g : Hom Mod1 Mod2, Hom Mod1 Mod2. Proof. (* Goal: forall (_ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2)) (_ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2)), Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) intros f0 g. (* Goal: Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => sgroup_law Mod2 (f0 x) (g x))). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) y))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) y)) *) abstract auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) y))) *) abstract (intros x y; apply Trans with (sgroup_law (module_carrier Mod2) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y)) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) y))); auto with algebra). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) abstract (apply Trans with (sgroup_law (module_carrier Mod2) (monoid_unit (module_carrier Mod2)) (monoid_unit (module_carrier Mod2))); auto with algebra). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 g))) x))) *) abstract (intros a x; apply Trans with (sgroup_law (module_carrier Mod2) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x)) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom g))) x))); auto with algebra). Qed. Definition zero_hom_module : Hom Mod1 Mod2. Proof. (* Goal: Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => monoid_unit Mod2)); abstract auto with algebra. Qed. Definition opp_hom_module : forall f : Hom Mod1 Mod2, Hom Mod1 Mod2. Proof. (* Goal: forall _ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2), Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) intros f0. (* Goal: Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => group_inverse Mod2 (f0 x))). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y)) *) abstract auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y))) *) abstract (intros x y; apply Trans with (group_inverse (module_carrier Mod2) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y))); auto with algebra; apply Trans with (group_inverse (module_carrier Mod2) (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x))); auto with algebra). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) abstract (apply Trans with (group_inverse (module_carrier Mod2) (monoid_unit (module_carrier Mod2))); auto with algebra). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a x))) (@module_mult (cring_ring R) Mod2 a (group_inverse (abelian_group_group (@module_carrier (cring_ring R) Mod2)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) abstract (intros a x; apply Trans with (group_inverse (module_carrier Mod2) (module_mult a (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x))); auto with algebra). Qed. Definition mult_hom_module : forall (a : R) (f : Hom Mod1 Mod2), Hom Mod1 Mod2. Proof. (* Goal: forall (_ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (_ : Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2)), Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) intros a f0. (* Goal: Carrier (@Hom (MODULE (cring_ring R)) Mod1 Mod2) *) apply (BUILD_HOM_MODULE (R:=R) (Mod:=Mod1) (Mod':=Mod2) (ff:=fun x : Mod1 => module_mult a (f0 x))). (* Goal: forall (a0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a0 x))) (@module_mult (cring_ring R) Mod2 a0 (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y)) *) abstract auto with algebra. (* Goal: forall (a0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a0 x))) (@module_mult (cring_ring R) Mod2 a0 (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) x y))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x)) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) y))) *) abstract (intros x y; apply Trans with (module_mult a (sgroup_law (module_carrier Mod2) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) y))); auto with algebra). (* Goal: forall (a0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a0 x))) (@module_mult (cring_ring R) Mod2 a0 (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) *) abstract (apply Trans with (module_mult a (monoid_unit (module_carrier Mod2))); auto with algebra). (* Goal: forall (a0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R))))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) (@module_mult (cring_ring R) Mod1 a0 x))) (@module_mult (cring_ring R) Mod2 a0 (@module_mult (cring_ring R) Mod2 a (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod1))) (group_monoid (abelian_group_group (@module_carrier (cring_ring R) Mod2))) (@module_monoid_hom (cring_ring R) Mod1 Mod2 f0))) x))) *) abstract (intros a0 x; apply Trans with (module_mult a (module_mult a0 (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x))); auto with algebra; apply Trans with (module_mult (ring_mult a a0) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x)); auto with algebra; apply Trans with (module_mult (ring_mult a0 a) (Ap (sgroup_map (monoid_sgroup_hom (module_monoid_hom f0))) x)); auto with algebra). Qed. Definition Hom_module : MODULE R. Proof. (* Goal: Ob (MODULE (cring_ring R)) *) apply (BUILD_MODULE (R:=R) (E:=Hom Mod1 Mod2) (genlaw:=add_hom_module) (e:=zero_hom_module) (geninv:=opp_hom_module) (gen_module_op:=mult_hom_module)); try abstract (simpl in |- *; unfold Map_eq in |- *; simpl in |- *; auto with algebra). Qed. End Hom_module_def.
Require Import Arith. Require Import Compare_dec. Lemma eq_gt_O_dec : forall n : nat, {n = 0} + {n > 0}. Proof. (* Goal: forall n : nat, sumbool (@eq nat n O) (gt n O) *) simple destruct n; auto with arith. Qed. Lemma technical_lemma : forall y m : nat, S (y * m + (y + m) + m) = S y * m + (S y + m). Proof. (* Goal: forall y m : nat, @eq nat (S (Init.Nat.add (Init.Nat.add (Init.Nat.mul y m) (Init.Nat.add y m)) m)) (Init.Nat.add (Init.Nat.mul (S y) m) (Init.Nat.add (S y) m)) *) intros; simpl in |- *; elim (plus_comm m (y * m + (y + m))). (* Goal: @eq nat (S (Nat.add m (Init.Nat.add (Init.Nat.mul y m) (Init.Nat.add y m)))) (Init.Nat.add (Init.Nat.add m (Init.Nat.mul y m)) (S (Init.Nat.add y m))) *) rewrite (plus_assoc m (y * m) (y + m)); auto with arith. Qed. Lemma lt_minus2 : forall n m : nat, n < m -> 0 < m - n. Proof. (* Goal: forall (n m : nat) (_ : lt n m), lt O (Init.Nat.sub m n) *) simple induction 1; intros; elim minus_Sn_m; auto with arith. Qed. Lemma minus_n_Sm : forall n m : nat, m < n -> pred (n - m) = n - S m. Proof. (* Goal: forall (n m : nat) (_ : lt m n), @eq nat (Init.Nat.pred (Init.Nat.sub n m)) (Init.Nat.sub n (S m)) *) simple induction 1; intros; elim minus_Sn_m; auto with arith. Qed. Lemma lt_succ : forall n m : nat, n <= S m -> {n <= m} + {n = S m}. Proof. (* Goal: forall (n m : nat) (_ : le n (S m)), sumbool (le n m) (@eq nat n (S m)) *) intros; elim (le_lt_eq_dec n (S m) H); auto with arith. Qed.
Inductive or3 (A B C : Prop) : Set := | or3_Left : A -> or3 A B C | or3_Middle : B -> or3 A B C | or3_Right : C -> or3 A B C. Lemma sym_and : forall A B : Prop, A /\ B -> B /\ A. Proof. (* Goal: forall (A B : Prop) (_ : and A B), and B A *) intros A B H; elim H; split; auto. Qed. Hint Immediate sym_and. Lemma sym_or : forall A B : Prop, A \/ B -> B \/ A. Proof. (* Goal: forall (A B : Prop) (_ : or A B), or B A *) simple induction 1; auto. Qed. Hint Immediate sym_or. Lemma no_and_l : forall A B : Prop, ~ A -> ~ (A /\ B). Proof. (* Goal: forall (A B : Prop) (_ : not A), not (and A B) *) unfold not in |- *. (* Goal: forall (A B : Prop) (_ : forall _ : A, False) (_ : and A B), False *) intros A B H G; apply H. (* Goal: A *) elim G; auto. Qed. Hint Resolve no_and_l. Lemma no_and_r : forall A B : Prop, ~ B -> ~ (A /\ B). Proof. (* Goal: forall (A B : Prop) (_ : not B), not (and A B) *) unfold not in |- *. (* Goal: forall (A B : Prop) (_ : forall _ : B, False) (_ : and A B), False *) intros A B H G; apply H. (* Goal: B *) elim G; auto. Qed. Hint Resolve no_and_r. Lemma no_or : forall A B : Prop, ~ A -> B \/ A -> B. Proof. (* Goal: forall (A B : Prop) (_ : not A) (_ : or B A), B *) intros A B H G; elim G; auto. (* Goal: forall _ : A, B *) intro; absurd A; auto. Qed. Lemma no_or_inv : forall A B : Prop, ~ A -> A \/ B -> B. Proof. (* Goal: forall (A B : Prop) (_ : not A) (_ : or A B), B *) intros A B H G; elim G; auto. (* Goal: forall _ : A, B *) intro; absurd A; auto. Qed. Lemma no_or_and : forall A B C D : Prop, ~ C -> A /\ B \/ C /\ D -> A /\ B. Proof. (* Goal: forall (A B C D : Prop) (_ : not C) (_ : or (and A B) (and C D)), and A B *) intros. (* Goal: and A B *) apply no_or with (C /\ D); auto. Qed. Lemma no_or_and_inv : forall A B C D : Prop, ~ D -> C /\ D \/ A /\ B -> A /\ B. Proof. (* Goal: forall (A B C D : Prop) (_ : not D) (_ : or (and C D) (and A B)), and A B *) intros. (* Goal: and A B *) apply no_or_inv with (C /\ D); auto. Qed. Lemma no_no_A : forall A : Prop, A -> ~ ~ A. Proof. (* Goal: forall (A : Prop) (_ : A), not (not A) *) unfold not in |- *; auto. Qed. Hint Resolve no_no_A. Lemma impl_no_no : forall A B : Prop, (A -> B) -> ~ B -> ~ A. Proof. (* Goal: forall (A B : Prop) (_ : forall _ : A, B) (_ : not B), not A *) unfold not in |- *; auto. Qed. Lemma no_or_r : forall A B : Prop, ~ A -> A \/ B -> B. Proof. (* Goal: forall (A B : Prop) (_ : not A) (_ : or A B), B *) intros A B not_A A_or_B. (* Goal: B *) elim A_or_B; auto. (* Goal: forall _ : A, B *) intro; absurd A; auto. Qed. Lemma no_or_l : forall A B : Prop, ~ B -> A \/ B -> A. Proof. (* Goal: forall (A B : Prop) (_ : not B) (_ : or A B), A *) intros A B not_A A_or_B. (* Goal: A *) elim A_or_B; auto. (* Goal: forall _ : B, A *) intro; absurd B; auto. Qed.
Require Export Qhomographic_sign. Require Export Qhomographic_Qpositive_to_Qpositive. Require Export Qhomographic_sign_properties. Definition new_a (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) := fst (fst (snd (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero))). Definition new_b (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) := fst (snd (fst (snd (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero)))). Definition new_c (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) := fst (snd (snd (fst (snd (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero))))). Definition new_d (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) := snd (snd (snd (fst (snd (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero))))). Definition new_p (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) := snd (snd (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero)). Lemma Qhomographic_Qpositive_to_Q_homographicAcc_pos_1 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), (a * d)%Z <> (b * c)%Z -> h_sign a b c d p H_Qhomographic_sg_denom_nonzero = 1%Z -> (0 < Z.sgn Proof. (* Goal: forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : not (@eq Z (Z.mul a d) (Z.mul b c))) (_ : @eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) (Zpos xH)) (_ : Z.lt Z0 (Z.sgn (Z.add (new_a a b c d p H_Qhomographic_sg_denom_nonzero) (new_b a b c d p H_Qhomographic_sg_denom_nonzero)))), homographicAcc (new_a a b c d p H_Qhomographic_sg_denom_nonzero) (new_b a b c d p H_Qhomographic_sg_denom_nonzero) (new_c a b c d p H_Qhomographic_sg_denom_nonzero) (new_d a b c d p H_Qhomographic_sg_denom_nonzero) (new_p a b c d p H_Qhomographic_sg_denom_nonzero) *) intros a b c d p H_hsign ad_neq_bc l1_eq_one z. (* Goal: homographicAcc (new_a a b c d p H_hsign) (new_b a b c d p H_hsign) (new_c a b c d p H_hsign) (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (na := new_a a b c d p H_hsign) in *. (* Goal: homographicAcc na (new_b a b c d p H_hsign) (new_c a b c d p H_hsign) (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (nb := new_b a b c d p H_hsign) in *. (* Goal: homographicAcc na nb (new_c a b c d p H_hsign) (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (nc := new_c a b c d p H_hsign) in *. (* Goal: homographicAcc na nb nc (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (nd := new_d a b c d p H_hsign) in *. (* Goal: homographicAcc na nb nc nd (new_p a b c d p H_hsign) *) set (l3 := new_p a b c d p H_hsign) in *. (* Goal: homographicAcc na nb nc nd l3 *) assert (H : Qhomographic_sign a b c d p H_hsign = (1%Z, (na, (nb, (nc, nd)), l3))). (* Goal: homographicAcc na nb nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) na (@pair Z (prod Z Z) nb (@pair Z Z nc nd))) l3)) *) unfold na, nb, nc, nd, l3 in |- *. (* Goal: homographicAcc na nb nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) rewrite <- l1_eq_one. (* Goal: homographicAcc na nb nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) unfold new_a, new_b, new_c, new_d, new_p in |- *. (* Goal: homographicAcc na nb nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (@fst Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))) (@pair Z (prod Z Z) (@fst Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) (@pair Z Z (@fst Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))))) (@snd Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))))))) (@snd (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) *) replace (h_sign a b c d p H_hsign) with (fst (Qhomographic_sign a b c d p H_hsign)); [ idtac | reflexivity ]; repeat rewrite <- pair_1; reflexivity. (* Goal: homographicAcc na nb nc nd l3 *) destruct l3 as [p0| p0| ]. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: homographicAcc na nb nc nd (nR p0) *) apply homographicAcc_wf. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) generalize (Zsgn_12 (na + nb) z). (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : Z.lt Z0 (Z.add na nb), False *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) (* Goal: Z.le Z0 na *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intros; assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nc *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H4. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nc *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nd *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H4. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nd *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) (* Goal: homographicAcc na nb nc nd (dL p0) *) apply homographicAcc_wf. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add nc nd) *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) generalize (Zsgn_12 (na + nb) z). (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : Z.lt Z0 (Z.add na nb), False *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) (* Goal: Z.le Z0 na *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intros; assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 nb *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nc *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H4. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nc *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) case H0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) case s. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nd *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H4. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nd *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) apply False_ind. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_compat. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) intro. (* Goal: homographicAcc na nb nc nd One *) (* Goal: Z.le Z0 nd *) discriminate e. (* Goal: homographicAcc na nb nc nd One *) apply homographicacc0. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add na nb) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply Zsgn_12. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.sgn (Z.add na nb)) *) assumption. (* Goal: Z.lt Z0 (Z.add nc nd) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd One H). (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: Z.lt Z0 (Z.add nc nd) *) case H0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intro. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) assumption. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: Z.lt Z0 (Z.add nc nd) *) apply False_ind. (* Goal: False *) elim a0. (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), False *) intros. (* Goal: False *) generalize (Zsgn_12 (na + nb) z). (* Goal: forall _ : Z.lt Z0 (Z.add na nb), False *) intro. (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (na + nb)%Z. (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. Qed. Lemma Qhomographic_Qpositive_to_Q_homographicAcc_pos_2 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), (a * d)%Z <> (b * c)%Z -> h_sign a b c d p H_Qhomographic_sg_denom_nonzero = 1%Z -> (Z.sgn Proof. (* Goal: forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : not (@eq Z (Z.mul a d) (Z.mul b c))) (_ : @eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) (Zpos xH)) (_ : Z.le (Z.sgn (Z.add (new_a a b c d p H_Qhomographic_sg_denom_nonzero) (new_b a b c d p H_Qhomographic_sg_denom_nonzero))) Z0), homographicAcc (Z.opp (new_a a b c d p H_Qhomographic_sg_denom_nonzero)) (Z.opp (new_b a b c d p H_Qhomographic_sg_denom_nonzero)) (Z.opp (new_c a b c d p H_Qhomographic_sg_denom_nonzero)) (Z.opp (new_d a b c d p H_Qhomographic_sg_denom_nonzero)) (new_p a b c d p H_Qhomographic_sg_denom_nonzero) *) intros a b c d p H_hsign ad_neq_bc l1_eq_one z. (* Goal: homographicAcc (Z.opp (new_a a b c d p H_hsign)) (Z.opp (new_b a b c d p H_hsign)) (Z.opp (new_c a b c d p H_hsign)) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (na := new_a a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp (new_b a b c d p H_hsign)) (Z.opp (new_c a b c d p H_hsign)) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (nb := new_b a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp (new_c a b c d p H_hsign)) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (nc := new_c a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (nd := new_d a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (new_p a b c d p H_hsign) *) set (l3 := new_p a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) l3 *) assert (H : Qhomographic_sign a b c d p H_hsign = (1%Z, (na, (nb, (nc, nd)), l3))). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) na (@pair Z (prod Z Z) nb (@pair Z Z nc nd))) l3)) *) unfold na, nb, nc, nd, l3 in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) rewrite <- l1_eq_one. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) unfold new_a, new_b, new_c, new_d, new_p in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (@fst Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))) (@pair Z (prod Z Z) (@fst Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) (@pair Z Z (@fst Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))))) (@snd Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))))))) (@snd (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) *) replace (h_sign a b c d p H_hsign) with (fst (Qhomographic_sign a b c d p H_hsign)); [ idtac | reflexivity ]; repeat rewrite <- pair_1; reflexivity. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) l3 *) destruct l3 as [p0| p0| ]. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (nR p0) *) apply homographicAcc_wf. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) generalize (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall _ : Z.le (Z.add na nb) Z0, False *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.le (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.opp (Z.add na nb)) *) apply Zlt_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) generalize (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : Z.le (Z.add na nb) Z0, False *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.le (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.opp (Z.add nc nd)) *) apply Zlt_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) case (Z_le_lt_eq_dec 0 na H1). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : Z.lt Z0 na, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: False *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.lt Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) case (Z_le_lt_eq_dec 0 nb H3). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : Z.lt Z0 nb, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case (Z_le_lt_eq_dec 0 nc H5). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : Z.lt Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (nc + nd)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) (* Goal: Z.lt Z0 nc *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) case (sg_pos_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.le (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply Zlt_le_weak. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le nc Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case (Z_le_lt_eq_dec 0 nd H6). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : Z.lt Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (nc + nd)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) case (sg_pos_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.le (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply Zlt_le_weak. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le nd Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) (dL p0) *) apply homographicAcc_wf. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) generalize (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall _ : Z.le (Z.add na nb) Z0, False *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.le (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.opp (Z.add na nb)) *) apply Zlt_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) generalize (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : Z.le (Z.add na nb) Z0, False *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.le (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.opp (Z.add nc nd)) *) apply Zlt_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) case (Z_le_lt_eq_dec 0 na H1). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : Z.lt Z0 na, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: False *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.lt Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : @eq Z Z0 na, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) case (Z_le_lt_eq_dec 0 nb H3). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : Z.lt Z0 nb, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Z Z0 nb, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nb) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case (Z_le_lt_eq_dec 0 nc H5). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : Z.lt Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (nc + nd)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) (* Goal: Z.lt Z0 nc *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) case (sg_pos_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.le (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply Zlt_le_weak. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le nc Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) generalize (sg_pos_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0)))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case (Z_le_lt_eq_dec 0 nd H6). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : Z.lt Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (nc + nd)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) case (sg_pos_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.le (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) (* Goal: Z.le (Z.add na nb) Z0 *) apply (Zsgn_14 _ z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.le (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le (Z.add nc nd) Z0 *) apply Zlt_le_weak. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) rewrite <- e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le nd Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (Z.opp nc) (Z.opp nd) One *) apply homographicacc0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd One H). (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) case H0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intros. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) apply False_ind. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) elim a0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) generalize (Zsgn_14 _ z). (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: forall _ : Z.le (Z.add na nb) Z0, False *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: Z.le (Z.add na nb) Z0 *) assumption. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) elim a0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) intros. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) rewrite <- Zopp_plus_distr. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.opp (Z.add na nb)) *) apply Zlt_neg_opp. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) generalize (sg_pos_1 a b c d p H_hsign na nb nc nd One H). (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd))) (and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) case H0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) apply False_ind. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) elim a0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) generalize (Zsgn_14 _ z). (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : Z.le (Z.add na nb) Z0, False *) intro. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_le_trans with (na + nb)%Z. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.le (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.le (Z.add na nb) Z0 *) assumption. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) elim a0. (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) rewrite <- Zopp_plus_distr. (* Goal: Z.lt Z0 (Z.opp (Z.add nc nd)) *) apply Zlt_neg_opp. (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. Qed. Lemma Qhomographic_Qpositive_to_Q_homographicAcc_neg_1 : forall (a b c d : Z) (p : Qpositive) (H_hsign : Qhomographic_sg_denom_nonzero c d p), (a * d)%Z <> (b * c)%Z -> h_sign a b c d p H_hsign = (-1)%Z -> (Z.sgn (new_a a b c d p H_hsign + new_b a b c d p H_hsign) < 0)%Z -> Proof. (* Goal: forall (a b c d : Z) (p : Qpositive) (H_hsign : Qhomographic_sg_denom_nonzero c d p) (_ : not (@eq Z (Z.mul a d) (Z.mul b c))) (_ : @eq Z (h_sign a b c d p H_hsign) (Zneg xH)) (_ : Z.lt (Z.sgn (Z.add (new_a a b c d p H_hsign) (new_b a b c d p H_hsign))) Z0), homographicAcc (Z.opp (new_a a b c d p H_hsign)) (Z.opp (new_b a b c d p H_hsign)) (new_c a b c d p H_hsign) (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) intros a b c d p H_hsign ad_neq_bc l1_eq__minus_one z. (* Goal: homographicAcc (Z.opp (new_a a b c d p H_hsign)) (Z.opp (new_b a b c d p H_hsign)) (new_c a b c d p H_hsign) (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (na := new_a a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp (new_b a b c d p H_hsign)) (new_c a b c d p H_hsign) (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (nb := new_b a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) (new_c a b c d p H_hsign) (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (nc := new_c a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc (new_d a b c d p H_hsign) (new_p a b c d p H_hsign) *) set (nd := new_d a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (new_p a b c d p H_hsign) *) set (l3 := new_p a b c d p H_hsign) in *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd l3 *) assert (H : Qhomographic_sign a b c d p H_hsign = ((-1)%Z, (na, (nb, (nc, nd)), l3))). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) na (@pair Z (prod Z Z) nb (@pair Z Z nc nd))) l3)) *) unfold na, nb, nc, nd, l3 in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) rewrite <- l1_eq__minus_one. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) unfold new_a, new_b, new_c, new_d, new_p in |- *. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (@fst Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))) (@pair Z (prod Z Z) (@fst Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) (@pair Z Z (@fst Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))))) (@snd Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))))))) (@snd (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) *) replace (h_sign a b c d p H_hsign) with (fst (Qhomographic_sign a b c d p H_hsign)); [ idtac | reflexivity ]; repeat rewrite <- pair_1; reflexivity. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd l3 *) destruct l3 as [p0| p0| ]. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (nR p0) *) apply homographicAcc_wf. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.opp (Z.add na nb)) *) apply Zlt_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: False *) generalize (Zsgn_11 (na + nb) z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : Z.lt (Z.add na nb) Z0, False *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: False *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: False *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) (* Goal: Z.le Z0 nd *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd (dL p0) *) apply homographicAcc_wf. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.opp (Z.add na nb)) *) apply Zlt_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: False *) generalize (Zsgn_11 (na + nb) z). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : Z.lt (Z.add na nb) Z0, False *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: False *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: False *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), False *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp na) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le Z0 (Z.opp na) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp na) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp na) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nb) *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le Z0 (Z.opp nb) *) apply Zle_neg_opp. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nb) *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) (* Goal: Z.le Z0 (Z.opp nb) *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nc *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nc *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) (* Goal: Z.le Z0 nc *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) case H0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) case s. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) apply False_ind. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le (Z.add Z0 Z0) (Z.add na nb) *) apply Zplus_le_compat. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim a0. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H2. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) elim H4. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 nd *) intros. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nd *) intro. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) (* Goal: Z.le Z0 nd *) discriminate e. (* Goal: homographicAcc (Z.opp na) (Z.opp nb) nc nd One *) apply homographicacc0. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add (Z.opp na) (Z.opp nb)) *) rewrite <- Zopp_plus_distr. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.opp (Z.add na nb)) *) apply Zlt_neg_opp. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) apply Zsgn_11. (* Goal: Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.sgn (Z.add na nb)) Z0 *) assumption. (* Goal: Z.lt Z0 (Z.add nc nd) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd One H). (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: Z.lt Z0 (Z.add nc nd) *) case H0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intro. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 (Z.add nc nd) *) apply False_ind. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: False *) generalize (Zsgn_11 (na + nb) z). (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: forall _ : Z.lt (Z.add na nb) Z0, False *) intro. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (na + nb)%Z. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intro. (* Goal: Z.lt Z0 (Z.add nc nd) *) elim a0. (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add nc nd) *) intros. (* Goal: Z.lt Z0 (Z.add nc nd) *) assumption. Qed. Lemma Qhomographic_Qpositive_to_Q_homographicAcc_neg_2 : forall (a b c d : Z) (p : Qpositive) (H_hsign : Qhomographic_sg_denom_nonzero c d p), (a * d)%Z <> (b * c)%Z -> h_sign a b c d p H_hsign = (-1)%Z -> (0 <= Z.sgn (new_a a b c d p H_hsign + new_b a b c d p H_hsign))%Z -> Proof. (* Goal: forall (a b c d : Z) (p : Qpositive) (H_hsign : Qhomographic_sg_denom_nonzero c d p) (_ : not (@eq Z (Z.mul a d) (Z.mul b c))) (_ : @eq Z (h_sign a b c d p H_hsign) (Zneg xH)) (_ : Z.le Z0 (Z.sgn (Z.add (new_a a b c d p H_hsign) (new_b a b c d p H_hsign)))), homographicAcc (new_a a b c d p H_hsign) (new_b a b c d p H_hsign) (Z.opp (new_c a b c d p H_hsign)) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) intros a b c d p H_hsign ad_neq_bc l1_eq__minus_one z. (* Goal: homographicAcc (new_a a b c d p H_hsign) (new_b a b c d p H_hsign) (Z.opp (new_c a b c d p H_hsign)) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (na := new_a a b c d p H_hsign) in *. (* Goal: homographicAcc na (new_b a b c d p H_hsign) (Z.opp (new_c a b c d p H_hsign)) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (nb := new_b a b c d p H_hsign) in *. (* Goal: homographicAcc na nb (Z.opp (new_c a b c d p H_hsign)) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (nc := new_c a b c d p H_hsign) in *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp (new_d a b c d p H_hsign)) (new_p a b c d p H_hsign) *) set (nd := new_d a b c d p H_hsign) in *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (new_p a b c d p H_hsign) *) set (l3 := new_p a b c d p H_hsign) in *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) l3 *) assert (H : Qhomographic_sign a b c d p H_hsign = ((-1)%Z, (na, (nb, (nc, nd)), l3))). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) na (@pair Z (prod Z Z) nb (@pair Z Z nc nd))) l3)) *) unfold na, nb, nc, nd, l3 in |- *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) rewrite <- l1_eq__minus_one. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (new_a a b c d p H_hsign) (@pair Z (prod Z Z) (new_b a b c d p H_hsign) (@pair Z Z (new_c a b c d p H_hsign) (new_d a b c d p H_hsign)))) (new_p a b c d p H_hsign))) *) unfold new_a, new_b, new_c, new_d, new_p in |- *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) l3 *) (* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_hsign) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (h_sign a b c d p H_hsign) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) (@fst Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))) (@pair Z (prod Z Z) (@fst Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) (@pair Z Z (@fst Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign)))))) (@snd Z Z (@snd Z (prod Z Z) (@snd Z (prod Z (prod Z Z)) (@fst (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))))))) (@snd (prod Z (prod Z (prod Z Z))) Qpositive (@snd Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Qhomographic_sign a b c d p H_hsign))))) *) replace (h_sign a b c d p H_hsign) with (fst (Qhomographic_sign a b c d p H_hsign)); [ idtac | reflexivity ]; repeat rewrite <- pair_1; reflexivity. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) l3 *) destruct l3 as [p0| p0| ]. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (nR p0) *) apply homographicAcc_wf. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add na nb) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: Z.lt Z0 (Z.add na nb) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) generalize (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : Z.le Z0 (Z.add na nb), False *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.opp (Z.add nc nd)) *) apply Zlt_neg_opp. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) generalize (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : Z.le Z0 (Z.add na nb), False *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: Z.le Z0 na *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) case (Z_le_lt_eq_dec na 0 H1). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: forall _ : Z.lt na Z0, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.le Z0 na *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), False *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) (* Goal: Z.lt na Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) rewrite e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) case (Z_le_lt_eq_dec nb 0 H3). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: forall _ : Z.lt nb Z0, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt nb Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) rewrite e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply Zle_neg_opp. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le nc Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case (Z_le_lt_eq_dec 0 nc H5). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : Z.lt Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (nc + nd)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) (* Goal: Z.lt Z0 nc *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) case (sg_neg_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add na nb) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add na nb) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) rewrite <- e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (nR p0) One), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply Zle_neg_opp. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le nd Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case (Z_le_lt_eq_dec 0 nd H6). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : Z.lt Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (nc + nd)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) case (sg_neg_1 a b c d p H_hsign na nb nc nd (nR p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add na nb) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) rewrite <- e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: forall _ : @eq Qpositive (nR p0) One, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) (* Goal: Z.le Z0 (Z.opp nd) *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) (dL p0) *) apply homographicAcc_wf. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add na nb) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: Z.lt Z0 (Z.add na nb) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) generalize (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : Z.le Z0 (Z.add na nb), False *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) rewrite <- Zopp_plus_distr. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.opp (Z.add nc nd)) *) apply Zlt_neg_opp. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) generalize (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: forall _ : Z.le Z0 (Z.add na nb), False *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: Z.le Z0 na *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 na *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) (* Goal: Z.le Z0 na *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 na *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) case (Z_le_lt_eq_dec na 0 H1). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: forall _ : Z.lt na Z0, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.le Z0 na *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: False *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), False *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.lt (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) (* Goal: Z.lt na Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) (* Goal: Z.le nb Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: forall _ : @eq Z na Z0, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 na *) rewrite e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 na *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) (* Goal: Z.le Z0 na *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 nb *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) case (Z_le_lt_eq_dec nb 0 H3). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: forall _ : Z.lt nb Z0, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt (Z.add na nb) Z0 *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt (Z.add na nb) (Z.add Z0 Z0) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt nb Z0 *) (* Goal: Z.le na Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) (* Goal: Z.lt nb Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: forall _ : @eq Z nb Z0, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 nb *) rewrite e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 nb *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 nb *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply Zle_neg_opp. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) (* Goal: Z.le nc Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nc) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) case (Z_le_lt_eq_dec 0 nc H5). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : Z.lt Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (nc + nd)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_lt_le_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) (* Goal: Z.lt Z0 nc *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.le Z0 nd *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) case (sg_neg_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add na nb) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add na nb) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: forall _ : @eq Z Z0 nc, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp nc) *) rewrite <- e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nc) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nc) *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) generalize (sg_neg_2 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : sumor (sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))))) (@eq Qpositive (dL p0) One), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) case H0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : sumbool (and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0)))) (and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd)))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case s. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le Z0 na) (and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 na) (_ : and (Z.le Z0 nb) (and (Z.le nc Z0) (Z.le nd Z0))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nb) (_ : and (Z.le nc Z0) (Z.le nd Z0)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nc Z0) (_ : Z.le nd Z0), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply Zle_neg_opp. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) (* Goal: Z.le nd Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.le na Z0) (and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim a0. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le na Z0) (_ : and (Z.le nb Z0) (and (Z.le Z0 nc) (Z.le Z0 nd))), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H2. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le nb Z0) (_ : and (Z.le Z0 nc) (Z.le Z0 nd)), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) elim H4. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.le Z0 nc) (_ : Z.le Z0 nd), Z.le Z0 (Z.opp nd) *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) case (Z_le_lt_eq_dec 0 nd H6). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : Z.lt Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.lt_trans with (nc + nd)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 (Z.add nc nd) *) rewrite Zplus_0_r_reverse with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add Z0 Z0) (Z.add nc nd) *) apply Zplus_le_lt_compat. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) (* Goal: Z.le Z0 nc *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt Z0 nd *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) case (sg_neg_1 a b c d p H_hsign na nb nc nd (dL p0) H). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add nc nd) Z0 *) apply False_ind. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) apply (Zsgn_13 _ z). (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) elim a1. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add na nb) Z0 *) intros. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: forall _ : @eq Z Z0 nd, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp nd) *) rewrite <- e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 (Z.opp Z0) *) simpl in |- *. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) (* Goal: Z.le Z0 Z0 *) apply Z.le_refl. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: forall _ : @eq Qpositive (dL p0) One, Z.le Z0 (Z.opp nd) *) intro. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) (* Goal: Z.le Z0 (Z.opp nd) *) discriminate e. (* Goal: homographicAcc na nb (Z.opp nc) (Z.opp nd) One *) apply homographicacc0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) (* Goal: @eq Qpositive One One *) reflexivity. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd One H). (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt Z0 (Z.add na nb) *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) case H0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: Z.lt Z0 (Z.add na nb) *) elim a0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt Z0 (Z.add na nb) *) intros. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) (* Goal: Z.lt Z0 (Z.add na nb) *) assumption. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt Z0 (Z.add na nb) *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 (Z.add na nb) *) apply False_ind. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) elim a0. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) generalize (Zsgn_13 _ z). (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: forall _ : Z.le Z0 (Z.add na nb), False *) intro. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) assumption. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. (* Goal: Z.lt Z0 (Z.add (Z.opp nc) (Z.opp nd)) *) rewrite <- Zopp_plus_distr. (* Goal: Z.lt Z0 (Z.opp (Z.add nc nd)) *) apply Zlt_neg_opp. (* Goal: Z.lt (Z.add nc nd) Z0 *) generalize (sg_neg_1 a b c d p H_hsign na nb nc nd One H). (* Goal: forall _ : sumbool (and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0)) (and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd))), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: Z.lt (Z.add nc nd) Z0 *) case H0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall _ : and (Z.lt Z0 (Z.add na nb)) (Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intros. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) elim a0. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: forall (_ : Z.lt Z0 (Z.add na nb)) (_ : Z.lt (Z.add nc nd) Z0), Z.lt (Z.add nc nd) Z0 *) intros. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) (* Goal: Z.lt (Z.add nc nd) Z0 *) assumption. (* Goal: forall _ : and (Z.lt (Z.add na nb) Z0) (Z.lt Z0 (Z.add nc nd)), Z.lt (Z.add nc nd) Z0 *) intro. (* Goal: Z.lt (Z.add nc nd) Z0 *) apply False_ind. (* Goal: False *) elim a0. (* Goal: forall (_ : Z.lt (Z.add na nb) Z0) (_ : Z.lt Z0 (Z.add nc nd)), False *) intros. (* Goal: False *) generalize (Zsgn_13 _ z). (* Goal: forall _ : Z.le Z0 (Z.add na nb), False *) intro. (* Goal: False *) apply Z.lt_irrefl with 0%Z. (* Goal: Z.lt Z0 Z0 *) apply Z.le_lt_trans with (na + nb)%Z. (* Goal: Z.lt (Z.add na nb) Z0 *) (* Goal: Z.le Z0 (Z.add na nb) *) assumption. (* Goal: Z.lt (Z.add na nb) Z0 *) assumption. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_squareparallelogram. Section Euclid. Context `{Ax1:euclidean_euclidean}. Lemma lemma_squareunique : forall A B C D E, SQ A B C D -> SQ A B C E -> eq E D. Proof. (* Goal: forall (A B C D E : @Point Ax0) (_ : @SQ Ax0 A B C D) (_ : @SQ Ax0 A B C E), @eq Ax0 E D *) intros. (* Goal: @eq Ax0 E D *) assert (PG A B C D) by (conclude lemma_squareparallelogram). (* Goal: @eq Ax0 E D *) let Tf:=fresh in assert (Tf:exists M, (Midpoint A M C /\ Midpoint B M D)) by (conclude lemma_diagonalsbisect);destruct Tf as [M];spliter. (* Goal: @eq Ax0 E D *) assert (BetS B M D) by (conclude_def Midpoint ). (* Goal: @eq Ax0 E D *) assert (BetS A M C) by (conclude_def Midpoint ). (* Goal: @eq Ax0 E D *) assert (Per D A B) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (Per E A B) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (nCol D A B) by (conclude lemma_rightangleNC). (* Goal: @eq Ax0 E D *) assert (nCol E A B) by (conclude lemma_rightangleNC). (* Goal: @eq Ax0 E D *) assert (Cong A B A B) by (conclude cn_congruencereflexive). (* Goal: @eq Ax0 E D *) assert (Cong A B D A) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (Cong A B E A) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (Cong E A A B) by (conclude lemma_congruencesymmetric). (* Goal: @eq Ax0 E D *) assert (Cong E A D A) by (conclude lemma_congruencetransitive). (* Goal: @eq Ax0 E D *) assert (Cong A E A D) by (forward_using lemma_congruenceflip). (* Goal: @eq Ax0 E D *) assert (CongA E A B D A B) by (conclude lemma_Euclid4). (* Goal: @eq Ax0 E D *) assert ((Cong E B D B /\ CongA A E B A D B /\ CongA A B E A B D)) by (conclude proposition_04). (* Goal: @eq Ax0 E D *) assert (CongA A B D A B E) by (conclude lemma_equalanglessymmetric). (* Goal: @eq Ax0 E D *) assert (neq B E) by (forward_using lemma_NCdistinct). (* Goal: @eq Ax0 E D *) assert (neq B M) by (forward_using lemma_betweennotequal). (* Goal: @eq Ax0 E D *) let Tf:=fresh in assert (Tf:exists N, (Out B E N /\ Cong B N B M)) by (conclude lemma_layoff);destruct Tf as [N];spliter. (* Goal: @eq Ax0 E D *) assert (Cong B M B N) by (conclude lemma_congruencesymmetric). (* Goal: @eq Ax0 E D *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @eq Ax0 E D *) assert (neq B A) by (forward_using lemma_NCdistinct). (* Goal: @eq Ax0 E D *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: @eq Ax0 E D *) assert (Out B M D) by (conclude lemma_ray4). (* Goal: @eq Ax0 E D *) assert (Out B D M) by (conclude lemma_ray5). (* Goal: @eq Ax0 E D *) assert (nCol A B D) by (forward_using lemma_NCorder). (* Goal: @eq Ax0 E D *) assert (CongA A B D A B D) by (conclude lemma_equalanglesreflexive). (* Goal: @eq Ax0 E D *) assert (CongA A B D A B M) by (conclude lemma_equalangleshelper). (* Goal: @eq Ax0 E D *) assert (CongA A B M A B D) by (conclude lemma_equalanglessymmetric). (* Goal: @eq Ax0 E D *) assert (CongA A B M A B E) by (conclude lemma_equalanglestransitive). (* Goal: @eq Ax0 E D *) assert (nCol A B E) by (forward_using lemma_NCorder). (* Goal: @eq Ax0 E D *) assert (CongA A B E A B E) by (conclude lemma_equalanglesreflexive). (* Goal: @eq Ax0 E D *) assert (CongA A B E A B N) by (conclude lemma_equalangleshelper). (* Goal: @eq Ax0 E D *) assert (CongA A B M A B N) by (conclude lemma_equalanglestransitive). (* Goal: @eq Ax0 E D *) assert (Cong B A B A) by (conclude cn_congruencereflexive). (* Goal: @eq Ax0 E D *) assert (Cong A M A N) by (conclude proposition_04). (* Goal: @eq Ax0 E D *) assert (Per B C D) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (Per B C E) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (CongA B C E B C D) by (conclude lemma_Euclid4). (* Goal: @eq Ax0 E D *) assert (Cong A B C D) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (Cong A B C E) by (conclude_def SQ ). (* Goal: @eq Ax0 E D *) assert (Cong C E A B) by (conclude lemma_congruencesymmetric). (* Goal: @eq Ax0 E D *) assert (Cong C E C D) by (conclude lemma_congruencetransitive). (* Goal: @eq Ax0 E D *) assert (nCol B C E) by (conclude lemma_rightangleNC). (* Goal: @eq Ax0 E D *) assert (nCol B C D) by (conclude lemma_rightangleNC). (* Goal: @eq Ax0 E D *) assert (Cong C B C B) by (conclude cn_congruencereflexive). (* Goal: @eq Ax0 E D *) assert ((Cong B E B D /\ CongA C B E C B D /\ CongA C E B C D B)) by (conclude proposition_04). (* Goal: @eq Ax0 E D *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @eq Ax0 E D *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @eq Ax0 E D *) assert (Out B C C) by (conclude lemma_ray4). (* Goal: @eq Ax0 E D *) assert (nCol B C D) by (conclude lemma_rightangleNC). (* Goal: @eq Ax0 E D *) assert (nCol C B D) by (forward_using lemma_NCorder). (* Goal: @eq Ax0 E D *) assert (CongA C B D C B D) by (conclude lemma_equalanglesreflexive). (* Goal: @eq Ax0 E D *) assert (CongA C B D C B M) by (conclude lemma_equalangleshelper). (* Goal: @eq Ax0 E D *) assert (nCol C B E) by (forward_using lemma_NCorder). (* Goal: @eq Ax0 E D *) assert (CongA C B E C B E) by (conclude lemma_equalanglesreflexive). (* Goal: @eq Ax0 E D *) assert (CongA C B E C B N) by (conclude lemma_equalangleshelper). (* Goal: @eq Ax0 E D *) assert (CongA C B E C B D) by (conclude lemma_equalanglestransitive). (* Goal: @eq Ax0 E D *) assert (CongA C B D C B E) by (conclude lemma_equalanglessymmetric). (* Goal: @eq Ax0 E D *) assert (CongA C B M C B D) by (conclude lemma_equalanglessymmetric). (* Goal: @eq Ax0 E D *) assert (CongA C B M C B E) by (conclude lemma_equalanglestransitive). (* Goal: @eq Ax0 E D *) assert (CongA C B M C B N) by (conclude lemma_equalanglestransitive). (* Goal: @eq Ax0 E D *) assert (CongA M B C N B C) by (conclude lemma_equalanglesflip). (* Goal: @eq Ax0 E D *) assert (Cong B C B C) by (conclude cn_congruencereflexive). (* Goal: @eq Ax0 E D *) assert (Cong M C N C) by (conclude (proposition_04 B M C B N C)). (* Goal: @eq Ax0 E D *) assert (Cong A C A C) by (conclude cn_congruencereflexive). (* Goal: @eq Ax0 E D *) assert (BetS A N C) by (conclude lemma_betweennesspreserved). (* Goal: @eq Ax0 E D *) assert (neq A M) by (forward_using lemma_betweennotequal). (* Goal: @eq Ax0 E D *) assert (Out A M C) by (conclude lemma_ray4). (* Goal: @eq Ax0 E D *) assert (neq A N) by (forward_using lemma_betweennotequal). (* Goal: @eq Ax0 E D *) assert (Out A N C) by (conclude lemma_ray4). (* Goal: @eq Ax0 E D *) assert (Out A C N) by (conclude lemma_ray5). (* Goal: @eq Ax0 E D *) assert (Out A C M) by (conclude lemma_ray5). (* Goal: @eq Ax0 E D *) assert (eq M N) by (conclude lemma_layoffunique). (* Goal: @eq Ax0 E D *) assert (Out B N E) by (conclude lemma_ray5). (* Goal: @eq Ax0 E D *) assert (Out B M D) by (conclude lemma_ray5). (* Goal: @eq Ax0 E D *) assert (Out B M E) by (conclude cn_equalitysub). (* Goal: @eq Ax0 E D *) assert (eq E D) by (conclude lemma_layoffunique). (* Goal: @eq Ax0 E D *) close. Qed. End Euclid.
Require Import List. Import ListNotations. Require Import StructTact.StructTactics. Set Implicit Arguments. Inductive Nth {A : Type} : list A -> nat -> A -> Prop := | Nth_0 : forall x l, Nth (x :: l) 0 x | Nth_S : forall l x n y, Nth l n x -> Nth (y :: l) (S n) x. Section nth. Variable A : Type. Lemma nth_error_Nth : forall n l (x : A), nth_error l n = Some x -> Nth l n x. Proof. (* Goal: forall (n : nat) (l : list A) (x : A) (_ : @eq (option A) (@nth_error A l n) (@Some A x)), @Nth A l n x *) induction n; intros; simpl in *; auto. (* Goal: @Nth A l (S n) x *) (* Goal: @Nth A l O x *) - (* Goal: @Nth A l O x *) break_match; try discriminate. (* Goal: @Nth A (@cons A a l0) O x *) unfold value in *. (* Goal: @Nth A (@cons A a l0) O x *) find_inversion. (* Goal: @Nth A (@cons A x l0) O x *) constructor. (* BG Goal: @Nth A l (S n) x *) - (* Goal: @Nth A l (S n) x *) break_match; try discriminate. (* Goal: @Nth A (@cons A a l0) (S n) x *) subst. (* Goal: @Nth A (@cons A a l0) (S n) x *) constructor. (* Goal: @Nth A l0 n x *) eauto. Qed. Lemma Nth_nth_error : forall n l (x : A), Nth l n x -> nth_error l n = Some x. Proof. (* Goal: forall (n : nat) (l : list A) (x : A) (_ : @Nth A l n x), @eq (option A) (@nth_error A l n) (@Some A x) *) intros. (* Goal: @eq (option A) (@nth_error A l n) (@Some A x) *) induction H; simpl in *; auto. Qed. End nth.
From mathcomp Require Import ssreflect ssrbool ssrfun ssrnat eqtype seq. From LemmaOverloading Require Import prelude heaps rels hprop domains. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Inductive exn : Type := exn_from_nat : nat -> exn. Definition exn_to_nat (e : exn) : nat := let: exn_from_nat y := e in y. Definition eqexn (e1 e2 : exn) : bool := match e1, e2 with exn_from_nat m, exn_from_nat n => m == n end. Lemma eqexnP : Equality.axiom eqexn. Proof. (* Goal: @Equality.axiom exn eqexn *) move=>[x][y]//=; case: eqP=>[->|*];constructor=>//. (* Goal: not (@eq exn (exn_from_nat x) (exn_from_nat y)) *) by move=>[*]. Qed. Canonical Structure exn_eqMixin := EqMixin eqexnP. Canonical Structure exn_eqType := EqType exn exn_eqMixin. Inductive ans (A : Type) : Type := Val of A | Exn of exn. Arguments Exn [A]. Notation pre := (Pred heap). Notation post A := (ans A -> heap -> heap -> Prop). Definition spec B := pre * post B : Type. Definition defed (P : Pred heap) : Pred heap := fun i => i \In P /\ def i. Notation ideald P := (ideal (defed P)). Section BasePrograms. Variables (A : Type) (P : Pred heap). Lemma singleP i : i \In defed P -> this i <== defed P. Proof. (* Goal: forall _ : @InMem heap i (@Mem heap (PredPredType heap) (defed P)), @Poset.leq (predPoset heap) (this i) (defed P) *) by move=>[pf1 pf2] h <-; split. Qed. Definition single i (pf : i \In defed P) := Ideal (singleP pf). Lemma bound (p : ideald P) i : i \In id_val p -> i \In defed P. Proof. (* Goal: forall _ : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed P) p)), @InMem heap i (@Mem heap (PredPredType heap) (defed P)) *) by case: p=>p H; case/H. Qed. Definition prog := ideald P -> ans A -> Pred heap. Definition coherent (e : prog) := forall p x m, m \In e p x <-> exists i, exists pf : i \In id_val p, m \In e (single (bound pf)) x. Definition def_strict (e : prog) := forall p x, Undef \Notin e p x. Definition runs_of (e : prog) : Pred (heap * ans A * heap) := fun r => exists pf : r.1.1 \In defed P, r.2 \In e (single pf) r.1.2. End BasePrograms. Definition has_spec A (s : spec A) := [Pred c : prog A s.1 | forall i y m, (i, y, m) \In runs_of c -> s.2 y i m]. Section STDef. Variables (A : Type) (s : spec A). Structure ST := STprog { model : prog A s.1; _ : coherent model; _ : def_strict model; _ : model \In has_spec s}. Lemma modelE (e1 e2 : ST) : e1 = e2 <-> model e1 = model e2. Proof. (* Goal: iff (@eq ST e1 e2) (@eq (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (model e1) (model e2)) *) move: e1 e2=>[e1 M1 S1 H1][e2 M2 S2 H2] /=; split=>[[//]|E]. (* Goal: @eq ST (@STprog e1 M1 S1 H1) (@STprog e2 M2 S2 H2) *) rewrite E in M1 S1 H1 *. by congr STprog; apply: proof_irrelevance. Qed. Qed. Definition st_leq e1 e2 := model e1 <== model e2. Lemma st_refl e : st_leq e e. Proof. (* Goal: st_leq e e *) by []. Qed. Lemma st_asym e1 e2 : st_leq e1 e2 -> st_leq e2 e1 -> e1 = e2. Proof. (* Goal: forall (_ : st_leq e1 e2) (_ : st_leq e2 e1), @eq ST e1 e2 *) move: e1 e2=>[e1 M1 S1 H1][e2 M2 S2 H2]; rewrite /st_leq /= => E1 E2. (* Goal: @eq ST (@STprog e1 M1 S1 H1) (@STprog e2 M2 S2 H2) *) rewrite (poset_asym E1 E2) in M1 M2 S1 S2 H1 H2 *; congr STprog; by apply: proof_irrelevance. Qed. Lemma st_trans e1 e2 e3 : st_leq e1 e2 -> st_leq e2 e3 -> st_leq e1 e3. Proof. (* Goal: forall (_ : st_leq e1 e2) (_ : st_leq e2 e3), st_leq e1 e3 *) move: e1 e2 e3=>[e1 M1 S1 H1][e2 M2 S2 H2][e3 M3 S3 H3]. (* Goal: forall (_ : st_leq (@STprog e1 M1 S1 H1) (@STprog e2 M2 S2 H2)) (_ : st_leq (@STprog e2 M2 S2 H2) (@STprog e3 M3 S3 H3)), st_leq (@STprog e1 M1 S1 H1) (@STprog e3 M3 S3 H3) *) by apply: poset_trans. Qed. Definition st_bot' := bot : [poset of prog A s.1]. Lemma st_bot_coherent : coherent st_bot'. Proof. (* Goal: @coherent A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) st_bot' *) by move=>r x m; split=>//; case=>i []. Qed. Lemma st_bot_dstrict : def_strict st_bot'. Proof. (* Goal: @def_strict A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) st_bot' *) by move=>r x. Qed. Lemma st_bot_has_spec : st_bot' \In has_spec s. Proof. (* Goal: @InMem (Poset.sort (@Poset.clone (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (funPoset (@ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (funPoset (ans A) (predPoset heap))) (Poset.class (funPoset (@ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (funPoset (ans A) (predPoset heap)))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset (@ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (funPoset (ans A) (predPoset heap))))) (Poset.class (funPoset (@ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (funPoset (ans A) (predPoset heap)))) => x))) st_bot' (@Mem (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (SimplPredPredType (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (@has_spec A s)) *) by move=>i y m [/= H][]. Qed. Definition st_bot := STprog st_bot_coherent st_bot_dstrict st_bot_has_spec. Lemma st_botP e : st_leq st_bot e. Proof. (* Goal: st_leq st_bot e *) by case: e=>*; apply: botP. Qed. Definition stPosetMixin := PosetMixin st_botP st_refl st_asym st_trans. Canonical stPoset := Eval hnf in Poset ST stPosetMixin. Definition st_sup' (u : Pred ST) := sup [Pred p | exists e, p = model e /\ e \In u]. Lemma st_sup_coherent u : coherent (st_sup' u). Proof. (* Goal: @coherent A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (st_sup' u) *) move=>r x m; split. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))) *) case=>_ [[_]][[_]][[_]][[]][p] M S H [->] P -> -> -> /=. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: forall _ : p r x m, @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))) *) case/M=>i [pf] H1. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))) *) exists i; exists pf; exists (p (single (bound pf)) x m). (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: and (@InMem Prop (p (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x m) (@Mem Prop (PredPredType Prop) (@Pred_of_Simpl (Lattice.sort propLattice) (@SimplPred (Lattice.sort propLattice) (fun p : Lattice.sort propLattice => @ex (forall _ : heap, Lattice.sort propLattice) (fun f : forall _ : heap, Lattice.sort propLattice => and (@InMem (forall _ : heap, Lattice.sort propLattice) f (@Mem (forall _ : heap, Lattice.sort propLattice) (PredPredType (forall _ : heap, Lattice.sort propLattice)) (@Pred_of_Simpl (Lattice.sort (predLattice heap)) (@SimplPred (Lattice.sort (predLattice heap)) (fun p0 : Lattice.sort (predLattice heap) => @ex (forall _ : ans A, Lattice.sort (predLattice heap)) (fun f0 : forall _ : ans A, Lattice.sort (predLattice heap) => and (@InMem (forall _ : ans A, Lattice.sort (predLattice heap)) f0 (@Mem (forall _ : ans A, Lattice.sort (predLattice heap)) (PredPredType (forall _ : ans A, Lattice.sort (predLattice heap))) (@Pred_of_Simpl (Lattice.sort (funLattice (ans A) (predLattice heap))) (@SimplPred (Lattice.sort (funLattice (ans A) (predLattice heap))) (fun p1 : Lattice.sort (funLattice (ans A) (predLattice heap)) => @ex (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap))) (fun f1 : forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap)) => and (@InMem (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap))) f1 (@Mem (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap))) (PredPredType (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap)))) (@Pred_of_Simpl (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (@SimplPred (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (fun p2 : prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) => @ex ST (fun e : ST => and (@eq (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p2 (model e)) (@InMem ST e (@Mem ST (PredPredType ST) u)))))))) (@eq (Lattice.sort (funLattice (ans A) (predLattice heap))) p1 (f1 (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)))))))))) (@eq (Lattice.sort (predLattice heap)) p0 (f0 x)))))))) (@eq (Lattice.sort propLattice) p (f m)))))))) (p (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x m) *) split=>//; do 3![eexists _; split=>//]. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: @InMem (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap))) p (@Mem (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap))) (PredPredType (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap)))) (@Pred_of_Simpl (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (@SimplPred (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (fun p : prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) => @ex ST (fun e : ST => and (@eq (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p (model e)) (@InMem ST e (@Mem ST (PredPredType ST) u))))))) *) by exists (STprog M S H). (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) case=>i [pf][_][[_]][[_]][[_]][[]][p] M D H [->] P -> -> -> /= E. (* Goal: @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) have: exists i, exists pf : i \In id_val r, m \In p (single (bound pf)) x. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (p (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (p (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (p (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (p (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))) *) by exists i; exists pf. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) r)) => @InMem heap m (@Mem heap (PredPredType heap) (p (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) r i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u r x)) *) move/M=>H3; exists (p r x m); split=>//; do 3![eexists _; split=>//]. (* Goal: @InMem (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap))) p (@Mem (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap))) (PredPredType (forall _ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)), Lattice.sort (funLattice (ans A) (predLattice heap)))) (@Pred_of_Simpl (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (@SimplPred (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (fun p : prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) => @ex ST (fun e : ST => and (@eq (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p (model e)) (@InMem ST e (@Mem ST (PredPredType ST) u))))))) *) by exists (STprog M D H). Qed. Lemma st_sup_dstrict u : def_strict (st_sup' u). Proof. (* Goal: @def_strict A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (st_sup' u) *) by move=>p x [_][[_]][[_]][[_]][[]][r] M D H [->] P -> -> -> /=; move/D. Qed. Lemma st_sup_has_spec u : st_sup' u \In has_spec s. Proof. (* Goal: @InMem (Lattice.sort (funLattice (@ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (funLattice (ans A) (predLattice heap)))) (st_sup' u) (@Mem (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) (SimplPredPredType (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (@has_spec A s)) *) move=>i y m [/= D]. (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (st_sup' u (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i D) y)), @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s y i m *) case=>_ [[_]][[_]][[_]][[]][p] M S H [->] P -> -> -> /= R. (* Goal: @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s y i m *) by apply: (H); exists D. Qed. Definition st_sup u := STprog (@st_sup_coherent u) (@st_sup_dstrict u) (@st_sup_has_spec u). Lemma st_supP (u : Pred ST) e : e \In u -> st_leq e (st_sup u). Proof. (* Goal: forall _ : @InMem ST e (@Mem ST (PredPredType ST) u), st_leq e (st_sup u) *) by case: e=>p M S H R; apply: supP; exists (STprog M S H). Qed. Lemma st_supM (u : Pred ST) e : (forall e1, e1 \In u -> st_leq e1 e) -> st_leq (st_sup u) e. Proof. (* Goal: forall _ : forall (e1 : ST) (_ : @InMem ST e1 (@Mem ST (PredPredType ST) u)), st_leq e1 e, st_leq (st_sup u) e *) by case: e=>p M S H R; apply: supM=>y [q][->]; apply: R. Qed. Definition stLatticeMixin := LatticeMixin st_supP st_supM. Canonical stLattice := Lattice ST stLatticeMixin. Lemma bot_runs : runs_of (model st_bot) =p Pred0. Proof. (* Goal: @EqMem (prod (prod heap (ans A)) heap) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (model st_bot))) (@Mem (prod (prod heap (ans A)) heap) (SimplPredPredType (prod (prod heap (ans A)) heap)) (@Pred0 (prod (prod heap (ans A)) heap))) *) by move=>r; split=>//; case. Qed. Lemma model_runs p y m (e : ST) : m \In model e p y <-> exists i, i \In id_val p /\ (i, y, m) \In runs_of (model e). Proof. (* Goal: iff (@InMem heap m (@Mem heap (PredPredType heap) (model e p y))) (@ex heap (fun i : heap => and (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p))) (@InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i y) m) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (model e)))))) *) case: e=>mod M S H; rewrite M; split; case=>i [H1] H2. (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (mod (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) p i pf)) y)))) *) (* Goal: @ex heap (fun i : heap => and (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p))) (@InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i y) m) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (model (@STprog mod M S H)))))) *) - (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (mod (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) p i pf)) y)))) *) (* Goal: @ex heap (fun i : heap => and (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p))) (@InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i y) m) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (model (@STprog mod M S H)))))) *) by exists i; split=>//; exists (bound H1). (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (mod (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) p i pf)) y)))) *) exists i; exists H1; case: H2 =>/= H2. (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (mod (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i H2) y)), @InMem heap m (@Mem heap (PredPredType heap) (mod (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) p i H1)) y)) *) by rewrite (proof_irrelevance H2 (bound H1)). Qed. Lemma def_runs i y m (e : ST) : (i, y, m) \In runs_of (model e) -> [/\ def i, i \In s.1 & def m]. Proof. (* Goal: forall _ : @InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i y) m) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (model e))), and3 (is_true (def i)) (@InMem heap i (@Mem heap (PredPredType heap) (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s))) (is_true (def m)) *) case=>[[/= P D]] R; split=>//. (* Goal: is_true (def m) *) by case: e R=>p M S H; case: m=>//; move/S. Qed. Lemma spec_runs i y m (e : ST) : (i, y, m) \In runs_of (model e) -> s.2 y i m. Proof. (* Goal: forall _ : @InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i y) m) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (model e))), @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s y i m *) by case: e=>p M S; apply. Qed. End STDef. Arguments spec_runs {A s i y m}. Prenex Implicits bot_runs model_runs def_runs. Module Model. Section Fix. Variables (A : Type) (B : A -> Type) (s : forall x, spec (B x)). Notation tp := (forall x, ST (s x)). Notation lat := (dfunLattice (fun x => [lattice of ST (s x)])). Variable (f : tp -> tp). Definition f' (e : lat) := sup [Pred t : lat | exists e', e' <== e /\ t = f e']. Definition ffix : tp := tarski_lfp f'. End Fix. Section Return. Variables (A : Type) (x : A). Definition ret_s : spec A := (fun i => True, fun y i m => m = i /\ y = Val x). Definition ret_sp (p : ideald ret_s.1) y m := m \In id_val p /\ y = Val x. Lemma ret_coherent : coherent ret_sp. Proof. (* Goal: @coherent A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s) ret_sp *) move=>p y m; split; first by case=>H ->{y}; exists m; exists H. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (ret_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s) p i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (ret_sp p y)) *) by case=>i [H1] [<-{m}] ->{y}. Qed. Lemma ret_dstrict : def_strict ret_sp. Proof. (* Goal: @def_strict A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s) ret_sp *) by case=>p H y /= []; case/H. Qed. Lemma ret_has_spec : ret_sp \In has_spec ret_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s))) (_ : ans A) (_ : heap), Prop) ret_sp (@Mem (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s)) (SimplPredPredType (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) ret_s))) (@has_spec A ret_s)) *) by move=>i y m; case=>/= T [-> ->]. Qed. Definition ret := STprog ret_coherent ret_dstrict ret_has_spec. End Return. Section Throw. Variables (A : Type) (e : exn). Definition throw_s : spec A := (fun i => True, fun y i m => m = i /\ y = Exn e). Definition throw_sp (p : ideald throw_s.1) y m := m \In id_val p /\ y = @Exn A e. Lemma throw_coherent : coherent throw_sp. Proof. (* Goal: @coherent A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s) throw_sp *) move=>p y m; split; first by case=>H ->{y}; exists m; exists H. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (throw_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s) p i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (throw_sp p y)) *) by case=>i [H1] [<-{m}] ->{y}. Qed. Lemma throw_dstrict : def_strict throw_sp. Proof. (* Goal: @def_strict A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s) throw_sp *) by case=>p H y /= []; case/H. Qed. Lemma throw_has_spec : throw_sp \In has_spec throw_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s))) (_ : ans A) (_ : heap), Prop) throw_sp (@Mem (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s)) (SimplPredPredType (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) throw_s))) (@has_spec A throw_s)) *) by move=>i y m; case=>/= T [-> ->]. Qed. Definition throw := STprog throw_coherent throw_dstrict throw_has_spec. End Throw. Section Bind. Variables (A B : Type). Variables (s1 : spec A) (s2 : A -> spec B). Variables (e1 : ST s1) (e2 : forall x, ST (s2 x)). Definition bind_pre : pre := fun i => s1.1 i /\ forall x m, s1.2 (Val x) i m -> (s2 x).1 m. Definition bind_post : post B := fun y i m => (exists x, exists h, s1.2 (Val x) i h /\ (s2 x).2 y h m) \/ (exists e, y = Exn e /\ s1.2 (Exn e) i m). Definition bind_s := (bind_pre, bind_post). Definition bind_sp (p : ideald bind_s.1) y m := exists i, exists x, exists h, i \In id_val p /\ (i, x, h) \In runs_of (model e1) /\ match x with Val x' => (h, y, m) \In runs_of (model (e2 x')) | Exn e => y = Exn e /\ m = h end. Lemma bind_coherent : coherent bind_sp. Proof. (* Goal: @coherent B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) bind_sp *) case=>p H y m; split. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) i pf)) y)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) i pf)) y)))) *) case=>i [x][h][/= H1][H2] H3. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) y)) *) (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) p)) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) p) => @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@single bind_pre i (@bound bind_pre (@Ideal (predPoset heap) (defed bind_pre) p H) i pf)) y)))) *) by exists i; exists H1; exists i; exists x; exists h. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) p H) y)) *) case=>i [/= H1][_][x][h][<-][T1 T2]. (* Goal: @InMem heap m (@Mem heap (PredPredType heap) (bind_sp (@Ideal (predPoset heap) (defed bind_pre) p H) y)) *) by exists i; exists x; exists h. Qed. Lemma bind_dstrict : def_strict bind_sp. Proof. (* Goal: @def_strict B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) bind_sp *) move=>p y [i][x][h][H1][]. (* Goal: forall (_ : @InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i x) h) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s1) (@model A s1 e1)))) (_ : match x with | Val x' => @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) h y) Undef) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x')) (@model B (s2 x') (e2 x')))) | Exn e => and (@eq (ans B) y (@Exn B e)) (@eq heap Undef h) end), False *) case: x=>[x'|e] H2; first by case/def_runs. (* Goal: forall _ : and (@eq (ans B) y (@Exn B e)) (@eq heap Undef h), False *) by case=>_ E; case/def_runs: H2; rewrite -E. Qed. Lemma bind_has_spec : bind_sp \In has_spec bind_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s))) (_ : ans B) (_ : heap), Prop) bind_sp (@Mem (prog B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s)) (SimplPredPredType (prog B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s))) (@has_spec B bind_s)) *) move=>i y m. (* Goal: forall _ : @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) i y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s) bind_sp)), @snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) bind_s y i m *) case=>[[[/= S1 S2]]] D [h][x][j][<-][]. (* Goal: forall (_ : @InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i x) j) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s1) (@model A s1 e1)))) (_ : match x with | Val x' => @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) j y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x')) (@model B (s2 x') (e2 x')))) | Exn e => and (@eq (ans B) y (@Exn B e)) (@eq heap m j) end), bind_post y i m *) case: x=>[x|e] T1; last first. (* Goal: forall _ : @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) j y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x)) (@model B (s2 x) (e2 x)))), bind_post y i m *) (* Goal: forall _ : and (@eq (ans B) y (@Exn B e)) (@eq heap m j), bind_post y i m *) - (* Goal: forall _ : @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) j y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x)) (@model B (s2 x) (e2 x)))), bind_post y i m *) (* Goal: forall _ : and (@eq (ans B) y (@Exn B e)) (@eq heap m j), bind_post y i m *) case=>->->; right; exists e; split=>//. (* Goal: forall _ : @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) j y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x)) (@model B (s2 x) (e2 x)))), bind_post y i m *) (* Goal: @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s1 (@Exn A e) i j *) by apply: spec_runs T1. (* Goal: forall _ : @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) j y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x)) (@model B (s2 x) (e2 x)))), bind_post y i m *) move=>T2; left; exists x; exists j. (* Goal: and (@snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s1 (@Val A x) i j) (@snd (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 x) y j m) *) by split; [apply: spec_runs T1 | apply: spec_runs T2]. Qed. Definition bind := STprog bind_coherent bind_dstrict bind_has_spec. End Bind. Section Try. Variables (A B : Type) (s : spec A) (s1 : A -> spec B) (s2 : exn -> spec B). Variables (e : ST s) (e1 : forall x, ST (s1 x)) (e2 : forall x, ST (s2 x)). Definition try_pre : pre := fun i => s.1 i /\ (forall y m, s.2 (Val y) i m -> (s1 y).1 m) /\ forall e m, s.2 (Exn e) i m -> (s2 e).1 m. Definition try_post : post B := fun y i m => (exists x, exists h, s.2 (Val x) i h /\ (s1 x).2 y h m) \/ (exists e, exists h, s.2 (Exn e) i h /\ (s2 e).2 y h m). Definition try_s := (try_pre, try_post). Definition try_sp (p : ideald try_s.1) y m := exists i, exists x, exists h, i \In id_val p /\ (i, x, h) \In runs_of (model e) /\ match x with Val x' => (h, y, m) \In runs_of (model (e1 x')) | Exn e => (h, y, m) \In runs_of (model (e2 e)) end. Lemma try_coherent : coherent try_sp. Proof. (* Goal: @coherent B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) try_sp *) case=>p H y m; split. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) i pf)) y)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) i pf)) y)))) *) case=>i [x][h][/= H1][H2] H3. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) y)) *) (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) p)) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) p) => @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@single try_pre i (@bound try_pre (@Ideal (predPoset heap) (defed try_pre) p H) i pf)) y)))) *) by exists i; exists H1; exists i; exists x; exists h. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H))) => @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@single (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) i (@bound (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) p H) y)) *) case=>i [/= H1][_][x][h][<-][T1 T2]. (* Goal: @InMem heap m (@Mem heap (PredPredType heap) (try_sp (@Ideal (predPoset heap) (defed try_pre) p H) y)) *) by exists i; exists x; exists h. Qed. Lemma try_dstrict : def_strict try_sp. Proof. (* Goal: @def_strict B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s) try_sp *) move=>p y [i][x][h][H1][]. (* Goal: forall (_ : @InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i x) h) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (@model A s e)))) (_ : match x with | Val x' => @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) h y) Undef) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s1 x')) (@model B (s1 x') (e1 x')))) | Exn e => @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) h y) Undef) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 e)) (@model B (s2 e) (e2 e)))) end), False *) by case: x=>[x'|e'] H2; case/def_runs. Qed. Lemma try_has_spec : try_sp \In has_spec try_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s))) (_ : ans B) (_ : heap), Prop) try_sp (@Mem (prog B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s)) (SimplPredPredType (prog B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) try_s))) (@has_spec B try_s)) *) move=>i y m; case=>[[[/= S1 [S2 S3]]]] D [h][x][j][<-][]. (* Goal: forall (_ : @InMem (prod (prod heap (ans A)) heap) (@pair (prod heap (ans A)) heap (@pair heap (ans A) i x) j) (@Mem (prod (prod heap (ans A)) heap) (PredPredType (prod (prod heap (ans A)) heap)) (@runs_of A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s) (@model A s e)))) (_ : match x with | Val x' => @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) j y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s1 x')) (@model B (s1 x') (e1 x')))) | Exn e => @InMem (prod (prod heap (ans B)) heap) (@pair (prod heap (ans B)) heap (@pair heap (ans B) j y) m) (@Mem (prod (prod heap (ans B)) heap) (PredPredType (prod (prod heap (ans B)) heap)) (@runs_of B (@fst (Pred heap) (forall (_ : ans B) (_ : heap) (_ : heap), Prop) (s2 e)) (@model B (s2 e) (e2 e)))) end), try_post y i m *) case: x=>[x'|e'] T1 T2; [left; exists x' | right; exists e']; exists j; by split; [apply: spec_runs T1 | apply: spec_runs T2]. Qed. Definition try := STprog try_coherent try_dstrict try_has_spec. End Try. Definition conseq A (s1 s2 : spec A) := forall i, s2.1 i -> def i -> s1.1 i /\ forall y m, s1.2 y i m -> def m -> s2.2 y i m. Lemma conseq_refl (A : Type) (s : spec A) : conseq s s. Proof. (* Goal: @conseq A s s *) by []. Qed. Hint Resolve conseq_refl : core. Section Consequence. Variables (A : Type) (s1 s2 : spec A) (e : ST s1) (pf : conseq s1 s2). Definition do_sp (p : ideald s2.1) y m := exists i, i \In id_val p /\ (i, y, m) \In runs_of (model e). Lemma do_coherent : coherent do_sp. Proof. (* Goal: @coherent A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) do_sp *) case=>q H y m; split. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H))) => @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H))) => @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) i pf)) y)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H))) => @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H))) => @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) i pf)) y)))) *) by case=>i [/= H1 T1]; exists i; exists H1; exists i. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H)))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H))) => @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (do_sp (@Ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) q H) y)) *) by case=>i [/= H1][_][<-] T1; exists i. Qed. Lemma do_dstrict : def_strict do_sp. Proof. (* Goal: @def_strict A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2) do_sp *) by move=>q y [h][/= H]; case/def_runs. Qed. Lemma do_has_spec : do_sp \In has_spec s2. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2))) (_ : ans A) (_ : heap), Prop) do_sp (@Mem (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2)) (SimplPredPredType (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2))) (@has_spec A s2)) *) move=>i y m [[/= S1 D1]][_][<-] T; case/def_runs: (T)=>_ S2 D2. (* Goal: @snd (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s2 y i m *) by apply: (proj2 (pf S1 D1)) D2; apply: spec_runs T. Qed. Definition Do := STprog do_coherent do_dstrict do_has_spec. End Consequence. Section Read. Variable (A : Type) (x : ptr). Definition read_s : spec A := (fun i => x \in dom i /\ exists v:A, look x i = dyn v, fun y i m => m = i /\ forall v, look x i = dyn v -> y = Val v). Definition read_sp (p : ideald read_s.1) (v : ans A) m := m \In id_val p /\ exists w, v = Val w /\ look x m = dyn w. Lemma read_coherent : coherent read_sp. Proof. (* Goal: @coherent A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) read_sp *) move=>p v m; split; last first. (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (read_sp p v)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (read_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) p i pf)) v)))) *) (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (read_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) p i pf)) v)))), @InMem heap m (@Mem heap (PredPredType heap) (read_sp p v)) *) - (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (read_sp p v)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (read_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) p i pf)) v)))) *) (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (read_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) p i pf)) v)))), @InMem heap m (@Mem heap (PredPredType heap) (read_sp p v)) *) by case=>i [H1][<-][w][->]; split=>//; exists w. (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (read_sp p v)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (read_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) p i pf)) v)))) *) case=>H1 [w][->] H2. (* Goal: @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (read_sp (@single (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) i (@bound (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) p i pf)) (@Val A w))))) *) by exists m; exists H1; split=>//; exists w. Qed. Lemma read_dstrict : def_strict read_sp. Proof. (* Goal: @def_strict A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s) read_sp *) by case=>p H y []; case/H. Qed. Lemma read_has_spec : read_sp \In has_spec read_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s))) (_ : ans A) (_ : heap), Prop) read_sp (@Mem (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s)) (SimplPredPredType (prog A (@fst (Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) read_s))) (@has_spec A read_s)) *) move=>i y m [[[/= H1]]][v] H2 D [<-][w][->] H3. (* Goal: and (@eq heap i i) (forall (v : A) (_ : @eq Dyn.dynamic (look x i) (@Dyn.dyn A v)), @eq (ans A) (@Val A w) (@Val A v)) *) by split=>// b1; rewrite H3=>H; move:(dyn_inj H)=>->. Qed. Definition read := STprog read_coherent read_dstrict read_has_spec. End Read. Section Write. Variable (A : Type) (x : ptr) (v : A). Definition write_s : spec unit := (fun i => x \in dom i : Prop, fun y i m => y = Val tt /\ upd i x (dyn v) = m). Definition write_sp (p : ideald write_s.1) (y : ans unit) m := exists i, i \In id_val p /\ x \in dom i /\ y = Val tt /\ m = upd i x (dyn v). Lemma write_coherent : coherent write_sp. Proof. (* Goal: @coherent unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) write_sp *) move=>p y m; split; case=>i [H1]. (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (write_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) p i H1)) y)), @InMem heap m (@Mem heap (PredPredType heap) (write_sp p y)) *) (* Goal: forall _ : and (is_true (@in_mem ptr x (@mem ptr (ssrbool.predPredType ptr) (dom i)))) (and (@eq (ans unit) y (@Val unit tt)) (@eq heap m (upd i x (@Dyn.dyn A v)))), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (write_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) p i pf)) y)))) *) - (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (write_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) p i H1)) y)), @InMem heap m (@Mem heap (PredPredType heap) (write_sp p y)) *) (* Goal: forall _ : and (is_true (@in_mem ptr x (@mem ptr (ssrbool.predPredType ptr) (dom i)))) (and (@eq (ans unit) y (@Val unit tt)) (@eq heap m (upd i x (@Dyn.dyn A v)))), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (write_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) p i pf)) y)))) *) by case=>H2 [->->]; exists i; exists H1; exists i. (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (write_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) p i H1)) y)), @InMem heap m (@Mem heap (PredPredType heap) (write_sp p y)) *) by case=>_ [<-][H2][->] ->; exists i. Qed. Lemma write_dstrict : def_strict write_sp. Proof. (* Goal: @def_strict unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s) write_sp *) case=>p H y [i] /= [H1][H2][H3]. (* Goal: forall _ : @eq heap Undef (upd i x (@Dyn.dyn A v)), False *) suff L: def (upd i x (dyn v)) by move=>H4; rewrite -H4 in L. (* Goal: is_true (def (upd i x (@Dyn.dyn A v))) *) by rewrite defU (dom_null H2) (dom_def H2). Qed. Lemma write_has_spec : write_sp \In has_spec write_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s))) (_ : ans unit) (_ : heap), Prop) write_sp (@Mem (prog unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s)) (SimplPredPredType (prog unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) write_s))) (@has_spec unit write_s)) *) by move=>i y m [[/= H1 D1]][_][<-][H2][->] ->. Qed. Definition write := STprog write_coherent write_dstrict write_has_spec. End Write. Section Allocation. Variables (A : Type) (v : A). Definition alloc_s : spec ptr := (fun i => def i : Prop, fun y i m => exists x, x != null /\ y = Val x /\ x \notin dom i /\ upd i x (dyn v) = m). Definition alloc_sp (p : ideald alloc_s.1) y m := exists i, i \In id_val p /\ exists l : ptr, y = Val l /\ m = i :+ l :-> v /\ l != null /\ l \notin dom i. Lemma alloc_coherent : coherent alloc_sp. Proof. (* Goal: @coherent ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) alloc_sp *) move=>p x m; split. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) p i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp p x)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp p x)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) p i pf)) x)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) p i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp p x)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp p x)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) p i pf)) x)))) *) case=>i [H1][l][->][->][H2] H3. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) p i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp p x)) *) (* Goal: @ex heap (fun i0 : heap => @ex (@InMem heap i0 (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p))) (fun pf : @InMem heap i0 (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p)) => @InMem heap (union2 i (@pts A l v)) (@Mem heap (PredPredType heap) (alloc_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) i0 (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) p i0 pf)) (@Val ptr l))))) *) by exists i; exists H1; exists i; split=>//; exists l. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) p i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (alloc_sp p x)) *) case=>i [H1][_][<-][l][->][->][H2] H3. (* Goal: @InMem heap (union2 i (@pts A l v)) (@Mem heap (PredPredType heap) (alloc_sp p (@Val ptr l))) *) by exists i; split=>//; exists l. Qed. Lemma alloc_dstrict : def_strict alloc_sp. Proof. (* Goal: @def_strict ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s) alloc_sp *) case=>p H y [m][/= H1][l][H2][H3][H4] H5; case/H: H1=>_ D. (* Goal: False *) suff {H3}: def (m :+ l :-> v) by rewrite -H3. (* Goal: is_true (def (union2 m (@pts A l v))) *) by rewrite unC defPtUn H4 D H5. Qed. Lemma alloc_has_spec : alloc_sp \In has_spec alloc_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s))) (_ : ans ptr) (_ : heap), Prop) alloc_sp (@Mem (prog ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s)) (SimplPredPredType (prog ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) alloc_s))) (@has_spec ptr alloc_s)) *) move=>i y m [[/= H D]][_][<-][l][->][->][H1] H2. (* Goal: @ex ptr (fun x : ptr => and (is_true (negb (@eq_op ptr_eqType x null))) (and (@eq (ans ptr) (@Val ptr l) (@Val ptr x)) (and (is_true (negb (@in_mem ptr x (@mem ptr (ssrbool.predPredType ptr) (dom i))))) (@eq heap (upd i x (@Dyn.dyn A v)) (union2 i (@pts A l v)))))) *) exists l; do !split=>//. (* Goal: @eq heap (upd i l (@Dyn.dyn A v)) (union2 i (@pts A l v)) *) rewrite (_ : i = i :+ empty); last by rewrite unh0. (* Goal: @eq heap (upd (union2 i empty) l (@Dyn.dyn A v)) (union2 (union2 i empty) (@pts A l v)) *) by rewrite updUnl (negbTE H2) unh0. Qed. Definition alloc := STprog alloc_coherent alloc_dstrict alloc_has_spec. End Allocation. Section BlockAllocation. Variables (A : Type) (v : A) (n : nat). Definition allocb_s : spec ptr := (fun i => def i : Prop, fun y i m => exists r, y = Val r /\ m = i :+ updi r (nseq n v)). Definition allocb_sp (p : ideald allocb_s.1) y m := exists i, i \In id_val p /\ y = Val (fresh i) /\ m = i :+ updi (fresh i) (nseq n v). Lemma allocb_coherent : coherent allocb_sp. Proof. (* Goal: @coherent ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) allocb_sp *) move=>p x m; split. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) p i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp p x)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp p x)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) p i pf)) x)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) p i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp p x)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp p x)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) p i pf)) x)))) *) by case=>i [H1][->] ->; exists i; exists H1; exists i. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp (@single (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) i (@bound (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) p i pf)) x)))), @InMem heap m (@Mem heap (PredPredType heap) (allocb_sp p x)) *) by case=>i [H1][_][<-][->] ->; exists i. Qed. Lemma allocb_dstrict : def_strict allocb_sp. Proof. (* Goal: @def_strict ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s) allocb_sp *) case=>p H y [m][/= H1][_] H2; case/H: H1=>_ D. (* Goal: False *) suff {H2}: def (m :+ updi (fresh m) (nseq n v)) by rewrite -H2. (* Goal: is_true (def (union2 m (@updi A (fresh m) (@nseq A n v)))) *) elim: n =>[|k IH]; first by rewrite /= unh0. (* Goal: is_true (def (union2 m (@updi A (fresh m) (@nseq A (S k) v)))) *) rewrite (_ : nseq k.+1 v = rcons (nseq k v) v); last first. (* Goal: is_true (def (union2 m (@updi A (fresh m) (@rcons A (@nseq A k v) v)))) *) (* Goal: @eq (list A) (@nseq A (S k) v) (@rcons A (@nseq A k v) v) *) - (* Goal: is_true (def (union2 m (@updi A (fresh m) (@rcons A (@nseq A k v) v)))) *) (* Goal: @eq (list A) (@nseq A (S k) v) (@rcons A (@nseq A k v) v) *) by elim: {IH} k=>[|k IH] //=; rewrite -IH. (* Goal: is_true (def (union2 m (@updi A (fresh m) (@rcons A (@nseq A k v) v)))) *) rewrite updi_last unA unC defPtUn IH /=. (* Goal: is_true (andb (negb (@eq_op ptr_eqType (ptr_offset (fresh m) (@size A (@nseq A k v))) null)) (negb (@in_mem ptr (ptr_offset (fresh m) (@size A (@nseq A k v))) (@mem ptr (ssrbool.predPredType ptr) (dom (union2 m (@updi A (fresh m) (@nseq A k v)))))))) *) rewrite ptr_null negb_and fresh_null /=. (* Goal: is_true (negb (@in_mem ptr (ptr_offset (fresh m) (@size A (@nseq A k v))) (@mem ptr (ssrbool.predPredType ptr) (dom (union2 m (@updi A (fresh m) (@nseq A k v))))))) *) rewrite domUn !inE /= negb_and IH negb_or /=. (* Goal: is_true (andb (negb (@in_mem ptr (ptr_offset (fresh m) (@size A (@nseq A k v))) (@mem ptr (ssrbool.predPredType ptr) (dom m)))) (negb (@in_mem ptr (ptr_offset (fresh m) (@size A (@nseq A k v))) (@mem ptr (ssrbool.predPredType ptr) (dom (@updi A (fresh m) (@nseq A k v))))))) *) by rewrite dom_fresh updimV negb_and fresh_null ltnn. Qed. Lemma allocb_has_spec : allocb_sp \In has_spec allocb_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s))) (_ : ans ptr) (_ : heap), Prop) allocb_sp (@Mem (prog ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s)) (SimplPredPredType (prog ptr (@fst (Pred heap) (forall (_ : ans ptr) (_ : heap) (_ : heap), Prop) allocb_s))) (@has_spec ptr allocb_s)) *) by move=>i y m [[/= H D]][_][<-][->] ->; exists (fresh i). Qed. Definition allocb := STprog allocb_coherent allocb_dstrict allocb_has_spec. End BlockAllocation. Section Deallocation. Variable x : ptr. Definition dealloc_s : spec unit := (fun i => x \in dom i : Prop, fun y i m => y = Val tt /\ free x i = m). Definition dealloc_sp (p : ideald dealloc_s.1) (y : ans unit) m := exists i, i \In id_val p /\ y = Val tt /\ x \in dom i /\ m = free x i. Lemma dealloc_coherent : coherent dealloc_sp. Proof. (* Goal: @coherent unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) dealloc_sp *) move=>p y m; split. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) p i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp p y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp p y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) p i pf)) y)))) *) - (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) p i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp p y)) *) (* Goal: forall _ : @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp p y)), @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) p i pf)) y)))) *) by case=>i [H1][->][H2] ->; exists i; exists H1; exists i. (* Goal: forall _ : @ex heap (fun i : heap => @ex (@InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p))) (fun pf : @InMem heap i (@Mem heap (PredPredType heap) (@id_val (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) p)) => @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp (@single (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) i (@bound (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) p i pf)) y)))), @InMem heap m (@Mem heap (PredPredType heap) (dealloc_sp p y)) *) by case=>i [H1][_][<-][->][H2] ->; exists i. Qed. Lemma dealloc_dstrict : def_strict dealloc_sp. Proof. (* Goal: @def_strict unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s) dealloc_sp *) case=>p H y [h][/=]; case/H=>_ H1 [H2][H3] H4. (* Goal: False *) suff: def (free x h) by rewrite -H4. (* Goal: is_true (def (free x h)) *) by rewrite defF. Qed. Lemma dealloc_has_spec : dealloc_sp \In has_spec dealloc_s. Proof. (* Goal: @InMem (forall (_ : @ideal (predPoset heap) (defed (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s))) (_ : ans unit) (_ : heap), Prop) dealloc_sp (@Mem (prog unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s)) (SimplPredPredType (prog unit (@fst (Pred heap) (forall (_ : ans unit) (_ : heap) (_ : heap), Prop) dealloc_s))) (@has_spec unit dealloc_s)) *) by move=>i y m [[/= H1 D1]][_][<-][->][H2] ->. Qed. Definition dealloc := STprog dealloc_coherent dealloc_dstrict dealloc_has_spec. End Deallocation. End Model.
Require Import AMM11262. Import NatSet GeneralProperties. Section example_three_inhabitants. Definition town_1:= 1++ 2 ++ 3 ++ empty. Remark population_1 : cardinal town_1 = 2*1 +1. Proof. (* Goal: @Logic.eq nat (cardinal town_1) (Nat.add (Nat.mul (S (S O)) (S O)) (S O)) *) reflexivity. Qed. Definition familiarity_1 (m n:elt):Prop := match m,n with | 1,2 => True | 2,1 => True | 2,3 => True | 3,2 => True | _,_ => False end. Remark familiarity_1_sym:forall m n : elt, familiarity_1 m n -> familiarity_1 n m. Remark familiarity_1_extensional:forall (m : elt) (n p : E.t), E.eq n p -> familiarity_1 m n -> familiarity_1 m p. Remark subsets_1: forall B : t, Subset B town_1 -> cardinal B = 1 -> {B [=] 1++empty}+{B[=]2++empty}+{B[=]3++empty}. Proof. (* Goal: forall (B : t) (_ : Subset B town_1) (_ : @Logic.eq nat (cardinal B) (S O)), sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) intros B H_sub H_card. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) destruct (In_dec 1 B) as [H1|H1]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) left; left; rewrite <- (add_remove H1); generalize (remove_cardinal_1 H1); rewrite H_card; intro H_eq; rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq))); reflexivity... destruct (In_dec 2 B) as [H2|H2]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) left; right; rewrite <- (add_remove H2); generalize (remove_cardinal_1 H2); rewrite H_card; intro H_eq; rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq))); reflexivity... destruct (In_dec 3 B) as [H3|H3]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) right; rewrite <- (add_remove H3); generalize (remove_cardinal_1 H3); rewrite H_card; intro H_eq; rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq))); reflexivity... apply False_rec. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) destruct (cardinal_inv_2 H_card) as [b Hb]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) destruct (NatSet.E.eq_dec b 1) as [Hb1|Hb1]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) (* Goal: False *) apply H1; rewrite <- Hb1; assumption. destruct (NatSet.E.eq_dec b 2) as [Hb2|Hb2]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H2; rewrite <- Hb2; assumption. destruct (NatSet.E.eq_dec b 3) as [Hb3|Hb3]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H3; rewrite <- Hb3; assumption. assert (Hb_town:=H_sub _ Hb). (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) unfold town_1 in Hb_town. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) destruct (proj1 (FM.add_iff _ _ b) Hb_town) as [Hb1_town|Hb1_town]. (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: sumor (sumbool (Equal B (add (S O) empty)) (Equal B (add (S (S O)) empty))) (Equal B (add (S (S (S O))) empty)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply Hb1; rewrite Hb1_town; reflexivity. destruct (proj1 (FM.add_iff _ _ b) Hb1_town) as [Hb2_town|Hb2_town]. apply Hb2; rewrite Hb2_town; reflexivity. destruct (proj1 (FM.add_iff _ _ b) Hb2_town) as [Hb3_town|Hb3_town]. apply Hb3; rewrite Hb3_town; reflexivity. apply (proj1 (FM.empty_iff b) Hb3_town). Qed. Qed. Remark acquintance_1: forall B : t, Subset B town_1 -> cardinal B = 1 -> {d : elt |In d (diff town_1 B) /\ (forall b : elt, In b B -> familiarity_1 d b)}. Proof. (* Goal: forall (B : t) (_ : Subset B town_1) (_ : @Logic.eq nat (cardinal B) (S O)), @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) intros B H_sub H_card. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) destruct (subsets_1 B H_sub H_card) as [[HB1|HB2]|HB3]. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) exists 2; split. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity_1 (S (S O)) b *) (* Goal: In (S (S O)) (diff town_1 B) *) rewrite HB1; apply mem_2; trivial. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity_1 (S (S O)) b *) intro b; rewrite HB1; intro Hb. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: familiarity_1 (S (S O)) b *) destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H]. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: familiarity_1 (S (S O)) b *) (* Goal: familiarity_1 (S (S O)) b *) compute in H; rewrite <- H; simpl; trivial. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: familiarity_1 (S (S O)) b *) apply False_ind; apply (proj1 (FM.empty_iff b) H). (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) exists 1; split. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity_1 (S O) b *) (* Goal: In (S O) (diff town_1 B) *) rewrite HB2; apply mem_2; trivial. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: forall (b : elt) (_ : In b B), familiarity_1 (S O) b *) intro b; rewrite HB2; intro Hb. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: familiarity_1 (S O) b *) destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H]. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: familiarity_1 (S O) b *) (* Goal: familiarity_1 (S O) b *) compute in H; rewrite <- H; simpl; trivial. (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) (* Goal: familiarity_1 (S O) b *) apply False_ind; apply (proj1 (FM.empty_iff b) H). (* Goal: @sig elt (fun d : elt => and (In d (diff town_1 B)) (forall (b : elt) (_ : In b B), familiarity_1 d b)) *) exists 2; split. (* Goal: forall (b : elt) (_ : In b B), familiarity_1 (S (S O)) b *) (* Goal: In (S (S O)) (diff town_1 B) *) rewrite HB3; apply mem_2; trivial. (* Goal: forall (b : elt) (_ : In b B), familiarity_1 (S (S O)) b *) intro b; rewrite HB3; intro Hb. (* Goal: familiarity_1 (S (S O)) b *) destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H]. (* Goal: familiarity_1 (S (S O)) b *) (* Goal: familiarity_1 (S (S O)) b *) compute in H; rewrite <- H; simpl; trivial. (* Goal: familiarity_1 (S (S O)) b *) apply False_ind; apply (proj1 (FM.empty_iff b) H). Qed. Check (AMM11262 town_1 1 population_1 familiarity_1 familiarity_1_sym familiarity_1_extensional acquintance_1). Definition social_citizen_1:=AMM11262 town_1 1 population_1 familiarity_1 familiarity_1_sym familiarity_1_extensional acquintance_1. End example_three_inhabitants. Extraction "social1" social_citizen_1.
Require Export GeoCoq.Elements.OriginalProofs.proposition_44. Require Export GeoCoq.Elements.OriginalProofs.lemma_RTcongruence. Require Export GeoCoq.Elements.OriginalProofs.lemma_RTsymmetric. Require Export GeoCoq.Elements.OriginalProofs.proposition_14. Section Euclid. Context `{Ax:area}. Lemma proposition_45 : forall A B C D E J K N O R S, nCol J E N -> nCol A B D -> nCol C B D -> BetS A O C -> BetS B O D -> neq R K -> nCol K R S -> exists X Z U, PG X K Z U /\ CongA X K Z J E N /\ EF X K Z U A B C D /\ Out K R Z /\ OS X S K Z. Proof. (* Goal: forall (A B C D E J K N O R S : @Point Ax0) (_ : @nCol Ax0 J E N) (_ : @nCol Ax0 A B D) (_ : @nCol Ax0 C B D) (_ : @BetS Ax0 A O C) (_ : @BetS Ax0 B O D) (_ : @neq Ax0 R K) (_ : @nCol Ax0 K R S), @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) intros. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq B D) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) let Tf:=fresh in assert (Tf:exists m, (BetS B m D /\ Cong m B m D)) by (conclude proposition_10);destruct Tf as [m];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Cong B m m D) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Midpoint B m D) by (conclude_def Midpoint ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq B m) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) let Tf:=fresh in assert (Tf:exists P, (BetS R K P /\ Cong K P B m)) by (conclude lemma_extension);destruct Tf as [P];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Triangle A B D) by (conclude_def Triangle ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq K P) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq P K) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) rename_H H;let Tf:=fresh in assert (Tf:exists H, (BetS P K H /\ Cong K H P K)) by (conclude lemma_extension);destruct Tf as [H];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Cong P K K H) by (conclude lemma_congruencesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Midpoint P K H) by (conclude_def Midpoint ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Cong P K B m) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Cong K H B m) by (conclude lemma_congruencetransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Cong B m m D) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Cong K H m D) by (conclude lemma_congruencetransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (BetS P K R) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col P K H) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col P K R) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq P K) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col K H R) by (conclude lemma_collinear4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col R K H) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol R K S) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (eq K K) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col R K K) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq K H) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq H K) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol H K S) by (conclude lemma_NChelper). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol S K H) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) let Tf:=fresh in assert (Tf:exists F G, (PG F K H G /\ EF A B m D F K H G /\ CongA H K F J E N /\ OS S F K H)) by (conclude proposition_42B);destruct Tf as [F[G]];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol D B C) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Triangle D B C) by (conclude_def Triangle ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F K H G) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol K H G) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol H G K) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol G H K) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) let Tf:=fresh in assert (Tf:exists M L e, (PG G H M L /\ CongA G H M J E N /\ EF D B e C G H M L /\ Midpoint B e C /\ TS M G H K)) by (conclude proposition_44);destruct Tf as [M[L[e]]];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (BetS B e C) by (conclude_def Midpoint ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA J E N G H M) by (conclude lemma_equalanglessymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA H K F G H M) by (conclude lemma_equalanglestransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F K H G) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par K F H G) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq H K) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) let Tf:=fresh in assert (Tf:exists s, (BetS H K s /\ Cong K s H K)) by (conclude lemma_extension);destruct Tf as [s];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F G K H) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par K H F G) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TP K H F G) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (OS F G K H) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (RT F K H K H G) by (conclude proposition_29C). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA G H M H K F) by (conclude lemma_equalanglessymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol H K F) by (conclude lemma_equalanglesNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol F K H) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA F K H H K F) by (conclude lemma_ABCequalsCBA). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA F K H G H M) by (conclude lemma_equalanglestransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (RT G H M K H G) by (conclude lemma_RTcongruence). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (RT K H G G H M) by (conclude lemma_RTsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (eq G G) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq H G) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Out H G G) by (conclude lemma_ray4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (BetS K H M) by (conclude proposition_14). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq F K) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol G H M) by (conclude lemma_equalanglesNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq G H) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par G H M L) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol H M L) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq L M) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (eq K K) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (eq H H) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (eq M M) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col F K K) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col G H H) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col L M M) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F K G H) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par M L G H) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par L M G H) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F K L M) by (conclude proposition_30). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F K M L) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F G K H) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par G L H M) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F G H K) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col K H M) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col H K M) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq K M) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq M K) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F G M K) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col H M K) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par G L K M) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par G L M K) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par M K G L) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par M K F G) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par M K G F) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col G L F) by (conclude lemma_Playfair). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col G F L) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol F L M) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq L F) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par M K L F) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par L F M K) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F L K M) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (PG F K M L) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol F K H) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA F K H H K F) by (conclude lemma_ABCequalsCBA). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA F K H J E N) by (conclude lemma_equalanglestransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq K H) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Out K H M) by (conclude lemma_ray4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Out K M H) by (conclude lemma_ray5). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (eq F F) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq K F) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Out K F F) by (conclude lemma_ray4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol F K M) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA F K M F K M) by (conclude lemma_equalanglesreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA F K M F K H) by (conclude lemma_equalangleshelper). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (CongA F K M J E N) by (conclude lemma_equalanglestransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col B O D) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col B D O) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (nCol B D A) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TS A B D C) by (conclude_def TS ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par G H L M) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TP G H L M) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (OS L M G H) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par F K G H) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Par G H F K) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TP G H F K) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (OS F K G H) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (eq H H) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col G H H) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TS K G H M) by (conclude_def TS ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TS F G H M) by (conclude lemma_planeseparation). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TS M G H F) by (conclude lemma_oppositesidesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (TS L G H F) by (conclude lemma_planeseparation). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) let Tf:=fresh in assert (Tf:exists t, (BetS L t F /\ Col G H t /\ nCol G H L)) by (conclude_def TS );destruct Tf as [t];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col F L G) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col L t F) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col F L t) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (neq F L) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col L G t) by (conclude lemma_collinear4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col t G L) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col t G H) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (~ neq t G). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) (* Goal: not (@neq Ax0 t G) *) { (* Goal: not (@neq Ax0 t G) *) intro. (* Goal: False *) assert (Col G L H) by (conclude lemma_collinear4). (* Goal: False *) assert (Col G H L) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (BetS L G F) by (conclude cn_equalitysub). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (BetS F G L) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) let Tf:=fresh in assert (Tf:exists j, (BetS F j M /\ BetS K j L)) by (conclude lemma_diagonalsmeet);destruct Tf as [j];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (EF A B C D F K M L) by (conclude axiom_paste4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (EF F K M L A B C D) by (conclude axiom_EFsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (BetS P K M) by (conclude lemma_3_7b). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Out K R M) by (conclude_def Out ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (OS F S K H) by (forward_using lemma_samesidesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (Col K H M) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) assert (OS F S K M) by (conclude lemma_samesidecollinear). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => @ex (@Point Ax0) (fun U : @Point Ax0 => and (@PG Ax0 X K Z U) (and (@CongA Ax0 X K Z J E N) (and (@EF Ax0 Ax1 Ax2 Ax X K Z U A B C D) (and (@Out Ax0 K R Z) (@OS Ax0 X S K Z))))))) *) close. Qed. End Euclid.
Require Import ZArith. Require Import Wf_nat. Require Import lemmas. Require Import natZ. Require Import dec. Require Import divides. Require Import modulo. Require Import list. Definition Prime (n : nat) : Prop := n > 1 /\ (forall q : nat, Divides q n -> q = 1 \/ q = n). Definition bPrime (n : nat) := n > 1 /\ (forall q : nat, q < S n -> Divides q n -> q = 1 \/ q = n). Lemma primebprime : forall n : nat, Prime n <-> bPrime n. Proof. (* Goal: forall n : nat, iff (Prime n) (bPrime n) *) unfold Prime, bPrime in |- *. (* Goal: forall n : nat, iff (and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) (and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) *) split. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) intro. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) (* Goal: and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) elim H. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) (* Goal: forall (_ : gt n (S O)) (_ : forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) split. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) (* Goal: forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n) *) (* Goal: gt n (S O) *) assumption. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) (* Goal: forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n) *) intros. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) (* Goal: or (@eq nat q (S O)) (@eq nat q n) *) apply H1. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) (* Goal: Divides q n *) assumption. (* Goal: forall _ : and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) intro. (* Goal: and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) elim H. (* Goal: forall (_ : gt n (S O)) (_ : forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) *) split. (* Goal: forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n) *) (* Goal: gt n (S O) *) assumption. (* Goal: forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n) *) intros. (* Goal: or (@eq nat q (S O)) (@eq nat q n) *) apply H1. (* Goal: Divides q n *) (* Goal: lt q (S n) *) unfold lt in |- *. (* Goal: Divides q n *) (* Goal: le (S q) (S n) *) apply le_n_S. (* Goal: Divides q n *) (* Goal: le q n *) apply div_le. (* Goal: Divides q n *) (* Goal: Divides q n *) (* Goal: lt O n *) apply lt_trans with 1. (* Goal: Divides q n *) (* Goal: Divides q n *) (* Goal: lt (S O) n *) (* Goal: lt O (S O) *) apply lt_O_Sn. (* Goal: Divides q n *) (* Goal: Divides q n *) (* Goal: lt (S O) n *) assumption. (* Goal: Divides q n *) (* Goal: Divides q n *) assumption. (* Goal: Divides q n *) assumption. Qed. Lemma bprimedec : forall n : nat, bPrime n \/ ~ bPrime n. Proof. (* Goal: forall n : nat, or (bPrime n) (not (bPrime n)) *) unfold bPrime in |- *. (* Goal: forall n : nat, or (and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) (not (and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)))) *) intros. (* Goal: or (and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) (not (and (gt n (S O)) (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)))) *) apply anddec. (* Goal: or (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) (not (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) *) (* Goal: or (gt n (S O)) (not (gt n (S O))) *) apply gtdec. (* Goal: or (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)) (not (forall (q : nat) (_ : lt q (S n)) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))) *) apply (alldec (fun q : nat => Divides q n -> q = 1 \/ q = n) (S n)). (* Goal: forall n0 : nat, or (forall _ : Divides n0 n, or (@eq nat n0 (S O)) (@eq nat n0 n)) (not (forall _ : Divides n0 n, or (@eq nat n0 (S O)) (@eq nat n0 n))) *) intros. (* Goal: or (forall _ : Divides n0 n, or (@eq nat n0 (S O)) (@eq nat n0 n)) (not (forall _ : Divides n0 n, or (@eq nat n0 (S O)) (@eq nat n0 n))) *) apply impdec. (* Goal: or (or (@eq nat n0 (S O)) (@eq nat n0 n)) (not (or (@eq nat n0 (S O)) (@eq nat n0 n))) *) (* Goal: or (Divides n0 n) (not (Divides n0 n)) *) apply divdec. (* Goal: or (or (@eq nat n0 (S O)) (@eq nat n0 n)) (not (or (@eq nat n0 (S O)) (@eq nat n0 n))) *) apply ordec. (* Goal: or (@eq nat n0 n) (not (@eq nat n0 n)) *) (* Goal: or (@eq nat n0 (S O)) (not (@eq nat n0 (S O))) *) apply eqdec. (* Goal: or (@eq nat n0 n) (not (@eq nat n0 n)) *) apply eqdec. Qed. Lemma primedec : forall n : nat, Prime n \/ ~ Prime n. Proof. (* Goal: forall n : nat, or (Prime n) (not (Prime n)) *) intro. (* Goal: or (Prime n) (not (Prime n)) *) elim (primebprime n). (* Goal: forall (_ : forall _ : Prime n, bPrime n) (_ : forall _ : bPrime n, Prime n), or (Prime n) (not (Prime n)) *) intros. (* Goal: or (Prime n) (not (Prime n)) *) elim (bprimedec n). (* Goal: forall _ : not (bPrime n), or (Prime n) (not (Prime n)) *) (* Goal: forall _ : bPrime n, or (Prime n) (not (Prime n)) *) left. (* Goal: forall _ : not (bPrime n), or (Prime n) (not (Prime n)) *) (* Goal: Prime n *) apply (H0 H1). (* Goal: forall _ : not (bPrime n), or (Prime n) (not (Prime n)) *) right. (* Goal: not (Prime n) *) intro. (* Goal: False *) apply H1. (* Goal: bPrime n *) apply (H H2). Qed. Lemma nonprime_witness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d < n /\ Divides d n. Proof. (* Goal: forall (n : nat) (_ : gt n (S O)) (_ : not (Prime n)), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d n) (Divides d n))) *) intro n. (* Goal: forall (_ : gt n (S O)) (_ : not (Prime n)), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d n) (Divides d n))) *) case n. (* Goal: forall (n : nat) (_ : gt (S n) (S O)) (_ : not (Prime (S n))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S n)) (Divides d (S n)))) *) (* Goal: forall (_ : gt O (S O)) (_ : not (Prime O)), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d O) (Divides d O))) *) intro. (* Goal: forall (n : nat) (_ : gt (S n) (S O)) (_ : not (Prime (S n))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S n)) (Divides d (S n)))) *) (* Goal: forall _ : not (Prime O), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d O) (Divides d O))) *) elim (lt_n_O 1). (* Goal: forall (n : nat) (_ : gt (S n) (S O)) (_ : not (Prime (S n))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S n)) (Divides d (S n)))) *) (* Goal: lt (S O) O *) assumption. (* Goal: forall (n : nat) (_ : gt (S n) (S O)) (_ : not (Prime (S n))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S n)) (Divides d (S n)))) *) intro n1. (* Goal: forall (_ : gt (S n1) (S O)) (_ : not (Prime (S n1))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S n1)) (Divides d (S n1)))) *) case n1. (* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)) (_ : not (Prime (S (S n)))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n))) (Divides d (S (S n))))) *) (* Goal: forall (_ : gt (S O) (S O)) (_ : not (Prime (S O))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S O)) (Divides d (S O)))) *) intro. (* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)) (_ : not (Prime (S (S n)))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n))) (Divides d (S (S n))))) *) (* Goal: forall _ : not (Prime (S O)), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S O)) (Divides d (S O)))) *) elim (lt_irrefl 1). (* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)) (_ : not (Prime (S (S n)))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n))) (Divides d (S (S n))))) *) (* Goal: lt (S O) (S O) *) assumption. (* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)) (_ : not (Prime (S (S n)))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n))) (Divides d (S (S n))))) *) intro n2. (* Goal: forall (_ : gt (S (S n2)) (S O)) (_ : not (Prime (S (S n2)))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n2))) (Divides d (S (S n2))))) *) intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n2))) (Divides d (S (S n2))))) *) elim (decDeMorgan (S (S n2)) (fun d : nat => 1 < d /\ Divides d (S (S n2)))). (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (_ : forall _ : @ex nat (fun x : nat => and (lt x (S (S n2))) (and (lt (S O) x) (Divides x (S (S n2))))), not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2)))))) (_ : forall _ : not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))), @ex nat (fun x : nat => and (lt x (S (S n2))) (and (lt (S O) x) (Divides x (S (S n2)))))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n2))) (Divides d (S (S n2))))) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n2))) (Divides d (S (S n2))))) *) elim H2. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: forall (x : nat) (_ : and (lt x (S (S n2))) (and (lt (S O) x) (Divides x (S (S n2))))), @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n2))) (Divides d (S (S n2))))) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (lt d (S (S n2))) (Divides d (S (S n2))))) *) split with x. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: and (lt (S O) x) (and (lt x (S (S n2))) (Divides x (S (S n2)))) *) elim H3. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: forall (_ : lt x (S (S n2))) (_ : and (lt (S O) x) (Divides x (S (S n2)))), and (lt (S O) x) (and (lt x (S (S n2))) (Divides x (S (S n2)))) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: and (lt (S O) x) (and (lt x (S (S n2))) (Divides x (S (S n2)))) *) elim H5. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: forall (_ : lt (S O) x) (_ : Divides x (S (S n2))), and (lt (S O) x) (and (lt x (S (S n2))) (Divides x (S (S n2)))) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: and (lt (S O) x) (and (lt x (S (S n2))) (Divides x (S (S n2)))) *) split. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: and (lt x (S (S n2))) (Divides x (S (S n2))) *) (* Goal: lt (S O) x *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: and (lt x (S (S n2))) (Divides x (S (S n2))) *) split. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: Divides x (S (S n2)) *) (* Goal: lt x (S (S n2)) *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) (* Goal: Divides x (S (S n2)) *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: not (forall (x : nat) (_ : lt x (S (S n2))), not (and (lt (S O) x) (Divides x (S (S n2))))) *) intro. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: False *) apply H0. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: Prime (S (S n2)) *) unfold Prime in |- *. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: and (gt (S (S n2)) (S O)) (forall (q : nat) (_ : Divides q (S (S n2))), or (@eq nat q (S O)) (@eq nat q (S (S n2)))) *) split. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (q : nat) (_ : Divides q (S (S n2))), or (@eq nat q (S O)) (@eq nat q (S (S n2))) *) (* Goal: gt (S (S n2)) (S O) *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (q : nat) (_ : Divides q (S (S n2))), or (@eq nat q (S O)) (@eq nat q (S (S n2))) *) intro q. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall _ : Divides q (S (S n2)), or (@eq nat q (S O)) (@eq nat q (S (S n2))) *) case q. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S n) (S (S n2))), or (@eq nat (S n) (S O)) (@eq nat (S n) (S (S n2))) *) (* Goal: forall _ : Divides O (S (S n2)), or (@eq nat O (S O)) (@eq nat O (S (S n2))) *) intro. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S n) (S (S n2))), or (@eq nat (S n) (S O)) (@eq nat (S n) (S (S n2))) *) (* Goal: or (@eq nat O (S O)) (@eq nat O (S (S n2))) *) unfold Divides in H4. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S n) (S (S n2))), or (@eq nat (S n) (S O)) (@eq nat (S n) (S (S n2))) *) (* Goal: or (@eq nat O (S O)) (@eq nat O (S (S n2))) *) elim H4. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S n) (S (S n2))), or (@eq nat (S n) (S O)) (@eq nat (S n) (S (S n2))) *) (* Goal: forall (x : nat) (_ : @eq nat (S (S n2)) (Init.Nat.mul O x)), or (@eq nat O (S O)) (@eq nat O (S (S n2))) *) simpl in |- *. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S n) (S (S n2))), or (@eq nat (S n) (S O)) (@eq nat (S n) (S (S n2))) *) (* Goal: forall (_ : nat) (_ : @eq nat (S (S n2)) O), or (@eq nat O (S O)) (@eq nat O (S (S n2))) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S n) (S (S n2))), or (@eq nat (S n) (S O)) (@eq nat (S n) (S (S n2))) *) (* Goal: or (@eq nat O (S O)) (@eq nat O (S (S n2))) *) discriminate H5. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S n) (S (S n2))), or (@eq nat (S n) (S O)) (@eq nat (S n) (S (S n2))) *) intro q1. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall _ : Divides (S q1) (S (S n2)), or (@eq nat (S q1) (S O)) (@eq nat (S q1) (S (S n2))) *) case q1. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S (S n)) (S (S n2))), or (@eq nat (S (S n)) (S O)) (@eq nat (S (S n)) (S (S n2))) *) (* Goal: forall _ : Divides (S O) (S (S n2)), or (@eq nat (S O) (S O)) (@eq nat (S O) (S (S n2))) *) left. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S (S n)) (S (S n2))), or (@eq nat (S (S n)) (S O)) (@eq nat (S (S n)) (S (S n2))) *) (* Goal: @eq nat (S O) (S O) *) reflexivity. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall (n : nat) (_ : Divides (S (S n)) (S (S n2))), or (@eq nat (S (S n)) (S O)) (@eq nat (S (S n)) (S (S n2))) *) intro q2. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: forall _ : Divides (S (S q2)) (S (S n2)), or (@eq nat (S (S q2)) (S O)) (@eq nat (S (S q2)) (S (S n2))) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: or (@eq nat (S (S q2)) (S O)) (@eq nat (S (S q2)) (S (S n2))) *) right. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: @eq nat (S (S q2)) (S (S n2)) *) elim (le_lt_or_eq (S (S q2)) (S (S n2))). (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) (* Goal: forall _ : lt (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) (* Goal: @eq nat (S (S q2)) (S (S n2)) *) elim (H3 (S (S q2))). (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) (* Goal: and (lt (S O) (S (S q2))) (Divides (S (S q2)) (S (S n2))) *) (* Goal: lt (S (S q2)) (S (S n2)) *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) (* Goal: and (lt (S O) (S (S q2))) (Divides (S (S q2)) (S (S n2))) *) split. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) (* Goal: Divides (S (S q2)) (S (S n2)) *) (* Goal: lt (S O) (S (S q2)) *) apply lt_n_S. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) (* Goal: Divides (S (S q2)) (S (S n2)) *) (* Goal: lt O (S q2) *) apply lt_O_Sn. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) (* Goal: Divides (S (S q2)) (S (S n2)) *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: forall _ : @eq nat (S (S q2)) (S (S n2)), @eq nat (S (S q2)) (S (S n2)) *) intros. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) (* Goal: @eq nat (S (S q2)) (S (S n2)) *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: le (S (S q2)) (S (S n2)) *) apply div_le1. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) (* Goal: Divides (S (S q2)) (S (S n2)) *) assumption. (* Goal: forall n : nat, or (and (lt (S O) n) (Divides n (S (S n2)))) (not (and (lt (S O) n) (Divides n (S (S n2))))) *) intros. (* Goal: or (and (lt (S O) n0) (Divides n0 (S (S n2)))) (not (and (lt (S O) n0) (Divides n0 (S (S n2))))) *) apply anddec. (* Goal: or (Divides n0 (S (S n2))) (not (Divides n0 (S (S n2)))) *) (* Goal: or (lt (S O) n0) (not (lt (S O) n0)) *) apply ltdec. (* Goal: or (Divides n0 (S (S n2))) (not (Divides n0 (S (S n2)))) *) apply divdec. Qed. Lemma nonprime_sqrwitness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d * d <= n /\ Divides d n. Proof. (* Goal: forall (n : nat) (_ : gt n (S O)) (_ : not (Prime n)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) elim (nonprime_witness n). (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: forall (x : nat) (_ : and (lt (S O) x) (and (lt x n) (Divides x n))), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intro d. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: forall _ : and (lt (S O) d) (and (lt d n) (Divides d n)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) elim (sqrdivbound n d). (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall (x : nat) (_ : and (Divides x n) (and (le (Init.Nat.mul x x) n) (or (@eq nat x d) (@eq nat (Init.Nat.mul d x) n)))), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intro d'. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : and (Divides d' n) (and (le (Init.Nat.mul d' d') n) (or (@eq nat d' d) (@eq nat (Init.Nat.mul d d') n))), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) elim H2. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall (_ : Divides d' n) (_ : and (le (Init.Nat.mul d' d') n) (or (@eq nat d' d) (@eq nat (Init.Nat.mul d d') n))), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) elim H4. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall (_ : le (Init.Nat.mul d' d') n) (_ : or (@eq nat d' d) (@eq nat (Init.Nat.mul d d') n)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) elim H6. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: forall _ : @eq nat d' d, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intro. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) split with d'. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: and (lt (S O) d') (and (le (Init.Nat.mul d' d') n) (Divides d' n)) *) split. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: lt (S O) d' *) rewrite H7. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: lt (S O) d *) elim H1. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: forall (_ : lt (S O) d) (_ : and (lt d n) (Divides d n)), lt (S O) d *) tauto. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) split. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: Divides d' n *) (* Goal: le (Init.Nat.mul d' d') n *) assumption. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: Divides d' n *) rewrite H7. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: Divides d n *) elim H1. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) (* Goal: forall (_ : lt (S O) d) (_ : and (lt d n) (Divides d n)), Divides d n *) tauto. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: forall _ : @eq nat (Init.Nat.mul d d') n, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) intro. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (Divides d n))) *) split with d'. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: and (lt (S O) d') (and (le (Init.Nat.mul d' d') n) (Divides d' n)) *) split. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: lt (S O) d' *) apply (lt_n_nm_m_gt_1 d d'). (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: lt d (Init.Nat.mul d d') *) rewrite H7. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: lt d n *) elim H1. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) (* Goal: forall (_ : lt (S O) d) (_ : and (lt d n) (Divides d n)), lt d n *) tauto. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: and (le (Init.Nat.mul d' d') n) (Divides d' n) *) split. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: Divides d' n *) (* Goal: le (Init.Nat.mul d' d') n *) assumption. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) (* Goal: Divides d' n *) assumption. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides d n *) elim H1. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: forall (_ : lt (S O) d) (_ : and (lt d n) (Divides d n)), Divides d n *) tauto. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) assumption. (* Goal: not (Prime n) *) assumption. Qed. Theorem nonprime_primewitness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d * d <= n /\ Divides d n /\ Prime d. Proof. (* Goal: forall (n : nat) (_ : gt n (S O)) (_ : not (Prime n)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (and (Divides d n) (Prime d)))) *) intro. (* Goal: forall (_ : gt n (S O)) (_ : not (Prime n)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (and (Divides d n) (Prime d)))) *) apply (lt_wf_ind n). (* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (_ : gt m (S O)) (_ : not (Prime m)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) m) (and (Divides d m) (Prime d))))) (_ : gt n (S O)) (_ : not (Prime n)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) n) (and (Divides d n) (Prime d)))) *) intros N IH. (* Goal: forall (_ : gt N (S O)) (_ : not (Prime N)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim (nonprime_sqrwitness N). (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall (x : nat) (_ : and (lt (S O) x) (and (le (Init.Nat.mul x x) N) (Divides x N))), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intro x. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : and (lt (S O) x) (and (le (Init.Nat.mul x x) N) (Divides x N)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim H1. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall (_ : lt (S O) x) (_ : and (le (Init.Nat.mul x x) N) (Divides x N)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim H3. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall (_ : le (Init.Nat.mul x x) N) (_ : Divides x N), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim (primedec x). (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: forall _ : Prime x, @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) split with x. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: and (lt (S O) x) (and (le (Init.Nat.mul x x) N) (and (Divides x N) (Prime x))) *) split. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: and (le (Init.Nat.mul x x) N) (and (Divides x N) (Prime x)) *) (* Goal: lt (S O) x *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: and (le (Init.Nat.mul x x) N) (and (Divides x N) (Prime x)) *) split. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: and (Divides x N) (Prime x) *) (* Goal: le (Init.Nat.mul x x) N *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: and (Divides x N) (Prime x) *) split. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: Prime x *) (* Goal: Divides x N *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) (* Goal: Prime x *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: forall _ : not (Prime x), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim (IH x). (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: forall (x0 : nat) (_ : and (lt (S O) x0) (and (le (Init.Nat.mul x0 x0) x) (and (Divides x0 x) (Prime x0)))), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim H7. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: forall (_ : lt (S O) x0) (_ : and (le (Init.Nat.mul x0 x0) x) (and (Divides x0 x) (Prime x0))), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim H9. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: forall (_ : le (Init.Nat.mul x0 x0) x) (_ : and (Divides x0 x) (Prime x0)), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) elim H11. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: forall (_ : Divides x0 x) (_ : Prime x0), @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) intros. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: @ex nat (fun d : nat => and (lt (S O) d) (and (le (Init.Nat.mul d d) N) (and (Divides d N) (Prime d)))) *) split with x0. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (lt (S O) x0) (and (le (Init.Nat.mul x0 x0) N) (and (Divides x0 N) (Prime x0))) *) split. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (le (Init.Nat.mul x0 x0) N) (and (Divides x0 N) (Prime x0)) *) (* Goal: lt (S O) x0 *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (le (Init.Nat.mul x0 x0) N) (and (Divides x0 N) (Prime x0)) *) split. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (Divides x0 N) (Prime x0) *) (* Goal: le (Init.Nat.mul x0 x0) N *) apply le_trans with (x * x). (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (Divides x0 N) (Prime x0) *) (* Goal: le (Init.Nat.mul x x) N *) (* Goal: le (Init.Nat.mul x0 x0) (Init.Nat.mul x x) *) apply le_trans with x. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (Divides x0 N) (Prime x0) *) (* Goal: le (Init.Nat.mul x x) N *) (* Goal: le x (Init.Nat.mul x x) *) (* Goal: le (Init.Nat.mul x0 x0) x *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (Divides x0 N) (Prime x0) *) (* Goal: le (Init.Nat.mul x x) N *) (* Goal: le x (Init.Nat.mul x x) *) apply le_n_nn. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (Divides x0 N) (Prime x0) *) (* Goal: le (Init.Nat.mul x x) N *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: and (Divides x0 N) (Prime x0) *) split. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: Prime x0 *) (* Goal: Divides x0 N *) apply div_trans with x. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: Prime x0 *) (* Goal: Divides x N *) (* Goal: Divides x0 x *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: Prime x0 *) (* Goal: Divides x N *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) (* Goal: Prime x0 *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: lt x N *) unfold lt in |- *. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: le (S x) N *) apply le_trans with (x * x). (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: le (Init.Nat.mul x x) N *) (* Goal: le (S x) (Init.Nat.mul x x) *) change (x < x * x) in |- *. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: le (Init.Nat.mul x x) N *) (* Goal: lt x (Init.Nat.mul x x) *) apply sqr_ascend. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: le (Init.Nat.mul x x) N *) (* Goal: gt x (S O) *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) (* Goal: le (Init.Nat.mul x x) N *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) (* Goal: gt x (S O) *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) (* Goal: not (Prime x) *) assumption. (* Goal: not (Prime N) *) (* Goal: gt N (S O) *) assumption. (* Goal: not (Prime N) *) assumption. Qed. Theorem primepropdiv : forall n : nat, n > 1 -> (forall q : nat, Prime q -> Divides q n -> q * q > n) -> Prime n. Proof. (* Goal: forall (n : nat) (_ : gt n (S O)) (_ : forall (q : nat) (_ : Prime q) (_ : Divides q n), gt (Init.Nat.mul q q) n), Prime n *) intros. (* Goal: Prime n *) elim (primedec n). (* Goal: forall _ : not (Prime n), Prime n *) (* Goal: forall _ : Prime n, Prime n *) intro. (* Goal: forall _ : not (Prime n), Prime n *) (* Goal: Prime n *) assumption. (* Goal: forall _ : not (Prime n), Prime n *) intros. (* Goal: Prime n *) elim (nonprime_primewitness n). (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: forall (x : nat) (_ : and (lt (S O) x) (and (le (Init.Nat.mul x x) n) (and (Divides x n) (Prime x)))), Prime n *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Prime n *) elim H2. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: forall (_ : lt (S O) x) (_ : and (le (Init.Nat.mul x x) n) (and (Divides x n) (Prime x))), Prime n *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Prime n *) elim H4. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: forall (_ : le (Init.Nat.mul x x) n) (_ : and (Divides x n) (Prime x)), Prime n *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Prime n *) elim H6. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: forall (_ : Divides x n) (_ : Prime x), Prime n *) intros. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Prime n *) elim (le_not_lt (x * x) n). (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: lt n (Init.Nat.mul x x) *) (* Goal: le (Init.Nat.mul x x) n *) assumption. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: lt n (Init.Nat.mul x x) *) unfold gt in H0. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: lt n (Init.Nat.mul x x) *) apply H0. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides x n *) (* Goal: Prime x *) assumption. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) (* Goal: Divides x n *) assumption. (* Goal: not (Prime n) *) (* Goal: gt n (S O) *) assumption. (* Goal: not (Prime n) *) assumption. Qed. Lemma primediv1p : forall p n : nat, Prime p -> Divides n p -> n = 1 \/ n = p. Proof. (* Goal: forall (p n : nat) (_ : Prime p) (_ : Divides n p), or (@eq nat n (S O)) (@eq nat n p) *) intros. (* Goal: or (@eq nat n (S O)) (@eq nat n p) *) unfold Prime in H. (* Goal: or (@eq nat n (S O)) (@eq nat n p) *) elim H. (* Goal: forall (_ : gt p (S O)) (_ : forall (q : nat) (_ : Divides q p), or (@eq nat q (S O)) (@eq nat q p)), or (@eq nat n (S O)) (@eq nat n p) *) intros. (* Goal: or (@eq nat n (S O)) (@eq nat n p) *) apply (H2 n). (* Goal: Divides n p *) assumption. Qed. Lemma prime2 : Prime 2. Proof. (* Goal: Prime (S (S O)) *) apply primepropdiv. (* Goal: forall (q : nat) (_ : Prime q) (_ : Divides q (S (S O))), gt (Init.Nat.mul q q) (S (S O)) *) (* Goal: gt (S (S O)) (S O) *) auto. (* Goal: forall (q : nat) (_ : Prime q) (_ : Divides q (S (S O))), gt (Init.Nat.mul q q) (S (S O)) *) intro q. (* Goal: forall (_ : Prime q) (_ : Divides q (S (S O))), gt (Init.Nat.mul q q) (S (S O)) *) case q. (* Goal: forall (n : nat) (_ : Prime (S n)) (_ : Divides (S n) (S (S O))), gt (Init.Nat.mul (S n) (S n)) (S (S O)) *) (* Goal: forall (_ : Prime O) (_ : Divides O (S (S O))), gt (Init.Nat.mul O O) (S (S O)) *) intros. (* Goal: forall (n : nat) (_ : Prime (S n)) (_ : Divides (S n) (S (S O))), gt (Init.Nat.mul (S n) (S n)) (S (S O)) *) (* Goal: gt (Init.Nat.mul O O) (S (S O)) *) elim H. (* Goal: forall (n : nat) (_ : Prime (S n)) (_ : Divides (S n) (S (S O))), gt (Init.Nat.mul (S n) (S n)) (S (S O)) *) (* Goal: forall (_ : gt O (S O)) (_ : forall (q : nat) (_ : Divides q O), or (@eq nat q (S O)) (@eq nat q O)), gt (Init.Nat.mul O O) (S (S O)) *) intro. (* Goal: forall (n : nat) (_ : Prime (S n)) (_ : Divides (S n) (S (S O))), gt (Init.Nat.mul (S n) (S n)) (S (S O)) *) (* Goal: forall _ : forall (q : nat) (_ : Divides q O), or (@eq nat q (S O)) (@eq nat q O), gt (Init.Nat.mul O O) (S (S O)) *) elim (lt_n_O 1). (* Goal: forall (n : nat) (_ : Prime (S n)) (_ : Divides (S n) (S (S O))), gt (Init.Nat.mul (S n) (S n)) (S (S O)) *) (* Goal: lt (S O) O *) assumption. (* Goal: forall (n : nat) (_ : Prime (S n)) (_ : Divides (S n) (S (S O))), gt (Init.Nat.mul (S n) (S n)) (S (S O)) *) intro q1. (* Goal: forall (_ : Prime (S q1)) (_ : Divides (S q1) (S (S O))), gt (Init.Nat.mul (S q1) (S q1)) (S (S O)) *) case q1. (* Goal: forall (n : nat) (_ : Prime (S (S n))) (_ : Divides (S (S n)) (S (S O))), gt (Init.Nat.mul (S (S n)) (S (S n))) (S (S O)) *) (* Goal: forall (_ : Prime (S O)) (_ : Divides (S O) (S (S O))), gt (Init.Nat.mul (S O) (S O)) (S (S O)) *) intros. (* Goal: forall (n : nat) (_ : Prime (S (S n))) (_ : Divides (S (S n)) (S (S O))), gt (Init.Nat.mul (S (S n)) (S (S n))) (S (S O)) *) (* Goal: gt (Init.Nat.mul (S O) (S O)) (S (S O)) *) elim H. (* Goal: forall (n : nat) (_ : Prime (S (S n))) (_ : Divides (S (S n)) (S (S O))), gt (Init.Nat.mul (S (S n)) (S (S n))) (S (S O)) *) (* Goal: forall (_ : gt (S O) (S O)) (_ : forall (q : nat) (_ : Divides q (S O)), or (@eq nat q (S O)) (@eq nat q (S O))), gt (Init.Nat.mul (S O) (S O)) (S (S O)) *) intro. (* Goal: forall (n : nat) (_ : Prime (S (S n))) (_ : Divides (S (S n)) (S (S O))), gt (Init.Nat.mul (S (S n)) (S (S n))) (S (S O)) *) (* Goal: forall _ : forall (q : nat) (_ : Divides q (S O)), or (@eq nat q (S O)) (@eq nat q (S O)), gt (Init.Nat.mul (S O) (S O)) (S (S O)) *) elim (lt_irrefl 1). (* Goal: forall (n : nat) (_ : Prime (S (S n))) (_ : Divides (S (S n)) (S (S O))), gt (Init.Nat.mul (S (S n)) (S (S n))) (S (S O)) *) (* Goal: lt (S O) (S O) *) assumption. (* Goal: forall (n : nat) (_ : Prime (S (S n))) (_ : Divides (S (S n)) (S (S O))), gt (Init.Nat.mul (S (S n)) (S (S n))) (S (S O)) *) intro q2. (* Goal: forall (_ : Prime (S (S q2))) (_ : Divides (S (S q2)) (S (S O))), gt (Init.Nat.mul (S (S q2)) (S (S q2))) (S (S O)) *) case q2. (* Goal: forall (n : nat) (_ : Prime (S (S (S n)))) (_ : Divides (S (S (S n))) (S (S O))), gt (Init.Nat.mul (S (S (S n))) (S (S (S n)))) (S (S O)) *) (* Goal: forall (_ : Prime (S (S O))) (_ : Divides (S (S O)) (S (S O))), gt (Init.Nat.mul (S (S O)) (S (S O))) (S (S O)) *) simpl in |- *. (* Goal: forall (n : nat) (_ : Prime (S (S (S n)))) (_ : Divides (S (S (S n))) (S (S O))), gt (Init.Nat.mul (S (S (S n))) (S (S (S n)))) (S (S O)) *) (* Goal: forall (_ : Prime (S (S O))) (_ : Divides (S (S O)) (S (S O))), gt (S (S (S (S O)))) (S (S O)) *) intros. (* Goal: forall (n : nat) (_ : Prime (S (S (S n)))) (_ : Divides (S (S (S n))) (S (S O))), gt (Init.Nat.mul (S (S (S n))) (S (S (S n)))) (S (S O)) *) (* Goal: gt (S (S (S (S O)))) (S (S O)) *) auto. (* Goal: forall (n : nat) (_ : Prime (S (S (S n)))) (_ : Divides (S (S (S n))) (S (S O))), gt (Init.Nat.mul (S (S (S n))) (S (S (S n)))) (S (S O)) *) intro q3. (* Goal: forall (_ : Prime (S (S (S q3)))) (_ : Divides (S (S (S q3))) (S (S O))), gt (Init.Nat.mul (S (S (S q3))) (S (S (S q3)))) (S (S O)) *) simpl in |- *. (* Goal: forall (_ : Prime (S (S (S q3)))) (_ : Divides (S (S (S q3))) (S (S O))), gt (S (S (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (Init.Nat.mul q3 (S (S (S q3)))))))))))))))) (S (S O)) *) intros. (* Goal: gt (S (S (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (Init.Nat.mul q3 (S (S (S q3)))))))))))))))) (S (S O)) *) repeat apply gt_n_S. (* Goal: gt (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (S (S (S (Init.Nat.add q3 (Init.Nat.mul q3 (S (S (S q3)))))))))))))) O *) apply gt_Sn_O. Qed. Definition ZPrime (n : Z) : Prop := (n > 1)%Z /\ (forall q : Z, (q >= 0)%Z -> ZDivides q n -> q = 1%Z \/ q = n). Lemma primezprime : forall n : nat, Prime n -> ZPrime (Z_of_nat n). Proof. (* Goal: forall (n : nat) (_ : Prime n), ZPrime (Z.of_nat n) *) unfold Prime, ZPrime in |- *. (* Goal: forall (n : nat) (_ : and (gt n (S O)) (forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n))), and (Z.gt (Z.of_nat n) (Zpos xH)) (forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n))) *) intros. (* Goal: and (Z.gt (Z.of_nat n) (Zpos xH)) (forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n))) *) elim H. (* Goal: forall (_ : gt n (S O)) (_ : forall (q : nat) (_ : Divides q n), or (@eq nat q (S O)) (@eq nat q n)), and (Z.gt (Z.of_nat n) (Zpos xH)) (forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n))) *) intros. (* Goal: and (Z.gt (Z.of_nat n) (Zpos xH)) (forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n))) *) split. (* Goal: forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: Z.gt (Z.of_nat n) (Zpos xH) *) change (Z_of_nat n > Z_of_nat 1)%Z in |- *. (* Goal: forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: Z.gt (Z.of_nat n) (Z.of_nat (S O)) *) apply Znat.inj_gt. (* Goal: forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: gt n (S O) *) assumption. (* Goal: forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q (Z.of_nat n)), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) intros. (* Goal: or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) elim (H1 (Zabs_nat q)). (* Goal: Divides (Z.abs_nat q) n *) (* Goal: forall _ : @eq nat (Z.abs_nat q) n, or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: forall _ : @eq nat (Z.abs_nat q) (S O), or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) left. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: forall _ : @eq nat (Z.abs_nat q) n, or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: @eq Z q (Zpos xH) *) rewrite <- (inj_abs_pos q). (* Goal: Divides (Z.abs_nat q) n *) (* Goal: forall _ : @eq nat (Z.abs_nat q) n, or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: Z.ge q Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat q)) (Zpos xH) *) rewrite H4. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: forall _ : @eq nat (Z.abs_nat q) n, or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: Z.ge q Z0 *) (* Goal: @eq Z (Z.of_nat (S O)) (Zpos xH) *) simpl in |- *. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: forall _ : @eq nat (Z.abs_nat q) n, or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: Z.ge q Z0 *) (* Goal: @eq Z (Zpos xH) (Zpos xH) *) reflexivity. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: forall _ : @eq nat (Z.abs_nat q) n, or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) (* Goal: Z.ge q Z0 *) assumption. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: forall _ : @eq nat (Z.abs_nat q) n, or (@eq Z q (Zpos xH)) (@eq Z q (Z.of_nat n)) *) right. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: @eq Z q (Z.of_nat n) *) rewrite <- (inj_abs_pos q). (* Goal: Divides (Z.abs_nat q) n *) (* Goal: Z.ge q Z0 *) (* Goal: @eq Z (Z.of_nat (Z.abs_nat q)) (Z.of_nat n) *) rewrite H4. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: Z.ge q Z0 *) (* Goal: @eq Z (Z.of_nat n) (Z.of_nat n) *) reflexivity. (* Goal: Divides (Z.abs_nat q) n *) (* Goal: Z.ge q Z0 *) assumption. (* Goal: Divides (Z.abs_nat q) n *) rewrite <- (abs_inj n). (* Goal: Divides (Z.abs_nat q) (Z.abs_nat (Z.of_nat n)) *) apply zdivdiv. (* Goal: ZDivides q (Z.of_nat n) *) assumption. Qed. Lemma zprimeprime : forall n : Z, ZPrime n -> Prime (Zabs_nat n). Proof. (* Goal: forall (n : Z) (_ : ZPrime n), Prime (Z.abs_nat n) *) unfold ZPrime, Prime in |- *. (* Goal: forall (n : Z) (_ : and (Z.gt n (Zpos xH)) (forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q n), or (@eq Z q (Zpos xH)) (@eq Z q n))), and (gt (Z.abs_nat n) (S O)) (forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n))) *) intros. (* Goal: and (gt (Z.abs_nat n) (S O)) (forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n))) *) elim H. (* Goal: forall (_ : Z.gt n (Zpos xH)) (_ : forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q n), or (@eq Z q (Zpos xH)) (@eq Z q n)), and (gt (Z.abs_nat n) (S O)) (forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n))) *) intros. (* Goal: and (gt (Z.abs_nat n) (S O)) (forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n))) *) split. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: gt (Z.abs_nat n) (S O) *) change (Zabs_nat n > Zabs_nat 1) in |- *. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: gt (Z.abs_nat n) (Z.abs_nat (Zpos xH)) *) apply gtzgt. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.le Z0 n *) apply Zle_trans with 1%Z. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.le (Zpos xH) n *) (* Goal: Z.le Z0 (Zpos xH) *) unfold Zle in |- *. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.le (Zpos xH) n *) (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.le (Zpos xH) n *) (* Goal: not (@eq comparison Lt Gt) *) discriminate. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.le (Zpos xH) n *) apply Zlt_le_weak. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.lt (Zpos xH) n *) apply Zgt_lt. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: Z.le Z0 (Zpos xH) *) unfold Zle in |- *. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) (* Goal: not (@eq comparison Lt Gt) *) discriminate. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: Z.gt n (Zpos xH) *) assumption. (* Goal: forall (q : nat) (_ : Divides q (Z.abs_nat n)), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) intros. (* Goal: or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) elim (H1 (Z_of_nat q)). (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: forall _ : @eq Z (Z.of_nat q) (Zpos xH), or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) left. (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: @eq nat q (S O) *) rewrite <- (abs_inj q). (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: @eq nat (Z.abs_nat (Z.of_nat q)) (S O) *) rewrite H3. (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: @eq nat (Z.abs_nat (Zpos xH)) (S O) *) simpl in |- *. (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) (* Goal: @eq nat (Pos.to_nat xH) (S O) *) reflexivity. (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: forall _ : @eq Z (Z.of_nat q) n, or (@eq nat q (S O)) (@eq nat q (Z.abs_nat n)) *) right. (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: @eq nat q (Z.abs_nat n) *) rewrite <- (abs_inj q). (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: @eq nat (Z.abs_nat (Z.of_nat q)) (Z.abs_nat n) *) rewrite H3. (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) (* Goal: @eq nat (Z.abs_nat n) (Z.abs_nat n) *) reflexivity. (* Goal: ZDivides (Z.of_nat q) n *) (* Goal: Z.ge (Z.of_nat q) Z0 *) apply nat_ge_0. (* Goal: ZDivides (Z.of_nat q) n *) apply divzdiv. (* Goal: Divides (Z.abs_nat (Z.of_nat q)) (Z.abs_nat n) *) rewrite abs_inj. (* Goal: Divides q (Z.abs_nat n) *) assumption. Qed. Lemma zprime2 : ZPrime 2. Proof. (* Goal: ZPrime (Zpos (xO xH)) *) change (ZPrime (Z_of_nat 2)) in |- *. (* Goal: ZPrime (Z.of_nat (S (S O))) *) apply primezprime. (* Goal: Prime (S (S O)) *) exact prime2. Qed. Lemma zprime2a : ZPrime 2. Proof. (* Goal: ZPrime (Zpos (xO xH)) *) exact zprime2. Qed. Definition allPrime : natlist -> Prop := alllist nat Prime. Definition allZPrime : Zlist -> Prop := alllist Z ZPrime. Lemma allzprimeallpos : forall l : Zlist, allZPrime l -> allPos l. Proof. (* Goal: forall (l : Zlist) (_ : allZPrime l), allPos l *) unfold allZPrime, allPos in |- *. (* Goal: forall (l : Zlist) (_ : alllist Z ZPrime l), alllist Z (fun x : Z => Z.ge x Z0) l *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist Z (fun x : Z => Z.ge x Z0) l) (_ : alllist Z ZPrime (Cons Z a l)), alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l) *) (* Goal: forall _ : alllist Z ZPrime (Nil Z), alllist Z (fun x : Z => Z.ge x Z0) (Nil Z) *) simpl in |- *. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist Z (fun x : Z => Z.ge x Z0) l) (_ : alllist Z ZPrime (Cons Z a l)), alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l) *) (* Goal: forall _ : True, True *) intro. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist Z (fun x : Z => Z.ge x Z0) l) (_ : alllist Z ZPrime (Cons Z a l)), alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l) *) (* Goal: True *) assumption. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist Z (fun x : Z => Z.ge x Z0) l) (_ : alllist Z ZPrime (Cons Z a l)), alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l) *) simpl in |- *. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist Z (fun x : Z => Z.ge x Z0) l) (_ : and (ZPrime a) (alllist Z ZPrime l)), and (Z.ge a Z0) (alllist Z (fun x : Z => Z.ge x Z0) l) *) intros h t IH H. (* Goal: and (Z.ge h Z0) (alllist Z (fun x : Z => Z.ge x Z0) t) *) elim H. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Z.ge h Z0) (alllist Z (fun x : Z => Z.ge x Z0) t) *) intros. (* Goal: and (Z.ge h Z0) (alllist Z (fun x : Z => Z.ge x Z0) t) *) elim H0. (* Goal: forall (_ : Z.gt h (Zpos xH)) (_ : forall (q : Z) (_ : Z.ge q Z0) (_ : ZDivides q h), or (@eq Z q (Zpos xH)) (@eq Z q h)), and (Z.ge h Z0) (alllist Z (fun x : Z => Z.ge x Z0) t) *) intros. (* Goal: and (Z.ge h Z0) (alllist Z (fun x : Z => Z.ge x Z0) t) *) split. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.ge h Z0 *) apply Zle_ge. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.le Z0 h *) apply Zle_trans with 1%Z. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.le (Zpos xH) h *) (* Goal: Z.le Z0 (Zpos xH) *) unfold Zle in |- *. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.le (Zpos xH) h *) (* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *) simpl in |- *. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.le (Zpos xH) h *) (* Goal: not (@eq comparison Lt Gt) *) discriminate. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.le (Zpos xH) h *) apply Zlt_le_weak. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.lt (Zpos xH) h *) apply Zgt_lt. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) (* Goal: Z.gt h (Zpos xH) *) assumption. (* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *) apply IH. (* Goal: alllist Z ZPrime t *) assumption. Qed. Lemma allprimeallzprime : forall l : natlist, allPrime l -> allZPrime (map _ _ Z_of_nat l). Proof. (* Goal: forall (l : natlist) (_ : allPrime l), allZPrime (map nat Z Z.of_nat l) *) unfold allPrime, allZPrime in |- *. (* Goal: forall (l : natlist) (_ : alllist nat Prime l), alllist Z ZPrime (map nat Z Z.of_nat l) *) simple induction l. (* Goal: forall (a : nat) (l : list nat) (_ : forall _ : alllist nat Prime l, alllist Z ZPrime (map nat Z Z.of_nat l)) (_ : alllist nat Prime (Cons nat a l)), alllist Z ZPrime (map nat Z Z.of_nat (Cons nat a l)) *) (* Goal: forall _ : alllist nat Prime (Nil nat), alllist Z ZPrime (map nat Z Z.of_nat (Nil nat)) *) simpl in |- *. (* Goal: forall (a : nat) (l : list nat) (_ : forall _ : alllist nat Prime l, alllist Z ZPrime (map nat Z Z.of_nat l)) (_ : alllist nat Prime (Cons nat a l)), alllist Z ZPrime (map nat Z Z.of_nat (Cons nat a l)) *) (* Goal: forall _ : True, True *) intro. (* Goal: forall (a : nat) (l : list nat) (_ : forall _ : alllist nat Prime l, alllist Z ZPrime (map nat Z Z.of_nat l)) (_ : alllist nat Prime (Cons nat a l)), alllist Z ZPrime (map nat Z Z.of_nat (Cons nat a l)) *) (* Goal: True *) assumption. (* Goal: forall (a : nat) (l : list nat) (_ : forall _ : alllist nat Prime l, alllist Z ZPrime (map nat Z Z.of_nat l)) (_ : alllist nat Prime (Cons nat a l)), alllist Z ZPrime (map nat Z Z.of_nat (Cons nat a l)) *) simpl in |- *. (* Goal: forall (a : nat) (l : list nat) (_ : forall _ : alllist nat Prime l, alllist Z ZPrime (map nat Z Z.of_nat l)) (_ : and (Prime a) (alllist nat Prime l)), and (ZPrime (Z.of_nat a)) (alllist Z ZPrime (map nat Z Z.of_nat l)) *) intros h t IH H. (* Goal: and (ZPrime (Z.of_nat h)) (alllist Z ZPrime (map nat Z Z.of_nat t)) *) elim H. (* Goal: forall (_ : Prime h) (_ : alllist nat Prime t), and (ZPrime (Z.of_nat h)) (alllist Z ZPrime (map nat Z Z.of_nat t)) *) intros. (* Goal: and (ZPrime (Z.of_nat h)) (alllist Z ZPrime (map nat Z Z.of_nat t)) *) split. (* Goal: alllist Z ZPrime (map nat Z Z.of_nat t) *) (* Goal: ZPrime (Z.of_nat h) *) apply primezprime. (* Goal: alllist Z ZPrime (map nat Z Z.of_nat t) *) (* Goal: Prime h *) assumption. (* Goal: alllist Z ZPrime (map nat Z Z.of_nat t) *) apply IH. (* Goal: alllist nat Prime t *) assumption. Qed. Lemma allzprimeallprime : forall l : Zlist, allZPrime l -> allPrime (map _ _ Zabs_nat l). Proof. (* Goal: forall (l : Zlist) (_ : allZPrime l), allPrime (map Z nat Z.abs_nat l) *) unfold allPrime, allZPrime in |- *. (* Goal: forall (l : Zlist) (_ : alllist Z ZPrime l), alllist nat Prime (map Z nat Z.abs_nat l) *) simple induction l. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) (* Goal: forall _ : alllist Z ZPrime (Nil Z), alllist nat Prime (map Z nat Z.abs_nat (Nil Z)) *) simpl in |- *. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) (* Goal: forall _ : True, True *) intro. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) (* Goal: True *) assumption. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : alllist Z ZPrime (Cons Z a l)), alllist nat Prime (map Z nat Z.abs_nat (Cons Z a l)) *) simpl in |- *. (* Goal: forall (a : Z) (l : list Z) (_ : forall _ : alllist Z ZPrime l, alllist nat Prime (map Z nat Z.abs_nat l)) (_ : and (ZPrime a) (alllist Z ZPrime l)), and (Prime (Z.abs_nat a)) (alllist nat Prime (map Z nat Z.abs_nat l)) *) intros h t IH H. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) elim H. (* Goal: forall (_ : ZPrime h) (_ : alllist Z ZPrime t), and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) intros. (* Goal: and (Prime (Z.abs_nat h)) (alllist nat Prime (map Z nat Z.abs_nat t)) *) split. (* Goal: alllist nat Prime (map Z nat Z.abs_nat t) *) (* Goal: Prime (Z.abs_nat h) *) apply zprimeprime. (* Goal: alllist nat Prime (map Z nat Z.abs_nat t) *) (* Goal: ZPrime h *) assumption. (* Goal: alllist nat Prime (map Z nat Z.abs_nat t) *) apply IH. (* Goal: alllist Z ZPrime t *) assumption. Qed.
Require Export GeoCoq.Elements.OriginalProofs.proposition_42B. Require Export GeoCoq.Elements.OriginalProofs.proposition_44A. Section Euclid. Context `{Ax:area}. Lemma proposition_44 : forall A B D J N R a b c, Triangle a b c -> nCol J D N -> nCol A B R -> exists X Y Z, PG A B X Y /\ CongA A B X J D N /\ EF a b Z c A B X Y /\ Midpoint b Z c /\ TS X A B R. Proof. (* Goal: forall (A B D J N R a b c : @Point Ax0) (_ : @Triangle Ax0 a b c) (_ : @nCol Ax0 J D N) (_ : @nCol Ax0 A B R), @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) intros. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq A B) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol a b c) by (conclude_def Triangle ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq b c) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) let Tf:=fresh in assert (Tf:exists m, (BetS b m c /\ Cong m b m c)) by (conclude proposition_10);destruct Tf as [m];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Cong b m m c) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Midpoint b m c) by (conclude_def Midpoint ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq m c) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) let Tf:=fresh in assert (Tf:exists E, (BetS A B E /\ Cong B E m c)) by (conclude lemma_extension);destruct Tf as [E];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq B E) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col A B E) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col B A E) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col B A B) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol B A R) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol B E R) by (conclude lemma_NChelper). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) let Tf:=fresh in assert (Tf:exists g e, (Out B E e /\ CongA g B e J D N /\ OS g R B E)) by (conclude proposition_23C);destruct Tf as [g[e]];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) let Tf:=fresh in assert (Tf:exists P, (BetS B A P /\ Cong A P B A)) by (conclude lemma_extension);destruct Tf as [P];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq B E) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq E B) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq b m) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) let Tf:=fresh in assert (Tf:exists Q, (BetS E B Q /\ Cong B Q b m)) by (conclude lemma_extension);destruct Tf as [Q];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Cong b m m c) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Cong B Q m c) by (conclude lemma_congruencetransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Cong m c B E) by (conclude lemma_congruencesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Cong B Q B E) by (conclude lemma_congruencetransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (BetS Q B E) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Cong Q B B E) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Midpoint Q B E) by (conclude_def Midpoint ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol B A R) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col A B E) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col B A E) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (neq B E) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol B E R) by (conclude lemma_NChelper). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol R B E) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) let Tf:=fresh in assert (Tf:exists G F, (PG G B E F /\ EF a b m c G B E F /\ CongA E B G J D N /\ OS R G B E)) by (conclude proposition_42B);destruct Tf as [G[F]];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (PG B E F G) by (conclude lemma_PGrotate). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) let Tf:=fresh in assert (Tf:exists M L, (PG A B M L /\ CongA A B M J D N /\ EF B E F G L M B A /\ BetS G B M)) by (conclude proposition_44A);destruct Tf as [M[L]];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col A B B) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Par G B E F) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol G B E) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol E B G) by (forward_using lemma_NCorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col E B A) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col E B B) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (nCol A B G) by (conclude lemma_NChelper). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (TS G A B M) by (conclude_def TS ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (EF a b m c B E F G) by (forward_using axiom_EFpermutation). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (EF a b m c L M B A) by (conclude axiom_EFtransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (EF a b m c A B M L) by (forward_using axiom_EFpermutation). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (Col B E A) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (OS R G B A) by (conclude lemma_samesidecollinear). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (OS R G A B) by (conclude lemma_samesideflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (TS R A B M) by (conclude lemma_planeseparation). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) assert (TS M A B R) by (conclude lemma_oppositesidesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@PG Ax0 A B X Y) (and (@CongA Ax0 A B X J D N) (and (@EF Ax0 Ax1 Ax2 Ax a b Z c A B X Y) (and (@Midpoint Ax0 b Z c) (@TS Ax0 X A B R))))))) *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinear4. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_twolines2 : forall A B C D P Q, neq A B -> neq C D -> Col P A B -> Col P C D -> Col Q A B -> Col Q C D -> ~ (Col A C D /\ Col B C D) -> eq P Q. Proof. (* Goal: forall (A B C D P Q : @Point Ax) (_ : @neq Ax A B) (_ : @neq Ax C D) (_ : @Col Ax P A B) (_ : @Col Ax P C D) (_ : @Col Ax Q A B) (_ : @Col Ax Q C D) (_ : not (and (@Col Ax A C D) (@Col Ax B C D))), @eq Ax P Q *) intros. (* Goal: @eq Ax P Q *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @eq Ax P Q *) assert (neq D C) by (conclude lemma_inequalitysymmetric). (* Goal: @eq Ax P Q *) assert (~ neq P Q). (* Goal: @eq Ax P Q *) (* Goal: not (@neq Ax P Q) *) { (* Goal: not (@neq Ax P Q) *) intro. (* Goal: False *) assert (Col D C P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D C Q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col C P Q) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A B Q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B P Q) by (conclude lemma_collinear4). (* Goal: False *) assert (Col P Q B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col P Q C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col Q C B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col Q C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (~ eq Q C). (* Goal: False *) (* Goal: not (@eq Ax Q C) *) { (* Goal: not (@eq Ax Q C) *) intro. (* Goal: False *) assert (Col C P D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col Q P B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B A Q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B A P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A Q P) by (conclude lemma_collinear4). (* Goal: False *) assert (Col Q P A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col C P B) by (conclude cn_equalitysub). (* Goal: False *) assert (Col C P A) by (conclude cn_equalitysub). (* Goal: False *) assert (Col P C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col P C B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col P C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (~ eq P C). (* Goal: False *) (* Goal: not (@eq Ax P C) *) { (* Goal: not (@eq Ax P C) *) intro. (* Goal: False *) assert (eq P Q) by (conclude cn_equalitysub). (* Goal: False *) contradict. (* BG Goal: @eq Ax P Q *) (* BG Goal: False *) (* BG Goal: False *) } (* Goal: False *) assert (Col C D A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col C D B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B C D) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @eq Ax P Q *) (* BG Goal: False *) } (* Goal: False *) assert (Col C B D) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (~ eq B A). (* Goal: False *) (* Goal: not (@eq Ax B A) *) { (* Goal: not (@eq Ax B A) *) intro. (* Goal: False *) assert (eq A B) by (conclude lemma_equalitysymmetric). (* Goal: False *) contradict. (* BG Goal: @eq Ax P Q *) (* BG Goal: False *) } (* Goal: False *) assert (Col B A P) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B A Q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A P Q) by (conclude lemma_collinear4). (* Goal: False *) assert (Col P Q A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col P Q C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col Q C A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col Q C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col C A D) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A C D) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @eq Ax P Q *) } (* Goal: @eq Ax P Q *) close. Qed. End Euclid.
Require Import Arith List. Require Import BellantoniCook.Lib BellantoniCook.Cobham. Definition Zero_e (n:nat) : Cobham := Comp n Zero nil. Lemma arity_Zero n : arity (Zero_e n) = ok_arity n. Proof. (* Goal: @eq Arity (arity (Zero_e n)) (ok_arity n) *) trivial. Qed. Lemma rec_bounded_Zero n : rec_bounded (Zero_e n). Proof. (* Goal: rec_bounded (Zero_e n) *) simpl; tauto. Qed. Definition One_e (n:nat) : Cobham := Comp n (Comp 0 (Succ true) [Zero]) nil. Lemma arity_One n : arity (One_e n) = ok_arity n. Proof. (* Goal: @eq Arity (arity (One_e n)) (ok_arity n) *) trivial. Qed. Lemma rec_bounded_One n : rec_bounded (One_e n). Proof. (* Goal: rec_bounded (One_e n) *) simpl; tauto. Qed. Definition App_e : Cobham := Rec (Proj 1 0) (Comp 3 (Succ false) [Proj 3 1]) (Comp 3 (Succ true) [Proj 3 1]) (Comp 2 Smash [Comp 2 (Succ true) [Proj 2 0]; Comp 2 (Succ true) [Proj 2 1] ]). Lemma arity_App : arity App_e = ok_arity 2. Proof. (* Goal: @eq Arity (arity App_e) (ok_arity (S (S O))) *) trivial. Qed. Lemma rec_bounded_App : rec_bounded App_e. Proof. (* Goal: rec_bounded App_e *) simpl. (* Goal: and (and True (and (and True (and True True)) (and (and True (and True True)) True))) (and True (and (and True (and True True)) (and (and True (and True True)) (forall l : list (list bool), le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (@length bool (smash' (@nth (list bool) (S O) l (@nil bool)) (smash_bs (@nth (list bool) O l (@nil bool)) (@cons bool true (@nth (list bool) (S O) l (@nil bool))))))))))) *) intuition. (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (@length bool (smash' (@nth (list bool) (S O) l (@nil bool)) (smash_bs (@nth (list bool) O l (@nil bool)) (@cons bool true (@nth (list bool) (S O) l (@nil bool))))))) *) destruct l as [ | u [ | v l] ]; simpl. (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *) (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (S (@length bool (smash_bs u (@cons bool true (@nil bool))))) *) (* Goal: le O (S (S O)) *) omega. (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *) (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (S (@length bool (smash_bs u (@cons bool true (@nil bool))))) *) rewrite length_smash, mult_1_r; simpl. (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *) (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (S (S (@length bool u))) *) induction u as [ | [ | ] u IH]; simpl; omega. (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *) rewrite length_smash', length_smash; simpl. (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (Init.Nat.add (@length bool v) (S (Init.Nat.mul (@length bool u) (S (@length bool v)))))) *) induction u as [ | [ | ] u IH]; simpl; omega. Qed. Lemma App_correct : forall l, Sem App_e l = hd nil l ++ hd nil (tl l). Proof. (* Goal: forall l : list (list bool), @eq (list bool) (Sem App_e l) (@app bool (@hd (list bool) (@nil bool) l) (@hd (list bool) (@nil bool) (@tl (list bool) l))) *) intros; simpl. (* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l)) (@app bool (@hd (list bool) (@nil bool) l) (@hd (list bool) (@nil bool) (@tl (list bool) l))) *) destruct l; simpl; trivial. (* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) l l0) (@app bool l (@hd (list bool) (@nil bool) l0)) *) induction l; simpl. (* Goal: @eq (list bool) (if a then @cons bool true (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) l l0) else @cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) l l0)) (@cons bool a (@app bool l (@hd (list bool) (@nil bool) l0))) *) (* Goal: @eq (list bool) (@nth (list bool) O l0 (@nil bool)) (@hd (list bool) (@nil bool) l0) *) destruct l0; simpl; trivial. (* Goal: @eq (list bool) (if a then @cons bool true (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) l l0) else @cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) l l0)) (@cons bool a (@app bool l (@hd (list bool) (@nil bool) l0))) *) rewrite IHl; case a; trivial. Qed. Opaque App_e. Definition Rev_e : Cobham := Rec Zero (Comp 2 App_e [Proj 2 1; Comp 2 (Succ false) [Zero_e 2]]) (Comp 2 App_e [Proj 2 1; Comp 2 (Succ true) [Zero_e 2]]) (Proj 1 0). Lemma arity_Rev : arity Rev_e = ok_arity 1. Proof. (* Goal: @eq Arity (arity Rev_e) (ok_arity (S O)) *) trivial. Qed. Lemma rec_bounded_Rev : rec_bounded Rev_e. Proof. (* Goal: rec_bounded Rev_e *) simpl. (* Goal: and True (and True (and (and (rec_bounded App_e) (and True (and (and True (and (and True True) True)) True))) (and (and (rec_bounded App_e) (and True (and (and True (and (and True True) True)) True))) (forall l : list (list bool), le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))))))) *) intuition. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))) *) (* Goal: rec_bounded App_e *) (* Goal: rec_bounded App_e *) apply rec_bounded_App. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))) *) (* Goal: rec_bounded App_e *) apply rec_bounded_App. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))) *) destruct l as [ | v l]. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (@nth (list bool) O (@nil (list bool)) (@nil bool))) *) trivial. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *) simpl. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l)) (@length bool v) *) induction v as [ | [ | ] v IH]. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool true v) l)) (@length bool (@cons bool true v)) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@nil bool) l)) (@length bool (@nil bool)) *) trivial. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool true v) l)) (@length bool (@cons bool true v)) *) simpl. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (@length bool (Sem App_e (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool)))))) (S (@length bool v)) *) rewrite App_correct. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (@length bool (@app bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool)))))))) (S (@length bool v)) *) simpl. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (@length bool (@app bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons bool true (@nil bool)))) (S (@length bool v)) *) rewrite app_length. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (Init.Nat.add (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l)) (@length bool (@cons bool true (@nil bool)))) (S (@length bool v)) *) simpl; omega. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) simpl. (* Goal: le (@length bool (Sem App_e (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool)))))) (S (@length bool v)) *) rewrite App_correct. (* Goal: le (@length bool (@app bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool)))))))) (S (@length bool v)) *) simpl. (* Goal: le (@length bool (@app bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons bool false (@nil bool)))) (S (@length bool v)) *) rewrite app_length. (* Goal: le (Init.Nat.add (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l)) (@length bool (@cons bool false (@nil bool)))) (S (@length bool v)) *) simpl; omega. Qed. Lemma Rev_correct l : Sem Rev_e l = List.rev (hd nil l). Proof. (* Goal: @eq (list bool) (Sem Rev_e l) (@rev bool (@hd (list bool) (@nil bool) l)) *) destruct l as [ | v l]. (* Goal: @eq (list bool) (Sem Rev_e (@cons (list bool) v l)) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) *) (* Goal: @eq (list bool) (Sem Rev_e (@nil (list bool))) (@rev bool (@hd (list bool) (@nil bool) (@nil (list bool)))) *) trivial. (* Goal: @eq (list bool) (Sem Rev_e (@cons (list bool) v l)) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) *) simpl. (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@rev bool v) *) induction v as [ | [ | ] v IH]. (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l) (@rev bool (@cons bool false v)) *) (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool true v) l) (@rev bool (@cons bool true v)) *) (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@nil bool) l) (@rev bool (@nil bool)) *) trivial. (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l) (@rev bool (@cons bool false v)) *) (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool true v) l) (@rev bool (@cons bool true v)) *) simpl. (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l) (@rev bool (@cons bool false v)) *) (* Goal: @eq (list bool) (Sem App_e (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@app bool (@rev bool v) (@cons bool true (@nil bool))) *) rewrite App_correct. (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l) (@rev bool (@cons bool false v)) *) (* Goal: @eq (list bool) (@app bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))))) (@app bool (@rev bool v) (@cons bool true (@nil bool))) *) simpl; congruence. (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@cons bool false v) l) (@rev bool (@cons bool false v)) *) simpl. (* Goal: @eq (list bool) (Sem App_e (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (@app bool (@rev bool v) (@cons bool false (@nil bool))) *) rewrite App_correct. (* Goal: @eq (list bool) (@app bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (fun vl : list (list bool) => Sem App_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) v l) (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))))) (@app bool (@rev bool v) (@cons bool false (@nil bool))) *) simpl; congruence. Qed. Definition RemoveLSZ_e : Cobham := Rec Zero (Proj 2 1) (Comp 2 (Succ true) [Proj 2 0]) (Proj 1 0). Lemma arity_RemoveLSZ : arity RemoveLSZ_e = ok_arity 1. Proof. (* Goal: @eq Arity (arity RemoveLSZ_e) (ok_arity (S O)) *) trivial. Qed. Lemma rec_bounded_RemoveLSZ : rec_bounded RemoveLSZ_e. Proof. (* Goal: rec_bounded RemoveLSZ_e *) simpl. (* Goal: and True (and True (and True (and (and True (and True True)) (forall l : list (list bool), le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))))))) *) intuition. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))) *) destruct l as [ | v l]. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (@nth (list bool) O (@nil (list bool)) (@nil bool))) *) trivial. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *) simpl. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) v l)) (@length bool v) *) induction v as [ | [ | ] v IH]. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@cons bool true v) l)) (@length bool (@cons bool true v)) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@nil bool) l)) (@length bool (@nil bool)) *) trivial. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@cons bool true v) l)) (@length bool (@cons bool true v)) *) trivial. (* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *) simpl; omega. Qed. Lemma RemoveLSZ_app u v l : Sem RemoveLSZ_e ((u++v)::l) = match Sem RemoveLSZ_e (u::l) with | nil => Sem RemoveLSZ_e (v::l) | u' => u'++v end. Proof. (* Goal: @eq (list bool) (Sem RemoveLSZ_e (@cons (list bool) (@app bool u v) l)) match Sem RemoveLSZ_e (@cons (list bool) u l) with | nil => Sem RemoveLSZ_e (@cons (list bool) v l) | cons b l => @app bool (@cons bool b l) v end *) simpl. (* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@app bool u v) l) match sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) u l with | nil => sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) (S O) vl (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) v l | cons b l => @cons bool b (@app bool l v) end *) induction u as [ | [ | ] u IH]; trivial. Qed. Definition Cond : Cobham := Rec (Proj 3 0) (Proj 5 4) (Proj 5 3) ( Comp 4 Smash [ Comp 4 (Succ true) [Proj 4 1]; Comp 4 Smash [ Comp 4 (Succ true) [Proj 4 2]; Comp 4 (Succ true) [Proj 4 3] ] ] ). Lemma arity_Cond : arity Cond = ok_arity 4. Proof. (* Goal: @eq Arity (arity Cond) (ok_arity (S (S (S (S O))))) *) trivial. Qed. Lemma rec_bounded_Cond : rec_bounded' Cond. Proof. (* Goal: rec_bounded' Cond *) simpl; repeat (split; auto); intros. (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (@length bool (smash' (smash' (@nth (list bool) (S (S (S O))) l (@nil bool)) (smash_bs (@nth (list bool) (S (S O)) l (@nil bool)) (@cons bool true (@nth (list bool) (S (S (S O))) l (@nil bool))))) (smash_bs (@nth (list bool) (S O) l (@nil bool)) (@cons bool false (smash' (@nth (list bool) (S (S (S O))) l (@nil bool)) (smash_bs (@nth (list bool) (S (S O)) l (@nil bool)) (@cons bool true (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))) *) repeat (rewrite length_smash'; simpl). (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (@length bool (smash_bs (@nth (list bool) (S (S O)) l (@nil bool)) (@cons bool true (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (@length bool (smash_bs (@nth (list bool) (S O) l (@nil bool)) (@cons bool false (smash' (@nth (list bool) (S (S (S O))) l (@nil bool)) (smash_bs (@nth (list bool) (S (S O)) l (@nil bool)) (@cons bool true (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))) *) repeat (rewrite length_smash; simpl). (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (@length bool (smash' (@nth (list bool) (S (S (S O))) l (@nil bool)) (smash_bs (@nth (list bool) (S (S O)) l (@nil bool)) (@cons bool true (@nth (list bool) (S (S (S O))) l (@nil bool))))))))))) *) repeat (rewrite length_smash'; simpl). (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (@length bool (smash_bs (@nth (list bool) (S (S O)) l (@nil bool)) (@cons bool true (@nth (list bool) (S (S (S O))) l (@nil bool))))))))))) *) repeat (rewrite length_smash; simpl). (* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) destruct (hd nil l); simpl; repeat rewrite nth_S_tl. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) rewrite plus_n_Sm. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (@length bool (@nth (list bool) (S O) l (@nil bool))) (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) rewrite plus_comm. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (@length bool (@nth (list bool) (S O) l (@nil bool))) (Nat.add (S (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))))))) (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))) *) apply le_plus_trans. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))))))) *) apply le_trans with ( S (S (length (nth 1 l nil)) * 1)). (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S O) l (@nil bool)))) (S O))) (S (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))))))) *) (* Goal: le (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S O) l (@nil bool)))) (S O))) *) omega. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S O) l (@nil bool)))) (S O))) (S (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))))))) *) apply le_n_S. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (@nth (list bool) (S O) l (@nil bool)))) (S O)) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))) *) apply le_n_S. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le ((fix mul (n m : nat) {struct n} : nat := match n with | O => O | S p => Init.Nat.add m (mul p m) end) (@length bool (@nth (list bool) (S O) l (@nil bool))) (S O)) (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))))) *) apply mult_le_compat. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (S O) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))) *) (* Goal: le (@length bool (@nth (list bool) (S O) l (@nil bool))) (@length bool (@nth (list bool) (S O) l (@nil bool))) *) trivial. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (S O) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))) *) apply le_n_S. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le O (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) *) auto with arith. (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) apply le_trans with ( S (length (if b then nth 2 l nil else nth 3 l nil)) * 1). (* Goal: le (Init.Nat.mul (S (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool))) (Init.Nat.mul (S (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) *) rewrite mult_1_r; auto with arith. (* Goal: le (Init.Nat.mul (S (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) apply le_trans with (S (S (length (nth 2 l nil)) * S (length (nth 3 l nil)))). (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (if b then @nth (list bool) (S (S O)) l (@nil bool) else @nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) case b. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S O)) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) rewrite mult_1_r. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) (* Goal: le (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) apply le_n_S. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) (* Goal: le (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))) *) rewrite <- mult_1_r at 1. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) (* Goal: le (Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S O)) (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))) *) apply mult_le_compat; auto with arith. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))) (S O)) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) rewrite mult_1_r. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))) (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) *) apply le_n_S. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))) *) rewrite <- mult_1_l at 1. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) (* Goal: le (Nat.mul (S O) (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))) (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))) *) apply mult_le_compat; auto with arith. (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S O) l (@nil bool))) (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) set (R1 := length (nth 1 l nil)). (* Goal: le (S (Init.Nat.mul (S (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul R1 (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) set (R2 := length (nth 2 l nil)). (* Goal: le (S (Init.Nat.mul (S R2) (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))) (S (Init.Nat.add (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul R2 (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))))))) (S (Init.Nat.mul R1 (S (Init.Nat.add (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool))) (S (Init.Nat.mul R2 (S (@length bool (@nth (list bool) (S (S (S O))) l (@nil bool)))))))))))) *) set (R3 := length (nth 3 l nil)). (* Goal: le (S (Init.Nat.mul (S R2) (S R3))) (S (Init.Nat.add (Init.Nat.add R3 (S (Init.Nat.mul R2 (S R3)))) (S (Init.Nat.mul R1 (S (Init.Nat.add R3 (S (Init.Nat.mul R2 (S R3))))))))) *) set (R4 := length (nth 4 l nil)). (* Goal: le (S (Init.Nat.mul (S R2) (S R3))) (S (Init.Nat.add (Init.Nat.add R3 (S (Init.Nat.mul R2 (S R3)))) (S (Init.Nat.mul R1 (S (Init.Nat.add R3 (S (Init.Nat.mul R2 (S R3))))))))) *) ring_simplify. (* Goal: le (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul R2 R3) R2) R3) (S (S O))) (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul (Init.Nat.mul R2 R3) R1) (Init.Nat.mul R2 R3)) (Init.Nat.mul R2 R1)) R2) (Init.Nat.mul R3 R1)) R3) (Init.Nat.mul (S (S O)) R1)) (S (S (S O)))) *) cutrewrite (R2 * R3 * R1 + R2 * R3 + R2 * R1 + R2 + R3 * R1 + R3 + 2 * R1 + 3 = (R2 * R3 + R2 + R3 + 2) + (R2 * R3 * R1 + R2 * R1 + R3 * R1 + 2 * R1 + 1)). (* Goal: @eq nat (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul (Init.Nat.mul R2 R3) R1) (Init.Nat.mul R2 R3)) (Init.Nat.mul R2 R1)) R2) (Init.Nat.mul R3 R1)) R3) (Init.Nat.mul (S (S O)) R1)) (S (S (S O)))) (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul R2 R3) R2) R3) (S (S O))) (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul (Init.Nat.mul R2 R3) R1) (Init.Nat.mul R2 R1)) (Init.Nat.mul R3 R1)) (Init.Nat.mul (S (S O)) R1)) (S O))) *) (* Goal: le (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul R2 R3) R2) R3) (S (S O))) (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul R2 R3) R2) R3) (S (S O))) (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul (Init.Nat.mul R2 R3) R1) (Init.Nat.mul R2 R1)) (Init.Nat.mul R3 R1)) (Init.Nat.mul (S (S O)) R1)) (S O))) *) auto with arith. (* Goal: @eq nat (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul (Init.Nat.mul R2 R3) R1) (Init.Nat.mul R2 R3)) (Init.Nat.mul R2 R1)) R2) (Init.Nat.mul R3 R1)) R3) (Init.Nat.mul (S (S O)) R1)) (S (S (S O)))) (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul R2 R3) R2) R3) (S (S O))) (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.add (Init.Nat.mul (Init.Nat.mul R2 R3) R1) (Init.Nat.mul R2 R1)) (Init.Nat.mul R3 R1)) (Init.Nat.mul (S (S O)) R1)) (S O))) *) ring. Qed. Lemma Cond_correct : forall l, Sem Cond l = match hd nil l with | nil => hd nil (tl l) | true::_ => hd nil (tl (tl l)) | false::_ => hd nil (tl (tl (tl l))) end. Proof. (* Goal: forall l : list (list bool), @eq (list bool) (Sem Cond l) match @hd (list bool) (@nil bool) l with | nil => @hd (list bool) (@nil bool) (@tl (list bool) l) | cons (true as b) l0 => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) l)) | cons (false as b) l0 => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@tl (list bool) l))) end *) destruct l as [ | [ | [ | ] v1] [ | v2 [ | v3 [ | v4 l] ] ] ]; trivial. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearparallel2. Require Export GeoCoq.Elements.OriginalProofs.proposition_33. Require Export GeoCoq.Elements.OriginalProofs.proposition_35. Require Export GeoCoq.Elements.OriginalProofs.lemma_PGsymmetric. Section Euclid. Context `{Ax:area}. Lemma proposition_36A : forall A B C D E F G H M, PG A B C D -> PG E F G H -> Col A D E -> Col A D H -> Col B C F -> Col B C G -> Cong B C F G -> BetS B M H -> BetS C M E -> EF A B C D E F G H. Proof. (* Goal: forall (A B C D E F G H M : @Point Ax0) (_ : @PG Ax0 A B C D) (_ : @PG Ax0 E F G H) (_ : @Col Ax0 A D E) (_ : @Col Ax0 A D H) (_ : @Col Ax0 B C F) (_ : @Col Ax0 B C G) (_ : @Cong Ax0 B C F G) (_ : @BetS Ax0 B M H) (_ : @BetS Ax0 C M E), @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) intros. (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert ((Par A B C D /\ Par A D B C)) by (conclude_def PG ). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert ((Par E F G H /\ Par E H F G)) by (conclude_def PG ). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (nCol A C D) by (forward_using lemma_parallelNC). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (neq A D) by (forward_using lemma_NCdistinct). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Cong A D B C) by (forward_using proposition_34). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Cong E H F G) by (forward_using proposition_34). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Cong F G E H) by (conclude lemma_congruencesymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Cong B C E H) by (conclude lemma_congruencetransitive). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Par B C A D) by (conclude lemma_parallelsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (nCol A B C) by (forward_using lemma_parallelNC). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (neq E H) by (conclude axiom_nocollapse). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Par B C E H) by (conclude lemma_collinearparallel2). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert ((Par B E C H /\ Cong B E C H)) by (conclude proposition_33). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Par E B C H) by (forward_using lemma_parallelflip). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Par E H B C) by (conclude lemma_parallelsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (PG E B C H) by (conclude_def PG ). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (EF A B C D E B C H) by (conclude proposition_35). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Cong F G B C) by (conclude lemma_congruencesymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Cong G F C B) by (forward_using lemma_congruenceflip). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (PG C H E B) by (conclude lemma_PGsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (nCol A B C) by (forward_using lemma_parallelNC). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (neq C B) by (conclude lemma_inequalitysymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Col C F G) by (conclude lemma_collinear4). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Col G F C) by (forward_using lemma_collinearorder). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Col C B F) by (forward_using lemma_collinearorder). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Col C B G) by (forward_using lemma_collinearorder). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Col B F G) by (conclude lemma_collinear4). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (Col G F B) by (forward_using lemma_collinearorder). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (PG G H E F) by (conclude lemma_PGsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (EF G H E F C H E B) by (conclude proposition_35). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (EF G H E F E B C H) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (EF E B C H G H E F) by (conclude axiom_EFsymmetric). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (EF A B C D G H E F) by (conclude axiom_EFtransitive). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) assert (EF A B C D E F G H) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax1 Ax2 Ax A B C D E F G H *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_3_7a. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_3_7b : forall A B C D, BetS A B C -> BetS B C D -> BetS A B D. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @BetS Ax0 A B C) (_ : @BetS Ax0 B C D), @BetS Ax0 A B D *) intros. (* Goal: @BetS Ax0 A B D *) assert (BetS C B A) by (conclude axiom_betweennesssymmetry). (* Goal: @BetS Ax0 A B D *) assert (BetS D C B) by (conclude axiom_betweennesssymmetry). (* Goal: @BetS Ax0 A B D *) assert (BetS D B A) by (conclude lemma_3_7a). (* Goal: @BetS Ax0 A B D *) assert (BetS A B D) by (conclude axiom_betweennesssymmetry). (* Goal: @BetS Ax0 A B D *) close. Qed. End Euclid.
Require Export Qpositive. Fixpoint Qpositive_le_bool (w w' : Qpositive) {struct w'} : bool := match w with | One => match w' with | dL y => false | _ => true end | dL y => match w' with | dL y' => Qpositive_le_bool y y' | _ => true end | nR y => match w' with | nR y' => Qpositive_le_bool y y' | _ => false end end. Definition Qpositive_le (w w' : Qpositive) := Qpositive_le_bool w w' = true. Definition Qpositive_le' (w w' : Qpositive) := match Qpositive_i w, Qpositive_i w' with | (p, q), (p', q') => p * q' <= p' * q end. Theorem Qpositive_le_to_Qpositive_le' : forall w w' : Qpositive, Qpositive_le w w' -> Qpositive_le' w w'. Theorem Qpositive_le'_to_Qpositive_le : forall w w' : Qpositive, Qpositive_le' w w' -> Qpositive_le w w'. Proof. (* Goal: forall (w w' : Qpositive) (_ : Qpositive_le' w w'), Qpositive_le w w' *) intros w w'; generalize w; elim w'; clear w w'. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (nR q)), Qpositive_le w (nR q) *) intros w'1 Hrec w; case w; clear w. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (nR q) (nR w'1)), Qpositive_le (nR q) (nR w'1) *) intros w; unfold Qpositive_le', Qpositive_le in |- *; simpl in |- *. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: forall _ : let (p, q) := let (p, q) := Qpositive_i w in @pair nat nat (Init.Nat.add p q) q in let (p', q') := let (p0, q0) := Qpositive_i w'1 in @pair nat nat (Init.Nat.add p0 q0) q0 in le (Init.Nat.mul p q') (Init.Nat.mul p' q), @eq bool (Qpositive_le_bool w w'1) true *) generalize (Hrec w); clear Hrec; unfold Qpositive_le, Qpositive_le' in |- *; simpl in |- *. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: forall (_ : forall _ : let (p, q) := Qpositive_i w in let (p', q') := Qpositive_i w'1 in le (Init.Nat.mul p q') (Init.Nat.mul p' q), @eq bool (Qpositive_le_bool w w'1) true) (_ : let (p, q) := let (p, q) := Qpositive_i w in @pair nat nat (Init.Nat.add p q) q in let (p', q') := let (p0, q0) := Qpositive_i w'1 in @pair nat nat (Init.Nat.add p0 q0) q0 in le (Init.Nat.mul p q') (Init.Nat.mul p' q)), @eq bool (Qpositive_le_bool w w'1) true *) elim (interp_non_zero w); intros p Hex; elim Hex; intros q Heq; clear Hex; rewrite Heq. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: forall (_ : forall _ : let (p', q') := Qpositive_i w'1 in le (Init.Nat.mul (S p) q') (Init.Nat.mul p' (S q)), @eq bool (Qpositive_le_bool w w'1) true) (_ : let (p', q') := let (p, q) := Qpositive_i w'1 in @pair nat nat (Init.Nat.add p q) q in le (Init.Nat.mul (Init.Nat.add (S p) (S q)) q') (Init.Nat.mul p' (S q))), @eq bool (Qpositive_le_bool w w'1) true *) elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1; clear Hex; rewrite Heq1. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: forall (_ : forall _ : le (Init.Nat.mul (S p) (S q')) (Init.Nat.mul (S p') (S q)), @eq bool (Qpositive_le_bool w w'1) true) (_ : le (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S q')) (Init.Nat.mul (Init.Nat.add (S p') (S q')) (S q))), @eq bool (Qpositive_le_bool w w'1) true *) intros H H1; (lapply H; [ intros H0; try exact H0 | idtac ]). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: le (Init.Nat.mul (S p) (S q')) (Init.Nat.mul (S p') (S q)) *) apply (fun p n m : nat => plus_le_reg_l n m p) with (S q * S q'). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: le (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p) (S q'))) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p') (S q))) *) replace (S q * S q' + S p * S q') with ((S p + S q) * S q'). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S q')) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p) (S q'))) *) (* Goal: le (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S q')) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p') (S q))) *) replace (S q * S q' + S p' * S q) with ((S p' + S q') * S q). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S q')) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p) (S q'))) *) (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (S p') (S q')) (S q)) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p') (S q))) *) (* Goal: le (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S q')) (Init.Nat.mul (Init.Nat.add (S p') (S q')) (S q)) *) auto. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S q')) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p) (S q'))) *) (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (S p') (S q')) (S q)) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p') (S q))) *) ring. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S q')) (Init.Nat.add (Init.Nat.mul (S q) (S q')) (Init.Nat.mul (S p) (S q'))) *) ring. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (nR w'1)), Qpositive_le (dL q) (nR w'1) *) unfold Qpositive_le in |- *; simpl in |- *; auto. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), Qpositive_le One (nR w'1) *) unfold Qpositive_le in |- *; simpl in |- *. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) (* Goal: forall _ : Qpositive_le' One (nR w'1), @eq bool true true *) auto. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall (q : Qpositive) (_ : forall (w : Qpositive) (_ : Qpositive_le' w q), Qpositive_le w q) (w : Qpositive) (_ : Qpositive_le' w (dL q)), Qpositive_le w (dL q) *) intros w'1 Hrec w; case w; clear w; unfold Qpositive_le in |- *; simpl in |- *; auto. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (nR q) (dL w'1)), @eq bool false true *) intros w1; unfold Qpositive_le' in |- *; simpl in |- *. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : let (p, q) := let (p, q) := Qpositive_i w1 in @pair nat nat (Init.Nat.add p q) q in let (p', q') := let (p0, q0) := Qpositive_i w'1 in @pair nat nat p0 (Init.Nat.add p0 q0) in le (Init.Nat.mul p q') (Init.Nat.mul p' q), @eq bool false true *) elim (interp_non_zero w1); intros p Hex; elim Hex; intros q Heq; clear Hex; rewrite Heq. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : let (p', q') := let (p, q) := Qpositive_i w'1 in @pair nat nat p (Init.Nat.add p q) in le (Init.Nat.mul (Init.Nat.add (S p) (S q)) q') (Init.Nat.mul p' (S q)), @eq bool false true *) elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1; clear Hex; rewrite Heq1. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : le (Init.Nat.mul (Init.Nat.add (S p) (S q)) (Init.Nat.add (S p') (S q'))) (Init.Nat.mul (S p') (S q)), @eq bool false true *) rewrite mult_plus_distr_r. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : le (Nat.add (Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Nat.mul (S q) (Init.Nat.add (S p') (S q')))) (Init.Nat.mul (S p') (S q)), @eq bool false true *) repeat rewrite <- (mult_comm (S p' + S q')). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : le (Nat.add (Nat.mul (Init.Nat.add (S p') (S q')) (S p)) (Nat.mul (Init.Nat.add (S p') (S q')) (S q))) (Init.Nat.mul (S p') (S q)), @eq bool false true *) repeat rewrite mult_plus_distr_r. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : le (Nat.add (Nat.add (Nat.mul (S p') (S p)) (Nat.mul (S q') (S p))) (Nat.add (Nat.mul (S p') (S q)) (Nat.mul (S q') (S q)))) (Init.Nat.mul (S p') (S q)), @eq bool false true *) repeat rewrite <- (plus_comm (S p' * S q)) || rewrite plus_assoc; repeat rewrite <- plus_assoc. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : le (Nat.add (Init.Nat.mul (S p') (S q)) (Nat.add (Nat.mul (S p') (S p)) (Nat.add (Nat.mul (S q') (S p)) (Nat.mul (S q') (S q))))) (Init.Nat.mul (S p') (S q)), @eq bool false true *) pattern (S p' * S q) at 2 in |- *; rewrite plus_n_O. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) (* Goal: forall _ : le (Nat.add (Init.Nat.mul (S p') (S q)) (Nat.add (Nat.mul (S p') (S p)) (Nat.add (Nat.mul (S q') (S p)) (Nat.mul (S q') (S q))))) (Init.Nat.add (Init.Nat.mul (S p') (S q)) O), @eq bool false true *) intros H; generalize (plus_le_reg_l _ _ _ H); simpl in |- *; intros H1; inversion H1. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (q : Qpositive) (_ : Qpositive_le' (dL q) (dL w'1)), @eq bool (Qpositive_le_bool q w'1) true *) intros w; unfold Qpositive_le', Qpositive_le in |- *; simpl in |- *. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall _ : let (p, q) := let (p, q) := Qpositive_i w in @pair nat nat p (Init.Nat.add p q) in let (p', q') := let (p0, q0) := Qpositive_i w'1 in @pair nat nat p0 (Init.Nat.add p0 q0) in le (Init.Nat.mul p q') (Init.Nat.mul p' q), @eq bool (Qpositive_le_bool w w'1) true *) generalize (Hrec w); clear Hrec; unfold Qpositive_le, Qpositive_le' in |- *; simpl in |- *. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (_ : forall _ : let (p, q) := Qpositive_i w in let (p', q') := Qpositive_i w'1 in le (Init.Nat.mul p q') (Init.Nat.mul p' q), @eq bool (Qpositive_le_bool w w'1) true) (_ : let (p, q) := let (p, q) := Qpositive_i w in @pair nat nat p (Init.Nat.add p q) in let (p', q') := let (p0, q0) := Qpositive_i w'1 in @pair nat nat p0 (Init.Nat.add p0 q0) in le (Init.Nat.mul p q') (Init.Nat.mul p' q)), @eq bool (Qpositive_le_bool w w'1) true *) elim (interp_non_zero w); intros p Hex; elim Hex; intros q Heq; clear Hex; rewrite Heq. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (_ : forall _ : let (p', q') := Qpositive_i w'1 in le (Init.Nat.mul (S p) q') (Init.Nat.mul p' (S q)), @eq bool (Qpositive_le_bool w w'1) true) (_ : let (p', q') := let (p, q) := Qpositive_i w'1 in @pair nat nat p (Init.Nat.add p q) in le (Init.Nat.mul (S p) q') (Init.Nat.mul p' (Init.Nat.add (S p) (S q)))), @eq bool (Qpositive_le_bool w w'1) true *) elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1; clear Hex; rewrite Heq1. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: forall (_ : forall _ : le (Init.Nat.mul (S p) (S q')) (Init.Nat.mul (S p') (S q)), @eq bool (Qpositive_le_bool w w'1) true) (_ : le (Init.Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Init.Nat.mul (S p') (Init.Nat.add (S p) (S q)))), @eq bool (Qpositive_le_bool w w'1) true *) intros H H1; (lapply H; [ intros H0; try exact H0 | idtac ]). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: le (Init.Nat.mul (S p) (S q')) (Init.Nat.mul (S p') (S q)) *) apply (fun p n m : nat => plus_le_reg_l n m p) with (S p * S p'). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: le (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p) (S q'))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p') (S q))) *) replace (S p * S p' + S p * S q') with (S p * (S p' + S q')). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: @eq nat (Init.Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p) (S q'))) *) (* Goal: le (Init.Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p') (S q))) *) replace (S p * S p' + S p' * S q) with (S p' * (S p + S q)). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: @eq nat (Init.Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p) (S q'))) *) (* Goal: @eq nat (Init.Nat.mul (S p') (Init.Nat.add (S p) (S q))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p') (S q))) *) (* Goal: le (Init.Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Init.Nat.mul (S p') (Init.Nat.add (S p) (S q))) *) auto. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: @eq nat (Init.Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p) (S q'))) *) (* Goal: @eq nat (Init.Nat.mul (S p') (Init.Nat.add (S p) (S q))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p') (S q))) *) ring. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) (* Goal: @eq nat (Init.Nat.mul (S p) (Init.Nat.add (S p') (S q'))) (Init.Nat.add (Init.Nat.mul (S p) (S p')) (Init.Nat.mul (S p) (S q'))) *) ring. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : Qpositive_le' One (dL w'1), @eq bool false true *) unfold Qpositive_le' in |- *; simpl in |- *. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : let (p', q') := let (p, q) := Qpositive_i w'1 in @pair nat nat p (Init.Nat.add p q) in le (Init.Nat.add q' O) (Init.Nat.mul p' (S O)), @eq bool false true *) elim (interp_non_zero w'1); intros p' Hex; elim Hex; intros q' Heq1; clear Hex; rewrite Heq1. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : le (Init.Nat.add (Init.Nat.add (S p') (S q')) O) (Init.Nat.mul (S p') (S O)), @eq bool false true *) rewrite <- plus_n_O; rewrite <- (mult_comm 1); simpl in |- *; intros H; generalize (plus_le_reg_l _ _ _ (le_S_n _ _ H)). (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) (* Goal: forall _ : le (S q') O, @eq bool false true *) intros H1; inversion H1. (* Goal: forall (w : Qpositive) (_ : Qpositive_le' w One), Qpositive_le w One *) intros w; case w; clear w; unfold Qpositive_le', Qpositive_le in |- *; simpl in |- *. (* Goal: forall _ : le (S O) (S O), @eq bool true true *) (* Goal: forall (q : Qpositive) (_ : let (p, q0) := let (p, q0) := Qpositive_i q in @pair nat nat p (Init.Nat.add p q0) in le (Init.Nat.mul p (S O)) (Init.Nat.add q0 O)), @eq bool true true *) (* Goal: forall (q : Qpositive) (_ : let (p, q0) := let (p, q0) := Qpositive_i q in @pair nat nat (Init.Nat.add p q0) q0 in le (Init.Nat.mul p (S O)) (Init.Nat.add q0 O)), @eq bool false true *) intros w; elim (interp_non_zero w). (* Goal: forall _ : le (S O) (S O), @eq bool true true *) (* Goal: forall (q : Qpositive) (_ : let (p, q0) := let (p, q0) := Qpositive_i q in @pair nat nat p (Init.Nat.add p q0) in le (Init.Nat.mul p (S O)) (Init.Nat.add q0 O)), @eq bool true true *) (* Goal: forall (x : nat) (_ : @ex nat (fun q : nat => @eq (prod nat nat) (Qpositive_i w) (@pair nat nat (S x) (S q)))) (_ : let (p, q) := let (p, q) := Qpositive_i w in @pair nat nat (Init.Nat.add p q) q in le (Init.Nat.mul p (S O)) (Init.Nat.add q O)), @eq bool false true *) intros p Hex; elim Hex; intros q Heq; rewrite Heq. (* Goal: forall _ : le (S O) (S O), @eq bool true true *) (* Goal: forall (q : Qpositive) (_ : let (p, q0) := let (p, q0) := Qpositive_i q in @pair nat nat p (Init.Nat.add p q0) in le (Init.Nat.mul p (S O)) (Init.Nat.add q0 O)), @eq bool true true *) (* Goal: forall _ : le (Init.Nat.mul (Init.Nat.add (S p) (S q)) (S O)) (Init.Nat.add (S q) O), @eq bool false true *) rewrite mult_1_r. (* Goal: forall _ : le (S O) (S O), @eq bool true true *) (* Goal: forall (q : Qpositive) (_ : let (p, q0) := let (p, q0) := Qpositive_i q in @pair nat nat p (Init.Nat.add p q0) in le (Init.Nat.mul p (S O)) (Init.Nat.add q0 O)), @eq bool true true *) (* Goal: forall _ : le (Init.Nat.add (S p) (S q)) (Init.Nat.add (S q) O), @eq bool false true *) rewrite (plus_comm (S p)). (* Goal: forall _ : le (S O) (S O), @eq bool true true *) (* Goal: forall (q : Qpositive) (_ : let (p, q0) := let (p, q0) := Qpositive_i q in @pair nat nat p (Init.Nat.add p q0) in le (Init.Nat.mul p (S O)) (Init.Nat.add q0 O)), @eq bool true true *) (* Goal: forall _ : le (Nat.add (S q) (S p)) (Init.Nat.add (S q) O), @eq bool false true *) intros H; generalize (plus_le_reg_l _ _ _ H); intros H1; inversion H1. (* Goal: forall _ : le (S O) (S O), @eq bool true true *) (* Goal: forall (q : Qpositive) (_ : let (p, q0) := let (p, q0) := Qpositive_i q in @pair nat nat p (Init.Nat.add p q0) in le (Init.Nat.mul p (S O)) (Init.Nat.add q0 O)), @eq bool true true *) auto. (* Goal: forall _ : le (S O) (S O), @eq bool true true *) auto. Qed. Theorem Qpositive_le_trans : forall w w' w'' : Qpositive, Qpositive_le w w' -> Qpositive_le w' w'' -> Qpositive_le w w''. Theorem Qpositive_le_antisym : forall w w' : Qpositive, Qpositive_le w w' -> Qpositive_le w' w -> w = w'. Theorem Qpositive_le_refl : forall w : Qpositive, Qpositive_le w w. Proof. (* Goal: forall w : Qpositive, Qpositive_le w w *) intros w; unfold Qpositive_le in |- *; elim w; simpl in |- *; auto. Qed. Theorem Qpositive_le_total : forall w w' : Qpositive, Qpositive_le w w' \/ Qpositive_le w' w. Proof. (* Goal: forall w w' : Qpositive, or (Qpositive_le w w') (Qpositive_le w' w) *) intros w w'; cut (Qpositive_le' w w' \/ Qpositive_le' w' w). (* Goal: or (Qpositive_le' w w') (Qpositive_le' w' w) *) (* Goal: forall _ : or (Qpositive_le' w w') (Qpositive_le' w' w), or (Qpositive_le w w') (Qpositive_le w' w) *) intros H; elim H; intros H1; generalize (Qpositive_le'_to_Qpositive_le _ _ H1); auto. (* Goal: or (Qpositive_le' w w') (Qpositive_le' w' w) *) unfold Qpositive_le' in |- *. (* Goal: or (let (p, q) := Qpositive_i w in let (p', q') := Qpositive_i w' in le (Init.Nat.mul p q') (Init.Nat.mul p' q)) (let (p, q) := Qpositive_i w' in let (p', q') := Qpositive_i w in le (Init.Nat.mul p q') (Init.Nat.mul p' q)) *) case (Qpositive_i w'); case (Qpositive_i w); intros p q p' q'. (* Goal: or (le (Init.Nat.mul p q') (Init.Nat.mul p' q)) (le (Init.Nat.mul p' q) (Init.Nat.mul p q')) *) elim (le_or_lt (p * q') (p' * q)); auto with arith. Qed. Theorem not_Qpositive_le_not_eq : forall n m : Qpositive, ~ Qpositive_le n m -> n <> m. Proof. (* Goal: forall (n m : Qpositive) (_ : not (Qpositive_le n m)), not (@eq Qpositive n m) *) intros n m H; red in |- *; intros H1; elim H; rewrite H1; apply Qpositive_le_refl. Qed. Theorem not_Qpositive_le_Qpositive_le' : forall n m : Qpositive, ~ Qpositive_le n m -> Qpositive_le m n. Proof. (* Goal: forall (n m : Qpositive) (_ : not (Qpositive_le n m)), Qpositive_le m n *) intros n m Hle; elim (Qpositive_le_total n m); auto. (* Goal: forall _ : Qpositive_le n m, Qpositive_le m n *) intros H; elim Hle; auto. Qed. Lemma Qpositive_le_noneq_explicit: forall qp qp', Qpositive_le qp qp' -> ~ qp=qp' -> let (p, q) := Qpositive_i qp in let (p', q') := Qpositive_i qp' in (p * q' < p' * q)%nat. Proof. (* Goal: forall (qp qp' : Qpositive) (_ : Qpositive_le qp qp') (_ : not (@eq Qpositive qp qp')), let (p, q) := Qpositive_i qp in let (p', q') := Qpositive_i qp' in lt (Init.Nat.mul p q') (Init.Nat.mul p' q) *) intros qp qp' H_le H_neq; generalize (Qpositive_le_to_Qpositive_le' qp qp' H_le); unfold Qpositive_le'; destruct (interp_non_zero qp) as [p [q H]]; destruct (interp_non_zero qp') as [p' [q' H']]; rewrite H; rewrite H'; intros H_le_unfold; destruct (le_lt_eq_dec _ _ H_le_unfold) as [H1|H1]; trivial; apply False_ind; apply H_neq; rewrite <- (construct_correct qp (S p) (S q) (S p+S q)%nat H); auto with arith; rewrite <- (construct_correct qp' (S p') (S q') (S p'+S q')%nat H'); auto with arith; apply construct_correct4'; auto with arith. Qed.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq choice fintype div. From mathcomp Require Import tuple bigop prime finset fingroup ssralg poly polydiv. From mathcomp Require Import morphism action finalg zmodp cyclic center pgroup abelian. From mathcomp Require Import matrix mxpoly vector falgebra fieldext separable galois. From mathcomp Require ssrnum ssrint algC cyclotomic. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope GRing.Theory FinRing.Theory. Local Open Scope ring_scope. Section FinRing. Variable R : finRingType. Lemma finRing_nontrivial : [set: R] != 1%g. Proof. (* Goal: is_true (negb (@eq_op (set_of_eqType (FinRing.Ring.finType R)) (@setTfor (FinRing.Ring.finType R) (Phant (FinRing.Ring.sort R))) (oneg (group_set_of_baseGroupType (FinRing.Ring.baseFinGroupType R))))) *) by apply/trivgPn; exists 1; rewrite ?inE ?oner_neq0. Qed. Lemma finRing_gt1 : 1 < #|R|. Proof. (* Goal: is_true (leq (S (S O)) (@card (FinRing.Ring.finType R) (@mem (Equality.sort (FinRing.Ring.eqType R)) (predPredType (Equality.sort (FinRing.Ring.eqType R))) (@sort_of_simpl_pred (Equality.sort (FinRing.Ring.eqType R)) (pred_of_argType (Equality.sort (FinRing.Ring.eqType R))))))) *) by rewrite -cardsT cardG_gt1 finRing_nontrivial. Qed. End FinRing. Section FinField. Variable F : finFieldType. Lemma card_finField_unit : #|[set: {unit F}]| = #|F|.-1. Proof. (* Goal: @eq nat (@card (FinRing.unit_finType (FinRing.Field.finUnitRingType F)) (@mem (Finite.sort (FinRing.unit_finType (FinRing.Field.finUnitRingType F))) (predPredType (Finite.sort (FinRing.unit_finType (FinRing.Field.finUnitRingType F)))) (@SetDef.pred_of_set (FinRing.unit_finType (FinRing.Field.finUnitRingType F)) (@setTfor (FinRing.unit_finType (FinRing.Field.finUnitRingType F)) (Phant (@FinRing.unit_of (FinRing.Field.finUnitRingType F) (Phant (FinRing.Field.sort F)))))))) (Nat.pred (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))) *) by rewrite -(cardC1 0) cardsT card_sub; apply: eq_card => x; rewrite unitfE. Qed. Definition finField_unit x (nz_x : x != 0) := FinRing.unit F (etrans (unitfE x) nz_x). Lemma expf_card x : x ^+ #|F| = x :> F. Proof. (* Goal: @eq (FinRing.Field.sort F) (@GRing.exp (FinRing.Field.ringType F) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))) x *) rewrite -[RHS]mulr1 -(ltn_predK (finRing_gt1 F)) exprS. (* Goal: @eq (FinRing.Field.sort F) (@GRing.mul (FinRing.Field.ringType F) x (@GRing.exp (FinRing.Field.ringType F) x (Nat.pred (@card (FinRing.Ring.finType (FinRing.Field.finRingType F)) (@mem (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))) (predPredType (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F)))) (@sort_of_simpl_pred (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))) (pred_of_argType (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F)))))))))) (@GRing.mul (FinRing.Field.ringType F) x (GRing.one (FinRing.Field.ringType F))) *) apply/eqP; rewrite -subr_eq0 -mulrBr mulf_eq0 subr_eq0 -implyNb -unitfE. (* Goal: is_true (implb (@in_mem (GRing.Field.sort (FinRing.Field.fieldType F)) x (@mem (GRing.UnitRing.sort (GRing.Field.unitRingType (FinRing.Field.fieldType F))) (predPredType (GRing.UnitRing.sort (GRing.Field.unitRingType (FinRing.Field.fieldType F)))) (@has_quality (S O) (GRing.UnitRing.sort (GRing.Field.unitRingType (FinRing.Field.fieldType F))) (@GRing.unit (GRing.Field.unitRingType (FinRing.Field.fieldType F)))))) (@eq_op (GRing.Zmodule.eqType (GRing.IntegralDomain.zmodType (FinRing.Field.idomainType F))) (@GRing.exp (FinRing.Field.ringType F) x (Nat.pred (@card (FinRing.Ring.finType (FinRing.Field.finRingType F)) (@mem (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))) (predPredType (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F)))) (@sort_of_simpl_pred (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))) (pred_of_argType (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))))))))) (GRing.one (FinRing.Field.ringType F)))) *) apply/implyP=> Ux; rewrite -(val_unitX _ (Sub x _)) -val_unit1 val_eqE. (* Goal: is_true (@eq_op (@sub_eqType (GRing.Zmodule.eqType (GRing.IntegralDomain.zmodType (FinRing.Field.idomainType F))) (fun x : FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F) => @in_mem (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) x (@mem (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (predPredType (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))) (@has_quality (S O) (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (@GRing.unit (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))))) (FinRing.unit_subType (FinRing.Field.finUnitRingType F))) (@expgn (FinRing.unit_baseFinGroupType (FinRing.Field.finUnitRingType F)) (@Sub (GRing.Ring.sort (FinRing.Field.ringType F)) (fun x : FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F) => @in_mem (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) x (@mem (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (predPredType (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))) (@has_quality (S O) (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (@GRing.unit (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))))) (FinRing.unit_subType (FinRing.Field.finUnitRingType F)) x Ux) (Nat.pred (@card (FinRing.Ring.finType (FinRing.Field.finRingType F)) (@mem (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))) (predPredType (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F)))) (@sort_of_simpl_pred (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))) (pred_of_argType (Equality.sort (FinRing.Ring.eqType (FinRing.Field.finRingType F))))))))) (oneg (FinRing.unit_baseFinGroupType (FinRing.Field.finUnitRingType F)))) *) by rewrite -order_dvdn -card_finField_unit order_dvdG ?inE. Qed. Lemma finField_genPoly : 'X^#|F| - 'X = \prod_x ('X - x%:P) :> {poly F}. Proof. (* Goal: @eq (@poly_of (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (FinRing.Field.ringType F))) (@GRing.exp (poly_ringType (FinRing.Field.ringType F)) (polyX (FinRing.Field.ringType F)) (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))) (@GRing.opp (poly_zmodType (FinRing.Field.ringType F)) (polyX (FinRing.Field.ringType F)))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (GRing.one (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (index_enum (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (fun x : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F)) => @BigBody (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) x (@GRing.mul (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) true (@GRing.add (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (polyX (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@GRing.opp (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@polyC (FinRing.Ring.ringType (FinRing.Field.finRingType F)) x))))) *) set n := #|F|; set oppX := - 'X; set pF := LHS. (* Goal: @eq (@poly_of (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))) pF (@BigOp.bigop (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (GRing.one (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (index_enum (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (fun x : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F)) => @BigBody (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) x (@GRing.mul (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) true (@GRing.add (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (polyX (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@GRing.opp (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@polyC (FinRing.Ring.ringType (FinRing.Field.finRingType F)) x))))) *) have le_oppX_n: size oppX <= n by rewrite size_opp size_polyX finRing_gt1. (* Goal: @eq (@poly_of (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))) pF (@BigOp.bigop (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (GRing.one (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (index_enum (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (fun x : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F)) => @BigBody (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) x (@GRing.mul (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) true (@GRing.add (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (polyX (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@GRing.opp (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@polyC (FinRing.Ring.ringType (FinRing.Field.finRingType F)) x))))) *) have: size pF = (size (enum F)).+1 by rewrite -cardE size_addl size_polyXn. (* Goal: forall _ : @eq nat (@size (GRing.Ring.sort (FinRing.Field.ringType F)) (@polyseq (FinRing.Field.ringType F) pF)) (S (@size (Finite.sort (FinRing.Field.finType F)) (@enum_mem (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))), @eq (@poly_of (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))) pF (@BigOp.bigop (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (GRing.one (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (index_enum (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (fun x0 : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F)) => @BigBody (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) x0 (@GRing.mul (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) true (@GRing.add (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (polyX (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@GRing.opp (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@polyC (FinRing.Ring.ringType (FinRing.Field.finRingType F)) x0))))) *) move/all_roots_prod_XsubC->; last by rewrite uniq_rootsE enum_uniq. (* Goal: is_true (@all (GRing.Ring.sort (GRing.UnitRing.ringType (FinRing.Field.unitRingType F))) (@root (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)) pF) (@enum_mem (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))) *) (* Goal: @eq (@poly_of (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))) (@GRing.scale (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)) (@GRing.Lalgebra.lmod_ringType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)))) (poly_lalgType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)))) (@lead_coef (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)) pF) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)))) (GRing.UnitRing.sort (FinRing.Field.unitRingType F)) (GRing.one (poly_ringType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)))) (@enum_mem (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (fun z : GRing.UnitRing.sort (FinRing.Field.unitRingType F) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)))) (GRing.UnitRing.sort (FinRing.Field.unitRingType F)) z (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)))) true (@GRing.add (poly_zmodType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (FinRing.Field.unitRingType F))) (@GRing.opp (poly_zmodType (GRing.UnitRing.ringType (FinRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)) z)))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (GRing.one (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (index_enum (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (fun x : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F)) => @BigBody (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) x (@GRing.mul (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType F)))) true (@GRing.add (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (polyX (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@GRing.opp (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@polyC (FinRing.Ring.ringType (FinRing.Field.finRingType F)) x))))) *) by rewrite enumT lead_coefDl ?size_polyXn // lead_coefXn scale1r. (* Goal: is_true (@all (GRing.Ring.sort (GRing.UnitRing.ringType (FinRing.Field.unitRingType F))) (@root (GRing.UnitRing.ringType (FinRing.Field.unitRingType F)) pF) (@enum_mem (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))) *) by apply/allP=> x _; rewrite rootE !hornerE hornerXn expf_card subrr. Qed. Lemma finCharP : {p | prime p & p \in [char F]}. Proof. (* Goal: @sig2 nat (fun p : nat => is_true (prime p)) (fun p : nat => is_true (@in_mem nat p (@mem nat nat_pred_pred (@GRing.char (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)))))) *) pose e := exponent [set: F]; have e_gt0: e > 0 by apply: exponent_gt0. (* Goal: @sig2 nat (fun p : nat => is_true (prime p)) (fun p : nat => is_true (@in_mem nat p (@mem nat nat_pred_pred (@GRing.char (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)))))) *) have: e%:R == 0 :> F by rewrite -zmodXgE expg_exponent // inE. (* Goal: forall _ : is_true (@eq_op (FinRing.Field.eqType F) (@GRing.natmul (GRing.Ring.zmodType (FinRing.Field.ringType F)) (GRing.one (FinRing.Field.ringType F)) e) (GRing.zero (FinRing.Field.zmodType F))), @sig2 nat (fun p : nat => is_true (prime p)) (fun p : nat => is_true (@in_mem nat p (@mem nat nat_pred_pred (@GRing.char (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)))))) *) by case/natf0_char/sigW=> // p charFp; exists p; rewrite ?(charf_prime charFp). Qed. Lemma finField_is_abelem : is_abelem [set: F]. Proof. (* Goal: is_true (@is_abelem (FinRing.Field.finGroupType F) (@setTfor (FinRing.Field.finType F) (Phant (FinRing.Field.sort F)))) *) have [p pr_p charFp] := finCharP. (* Goal: is_true (@is_abelem (FinRing.Field.finGroupType F) (@setTfor (FinRing.Field.finType F) (Phant (FinRing.Field.sort F)))) *) by apply/is_abelemP; exists p; last apply: fin_ring_char_abelem. Qed. Lemma card_finCharP p n : #|F| = (p ^ n)%N -> prime p -> p \in [char F]. Proof. (* Goal: forall (_ : @eq nat (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (expn p n)) (_ : is_true (prime p)), is_true (@in_mem nat p (@mem nat nat_pred_pred (@GRing.char (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))))) *) move=> oF pr_p; rewrite inE pr_p -order_dvdn. (* Goal: is_true (andb true (dvdn (@order (FinRing.Ring.join_finGroupType (FinRing.Field.finRingType F)) (GRing.one (FinRing.Field.ringType F))) p)) *) rewrite (abelem_order_p finField_is_abelem) ?inE ?oner_neq0 //=. (* Goal: is_true (dvdn (pdiv (@card (FinGroup.arg_finType (FinRing.Field.baseFinGroupType F)) (@mem (FinRing.Field.sort F) (predPredType (FinRing.Field.sort F)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinRing.Field.baseFinGroupType F)) (@setTfor (FinRing.Field.finType F) (Phant (FinRing.Field.sort F))))))) p) *) have n_gt0: n > 0 by rewrite -(ltn_exp2l _ _ (prime_gt1 pr_p)) -oF finRing_gt1. (* Goal: is_true (dvdn (pdiv (@card (FinGroup.arg_finType (FinRing.Field.baseFinGroupType F)) (@mem (FinRing.Field.sort F) (predPredType (FinRing.Field.sort F)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinRing.Field.baseFinGroupType F)) (@setTfor (FinRing.Field.finType F) (Phant (FinRing.Field.sort F))))))) p) *) by rewrite cardsT oF -(prednK n_gt0) pdiv_pfactor. Qed. End FinField. Section CardVspace. Variables (F : finFieldType) (T : finType). Section Vector. Variable cvT : Vector.class_of F T. Let vT := Vector.Pack (Phant F) cvT. Lemma card_vspace (V : {vspace vT}) : #|V| = (#|F| ^ \dim V)%N. Proof. (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (@dimv (FinRing.Field.fieldType F) vT V)) *) set n := \dim V; pose V2rV v := \row_i coord (vbasis V) i v. (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) n) *) pose rV2V (rv : 'rV_n) := \sum_i rv 0 i *: (vbasis V)`_i. (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) n) *) have rV2V_K: cancel rV2V V2rV. (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) n) *) (* Goal: @cancel (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))))) (matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (S O) n) rV2V V2rV *) have freeV: free (vbasis V) := basis_free (vbasisP V). (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) n) *) (* Goal: @cancel (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))))) (matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (S O) n) rV2V V2rV *) by move=> rv; apply/rowP=> i; rewrite mxE coord_sum_free. (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) n) *) rewrite -[n]mul1n -card_matrix -(card_imset _ (can_inj rV2V_K)). (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@Imset.imset (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n) T rV2V (@mem (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n))) (@sort_of_simpl_pred (matrix (Finite.sort (FinRing.Field.finType F)) (S O) n) (pred_of_argType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) n)))))))) *) apply: eq_card => v; apply/idP/imsetP=> [/coord_vbasis-> | [rv _ ->]]. (* Goal: is_true (@in_mem (Finite.sort T) (rV2V rv) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) *) (* Goal: @ex2 (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n)) (fun x : Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n) => is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n)) x (@mem (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n))) (@sort_of_simpl_pred (matrix (Finite.sort (FinRing.Field.finType F)) (S O) n) (pred_of_argType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) n)))))) (fun x : Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n) => @eq (Finite.sort T) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))))) (Finite.sort (ordinal_finType (@dimv (FinRing.Field.fieldType F) vT V))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))))) (index_enum (ordinal_finType (@dimv (FinRing.Field.fieldType F) vT V))) (fun i : ordinal (@dimv (FinRing.Field.fieldType F) vT V) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))))) (ordinal (@dimv (FinRing.Field.fieldType F) vT V)) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))))) true (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT) (@coord (FinRing.Field.fieldType F) vT (@dimv (FinRing.Field.fieldType F) vT V) (@vbasis (FinRing.Field.fieldType F) vT V) i v) (@nth (GRing.Zmodule.sort (@GRing.Lmodule.zmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))) (GRing.zero (@GRing.Lmodule.zmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT))) (@tval (@dimv (FinRing.Field.fieldType F) vT V) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) vT)) (@vbasis (FinRing.Field.fieldType F) vT V)) (@nat_of_ord (@dimv (FinRing.Field.fieldType F) vT V) i))))) (rV2V x)) *) by exists (V2rV v) => //; apply: eq_bigr => i _; rewrite mxE. (* Goal: is_true (@in_mem (Finite.sort T) (rV2V rv) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) vT)) V))) *) by apply: (@rpred_sum vT) => i _; rewrite rpredZ ?vbasis_mem ?memt_nth. Qed. Lemma card_vspacef : #|{: vT}%VS| = #|T|. Proof. (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@pred_of_vspace (FinRing.Field.fieldType F) vT (Phant (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) vT)) (@fullv (FinRing.Field.fieldType F) vT)))) (@card T (@mem (Equality.sort (Finite.eqType T)) (predPredType (Equality.sort (Finite.eqType T))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T)))))) *) by apply: eq_card => v; rewrite (@memvf _ vT). Qed. End Vector. Variable caT : Falgebra.class_of F T. Let aT := Falgebra.Pack (Phant F) caT. Lemma card_vspace1 : #|(1%VS : {vspace aT})| = #|F|. Proof. (* Goal: @eq nat (@card T (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) aT)) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) aT))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) aT) (Phant (@Falgebra.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) aT)) (@vline (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) aT) (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) aT)) : @Vector.space (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) aT) (Phant (@Falgebra.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) aT)))))) (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) *) by rewrite card_vspace (dimv1 aT). Qed. End CardVspace. Lemma VectFinMixin (R : finRingType) (vT : vectType R) : Finite.mixin_of vT. Proof. (* Goal: Finite.mixin_of (@Vector.eqType (FinRing.Ring.ringType R) (Phant (FinRing.Ring.sort R)) vT) *) have v2rK := @Vector.InternalTheory.v2rK R vT. (* Goal: Finite.mixin_of (@Vector.eqType (FinRing.Ring.ringType R) (Phant (FinRing.Ring.sort R)) vT) *) exact: CanFinMixin (v2rK : @cancel _ (CountType vT (CanCountMixin v2rK)) _ _). Qed. Module FinVector. Section Interfaces. Variable F : finFieldType. Implicit Types (vT : vectType F) (aT : FalgType F) (fT : fieldExtType F). Canonical vect_finType vT := FinType vT (VectFinMixin vT). Canonical Falg_finType aT := FinType aT (VectFinMixin aT). Canonical fieldExt_finType fT := FinType fT (VectFinMixin fT). Canonical Falg_finRingType aT := [finRingType of aT]. Canonical fieldExt_finRingType fT := [finRingType of fT]. Canonical fieldExt_finFieldType fT := [finFieldType of fT]. Lemma finField_splittingField_axiom fT : SplittingField.axiom fT. Proof. (* Goal: @SplittingField.axiom (FinRing.Field.fieldType F) fT *) exists ('X^#|fT| - 'X); first by rewrite rpredB 1?rpredX ?polyOverX. (* Goal: @splittingFieldFor (FinRing.Field.fieldType F) fT (@vline (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (@FieldExt.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT))) (@GRing.exp (poly_ringType (@FieldExt.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) (polyX (@FieldExt.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) (@card (fieldExt_finType fT) (@mem (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT)) (predPredType (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT))) (@sort_of_simpl_pred (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT)) (pred_of_argType (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT))))))) (@GRing.opp (poly_zmodType (@FieldExt.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) (polyX (@FieldExt.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)))) (@fullv (FinRing.Field.fieldType F) (@FieldExt.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) *) exists (enum fT); first by rewrite enumT finField_genPoly eqpxx. (* Goal: @eq (@Vector.space (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) (Phant (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT))))) (@agenv (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT) (@addv (FinRing.Field.fieldType F) (@FieldExt.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT) (@vline (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)))) (@span (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) (@enum_mem (fieldExt_finType fT) (@mem (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT)) (predPredType (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT))) (@sort_of_simpl_pred (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT)) (pred_of_argType (Equality.sort (@FieldExt.eqType (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) fT))))))))) (@fullv (FinRing.Field.fieldType F) (@FieldExt.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) fT)) *) by apply/vspaceP=> x; rewrite memvf seqv_sub_adjoin ?mem_enum. Qed. End Interfaces. End FinVector. Notation FinFieldExtType := FinVector.fieldExt_finFieldType. Notation FinSplittingFieldAxiom := (FinVector.finField_splittingField_axiom _). Notation FinSplittingFieldType F L := (SplittingFieldType F L FinSplittingFieldAxiom). Section PrimeChar. Variable p : nat. Section PrimeCharRing. Variable R0 : ringType. Definition PrimeCharType of p \in [char R0] : predArgType := R0. Hypothesis charRp : p \in [char R0]. Local Notation R := (PrimeCharType charRp). Implicit Types (a b : 'F_p) (x y : R). Canonical primeChar_eqType := [eqType of R]. Canonical primeChar_choiceType := [choiceType of R]. Canonical primeChar_zmodType := [zmodType of R]. Canonical primeChar_ringType := [ringType of R]. Definition primeChar_scale a x := a%:R * x. Local Infix "*p:" := primeChar_scale (at level 40). Let natrFp n : (inZp n : 'F_p)%:R = n%:R :> R. Proof. (* Goal: @eq (PrimeCharType charRp) (@GRing.natmul (GRing.Ring.zmodType primeChar_ringType) (GRing.one primeChar_ringType) (@nat_of_ord (S (S (Zp_trunc (pdiv p)))) (@inZp (S (Zp_trunc (pdiv p))) n : ordinal (S (S (Zp_trunc (pdiv p))))))) (@GRing.natmul (GRing.Ring.zmodType primeChar_ringType) (GRing.one primeChar_ringType) n) *) rewrite [in RHS](divn_eq n p) natrD mulrnA (mulrn_char charRp) add0r. (* Goal: @eq (PrimeCharType charRp) (@GRing.natmul (GRing.Ring.zmodType primeChar_ringType) (GRing.one primeChar_ringType) (@nat_of_ord (S (S (Zp_trunc (pdiv p)))) (@inZp (S (Zp_trunc (pdiv p))) n))) (@GRing.natmul (GRing.Ring.zmodType primeChar_ringType) (GRing.one primeChar_ringType) (modn n p)) *) by rewrite /= (Fp_cast (charf_prime charRp)). Qed. Lemma primeChar_scaleA a b x : a *p: (b *p: x) = (a * b) *p: x. Proof. (* Goal: @eq (GRing.Ring.sort primeChar_ringType) (primeChar_scale a (primeChar_scale b x)) (primeChar_scale (@GRing.mul (Zp_ringType (Zp_trunc (pdiv p))) a b) x) *) by rewrite /primeChar_scale mulrA -natrM natrFp. Qed. Lemma primeChar_scale1 : left_id 1 primeChar_scale. Proof. (* Goal: @left_id (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p)))) (PrimeCharType charRp) (GRing.one (Zp_ringType (Zp_trunc (pdiv p)))) primeChar_scale *) by move=> x; rewrite /primeChar_scale mul1r. Qed. Lemma primeChar_scaleDr : right_distributive primeChar_scale +%R. Proof. (* Goal: @right_distributive (ordinal (S (S (Zp_trunc (pdiv p))))) (PrimeCharType charRp) primeChar_scale (@GRing.add primeChar_zmodType) *) by move=> a x y /=; rewrite /primeChar_scale mulrDr. Qed. Lemma primeChar_scaleDl x : {morph primeChar_scale^~ x: a b / a + b}. Proof. (* Goal: @morphism_2 (ordinal (S (S (Zp_trunc (pdiv p))))) (GRing.Ring.sort primeChar_ringType) (fun x0 : ordinal (S (S (Zp_trunc (pdiv p)))) => primeChar_scale x0 x) (fun a b : ordinal (S (S (Zp_trunc (pdiv p)))) => @GRing.add (Zp_zmodType (S (Zp_trunc (pdiv p)))) a b) (fun a b : GRing.Ring.sort primeChar_ringType => @GRing.add (GRing.Ring.zmodType primeChar_ringType) a b) *) by move=> a b; rewrite /primeChar_scale natrFp natrD mulrDl. Qed. Definition primeChar_lmodMixin := LmodMixin primeChar_scaleA primeChar_scale1 primeChar_scaleDr primeChar_scaleDl. Canonical primeChar_lmodType := LmodType 'F_p R primeChar_lmodMixin. Lemma primeChar_scaleAl : GRing.Lalgebra.axiom ( *%R : R -> R -> R). Proof. (* Goal: @GRing.Lalgebra.axiom (Zp_ringType (Zp_trunc (pdiv p))) primeChar_lmodType (@GRing.mul primeChar_ringType : forall (_ : PrimeCharType charRp) (_ : PrimeCharType charRp), PrimeCharType charRp) *) by move=> a x y; apply: mulrA. Qed. Canonical primeChar_LalgType := LalgType 'F_p R primeChar_scaleAl. Lemma primeChar_scaleAr : GRing.Algebra.axiom primeChar_LalgType. Proof. (* Goal: @GRing.Algebra.axiom (Zp_ringType (Zp_trunc (pdiv p))) primeChar_LalgType *) by move=> a x y; rewrite ![a *: _]mulr_natl mulrnAr. Qed. Lemma primeChar_abelem : p.-abelem [set: R]. Proof. (* Goal: is_true (@abelem primeChar_groupType p (@setTfor primeChar_finType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp)))) *) exact: fin_Fp_lmod_abelem. Qed. Lemma primeChar_pgroup : p.-group [set: R]. Proof. (* Goal: is_true (@pgroup primeChar_groupType (nat_pred_of_nat p) (@setTfor primeChar_finType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp)))) *) by case/and3P: primeChar_abelem. Qed. Lemma order_primeChar x : x != 0 :> R -> #[x]%g = p. Proof. (* Goal: forall _ : is_true (negb (@eq_op (@primeChar_eqType (FinRing.Ring.ringType R0) charRp) (x : @PrimeCharType (FinRing.Ring.ringType R0) charRp) (GRing.zero (@primeChar_zmodType (FinRing.Ring.ringType R0) charRp) : @PrimeCharType (FinRing.Ring.ringType R0) charRp))), @eq nat (@order primeChar_groupType x) p *) by apply: (abelem_order_p primeChar_abelem); rewrite inE. Qed. Let n := logn p #|R|. Lemma card_primeChar : #|R| = (p ^ n)%N. Proof. (* Goal: @eq nat (@card primeChar_finType (@mem (@PrimeCharType (FinRing.Ring.ringType R0) charRp) (predPredType (@PrimeCharType (FinRing.Ring.ringType R0) charRp)) (@sort_of_simpl_pred (@PrimeCharType (FinRing.Ring.ringType R0) charRp) (pred_of_argType (@PrimeCharType (FinRing.Ring.ringType R0) charRp))))) (expn p n) *) by rewrite /n -cardsT {1}(card_pgroup primeChar_pgroup). Qed. Lemma primeChar_vectAxiom : Vector.axiom n (primeChar_lmodType charRp). Proof. (* Goal: @Vector.axiom_def (Zp_ringType (Zp_trunc (pdiv p))) n (@primeChar_lmodType (FinRing.Ring.ringType R0) charRp) (Phant (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (ordinal (S (S (Zp_trunc (pdiv p)))))) (@primeChar_lmodType (FinRing.Ring.ringType R0) charRp))) *) have /isog_isom/=[f /isomP[injf im_f]]: [set: R] \isog [set: 'rV['F_p]_n]. (* Goal: @Vector.axiom_def (Zp_ringType (Zp_trunc (pdiv p))) n (@primeChar_lmodType (FinRing.Ring.ringType R0) charRp) (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp)) *) (* Goal: is_true (@isog primeChar_groupType (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) (@setTfor primeChar_finType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp))) (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc (pdiv p))))) (S O) n) (Phant (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) n)))) *) rewrite (@isog_abelem_card _ _ p) fin_Fp_lmod_abelem //=. (* Goal: @Vector.axiom_def (Zp_ringType (Zp_trunc (pdiv p))) n (@primeChar_lmodType (FinRing.Ring.ringType R0) charRp) (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp)) *) (* Goal: is_true (@eq_op nat_eqType (@card (FinGroup.arg_finType (matrix_baseFinGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n)) (@mem (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) n) (predPredType (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) n)) (@SetDef.pred_of_set (FinGroup.arg_finType (matrix_baseFinGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n)) (@setTfor (FinGroup.arg_finType (matrix_baseFinGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n)) (Phant (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) n)))))) (@card (FinGroup.arg_finType primeChar_baseGroupType) (@mem (@PrimeCharType (FinRing.Ring.ringType R0) charRp) (predPredType (@PrimeCharType (FinRing.Ring.ringType R0) charRp)) (@SetDef.pred_of_set (FinGroup.arg_finType primeChar_baseGroupType) (@setTfor (FinGroup.arg_finType primeChar_baseGroupType) (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp))))))) *) by rewrite !cardsT card_primeChar card_matrix mul1n card_Fp. (* Goal: @Vector.axiom_def (Zp_ringType (Zp_trunc (pdiv p))) n (@primeChar_lmodType (FinRing.Ring.ringType R0) charRp) (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp)) *) exists f; last by exists (invm injf) => x; rewrite ?invmE ?invmK ?im_f ?inE. (* Goal: @GRing.Linear.axiom (Zp_ringType (Zp_trunc (pdiv p))) (@primeChar_lmodType (FinRing.Ring.ringType R0) charRp) (matrix_zmodType (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (pdiv p)))) (S O) n) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n)) (@mfun primeChar_groupType (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) (@setTfor primeChar_finType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp))) f) (@GRing.Scale.scale_law (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n)) (@Logic.eq_refl (forall (_ : GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p)))) (_ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n)) (@GRing.Lmodule.base (Zp_ringType (Zp_trunc (pdiv p))) (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n)) (@GRing.Lmodule.class (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n))))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n)) (@GRing.Lmodule.base (Zp_ringType (Zp_trunc (pdiv p))) (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n)) (@GRing.Lmodule.class (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n))))) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n))) *) move=> a x y; rewrite [a *: _]mulr_natl morphM ?morphX ?inE // zmodXgE. (* Goal: @eq (GRing.Zmodule.sort (matrix_zmodType (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (pdiv p)))) (S O) n)) (@mulg (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n)) (@GRing.natmul (FinRing.Zmodule.zmodType (matrix_finZmodType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n)) (@mfun primeChar_groupType (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) (@gval primeChar_groupType (@setT_group primeChar_groupType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp)))) f x) (@nat_of_ord (S (S (Zp_trunc (pdiv p)))) a)) (@mfun primeChar_groupType (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) (@setTfor primeChar_finType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp))) f y)) (@GRing.add (matrix_zmodType (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (pdiv p)))) (S O) n) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) n) a (@mfun primeChar_groupType (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) (@setTfor primeChar_finType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp))) f x)) (@mfun primeChar_groupType (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) (@setTfor primeChar_finType (Phant (@PrimeCharType (FinRing.Ring.ringType R0) charRp))) f y)) *) by congr (_ + _); rewrite -scaler_nat natr_Zp. Qed. Definition primeChar_vectMixin := Vector.Mixin primeChar_vectAxiom. Canonical primeChar_vectType := VectType 'F_p R primeChar_vectMixin. Lemma primeChar_dimf : \dim {:primeChar_vectType} = n. Proof. (* Goal: @eq nat (@dimv (Fp_fieldType p) primeChar_vectType (@fullv (Fp_fieldType p) primeChar_vectType)) n *) by rewrite dimvf. Qed. End FinRing. Canonical primeChar_finUnitRingType (R : finUnitRingType) charRp := [finUnitRingType of type R charRp]. Canonical primeChar_finUnitAlgType (R : finUnitRingType) charRp := [finUnitAlgType 'F_p of type R charRp]. Canonical primeChar_FalgType (R : finUnitRingType) charRp := [FalgType 'F_p of type R charRp]. Canonical primeChar_finComRingType (R : finComRingType) charRp := [finComRingType of type R charRp]. Canonical primeChar_finComUnitRingType (R : finComUnitRingType) charRp := [finComUnitRingType of type R charRp]. Canonical primeChar_finIdomainType (R : finIdomainType) charRp := [finIdomainType of type R charRp]. Section FinField. Variables (F0 : finFieldType) (charFp : p \in [char F0]). Local Notation F := (type _ charFp). Canonical primeChar_finFieldType := [finFieldType of F]. Canonical primeChar_fieldExtType := [fieldExtType 'F_p of F for F0]. Canonical primeChar_splittingFieldType := FinSplittingFieldType 'F_p F. End FinField. End PrimeChar. Section FinSplittingField. Variable F : finFieldType. Let order (L : vectType F) (K : {vspace L}) := (#|F| ^ \dim K)%N. Section FinGalois. Variable L : splittingFieldType F. Implicit Types (a b : F) (x y : L) (K E : {subfield L}). Let galL K : galois K {:L}. Proof. (* Goal: is_true (@galois (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K) (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) *) without loss {K} ->: K / K = 1%AS. (* Goal: is_true (@galois (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) *) (* Goal: forall _ : forall (K : @aspace_of (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (_ : @eq (@aspace_of (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) K (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))), is_true (@galois (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K) (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))), is_true (@galois (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K) (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) *) by move=> IH_K; apply: galoisS (IH_K _ (erefl _)); rewrite sub1v subvf. (* Goal: is_true (@galois (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) *) apply/splitting_galoisField; pose finL := FinFieldExtType L. (* Goal: @ex (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (fun p : @poly_of (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) => and3 (is_true (@in_mem (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) p (@mem (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (predPredType (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))))) (@has_quality (S O) (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (@polyOver (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))))))) (is_true (@separable_poly (@FieldExt.vect_idomainType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) p)) (@splittingFieldFor (FinRing.Field.fieldType F) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) p (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) *) exists ('X^#|finL| - 'X); split; first by rewrite rpredB 1?rpredX ?polyOverX. (* Goal: @splittingFieldFor (FinRing.Field.fieldType F) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@GRing.exp (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@card (FinRing.Field.finType finL) (@mem (Equality.sort (FinRing.Field.eqType finL)) (predPredType (Equality.sort (FinRing.Field.eqType finL))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType finL)) (pred_of_argType (Equality.sort (FinRing.Field.eqType finL))))))) (@GRing.opp (poly_zmodType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) *) (* Goal: is_true (@separable_poly (@FieldExt.vect_idomainType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@GRing.exp (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@card (FinRing.Field.finType finL) (@mem (Equality.sort (FinRing.Field.eqType finL)) (predPredType (Equality.sort (FinRing.Field.eqType finL))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType finL)) (pred_of_argType (Equality.sort (FinRing.Field.eqType finL))))))) (@GRing.opp (poly_zmodType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))))) *) rewrite (finField_genPoly finL) -big_filter. (* Goal: @splittingFieldFor (FinRing.Field.fieldType F) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@GRing.exp (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@card (FinRing.Field.finType finL) (@mem (Equality.sort (FinRing.Field.eqType finL)) (predPredType (Equality.sort (FinRing.Field.eqType finL))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType finL)) (pred_of_argType (Equality.sort (FinRing.Field.eqType finL))))))) (@GRing.opp (poly_zmodType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) *) (* Goal: is_true (@separable_poly (@FieldExt.vect_idomainType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType finL)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType finL))) (GRing.one (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType finL)))) (@filter (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType finL))) (fun _ : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType finL)) => true) (index_enum (FinRing.Ring.join_finType (FinRing.Field.finRingType finL)))) (fun i : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType finL)) => @BigBody (GRing.Ring.sort (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType finL)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType finL))) i (@GRing.mul (poly_ringType (FinRing.Ring.ringType (FinRing.Field.finRingType finL)))) true (@GRing.add (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType finL))) (polyX (FinRing.Ring.ringType (FinRing.Field.finRingType finL))) (@GRing.opp (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType finL))) (@polyC (FinRing.Ring.ringType (FinRing.Field.finRingType finL)) i)))))) *) by rewrite separable_prod_XsubC ?(enum_uniq finL). (* Goal: @splittingFieldFor (FinRing.Field.fieldType F) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@GRing.exp (poly_ringType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@card (FinRing.Field.finType finL) (@mem (Equality.sort (FinRing.Field.eqType finL)) (predPredType (Equality.sort (FinRing.Field.eqType finL))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType finL)) (pred_of_argType (Equality.sort (FinRing.Field.eqType finL))))))) (@GRing.opp (poly_zmodType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (polyX (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) *) exists (enum finL); first by rewrite enumT (finField_genPoly finL) eqpxx. (* Goal: @eq (@Vector.space (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (@agenv (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@addv (FinRing.Field.fieldType F) (@FieldExt.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@span (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@enum_mem (FinRing.Field.finType finL) (@mem (Equality.sort (FinRing.Field.eqType finL)) (predPredType (Equality.sort (FinRing.Field.eqType finL))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType finL)) (pred_of_argType (Equality.sort (FinRing.Field.eqType finL))))))))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) *) by apply/vspaceP=> x; rewrite memvf seqv_sub_adjoin ?(mem_enum finL). Qed. Fact galLgen K : {alpha | generator 'Gal({:L} / K) alpha & forall x, alpha x = x ^+ order K}. Proof. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) *) without loss{K} ->: K / K = 1%AS; last rewrite /order dimv1 expn1. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: forall _ : forall (K : @aspace_of (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (_ : @eq (@aspace_of (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) K (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))), @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))), @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x0 : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x0) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x0 (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) *) case/(_ 1%AS)=> // alpha /eqP-defGalL; rewrite /order dimv1 expn1 => Dalpha. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K))))) *) exists (alpha ^+ \dim K)%g => [|x]; last first. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@expgn (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) alpha (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) *) (* Goal: @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@expgn (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) alpha (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K))))) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) *) elim: (\dim K) => [|n IHn]; first by rewrite gal_id. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@expgn (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) alpha (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) *) (* Goal: @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@expgn (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) alpha (S n)))) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (S n))) *) by rewrite expgSr galM ?memvf // IHn Dalpha expnSr exprM. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@expgn (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) alpha (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) *) have sGalLK: 'Gal({:L} / K) \subset <[alpha]> by rewrite -defGalL galS ?sub1v. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@expgn (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) alpha (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) *) rewrite /generator {sGalLK}(eq_subG_cyclic _ sGalLK) ?cycle_cyclic ?cycleX //. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: is_true (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@gval (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG_group (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))))) (@card (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@gval (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@cycle_group (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@expgn (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) alpha (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K))))))))) *) rewrite -orderE orderXdiv orderE -defGalL -?{1}galois_dim ?dimv1 ?divn1 //. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: is_true (dvdn (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@dimv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) *) by rewrite field_dimS ?subvf. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) pose f x := x ^+ #|F|. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) have idfP x: reflect (f x = x) (x \in 1%VS). (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: Bool.reflect (@eq (GRing.Ring.sort (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (f x) x) (@in_mem (@SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@vline (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))))) *) apply: (iffP (vlineP _ _)) => [[a ->] | xFx]. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) (* Goal: @eq (GRing.Ring.sort (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (f (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) a (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) a (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) *) by rewrite -in_algE -[LHS]rmorphX expf_card. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) pose q := map_poly (in_alg L) ('X^#|F| - 'X). (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) have: root q x. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: forall _ : is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) q x), @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) (* Goal: is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) q x) *) rewrite /q rmorphB /= map_polyXn map_polyX. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: forall _ : is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) q x), @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) (* Goal: is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@GRing.exp (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (polyX (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@card (FinRing.Field.finType F) (@mem (FinRing.Field.sort F) (predPredType (FinRing.Field.sort F)) (@sort_of_simpl_pred (FinRing.Field.sort F) (pred_of_argType (FinRing.Field.sort F)))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (polyX (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) x) *) by rewrite rootE !(hornerE, hornerXn) [x ^+ _]xFx subrr. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: forall _ : is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) q x), @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) have{q} ->: q = \prod_(z <- [seq b%:A | b : F]) ('X - z%:P). (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: forall _ : is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (GRing.one (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@image_mem (FinRing.Field.finType F) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (fun b : FinRing.Field.sort F => @GRing.scale (FinRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) b (GRing.one (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (fun z : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))) => @BigBody (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) z (@GRing.mul (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) true (@GRing.add (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (polyX (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.opp (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@polyC (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) z))))) x), @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) (* Goal: @eq (@poly_of (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (Phant (GRing.Ring.sort (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))) q (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (GRing.one (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@image_mem (FinRing.Field.finType F) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (fun b : FinRing.Field.sort F => @GRing.scale (FinRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) b (GRing.one (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (fun z : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))) => @BigBody (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) z (@GRing.mul (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) true (@GRing.add (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (polyX (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.opp (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@polyC (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) z))))) *) rewrite /q finField_genPoly rmorph_prod big_map enumT. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: forall _ : is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (GRing.one (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@image_mem (FinRing.Field.finType F) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (fun b : FinRing.Field.sort F => @GRing.scale (FinRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) b (GRing.one (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (fun z : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))) => @BigBody (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) z (@GRing.mul (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) true (@GRing.add (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (polyX (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.opp (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@polyC (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) z))))) x), @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) (* Goal: @eq (@poly_of (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (Phant (GRing.Ring.sort (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (GRing.one (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (index_enum (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) (fun i : Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F)) => @BigBody (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (Finite.sort (FinRing.Ring.join_finType (FinRing.Field.finRingType F))) i (@GRing.mul (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) true (@GRing.RMorphism.apply (poly_ringType (GRing.Field.ringType (FinRing.Field.fieldType F))) (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (Phant (forall _ : GRing.Ring.sort (poly_ringType (GRing.Field.ringType (FinRing.Field.fieldType F))), GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))) (@map_poly_rmorphism (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (@GRing.in_alg_rmorphism (GRing.Field.ringType (FinRing.Field.fieldType F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.add (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (polyX (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@GRing.opp (poly_zmodType (FinRing.Ring.ringType (FinRing.Field.finRingType F))) (@polyC (FinRing.Ring.ringType (FinRing.Field.finRingType F)) i)))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (Finite.sort (FinRing.Field.finType F)) (GRing.one (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (Finite.EnumDef.enum (FinRing.Field.finType F)) (fun j : Finite.sort (FinRing.Field.finType F) => @BigBody (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (Finite.sort (FinRing.Field.finType F)) j (@GRing.mul (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) true (@GRing.add (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (polyX (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.opp (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@polyC (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (@GRing.scale (FinRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) j (GRing.one (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))))))) *) by apply: eq_bigr => b _; rewrite rmorphB /= map_polyX map_polyC. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: forall _ : is_true (@root (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (GRing.one (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@image_mem (FinRing.Field.finType F) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (fun b : FinRing.Field.sort F => @GRing.scale (FinRing.Field.ringType F) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) b (GRing.one (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (fun z : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))))) => @BigBody (GRing.Ring.sort (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (FinRing.Field.ringType F) (@GRing.Lmodule.sort (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@GRing.Lalgebra.lmod_ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) z (@GRing.mul (poly_ringType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) true (@GRing.add (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (polyX (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.opp (poly_zmodType (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@polyC (@GRing.Lalgebra.ringType (FinRing.Field.ringType F) (Phant (GRing.Ring.sort (FinRing.Field.ringType F))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) z))))) x), @ex (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (fun k : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) => @eq (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) x (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) k (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) *) by rewrite root_prod_XsubC => /mapP[a]; exists a. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) have fM: rmorphism f. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @GRing.RMorphism.class_of (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) f *) rewrite /f; do 2?split=> [x y|]; rewrite ?exprMn ?expr1n //. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) x (@GRing.opp (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) y)) (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))) (@GRing.opp (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) y (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F))))))))) *) have [p _ charFp] := finCharP F; rewrite (card_primeChar charFp). (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) x (@GRing.opp (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) y)) (expn p (logn p (@card (@primeChar_finType p (FinRing.Field.finRingType F) charFp) (@mem (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp) (predPredType (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp)) (@sort_of_simpl_pred (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp) (pred_of_argType (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp)))))))) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (expn p (logn p (@card (@primeChar_finType p (FinRing.Field.finRingType F) charFp) (@mem (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp) (predPredType (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp)) (@sort_of_simpl_pred (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp) (pred_of_argType (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp)))))))) (@GRing.opp (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) y (expn p (logn p (@card (@primeChar_finType p (FinRing.Field.finRingType F) charFp) (@mem (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp) (predPredType (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp)) (@sort_of_simpl_pred (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp) (pred_of_argType (@PrimeCharType p (FinRing.Ring.ringType (FinRing.Field.finRingType F)) charFp)))))))))) *) elim: (logn _ _) => // n IHn; rewrite expnSr !exprM {}IHn. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (expn p n)) (@GRing.opp (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) y (expn p n)))) p) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (expn p n)) p) (@GRing.opp (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) y (expn p n)) p))) *) by rewrite -(char_lalg L) in charFp; rewrite -Frobenius_autE rmorphB. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) have fZ: linear f. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @GRing.Linear.axiom (GRing.Field.ringType (FinRing.Field.fieldType F)) (@SplittingField.lmodType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L) (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) f (@GRing.Scale.scale_law (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@Logic.eq_refl (forall (_ : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (_ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) *) move=> a x y; rewrite -mulr_algl [f _](rmorphD (RMorphism fM)) rmorphM /=. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @eq (@SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.mul (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (f (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) a (GRing.one (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (f x)) (f y)) (@GRing.add (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) a (f x)) (f y)) *) by rewrite (idfP _ _) ?mulr_algl ?memvZ // memv_line. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) have /kAut_to_gal[alpha galLalpha Dalpha]: kAut 1 {:L} (linfun (Linear fZ)). (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: is_true (@kAut (FinRing.Field.fieldType F) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@vline (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@linfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)) (@GRing.Linear.apply (GRing.Field.ringType (FinRing.Field.fieldType F)) (@SplittingField.lmodType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L) (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (Phant (forall _ : @GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lmodType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L), GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@GRing.Linear.Pack (GRing.Field.ringType (FinRing.Field.fieldType F)) (@SplittingField.lmodType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L) (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (Phant (forall _ : @GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lmodType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L), GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) f (@GRing.Linear.class_of_axiom (GRing.Field.ringType (FinRing.Field.fieldType F)) (@SplittingField.lmodType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L) (GRing.Ring.zmodType (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) f (@GRing.Scale.scale_law (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@Logic.eq_refl (forall (_ : GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (_ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.base (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L))) (@GRing.Lmodule.class (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))))) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@SplittingField.lalgType (FinRing.Field.fieldType F) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) L)))) fZ))))) *) rewrite kAutfE; apply/kHomP; split=> [x y _ _ | x /idfP]; rewrite !lfunE //=. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) (* Goal: @eq (@SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) (f (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@Falgebra.vect_lalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) x y)) (@GRing.mul (@GRing.Lalgebra.ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@Falgebra.vect_lalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (FinRing.Field.sort F)) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (f x) (f y)) *) exact: (rmorphM (RMorphism fM)). (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) have{Dalpha} Dalpha: alpha =1 f by move=> a; rewrite -Dalpha ?memvf ?lfunE. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspace1 (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) suffices <-: fixedField [set alpha] = 1%AS. (* Goal: @eq (@Vector.space (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (Phant (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fixedField (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@set1 (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (@asval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@aspace1 (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) *) (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (fun alpha0 : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@fixedField (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@set1 (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha))) alpha0)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) => forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))))) *) by rewrite gal_generated /generator; exists alpha. (* Goal: @eq (@Vector.space (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (Phant (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fixedField (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@set1 (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha)) (@asval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@aspace1 (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) *) apply/vspaceP=> x; apply/fixedFieldP/idfP; rewrite ?memvf // => id_x. (* Goal: forall (x0 : Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (_ : is_true (@in_mem (Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) x0 (@mem (Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (predPredType (Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))))) (@SetDef.pred_of_set (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@set1 (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha))))), @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) x0)) x) x *) (* Goal: @eq (GRing.Ring.sort (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (f x) x *) by rewrite -Dalpha id_x ?set11. (* Goal: forall (x0 : Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (_ : is_true (@in_mem (Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) x0 (@mem (Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))))) (predPredType (Finite.sort (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))))) (@SetDef.pred_of_set (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@set1 (@gal_finType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha))))), @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) x0)) x) x *) by move=> _ /set1P->; rewrite Dalpha. Qed. Lemma finField_galois K E : (K <= E)%VS -> galois K E. Lemma finField_galois_generator K E : (K <= E)%VS -> {alpha | generator 'Gal(E / K) alpha & {in E, forall x, alpha x = x ^+ order K}}. Proof. (* Goal: forall _ : is_true (@subsetv (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)), @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => @prop_in1 (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) (fun x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L => @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) (inPhantom (forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))))) *) move=> sKE; have [alpha defGalLK Dalpha] := galLgen K. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => @prop_in1 (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) (fun x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L => @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) (inPhantom (forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))))) *) have inKL_E: (K <= E <= {:L})%VS by rewrite sKE subvf. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => @prop_in1 (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) (fun x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L => @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) (inPhantom (forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))))) *) have nKE: normalField K E by have/and3P[] := finField_galois sKE. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => @prop_in1 (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) (fun x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L => @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) (inPhantom (forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))))) *) have galLKalpha: alpha \in 'Gal({:L} / K). (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => @prop_in1 (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) (fun x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L => @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) (inPhantom (forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))))) *) (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) alpha (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@galoisG (FinRing.Field.fieldType F) L (@fullv (FinRing.Field.fieldType F) (@SplittingField.vectType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K))))) *) by rewrite (('Gal(_ / _) =P _) defGalLK) cycle_id. (* Goal: @sig2 (FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)))) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) alpha)) (fun alpha : FinGroup.arg_sort (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) => @prop_in1 (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))) (fun x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L => @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))) (inPhantom (forall x : @SplittingField.sort (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L, @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) alpha)) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)))))) *) exists (normalField_cast _ alpha) => [|x Ex]; last first. (* Goal: is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@normalField_cast (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) E alpha)) *) (* Goal: @eq (@GRing.Lmodule.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Vector.lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F)))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@normalField_cast (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) E alpha))) x) (@GRing.exp (@SplittingField.ringType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L) x (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K))) *) by rewrite (normalField_cast_eq inKL_E). (* Goal: is_true (@generator (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@normalField_cast (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) E alpha)) *) rewrite /generator -(morphim_cycle (normalField_cast_morphism inKL_E nKE)) //. (* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E))))) (@galoisG (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K)) (@morphim (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@gval (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@galoisG_group (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K))) (@normalField_cast_morphism (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) K E inKL_E nKE) (@MorPhantom (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@mfun (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) E)) (@gval (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) (@galoisG_group (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) K))) (@normalField_cast_morphism (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) K E inKL_E nKE))) (@cycle (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha))) *) by rewrite -((_ =P <[alpha]>) defGalLK) normalField_img. Qed. End FinGalois. Lemma Fermat's_little_theorem (L : fieldExtType F) (K : {subfield L}) a : (a \in K) = (a ^+ order K == a). Proof. (* Goal: @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) K)))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@GRing.exp (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) a (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) K))) a) *) move: K a; wlog [{L}L -> K a]: L / exists galL : splittingFieldType F, L = galL. (* Goal: @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K)))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@GRing.exp (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) a (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K))) a) *) (* Goal: forall (_ : forall (L : @FieldExt.type (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))) (_ : @ex (@SplittingField.type (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F))) (fun galL : @SplittingField.type (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) => @eq (@FieldExt.type (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F))) L (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) galL))) (K : @aspace_of (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (Phant (@FieldExt.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) L))) (a : @Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))), @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) K)))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@GRing.exp (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) a (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) K))) a)) (K : @aspace_of (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (Phant (@FieldExt.sort (FinRing.Field.ringType F) (Phant (FinRing.Field.sort F)) L))) (a : @Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))), @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) K)))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@GRing.exp (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) a (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) K))) a) *) by pose galL := (FinSplittingFieldType F L) => /(_ galL); apply; exists galL. (* Goal: @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K)))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@GRing.exp (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) a (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K))) a) *) have /galois_fixedField fixLK := finField_galois (subvf K). (* Goal: @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K)))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@GRing.exp (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) a (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K))) a) *) have [alpha defGalLK Dalpha] := finField_galois_generator (subvf K). (* Goal: @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K)))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@GRing.exp (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) a (@order (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)) K))) a) *) rewrite -Dalpha ?memvf // -{1}fixLK (('Gal(_ / _) =P _) defGalLK). (* Goal: @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@fixedField (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) (@cycle (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))) alpha))))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) alpha)) a) a) *) rewrite /cycle -gal_generated (galois_fixedField _) ?fixedField_galois //. (* Goal: @eq bool (@in_mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) a (@mem (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (predPredType (@Vector.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))))) (@pred_of_vspace (FinRing.Field.fieldType F) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L))) (Phant (@Falgebra.sort (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@fixedField_aspace (FinRing.Field.fieldType F) L (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))) (@set1 (FinGroup.arg_finType (FinGroup.base (@gal_finGroupType (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L))))))) alpha)))))) (@eq_op (GRing.Ring.eqType (@Falgebra.vect_ringType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (FinRing.Field.sort F)) L)))) (@fun_of_lfun (GRing.Field.ringType (FinRing.Field.fieldType F)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@Falgebra.vectType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@ahval (FinRing.Field.fieldType F) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@SplittingField.FalgType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L) (@gal_repr (FinRing.Field.fieldType F) L (@asval (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)) (@aspacef (FinRing.Field.fieldType F) (@FieldExt.FalgType (GRing.Field.ringType (FinRing.Field.fieldType F)) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) (@SplittingField.fieldExtType (FinRing.Field.fieldType F) (Phant (GRing.Field.sort (FinRing.Field.fieldType F))) L)))) alpha)) a) a) *) by apply/fixedFieldP/eqP=> [|-> | alpha_x _ /set1P->]; rewrite ?memvf ?set11. Qed. End FinSplittingField. Section FinFieldExists. Let map_poly_extField (F : fieldType) (L : fieldExtType F) := map_poly (in_alg L) : {poly F} -> {poly L}. Local Notation "p ^%:A" := (map_poly_extField _ p) (at level 2, format "p ^%:A") : ring_scope. Lemma FinSplittingFieldFor (F : finFieldType) (p : {poly F}) : p != 0 -> {L : splittingFieldType F | splittingFieldFor 1 p^%:A {:L}}. Lemma PrimePowerField p k (m := (p ^ k)%N) : prime p -> 0 < k -> {Fm : finFieldType | p \in [char Fm] & #|Fm| = m}. End FinFieldExists. Section FinDomain. Import ssrnum ssrint algC cyclotomic Num.Theory. Local Infix "%|" := dvdn. Variable R : finUnitRingType. Hypothesis domR : GRing.IntegralDomain.axiom R. Implicit Types x y : R. Let lregR x : x != 0 -> GRing.lreg x. Proof. (* Goal: forall _ : is_true (negb (@eq_op (FinRing.UnitRing.eqType R) x (GRing.zero (FinRing.UnitRing.zmodType R)))), @GRing.lreg (FinRing.UnitRing.ringType R) x *) by move=> xnz; apply: mulrI0_lreg => y /domR/orP[/idPn | /eqP]. Qed. Lemma finDomain_field : GRing.Field.mixin_of R. Proof. (* Goal: GRing.Field.mixin_of (FinRing.UnitRing.unitRingType R) *) move=> x /lregR-regx; apply/unitrP; exists (invF regx 1). (* Goal: and (@eq (GRing.Ring.sort (GRing.UnitRing.ringType (FinRing.UnitRing.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (FinRing.UnitRing.unitRingType R)) (@invF (FinRing.Ring.join_finType (FinRing.UnitRing.finRingType R)) (@GRing.mul (FinRing.UnitRing.ringType R) x) regx (GRing.one (FinRing.Ring.ringType (FinRing.UnitRing.finRingType R)))) x) (GRing.one (GRing.UnitRing.ringType (FinRing.UnitRing.unitRingType R)))) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType (FinRing.UnitRing.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (FinRing.UnitRing.unitRingType R)) x (@invF (FinRing.Ring.join_finType (FinRing.UnitRing.finRingType R)) (@GRing.mul (FinRing.UnitRing.ringType R) x) regx (GRing.one (FinRing.Ring.ringType (FinRing.UnitRing.finRingType R))))) (GRing.one (GRing.UnitRing.ringType (FinRing.UnitRing.unitRingType R)))) *) by split; first apply: (regx); rewrite ?mulrA f_invF // mulr1 mul1r. Qed. Theorem finDomain_mulrC : @commutative R R *%R. Definition FinDomainFieldType : finFieldType := let fin_unit_class := FinRing.UnitRing.class R in let com_class := GRing.ComRing.Class finDomain_mulrC in let com_unit_class := @GRing.ComUnitRing.Class R com_class fin_unit_class in let dom_class := @GRing.IntegralDomain.Class R com_unit_class domR in let field_class := @GRing.Field.Class R dom_class finDomain_field in let finfield_class := @FinRing.Field.Class R field_class fin_unit_class in FinRing.Field.Pack finfield_class. Definition FinDomainSplittingFieldType p (charRp : p \in [char R]) := let RoverFp := @primeChar_splittingFieldType p FinDomainFieldType charRp in [splittingFieldType 'F_p of R for RoverFp]. End FinDomain.
Require Export GeoCoq.Elements.OriginalProofs.lemma_squarerectangle. Section Euclid. Context `{Ax1:area}. Lemma lemma_squaresequal : forall A B C D a b c d, Cong A B a b -> SQ A B C D -> SQ a b c d -> EF A B C D a b c d. Proof. (* Goal: forall (A B C D a b c d : @Point Ax0) (_ : @Cong Ax0 A B a b) (_ : @SQ Ax0 A B C D) (_ : @SQ Ax0 a b c d), @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) intros. (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Per D A B) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Per d a b) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (CongA D A B d a b) by (conclude lemma_Euclid4). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong A B D A) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong a b d a) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong D A A B) by (conclude lemma_congruencesymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong D A a b) by (conclude lemma_congruencetransitive). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong D A d a) by (conclude lemma_congruencetransitive). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (PG A B C D) by (conclude lemma_squareparallelogram). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (PG a b c d) by (conclude lemma_squareparallelogram). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Par A B C D) by (conclude_def PG ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Par a b c d) by (conclude_def PG ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (nCol A B D) by (forward_using lemma_parallelNC). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (nCol a b d) by (forward_using lemma_parallelNC). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong A D a d) by (forward_using lemma_congruenceflip). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong D B d b) by (conclude proposition_04). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong B D b d) by (forward_using lemma_congruenceflip). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Triangle A B D) by (conclude_def Triangle ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong_3 A B D a b d) by (conclude_def Cong_3 ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET A B D a b d) by (conclude axiom_congruentequal). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET A B D b d a) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET b d a A B D) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET b d a B D A) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET B D A b d a) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong A B B C) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong a b b c) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong A B C D) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong a b c d) by (conclude_def SQ ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong B C A B) by (conclude lemma_congruencesymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong B C a b) by (conclude lemma_congruencetransitive). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong B C b c) by (conclude lemma_congruencetransitive). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong C D A B) by (conclude lemma_congruencesymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong C D a b) by (conclude lemma_congruencetransitive). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong C D c d) by (conclude lemma_congruencetransitive). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (nCol B C D) by (forward_using lemma_parallelNC). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Triangle B C D) by (conclude_def Triangle ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (Cong_3 B C D b c d) by (conclude_def Cong_3 ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET B C D b c d) by (conclude axiom_congruentequal). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET B C D b d c) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET b d c B C D) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET b d c B D C) by (forward_using axiom_ETpermutation). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (ET B D C b d c) by (conclude axiom_ETsymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (RE A B C D) by (conclude lemma_squarerectangle). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (CR A C B D) by (conclude_def RE ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) let Tf:=fresh in assert (Tf:exists M, (BetS A M C /\ BetS B M D)) by (conclude_def CR );destruct Tf as [M];spliter. (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (RE a b c d) by (conclude lemma_squarerectangle). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (CR a c b d) by (conclude_def RE ). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) let Tf:=fresh in assert (Tf:exists m, (BetS a m c /\ BetS b m d)) by (conclude_def CR );destruct Tf as [m];spliter. (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (EF B A D C b a d c) by (conclude axiom_paste3). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (EF B A D C a b c d) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (EF a b c d B A D C) by (conclude axiom_EFsymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (EF a b c d A B C D) by (forward_using axiom_EFpermutation). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) assert (EF A B C D a b c d) by (conclude axiom_EFsymmetric). (* Goal: @EF Ax0 Ax2 Ax Ax1 A B C D a b c d *) close. Qed. End Euclid.
Require Import Ensf_types. Require Import Ensf_dans. Require Import Ensf_union. Require Import Ensf_inclus. Definition inter (A B C : Ensf) : Prop := inclus C A /\ inclus C B /\ (forall x : Elt, dans x A -> dans x B -> dans x C). Lemma union_inter : forall a b c : Ensf, inter a b empty -> inter a c empty -> inter a (union b c) empty. Proof. (* Goal: forall (a b c : Ensf) (_ : inter a b empty) (_ : inter a c empty), inter a (union b c) empty *) unfold inter in |- *. (* Goal: forall (a b c : Ensf) (_ : and (inclus empty a) (and (inclus empty b) (forall (x : Elt) (_ : dans x a) (_ : dans x b), dans x empty))) (_ : and (inclus empty a) (and (inclus empty c) (forall (x : Elt) (_ : dans x a) (_ : dans x c), dans x empty))), and (inclus empty a) (and (inclus empty (union b c)) (forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty)) *) intros. (* Goal: and (inclus empty a) (and (inclus empty (union b c)) (forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty)) *) elim H0; clear H0. (* Goal: forall (_ : inclus empty a) (_ : and (inclus empty c) (forall (x : Elt) (_ : dans x a) (_ : dans x c), dans x empty)), and (inclus empty a) (and (inclus empty (union b c)) (forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty)) *) intros H0 H1; elim H1; clear H1; intros H1 H2. (* Goal: and (inclus empty a) (and (inclus empty (union b c)) (forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty)) *) elim H; clear H. (* Goal: forall (_ : inclus empty a) (_ : and (inclus empty b) (forall (x : Elt) (_ : dans x a) (_ : dans x b), dans x empty)), and (inclus empty a) (and (inclus empty (union b c)) (forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty)) *) intros H3 H4; elim H4; clear H4; intros H4 H5. (* Goal: and (inclus empty a) (and (inclus empty (union b c)) (forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty)) *) split; auto. (* Goal: and (inclus empty (union b c)) (forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty) *) split. (* Goal: forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty *) (* Goal: inclus empty (union b c) *) apply empty_inclus. (* Goal: forall (x : Elt) (_ : dans x a) (_ : dans x (union b c)), dans x empty *) intros. (* Goal: dans x empty *) cut (dans x b \/ dans x c); auto. (* Goal: forall _ : or (dans x b) (dans x c), dans x empty *) intro H7; elim H7; auto. Qed. Lemma inter_union : forall A B C : Ensf, inter A C empty -> inter B C empty -> inter (union A B) C empty. Proof. (* Goal: forall (A B C : Ensf) (_ : inter A C empty) (_ : inter B C empty), inter (union A B) C empty *) unfold inter in |- *. (* Goal: forall (A B C : Ensf) (_ : and (inclus empty A) (and (inclus empty C) (forall (x : Elt) (_ : dans x A) (_ : dans x C), dans x empty))) (_ : and (inclus empty B) (and (inclus empty C) (forall (x : Elt) (_ : dans x B) (_ : dans x C), dans x empty))), and (inclus empty (union A B)) (and (inclus empty C) (forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty)) *) intros. (* Goal: and (inclus empty (union A B)) (and (inclus empty C) (forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty)) *) elim H0; clear H0. (* Goal: forall (_ : inclus empty B) (_ : and (inclus empty C) (forall (x : Elt) (_ : dans x B) (_ : dans x C), dans x empty)), and (inclus empty (union A B)) (and (inclus empty C) (forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty)) *) intros H0 H1; elim H1; clear H1; intros H1 H2. (* Goal: and (inclus empty (union A B)) (and (inclus empty C) (forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty)) *) elim H; clear H. (* Goal: forall (_ : inclus empty A) (_ : and (inclus empty C) (forall (x : Elt) (_ : dans x A) (_ : dans x C), dans x empty)), and (inclus empty (union A B)) (and (inclus empty C) (forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty)) *) intros H3 H4; elim H4; clear H4; intros H4 H5. (* Goal: and (inclus empty (union A B)) (and (inclus empty C) (forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty)) *) split; auto. (* Goal: and (inclus empty C) (forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty) *) split; auto. (* Goal: forall (x : Elt) (_ : dans x (union A B)) (_ : dans x C), dans x empty *) intros. (* Goal: dans x empty *) cut (dans x A \/ dans x B); auto. (* Goal: forall _ : or (dans x A) (dans x B), dans x empty *) intro H7; elim H7; auto. Qed. Lemma inter_dans : forall (A B : Ensf) (x : Elt), inter A B empty -> dans x A -> ~ dans x B. Proof. (* Goal: forall (A B : Ensf) (x : Elt) (_ : inter A B empty) (_ : dans x A), not (dans x B) *) unfold inter in |- *. (* Goal: forall (A B : Ensf) (x : Elt) (_ : and (inclus empty A) (and (inclus empty B) (forall (x0 : Elt) (_ : dans x0 A) (_ : dans x0 B), dans x0 empty))) (_ : dans x A), not (dans x B) *) intros. (* Goal: not (dans x B) *) elim H; clear H; intros H Ht; elim Ht; clear Ht; intros H1 H2. (* Goal: not (dans x B) *) red in |- *; intro. (* Goal: False *) cut (dans x empty); auto. (* Goal: forall _ : dans x empty, False *) intro. (* Goal: False *) apply dans_empty_imp_P with x; auto. Qed. Lemma sym_inter : forall A B C : Ensf, inter A B C -> inter B A C. Proof. (* Goal: forall (A B C : Ensf) (_ : inter A B C), inter B A C *) unfold inter in |- *. (* Goal: forall (A B C : Ensf) (_ : and (inclus C A) (and (inclus C B) (forall (x : Elt) (_ : dans x A) (_ : dans x B), dans x C))), and (inclus C B) (and (inclus C A) (forall (x : Elt) (_ : dans x B) (_ : dans x A), dans x C)) *) intros. (* Goal: and (inclus C B) (and (inclus C A) (forall (x : Elt) (_ : dans x B) (_ : dans x A), dans x C)) *) elim H; clear H; intros H Ht; elim Ht; clear Ht; intros H0 H1. (* Goal: and (inclus C B) (and (inclus C A) (forall (x : Elt) (_ : dans x B) (_ : dans x A), dans x C)) *) auto. Qed.
Set Implicit Arguments. Unset Strict Implicit. Require Export Group_util. Section Free_group_def. Variable V : SET. Inductive FG : Type := | Var : V -> FG | Law : FG -> FG -> FG | Unit : FG | Inv : FG -> FG. Inductive eqFG : FG -> FG -> Prop := | eqFG_Var : forall x y : V, Equal x y -> (eqFG (Var x) (Var y):Prop) | eqFG_law : forall x x' y y' : FG, eqFG x x' -> eqFG y y' -> (eqFG (Law x y) (Law x' y'):Prop) | eqFG_law_assoc : forall x y z : FG, eqFG (Law (Law x y) z) (Law x (Law y z)):Prop | eqFG_law0r : forall x : FG, eqFG (Law x Unit) x:Prop | eqFG_inv : forall x y : FG, eqFG x y -> eqFG (Inv x) (Inv y) | eqFG_invr : forall x : FG, eqFG (Law x (Inv x)) Unit | eqFG_refl : forall x : FG, eqFG x x:Prop | eqFG_sym : forall x y : FG, eqFG x y -> (eqFG y x:Prop) | eqFG_trans : forall x y z : FG, eqFG x y -> eqFG y z -> (eqFG x z:Prop). Hint Resolve eqFG_Var eqFG_law eqFG_law_assoc eqFG_law0r eqFG_invr eqFG_refl: algebra. Hint Immediate eqFG_sym: algebra. Lemma eqFG_Equiv : equivalence eqFG. Proof. (* Goal: @equivalence FG eqFG *) red in |- *. (* Goal: and (@reflexive FG eqFG) (@partial_equivalence FG eqFG) *) split; [ try assumption | idtac ]. (* Goal: @partial_equivalence FG eqFG *) (* Goal: @reflexive FG eqFG *) exact eqFG_refl. (* Goal: @partial_equivalence FG eqFG *) red in |- *. (* Goal: and (@transitive FG eqFG) (@symmetric FG eqFG) *) split; [ try assumption | idtac ]. (* Goal: @symmetric FG eqFG *) (* Goal: @transitive FG eqFG *) exact eqFG_trans. (* Goal: @symmetric FG eqFG *) exact eqFG_sym. Qed. Definition FG_set := Build_Setoid eqFG_Equiv. Definition FreeGroup : GROUP. Proof. (* Goal: Ob GROUP *) apply (BUILD_GROUP (E:=FG_set) (genlaw:=Law) (e:=Unit) (geninv:=Inv)). (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x Unit) x *) (* Goal: forall x y z : Carrier FG_set, @Equal FG_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall (x x' y y' : Carrier FG_set) (_ : @Equal FG_set x x') (_ : @Equal FG_set y y'), @Equal FG_set (Law x y) (Law x' y') *) exact eqFG_law. (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x Unit) x *) (* Goal: forall x y z : Carrier FG_set, @Equal FG_set (Law (Law x y) z) (Law x (Law y z)) *) exact eqFG_law_assoc. (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x Unit) x *) exact eqFG_law0r. (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FG_set) (_ : @Equal FG_set x y), @Equal FG_set (Inv x) (Inv y) *) exact eqFG_inv. (* Goal: forall x : Carrier FG_set, @Equal FG_set (Law x (Inv x)) Unit *) exact eqFG_invr. Qed. Section Universal_prop. Variable G : GROUP. Variable f : Hom V G. Fixpoint FG_lift_fun (p : FreeGroup) : G := match p with | Var v => f v | Law p1 p2 => sgroup_law _ (FG_lift_fun p1) (FG_lift_fun p2) | Unit => monoid_unit G | Inv p1 => group_inverse G (FG_lift_fun p1) end. Definition FG_lift : Hom FreeGroup G. Proof. (* Goal: Carrier (@Hom GROUP FreeGroup G) *) apply (BUILD_HOM_GROUP (G:=FreeGroup) (G':=G) (ff:=FG_lift_fun)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun y) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun y) *) elim H'; simpl in |- *; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: forall (x y z : FG) (_ : eqFG x y) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun y)) (_ : eqFG y z) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y) (FG_lift_fun z)), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x) (FG_lift_fun z) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun z) *) apply Trans with (FG_lift_fun y0); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid FreeGroup))), @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (sgroup_law (monoid_sgroup (group_monoid FreeGroup)) x y)) (sgroup_law (monoid_sgroup (group_monoid G)) (FG_lift_fun x) (FG_lift_fun y)) *) simpl in |- *; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun (@monoid_unit (monoid_sgroup (group_monoid FreeGroup)) (monoid_on_def (group_monoid FreeGroup)))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *) simpl in |- *; auto with algebra. Qed. Definition FG_var : Hom V FreeGroup. Proof. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup (group_monoid FreeGroup)))) *) apply (Build_Map (A:=V) (B:=FreeGroup) (Ap:=Var)). (* Goal: @fun_compatible V (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) Var *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Qed. Lemma FG_comp_prop : Equal f (comp_hom (FG_lift:Hom (FreeGroup:SET) G) FG_var). Proof. (* Goal: @Equal (@Hom SET V (sgroup_set (monoid_sgroup (group_monoid G)))) f (@comp_hom SET V (sgroup_set (monoid_sgroup (group_monoid FreeGroup))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid FreeGroup)) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid FreeGroup) (group_monoid G) FG_lift) : Carrier (@Hom SET (sgroup_set (monoid_sgroup (group_monoid FreeGroup)) : Ob SET) (sgroup_set (monoid_sgroup (group_monoid G))))) FG_var) *) simpl in |- *. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid G))) f (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x y : FG) (H' : eqFG x y) => @eqFG_ind (fun x0 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x0 x' y0 y' : FG) (_ : eqFG x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x0 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z)) (fun x0 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun x0 : FG => @GROUP_inverse_r G (FG_lift_fun x0)) (fun x0 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0)) (fun (x0 y0 : FG) (_ : eqFG x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) H0) (fun (x0 y0 z : FG) (_ : eqFG x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x0) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x y H')) FG_var) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) (@comp_hom SET V FG_set (sgroup_set (monoid_sgroup (group_monoid G))) (@f2 FreeGroup G FG_lift_fun (fun (x0 y : FG) (H' : eqFG x0 y) => @eqFG_ind (fun x1 y0 : FG => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid G))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid G)))) f)) (fun (x1 x' y0 y' : FG) (_ : eqFG x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun x')) (_ : eqFG y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid G)) (FG_lift_fun x1) (FG_lift_fun x') (FG_lift_fun y0) (FG_lift_fun y') H0 H2) (fun x1 y0 z : FG => @SGROUP_assoc (monoid_sgroup (group_monoid G)) (FG_lift_fun x1) (FG_lift_fun y0) (FG_lift_fun z)) (fun x1 : FG => @MONOID_unit_r (group_monoid G) (FG_lift_fun x1)) (fun (x1 y0 : FG) (_ : eqFG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) => @GROUP_comp G (FG_lift_fun x1) (FG_lift_fun y0) H0) (fun x1 : FG => @GROUP_inverse_r G (FG_lift_fun x1)) (fun x1 : FG => @Refl (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1)) (fun (x1 y0 : FG) (_ : eqFG x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0) H0) (fun (x1 y0 z : FG) (_ : eqFG x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0)) (_ : eqFG y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun y0) (FG_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid G))) (FG_lift_fun x1) (FG_lift_fun y0) (FG_lift_fun z) H'1 H'3) x0 y H')) FG_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid G))) f x) *) auto with algebra. Qed. End Universal_prop. End Free_group_def. Hint Resolve FG_comp_prop: algebra.
Require Import Ensf. Require Import Words. Require Import more_words. Require Import need. Hint Resolve dans_map_inv. Hint Resolve dans_map. Hint Resolve dans_add1. Definition comp (f g : Elt -> Elt) (x : Elt) := f (g x). Lemma map_map_eg_map_comp : forall (f g : Elt -> Elt) (E : Ensf), map f (map g E) = map (comp f g) E :>Ensf. Proof. (* Goal: forall (f g : forall _ : Elt, Elt) (E : Ensf), @eq Ensf (map f (map g E)) (map (comp f g) E) *) intros f g. (* Goal: forall E : Ensf, @eq Ensf (map f (map g E)) (map (comp f g) E) *) simple induction E; simpl in |- *; auto. Qed. Definition comp_word (f g : Word -> Word) (x : Word) := f (g x). Definition eg_f_W_W (f g : Word -> Word) := forall x : Word, f x = g x :>Word. Lemma comp_Word_ext : forall f g : Elt -> Elt, eg_f_W_W (Word_ext (comp f g)) (comp_word (Word_ext f) (Word_ext g)). Proof. (* Goal: forall f g : forall _ : Elt, Elt, eg_f_W_W (Word_ext (comp f g)) (comp_word (Word_ext f) (Word_ext g)) *) intros f g. (* Goal: eg_f_W_W (Word_ext (comp f g)) (comp_word (Word_ext f) (Word_ext g)) *) unfold eg_f_W_W, Word_ext, comp, comp_word in |- *. (* Goal: forall x : Word, @eq Word ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) (fun x0 : Elt => f (g x0)) x) ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) g x)) *) simple induction x; simpl in |- *; auto. Qed. Hint Resolve comp_Word_ext. Definition Id (E : Ensf) (f : Elt -> Elt) := forall x : Elt, dans x E -> f x = x :>Elt. Lemma Id_inv : forall (E : Ensf) (f : Elt -> Elt) (x : Elt), dans x E -> Id E f -> f x = x :>Elt. Proof. (* Goal: forall (E : Ensf) (f : forall _ : Elt, Elt) (x : Elt) (_ : dans x E) (_ : Id E f), @eq Elt (f x) x *) auto. Qed. Hint Unfold Id. Lemma Id_inclus : forall (E F : Ensf) (f : Elt -> Elt), inclus F E -> Id E f -> Id F f. Proof. (* Goal: forall (E F : Ensf) (f : forall _ : Elt, Elt) (_ : inclus F E) (_ : Id E f), Id F f *) auto. Qed. Lemma map_Id : forall (E : Ensf) (f : Elt -> Elt), Id E f -> map f E = E :>Ensf. Proof. (* Goal: forall (E : Ensf) (f : forall _ : Elt, Elt) (_ : Id E f), @eq Ensf (map f E) E *) intros E f. (* Goal: forall _ : Id E f, @eq Ensf (map f E) E *) elim E; unfold map in |- *. (* Goal: forall (e : Elt) (e0 : Ensf) (_ : forall _ : Id e0 f, @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e1 : Ensf) {struct e1} : Ensf := match e1 with | empty => empty | add y e2 => add (f y) (map f e2) end) f e0) e0) (_ : Id (add e e0) f), @eq Ensf (add (f e) ((fix map (f : forall _ : Elt, Elt) (e1 : Ensf) {struct e1} : Ensf := match e1 with | empty => empty | add y e2 => add (f y) (map f e2) end) f e0)) (add e e0) *) (* Goal: forall _ : Id empty f, @eq Ensf empty empty *) auto. (* Goal: forall (e : Elt) (e0 : Ensf) (_ : forall _ : Id e0 f, @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e1 : Ensf) {struct e1} : Ensf := match e1 with | empty => empty | add y e2 => add (f y) (map f e2) end) f e0) e0) (_ : Id (add e e0) f), @eq Ensf (add (f e) ((fix map (f : forall _ : Elt, Elt) (e1 : Ensf) {struct e1} : Ensf := match e1 with | empty => empty | add y e2 => add (f y) (map f e2) end) f e0)) (add e e0) *) intros a b Hyp_rec Id_a_b_f. (* Goal: @eq Ensf (add (f a) ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f b)) (add a b) *) apply add_add. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f b) b *) (* Goal: @eq Elt (f a) a *) auto. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f b) b *) apply Hyp_rec. (* Goal: Id b f *) apply Id_inclus with (add a b); auto. Qed. Definition Id_words (E : Ensf) (f : Word -> Word) := forall x : Word, inmonoid E x -> f x = x :>Word. Lemma Id_words_inv : forall (E : Ensf) (f : Word -> Word) (x : Word), inmonoid E x -> Id_words E f -> f x = x :>Word. Proof. (* Goal: forall (E : Ensf) (f : forall _ : Word, Word) (x : Word) (_ : inmonoid E x) (_ : Id_words E f), @eq Word (f x) x *) auto. Qed. Lemma Id_words_inclus : forall (E F : Ensf) (f : Word -> Word), inclus F E -> Id_words E f -> Id_words F f. Proof. (* Goal: forall (E F : Ensf) (f : forall _ : Word, Word) (_ : inclus F E) (_ : Id_words E f), Id_words F f *) intros E F f inclus_F_E Id_E_f. (* Goal: Id_words F f *) red in |- *. (* Goal: forall (x : Word) (_ : inmonoid F x), @eq Word (f x) x *) intros x inmonoid_F_x. (* Goal: @eq Word (f x) x *) apply Id_E_f. (* Goal: inmonoid E x *) apply inmonoid_inclus with F; assumption. Qed. Lemma extension_Id : forall (E : Ensf) (f : Elt -> Elt), Id E f -> Id_words E (Word_ext f). Proof. (* Goal: forall (E : Ensf) (f : forall _ : Elt, Elt) (_ : Id E f), Id_words E (Word_ext f) *) intros E f Id_E_f. (* Goal: Id_words E (Word_ext f) *) red in |- *. (* Goal: forall (x : Word) (_ : inmonoid E x), @eq Word (Word_ext f x) x *) simple induction x; clear x. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid E w, @eq Word (Word_ext f w) w) (_ : inmonoid E (cons e w)), @eq Word (Word_ext f (cons e w)) (cons e w) *) (* Goal: forall _ : inmonoid E nil, @eq Word (Word_ext f nil) nil *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid E w, @eq Word (Word_ext f w) w) (_ : inmonoid E (cons e w)), @eq Word (Word_ext f (cons e w)) (cons e w) *) unfold Word_ext in |- *. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid E w, @eq Word ((fix Word_ext (f : forall _ : Elt, Elt) (w0 : Word) {struct w0} : Word := match w0 with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f w) w) (_ : inmonoid E (cons e w)), @eq Word (cons (f e) ((fix Word_ext (f : forall _ : Elt, Elt) (w0 : Word) {struct w0} : Word := match w0 with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f w)) (cons e w) *) intros x w Hyp inmonoid_E_cons_x_w. (* Goal: @eq Word (cons (f x) ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f w)) (cons x w) *) simpl in |- *. (* Goal: @eq Word (cons (f x) ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f w)) (cons x w) *) apply cons_cons. (* Goal: @eq Word ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f w) w *) (* Goal: @eq Elt (f x) x *) apply Id_E_f; apply inmonoid_cons_inv2 with w; assumption. (* Goal: @eq Word ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f w) w *) apply Hyp. (* Goal: inmonoid E w *) apply inmonoid_cons_inv with x; assumption. Qed. Section fonctions. Variable E : Ensf. Variable F : Ensf. Variable f : Elt -> Elt. Definition application := forall x : Elt, dans x E -> dans (f x) F. Hint Unfold application. Definition is_mono := forall x y : Elt, dans x E -> dans y E -> f x = f y :>Elt -> x = y :>Elt. Definition is_epi := application /\ (forall x : Elt, dans x F -> exists2 y : Elt, x = f y & dans y E). Definition is_iso := is_epi /\ is_mono. Lemma mono_epi_imp_iso : is_mono -> is_epi -> is_iso. Proof. (* Goal: forall (_ : is_mono) (_ : is_epi), is_iso *) intros; red in |- *; auto. Qed. Variable fw : Word -> Word. Definition application_words := forall x : Word, inmonoid E x -> inmonoid F (fw x). Definition is_mono_words := forall x y : Word, inmonoid E x -> inmonoid E y -> fw x = fw y :>Word -> x = y :>Word. Definition is_epi_words := application_words /\ (forall x : Word, inmonoid F x -> exists2 y : Word, x = fw y & inmonoid E y). Definition is_iso_words := is_mono_words /\ is_epi_words. Lemma mono_epi_imp_iso_words : is_mono_words -> is_epi_words -> is_iso_words. Proof. (* Goal: forall (_ : is_mono_words) (_ : is_epi_words), is_iso_words *) intros; red in |- *; auto. Qed. End fonctions. Hint Resolve mono_epi_imp_iso. Parameter inv : Ensf -> Ensf -> (Elt -> Elt) -> Elt -> Elt. Axiom dans_inv_f : forall (E F : Ensf) (f : Elt -> Elt), is_iso E F f -> forall x : Elt, dans x F -> dans (inv E F f x) E. Hint Resolve dans_inv_f. Axiom inv1 : forall (E F : Ensf) (f : Elt -> Elt), is_iso E F f -> forall x : Elt, dans x E -> inv E F f (f x) = x :>Elt. Hint Resolve inv1. Axiom inv2 : forall (E F : Ensf) (f : Elt -> Elt), is_iso E F f -> forall x : Elt, dans x F -> f (inv E F f x) = x :>Elt. Hint Resolve inv2. Lemma inv1' : forall (E F : Ensf) (f : Elt -> Elt), is_iso E F f -> Id E (comp (inv E F f) f). Proof. (* Goal: forall (E F : Ensf) (f : forall _ : Elt, Elt) (_ : is_iso E F f), Id E (comp (inv E F f) f) *) unfold Id, comp in |- *. (* Goal: forall (E F : Ensf) (f : forall _ : Elt, Elt) (_ : is_iso E F f) (x : Elt) (_ : dans x E), @eq Elt (inv E F f (f x)) x *) intros. (* Goal: @eq Elt (inv E F f (f x)) x *) auto. Qed. Hint Resolve inv1'. Axiom extension_spec : forall (V : Ensf) (f : Elt -> Elt) (x : Elt), {y : Elt | dans x V /\ y = f x :>Elt \/ ~ dans x V /\ y = x :>Elt}. Definition extension (V : Ensf) (f : Elt -> Elt) (x : Elt) := let (y, p) return Elt := extension_spec V f x in y. Lemma extension_in : forall (e : Ensf) (f : Elt -> Elt) (x : Elt), dans x e -> extension e f x = f x :>Elt. Proof. (* Goal: forall (e : Ensf) (f : forall _ : Elt, Elt) (x : Elt) (_ : dans x e), @eq Elt (extension e f x) (f x) *) unfold extension in |- *. (* Goal: forall (e : Ensf) (f : forall _ : Elt, Elt) (x : Elt) (_ : dans x e), @eq Elt (let (y, _) := extension_spec e f x in y) (f x) *) intros e f x dans_x_e. (* Goal: @eq Elt (let (y, _) := extension_spec e f x in y) (f x) *) elim (extension_spec e f x). (* Goal: forall (x0 : Elt) (_ : or (and (dans x e) (@eq Elt x0 (f x))) (and (not (dans x e)) (@eq Elt x0 x))), @eq Elt x0 (f x) *) intro. (* Goal: forall _ : or (and (dans x e) (@eq Elt x0 (f x))) (and (not (dans x e)) (@eq Elt x0 x)), @eq Elt x0 (f x) *) tauto. Qed. Lemma extension_out : forall (e : Ensf) (f : Elt -> Elt) (x : Elt), ~ dans x e -> extension e f x = x :>Elt. Proof. (* Goal: forall (e : Ensf) (f : forall _ : Elt, Elt) (x : Elt) (_ : not (dans x e)), @eq Elt (extension e f x) x *) unfold extension in |- *. (* Goal: forall (e : Ensf) (f : forall _ : Elt, Elt) (x : Elt) (_ : not (dans x e)), @eq Elt (let (y, _) := extension_spec e f x in y) x *) intros e f x N_dans_x_e. (* Goal: @eq Elt (let (y, _) := extension_spec e f x in y) x *) elim (extension_spec e f x). (* Goal: forall (x0 : Elt) (_ : or (and (dans x e) (@eq Elt x0 (f x))) (and (not (dans x e)) (@eq Elt x0 x))), @eq Elt x0 x *) intro; tauto. Qed. Section fonctions2. Variable E : Ensf. Variable F : Ensf. Variable f : Elt -> Elt. Hint Unfold application. Lemma is_epi_f_over_image : is_epi E (map f E) f. Proof. (* Goal: is_epi E (map f E) f *) split. (* Goal: forall (x : Elt) (_ : dans x (map f E)), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E) *) (* Goal: application E (map f E) f *) auto. (* Goal: forall (x : Elt) (_ : dans x (map f E)), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E) *) intros. (* Goal: @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E) *) cut (exists y : Elt, dans y E /\ x = f y :>Elt). (* Goal: @ex Elt (fun y : Elt => and (dans y E) (@eq Elt x (f y))) *) (* Goal: forall _ : @ex Elt (fun y : Elt => and (dans y E) (@eq Elt x (f y))), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E) *) intro temp; elim temp; clear temp. (* Goal: @ex Elt (fun y : Elt => and (dans y E) (@eq Elt x (f y))) *) (* Goal: forall (x0 : Elt) (_ : and (dans x0 E) (@eq Elt x (f x0))), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E) *) intro. (* Goal: @ex Elt (fun y : Elt => and (dans y E) (@eq Elt x (f y))) *) (* Goal: forall _ : and (dans x0 E) (@eq Elt x (f x0)), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E) *) intuition. (* Goal: @ex Elt (fun y : Elt => and (dans y E) (@eq Elt x (f y))) *) (* Goal: @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E) *) prolog [ ex_intro2 ] 4. (* Goal: @ex Elt (fun y : Elt => and (dans y E) (@eq Elt x (f y))) *) auto. Qed. Hint Resolve is_epi_f_over_image. Lemma mono_imp_iso_over_image : is_mono E f -> is_iso E (map f E) f. Proof. (* Goal: forall _ : is_mono E f, is_iso E (map f E) f *) auto. Qed. Let invf := inv E F f. Hint Unfold invf. Lemma inv_is_mono : is_iso E F f -> is_mono F invf. Proof. (* Goal: forall _ : is_iso E F f, is_mono F invf *) intros. (* Goal: is_mono F invf *) red in |- *. (* Goal: forall (x y : Elt) (_ : dans x F) (_ : dans y F) (_ : @eq Elt (invf x) (invf y)), @eq Elt x y *) intros x y dans_x dans_y egal_inv. (* Goal: @eq Elt x y *) replace x with (f (inv E F f x)). (* Goal: @eq Elt (f (inv E F f x)) x *) (* Goal: @eq Elt (f (inv E F f x)) y *) replace y with (f (inv E F f y)). (* Goal: @eq Elt (f (inv E F f x)) x *) (* Goal: @eq Elt (f (inv E F f y)) y *) (* Goal: @eq Elt (f (inv E F f x)) (f (inv E F f y)) *) apply (f_equal (A:=Elt) (B:=Elt)); assumption. (* Goal: @eq Elt (f (inv E F f x)) x *) (* Goal: @eq Elt (f (inv E F f y)) y *) auto. (* Goal: @eq Elt (f (inv E F f x)) x *) auto. Qed. Lemma inv_is_epi : is_iso E F f -> is_epi F E invf. Proof. (* Goal: forall _ : is_iso E F f, is_epi F E invf *) unfold invf in |- *. (* Goal: forall _ : is_iso E F f, is_epi F E (inv E F f) *) intro is_iso_f. (* Goal: is_epi F E (inv E F f) *) split. (* Goal: forall (x : Elt) (_ : dans x E), @ex2 Elt (fun y : Elt => @eq Elt x (inv E F f y)) (fun y : Elt => dans y F) *) (* Goal: application F E (inv E F f) *) auto. (* Goal: forall (x : Elt) (_ : dans x E), @ex2 Elt (fun y : Elt => @eq Elt x (inv E F f y)) (fun y : Elt => dans y F) *) intros x dans_x. (* Goal: @ex2 Elt (fun y : Elt => @eq Elt x (inv E F f y)) (fun y : Elt => dans y F) *) exists (f x); [ apply sym_equal; auto | elim is_iso_f ]. (* Goal: forall (_ : is_epi E F f) (_ : is_mono E f), dans (f x) F *) intros is_epi_f. (* Goal: forall _ : is_mono E f, dans (f x) F *) elim is_epi_f. (* Goal: forall (_ : application E F f) (_ : forall (x : Elt) (_ : dans x F), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E)) (_ : is_mono E f), dans (f x) F *) auto. Qed. Let wef := Word_ext f. Lemma application_imp_application_words : application E F f -> application_words E F wef. Proof. (* Goal: forall _ : application E F f, application_words E F wef *) intro Hyp. (* Goal: application_words E F wef *) red in |- *. (* Goal: forall (x : Word) (_ : inmonoid E x), inmonoid F (wef x) *) intros x inmon; elim inmon; clear inmon. (* Goal: forall (w : Word) (e : Elt) (_ : inmonoid E w) (_ : inmonoid F (wef w)) (_ : dans e E), inmonoid F (wef (cons e w)) *) (* Goal: inmonoid F (wef nil) *) auto. (* Goal: forall (w : Word) (e : Elt) (_ : inmonoid E w) (_ : inmonoid F (wef w)) (_ : dans e E), inmonoid F (wef (cons e w)) *) intros. (* Goal: inmonoid F (wef (cons e w)) *) replace (wef (cons e w)) with (cons (f e) (wef w)); auto. Qed. Hint Resolve application_imp_application_words. Lemma is_mono_f_imp_is_mono_words : is_mono E f -> is_mono_words E wef. Proof. (* Goal: forall _ : is_mono E f, is_mono_words E wef *) intro Hyp. (* Goal: is_mono_words E wef *) red in |- *. (* Goal: forall (x y : Word) (_ : inmonoid E x) (_ : inmonoid E y) (_ : @eq Word (wef x) (wef y)), @eq Word x y *) simple induction x. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : inmonoid E w) (_ : inmonoid E y) (_ : @eq Word (wef w) (wef y)), @eq Word w y) (y : Word) (_ : inmonoid E (cons e w)) (_ : inmonoid E y) (_ : @eq Word (wef (cons e w)) (wef y)), @eq Word (cons e w) y *) (* Goal: forall (y : Word) (_ : inmonoid E nil) (_ : inmonoid E y) (_ : @eq Word (wef nil) (wef y)), @eq Word nil y *) intros. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : inmonoid E w) (_ : inmonoid E y) (_ : @eq Word (wef w) (wef y)), @eq Word w y) (y : Word) (_ : inmonoid E (cons e w)) (_ : inmonoid E y) (_ : @eq Word (wef (cons e w)) (wef y)), @eq Word (cons e w) y *) (* Goal: @eq Word nil y *) apply sym_equal. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : inmonoid E w) (_ : inmonoid E y) (_ : @eq Word (wef w) (wef y)), @eq Word w y) (y : Word) (_ : inmonoid E (cons e w)) (_ : inmonoid E y) (_ : @eq Word (wef (cons e w)) (wef y)), @eq Word (cons e w) y *) (* Goal: @eq Word y nil *) apply wef_nil with f. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : inmonoid E w) (_ : inmonoid E y) (_ : @eq Word (wef w) (wef y)), @eq Word w y) (y : Word) (_ : inmonoid E (cons e w)) (_ : inmonoid E y) (_ : @eq Word (wef (cons e w)) (wef y)), @eq Word (cons e w) y *) (* Goal: @eq Word (Word_ext f y) nil *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : inmonoid E w) (_ : inmonoid E y) (_ : @eq Word (wef w) (wef y)), @eq Word w y) (y : Word) (_ : inmonoid E (cons e w)) (_ : inmonoid E y) (_ : @eq Word (wef (cons e w)) (wef y)), @eq Word (cons e w) y *) intros x0 w0. (* Goal: forall (_ : forall (y : Word) (_ : inmonoid E w0) (_ : inmonoid E y) (_ : @eq Word (wef w0) (wef y)), @eq Word w0 y) (y : Word) (_ : inmonoid E (cons x0 w0)) (_ : inmonoid E y) (_ : @eq Word (wef (cons x0 w0)) (wef y)), @eq Word (cons x0 w0) y *) intros. (* Goal: @eq Word (cons x0 w0) y *) cut (exists x : Elt, (exists2 w : Word, cons x w = y & f x = f x0 /\ wef w = wef w0)). (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: forall _ : @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))), @eq Word (cons x0 w0) y *) intro temp; elim temp; clear temp. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: forall (x : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))), @eq Word (cons x0 w0) y *) intro e. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: forall _ : @ex2 Word (fun w : Word => @eq Word (cons e w) y) (fun w : Word => and (@eq Elt (f e) (f x0)) (@eq Word (wef w) (wef w0))), @eq Word (cons x0 w0) y *) intro temp; elim temp; clear temp. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: forall (x : Word) (_ : @eq Word (cons e x) y) (_ : and (@eq Elt (f e) (f x0)) (@eq Word (wef x) (wef w0))), @eq Word (cons x0 w0) y *) intro r. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: forall (_ : @eq Word (cons e r) y) (_ : and (@eq Elt (f e) (f x0)) (@eq Word (wef r) (wef w0))), @eq Word (cons x0 w0) y *) intros y_egal temp. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word (cons x0 w0) y *) elim temp; clear temp. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: forall (_ : @eq Elt (f e) (f x0)) (_ : @eq Word (wef r) (wef w0)), @eq Word (cons x0 w0) y *) intros. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word (cons x0 w0) y *) rewrite <- y_egal. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word (cons x0 w0) (cons e r) *) apply cons_cons. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word w0 r *) (* Goal: @eq Elt x0 e *) apply Hyp. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word w0 r *) (* Goal: @eq Elt (f x0) (f e) *) (* Goal: dans e E *) (* Goal: dans x0 E *) apply inmonoid_cons_inv2 with w0; assumption. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word w0 r *) (* Goal: @eq Elt (f x0) (f e) *) (* Goal: dans e E *) apply inmonoid_cons_inv2 with r; rewrite y_egal; assumption. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word w0 r *) (* Goal: @eq Elt (f x0) (f e) *) auto. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word w0 r *) apply H. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word (wef w0) (wef r) *) (* Goal: inmonoid E r *) (* Goal: inmonoid E w0 *) apply (inmonoid_cons_inv E w0 x0); assumption. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word (wef w0) (wef r) *) (* Goal: inmonoid E r *) apply (inmonoid_cons_inv E r e); rewrite y_egal; assumption. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) (* Goal: @eq Word (wef w0) (wef r) *) auto. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (wef w) (wef w0)))) *) unfold wef in |- *. (* Goal: @ex Elt (fun x : Elt => @ex2 Word (fun w : Word => @eq Word (cons x w) y) (fun w : Word => and (@eq Elt (f x) (f x0)) (@eq Word (Word_ext f w) (Word_ext f w0)))) *) auto. Qed. Hint Resolve is_mono_f_imp_is_mono_words. Lemma is_epi_f_imp_is_epi_words : is_epi E F f -> is_epi_words E F wef. Proof. (* Goal: forall _ : is_epi E F f, is_epi_words E F wef *) intro temp; elim temp; clear temp. (* Goal: forall (_ : application E F f) (_ : forall (x : Elt) (_ : dans x F), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E)), is_epi_words E F wef *) intro application_f. (* Goal: forall _ : forall (x : Elt) (_ : dans x F), @ex2 Elt (fun y : Elt => @eq Elt x (f y)) (fun y : Elt => dans y E), is_epi_words E F wef *) intro is_epi_f. (* Goal: is_epi_words E F wef *) split. (* Goal: forall (x : Word) (_ : inmonoid F x), @ex2 Word (fun y : Word => @eq Word x (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: application_words E F wef *) auto. (* Goal: forall (x : Word) (_ : inmonoid F x), @ex2 Word (fun y : Word => @eq Word x (wef y)) (fun y : Word => inmonoid E y) *) simple induction x; clear x. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid F w, @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y)) (_ : inmonoid F (cons e w)), @ex2 Word (fun y : Word => @eq Word (cons e w) (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: forall _ : inmonoid F nil, @ex2 Word (fun y : Word => @eq Word nil (wef y)) (fun y : Word => inmonoid E y) *) exists nil; auto. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid F w, @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y)) (_ : inmonoid F (cons e w)), @ex2 Word (fun y : Word => @eq Word (cons e w) (wef y)) (fun y : Word => inmonoid E y) *) intros x w Hyp inmonoid_F_cons. (* Goal: @ex2 Word (fun y : Word => @eq Word (cons x w) (wef y)) (fun y : Word => inmonoid E y) *) cut (exists2 y : Word, w = wef y & inmonoid E y). (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: forall _ : @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y), @ex2 Word (fun y : Word => @eq Word (cons x w) (wef y)) (fun y : Word => inmonoid E y) *) intro temp; elim temp; clear temp. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: forall (x0 : Word) (_ : @eq Word w (wef x0)) (_ : inmonoid E x0), @ex2 Word (fun y : Word => @eq Word (cons x w) (wef y)) (fun y : Word => inmonoid E y) *) intros y1 y1_egal inmonoid_y1. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Word (fun y : Word => @eq Word (cons x w) (wef y)) (fun y : Word => inmonoid E y) *) cut (exists2 x_ant : Elt, x = f x_ant & dans x_ant E). (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E) *) (* Goal: forall _ : @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E), @ex2 Word (fun y : Word => @eq Word (cons x w) (wef y)) (fun y : Word => inmonoid E y) *) intro temp; elim temp; clear temp. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E) *) (* Goal: forall (x0 : Elt) (_ : @eq Elt x (f x0)) (_ : dans x0 E), @ex2 Word (fun y : Word => @eq Word (cons x w) (wef y)) (fun y : Word => inmonoid E y) *) intros x_ant x_egal dans_x_ant. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E) *) (* Goal: @ex2 Word (fun y : Word => @eq Word (cons x w) (wef y)) (fun y : Word => inmonoid E y) *) exists (cons x_ant y1). (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E) *) (* Goal: inmonoid E (cons x_ant y1) *) (* Goal: @eq Word (cons x w) (wef (cons x_ant y1)) *) unfold wef, Word_ext in |- *. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E) *) (* Goal: inmonoid E (cons x_ant y1) *) (* Goal: @eq Word (cons x w) (cons (f x_ant) ((fix Word_ext (f : forall _ : Elt, Elt) (w : Word) {struct w} : Word := match w with | nil => nil | cons a w' => cons (f a) (Word_ext f w') end) f y1)) *) auto. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E) *) (* Goal: inmonoid E (cons x_ant y1) *) auto. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) (* Goal: @ex2 Elt (fun x_ant : Elt => @eq Elt x (f x_ant)) (fun x_ant : Elt => dans x_ant E) *) prolog [ inmonoid_cons_inv2 ] 3. (* Goal: @ex2 Word (fun y : Word => @eq Word w (wef y)) (fun y : Word => inmonoid E y) *) prolog [ inmonoid_cons_inv ] 3. Qed. Hint Resolve is_epi_f_imp_is_epi_words. Lemma is_iso_f_imp_is_iso_words : is_iso E F f -> is_iso_words E F wef. Proof. (* Goal: forall _ : is_iso E F f, is_iso_words E F wef *) intro is_iso_f. (* Goal: is_iso_words E F wef *) elim is_iso_f; intros. (* Goal: is_iso_words E F wef *) split; auto. Qed. Let invf' := inv E F f. Let weinvf := Word_ext invf'. Let weinvf_wef := comp_word weinvf wef. Lemma is_iso_f_imp_Id_words_weinvf_wef : is_iso E F f -> Id_words E weinvf_wef. Proof. (* Goal: forall _ : is_iso E F f, Id_words E weinvf_wef *) intro is_iso_f. (* Goal: Id_words E weinvf_wef *) red in |- *. (* Goal: forall (x : Word) (_ : inmonoid E x), @eq Word (weinvf_wef x) x *) intro x. (* Goal: forall _ : inmonoid E x, @eq Word (weinvf_wef x) x *) unfold weinvf_wef, weinvf, wef in |- *. (* Goal: forall _ : inmonoid E x, @eq Word (comp_word (Word_ext invf') (Word_ext f) x) x *) cut (eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f))). (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: forall (_ : eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f))) (_ : inmonoid E x), @eq Word (comp_word (Word_ext invf') (Word_ext f) x) x *) unfold eg_f_W_W in |- *. (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: forall (_ : forall x : Word, @eq Word (Word_ext (comp invf' f) x) (comp_word (Word_ext invf') (Word_ext f) x)) (_ : inmonoid E x), @eq Word (comp_word (Word_ext invf') (Word_ext f) x) x *) intro Hyp. (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: forall _ : inmonoid E x, @eq Word (comp_word (Word_ext invf') (Word_ext f) x) x *) rewrite <- (Hyp x). (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: forall _ : inmonoid E x, @eq Word (Word_ext (comp invf' f) x) x *) generalize x. (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: forall (x : Word) (_ : inmonoid E x), @eq Word (Word_ext (comp invf' f) x) x *) change (Id_words E (Word_ext (comp invf' f))) in |- *. (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: Id_words E (Word_ext (comp invf' f)) *) apply extension_Id. (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: Id E (comp invf' f) *) unfold invf' in |- *. (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) (* Goal: Id E (comp (inv E F f) f) *) auto. (* Goal: eg_f_W_W (Word_ext (comp invf' f)) (comp_word (Word_ext invf') (Word_ext f)) *) auto. Qed. End fonctions2. Hint Resolve mono_imp_iso_over_image.
Require Import Bool. Require Import Arith. Require Import Compare_dec. Require Import Peano_dec. Require Import General. Require Import MyList. Require Import MyRelations. Require Export Main. Require Export SortV6. Section CoqV6. Definition trm_v6 := term srt_v6. Definition env_v6 := env srt_v6. Definition v6 : CTS_spec srt_v6 := Build_CTS_spec _ axiom_v6 rules_v6 univ_v6 (beta_delta_rule _). Definition v6_pts : PTS_sub_spec srt_v6 := cts_pts_functor _ v6. Definition le_type : red_rule srt_v6 := Rule _ (Le_type _ (pts_le_type _ v6_pts)). Definition typ_v6 : env_v6 -> trm_v6 -> trm_v6 -> Prop := typ _ v6_pts. Definition wft_v6 : env_v6 -> trm_v6 -> Prop := wf_type _ v6_pts. Definition wf_v6 : env_v6 -> Prop := wf _ v6_pts. Definition v6_sn := sn srt_v6 (ctxt _ (Rule _ (head_reduct _ v6))). Hint Unfold le_type typ_v6 wft_v6 wf_v6 v6_sn: pts. Lemma whnf : forall (e : env_v6) (t : trm_v6), v6_sn e t -> {u : trm_v6 | red _ (beta_delta _) e t u & head_normal _ (beta_delta _) e u}. Proof beta_delta_whnf srt_v6. Lemma bd_conv_hnf : forall (e : env_v6) (x y : trm_v6), v6_sn e x -> v6_sn e y -> decide (conv_hn_inv _ (beta_delta_rule _) e x y). Proof CR_WHNF_convert_hn srt_v6 v6_sort_dec (beta_delta_rule srt_v6) (church_rosser_beta_delta srt_v6) whnf. Theorem v6_is_subtype_dec : subtype_dec_CTS _ v6. Proof. (* Goal: subtype_dec_CTS srt_v6 v6 *) apply Build_subtype_dec_CTS. (* Goal: forall s s' : srt_v6, decide (clos_refl_trans srt_v6 (universes srt_v6 v6) s s') *) (* Goal: forall (e : env srt_v6) (x y : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e x) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e y), decide (conv_hn_inv srt_v6 (head_reduct srt_v6 v6) e x y) *) (* Goal: forall (e : env srt_v6) (t : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e t), @sig2 (term srt_v6) (fun u : term srt_v6 => red srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e t u) (fun u : term srt_v6 => head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e u) *) (* Goal: forall (e : env srt_v6) (A B : term srt_v6), head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e (Prod srt_v6 A B) *) (* Goal: forall (e : env srt_v6) (s : srt_v6), head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e (Srt srt_v6 s) *) (* Goal: church_rosser srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) *) exact (church_rosser_beta_delta srt_v6). (* Goal: forall s s' : srt_v6, decide (clos_refl_trans srt_v6 (universes srt_v6 v6) s s') *) (* Goal: forall (e : env srt_v6) (x y : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e x) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e y), decide (conv_hn_inv srt_v6 (head_reduct srt_v6 v6) e x y) *) (* Goal: forall (e : env srt_v6) (t : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e t), @sig2 (term srt_v6) (fun u : term srt_v6 => red srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e t u) (fun u : term srt_v6 => head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e u) *) (* Goal: forall (e : env srt_v6) (A B : term srt_v6), head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e (Prod srt_v6 A B) *) (* Goal: forall (e : env srt_v6) (s : srt_v6), head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e (Srt srt_v6 s) *) exact (bd_hn_sort srt_v6). (* Goal: forall s s' : srt_v6, decide (clos_refl_trans srt_v6 (universes srt_v6 v6) s s') *) (* Goal: forall (e : env srt_v6) (x y : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e x) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e y), decide (conv_hn_inv srt_v6 (head_reduct srt_v6 v6) e x y) *) (* Goal: forall (e : env srt_v6) (t : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e t), @sig2 (term srt_v6) (fun u : term srt_v6 => red srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e t u) (fun u : term srt_v6 => head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e u) *) (* Goal: forall (e : env srt_v6) (A B : term srt_v6), head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e (Prod srt_v6 A B) *) exact (bd_hn_prod srt_v6). (* Goal: forall s s' : srt_v6, decide (clos_refl_trans srt_v6 (universes srt_v6 v6) s s') *) (* Goal: forall (e : env srt_v6) (x y : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e x) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e y), decide (conv_hn_inv srt_v6 (head_reduct srt_v6 v6) e x y) *) (* Goal: forall (e : env srt_v6) (t : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e t), @sig2 (term srt_v6) (fun u : term srt_v6 => red srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e t u) (fun u : term srt_v6 => head_normal srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6)) e u) *) exact whnf. (* Goal: forall s s' : srt_v6, decide (clos_refl_trans srt_v6 (universes srt_v6 v6) s s') *) (* Goal: forall (e : env srt_v6) (x y : term srt_v6) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e x) (_ : sn srt_v6 (ctxt srt_v6 (Rule srt_v6 (head_reduct srt_v6 v6))) e y), decide (conv_hn_inv srt_v6 (head_reduct srt_v6 v6) e x y) *) exact bd_conv_hnf. (* Goal: forall s s' : srt_v6, decide (clos_refl_trans srt_v6 (universes srt_v6 v6) s s') *) exact univ_v6_dec. Qed. Lemma sound_v6_bd : rule_sound _ v6_pts (beta_delta _). Proof. (* Goal: rule_sound srt_v6 v6_pts (beta_delta srt_v6) *) unfold beta_delta in |- *. (* Goal: rule_sound srt_v6 v6_pts (Rule srt_v6 (beta_delta_rule srt_v6)) *) simpl in |- *. (* Goal: rule_sound srt_v6 v6_pts (reunion srt_v6 (beta srt_v6) (delta srt_v6)) *) apply union_sound. (* Goal: rule_sound srt_v6 v6_pts (delta srt_v6) *) (* Goal: rule_sound srt_v6 v6_pts (beta srt_v6) *) apply beta_sound; auto with arith pts. (* Goal: rule_sound srt_v6 v6_pts (delta srt_v6) *) (* Goal: product_inversion srt_v6 (Rule srt_v6 (Le_type srt_v6 (pts_le_type srt_v6 v6_pts))) *) simpl in |- *. (* Goal: rule_sound srt_v6 v6_pts (delta srt_v6) *) (* Goal: product_inversion srt_v6 (R_rt srt_v6 (cumul srt_v6 v6)) *) apply cumul_inv_prod. (* Goal: rule_sound srt_v6 v6_pts (delta srt_v6) *) (* Goal: subtype_dec_CTS srt_v6 v6 *) exact v6_is_subtype_dec. (* Goal: rule_sound srt_v6 v6_pts (delta srt_v6) *) apply delta_sound. Qed. Axiom v6_normalise : forall (e : env_v6) (t T : trm_v6), typ_v6 e t T -> v6_sn e t. Lemma v6_is_norm_sound : norm_sound_CTS _ v6. Proof. (* Goal: norm_sound_CTS srt_v6 v6 *) refine (Build_norm_sound_CTS srt_v6 v6 sound_v6_bd v6_normalise _ _ _). (* Goal: forall (s1 s2 : srt_v6) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) s1 s2) (_ : typed_sort srt_v6 (cts_axiom srt_v6 v6) s2), typed_sort srt_v6 (cts_axiom srt_v6 v6) s1 *) (* Goal: forall x1 x2 : srt_v6, @sig2 srt_v6 (fun x3 : srt_v6 => cts_rules srt_v6 v6 x1 x2 x3) (fun x3 : srt_v6 => forall (s1 s2 s3 : srt_v6) (_ : cts_rules srt_v6 v6 s1 s2 s3) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) x1 s1) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) x2 s2), clos_refl_trans srt_v6 (universes srt_v6 v6) x3 s3) *) (* Goal: forall s : srt_v6, @ppal_dec srt_v6 (cts_axiom srt_v6 v6 s) (clos_refl_trans srt_v6 (universes srt_v6 v6)) *) left. (* Goal: forall (s1 s2 : srt_v6) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) s1 s2) (_ : typed_sort srt_v6 (cts_axiom srt_v6 v6) s2), typed_sort srt_v6 (cts_axiom srt_v6 v6) s1 *) (* Goal: forall x1 x2 : srt_v6, @sig2 srt_v6 (fun x3 : srt_v6 => cts_rules srt_v6 v6 x1 x2 x3) (fun x3 : srt_v6 => forall (s1 s2 s3 : srt_v6) (_ : cts_rules srt_v6 v6 s1 s2 s3) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) x1 s1) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) x2 s2), clos_refl_trans srt_v6 (universes srt_v6 v6) x3 s3) *) (* Goal: @sig srt_v6 (fun x : srt_v6 => @ppal srt_v6 (cts_axiom srt_v6 v6 s) (clos_refl_trans srt_v6 (universes srt_v6 v6)) x) *) apply v6_inf_axiom. (* Goal: forall (s1 s2 : srt_v6) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) s1 s2) (_ : typed_sort srt_v6 (cts_axiom srt_v6 v6) s2), typed_sort srt_v6 (cts_axiom srt_v6 v6) s1 *) (* Goal: forall x1 x2 : srt_v6, @sig2 srt_v6 (fun x3 : srt_v6 => cts_rules srt_v6 v6 x1 x2 x3) (fun x3 : srt_v6 => forall (s1 s2 s3 : srt_v6) (_ : cts_rules srt_v6 v6 s1 s2 s3) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) x1 s1) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) x2 s2), clos_refl_trans srt_v6 (universes srt_v6 v6) x3 s3) *) exact v6_inf_rule. (* Goal: forall (s1 s2 : srt_v6) (_ : clos_refl_trans srt_v6 (universes srt_v6 v6) s1 s2) (_ : typed_sort srt_v6 (cts_axiom srt_v6 v6) s2), typed_sort srt_v6 (cts_axiom srt_v6 v6) s1 *) intros. (* Goal: typed_sort srt_v6 (cts_axiom srt_v6 v6) s1 *) elim v6_inf_axiom with s1; intros. (* Goal: typed_sort srt_v6 (cts_axiom srt_v6 v6) s1 *) split with x. (* Goal: cts_axiom srt_v6 v6 s1 x *) apply (pp_ok p). Qed. Theorem v6_algorithms : PTS_TC _ v6_pts. Proof full_cts_type_checker srt_v6 v6 v6_is_subtype_dec v6_is_norm_sound. Lemma infer_type : forall (e : env_v6) (t : trm_v6), wf_v6 e -> infer_ppal_type _ v6_pts e t. Proof ptc_inf_ppal_type _ _ v6_algorithms. Lemma check_wf_type : forall (e : env_v6) (t : trm_v6), wf_v6 e -> wft_dec _ v6_pts e t. Proof ptc_chk_wft _ _ v6_algorithms. Lemma check_type : forall (e : env_v6) (t T : trm_v6), wf_v6 e -> check_dec _ v6_pts e t T. Proof ptc_chk_typ _ _ v6_algorithms. Lemma add_type : forall (e : env_v6) (t : trm_v6), wf_v6 e -> decl_dec _ v6_pts e (Ax _ t). Proof ptc_add_typ _ _ v6_algorithms. Lemma add_def : forall (e : env_v6) (t T : trm_v6), wf_v6 e -> decl_dec _ v6_pts e (Def _ t T). Proof ptc_add_def _ _ v6_algorithms. End CoqV6.
Require Export GeoCoq.Elements.OriginalProofs.lemma_squareparallelogram. Require Export GeoCoq.Elements.OriginalProofs.lemma_samesideflip. Require Export GeoCoq.Elements.OriginalProofs.lemma_erectedperpendicularunique. Require Export GeoCoq.Elements.OriginalProofs.lemma_twoperpsparallel. Require Export GeoCoq.Elements.OriginalProofs.proposition_29C. Require Export GeoCoq.Elements.OriginalProofs.lemma_altitudeofrighttriangle. Section Euclid. Context `{Ax:area}. Lemma proposition_47A : forall A B C D E, Triangle A B C -> Per B A C -> SQ B C E D -> TS D C B A -> exists X Y, PG B X Y D /\ BetS B X C /\ PG X C E Y /\ BetS D Y E /\ BetS Y X A /\ Per D Y A. Proof. (* Goal: forall (A B C D E : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @Per Ax0 B A C) (_ : @SQ Ax0 B C E D) (_ : @TS Ax0 D C B A), @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) intros. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) let Tf:=fresh in assert (Tf:exists N, (BetS D N A /\ Col C B N /\ nCol C B D)) by (conclude_def TS );destruct Tf as [N];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per C A B) by (conclude lemma_8_2). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (nCol C A B) by (conclude lemma_rightangleNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq A B) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq B C) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Cong B C E D) by (conclude_def SQ ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq E D) by (conclude axiom_nocollapse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq D E) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) let Tf:=fresh in assert (Tf:exists q, (BetS D q A /\ Col C B q /\ nCol C B D)) by (conclude_def TS );destruct Tf as [q];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (PG B C E D) by (conclude lemma_squareparallelogram). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B C E D) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ Meet B C E D) by (conclude_def Par ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ eq A E). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) (* Goal: not (@eq Ax0 A E) *) { (* Goal: not (@eq Ax0 A E) *) intro. (* Goal: False *) assert (BetS D q E) by (conclude cn_equalitysub). (* Goal: False *) assert (Col D q E) by (conclude_def Col ). (* Goal: False *) assert (Col E D q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B C q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet B C E D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ Col D E A). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) (* Goal: not (@Col Ax0 D E A) *) { (* Goal: not (@Col Ax0 D E A) *) intro. (* Goal: False *) assert (Col D A E) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D q A) by (conclude_def Col ). (* Goal: False *) assert (Col D A q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq D A) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col A E q) by (conclude lemma_collinear4). (* Goal: False *) assert (Col q A E) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col q A D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq q A) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col A E D) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A E q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col E D q) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B C q) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet B C E D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) let Tf:=fresh in assert (Tf:exists L, Perp_at A L D E L) by (conclude proposition_12);destruct Tf as [L];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) let Tf:=fresh in assert (Tf:exists p, (Col A L L /\ Col D E L /\ Col D E p /\ Per p L A)) by (conclude_def Perp_at );destruct Tf as [p];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per A L p) by (conclude lemma_8_2). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ eq B N). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) (* Goal: not (@eq Ax0 B N) *) { (* Goal: not (@eq Ax0 B N) *) intro. (* Goal: False *) assert (BetS D B A) by (conclude cn_equalitysub). (* Goal: False *) assert (Col D B A) by (conclude_def Col ). (* Goal: False *) assert (Per D B C) by (conclude_def SQ ). (* Goal: False *) assert (Per A B C) by (conclude lemma_collinearright). (* Goal: False *) assert (~ Per C A B) by (conclude lemma_8_7). (* Goal: False *) assert (Per C A B) by (conclude lemma_8_2). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B C E D) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B C D E) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par D E B C) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par D E C B) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq N B) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par D E N B) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par D E B N) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (TP D E B N) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS B N D E) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col D D E) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq D N) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Out D N A) by (conclude lemma_ray4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS B A D E) by (conclude lemma_sameside2). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS B A E D) by (conclude lemma_samesideflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS A B E D) by (forward_using lemma_samesidesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ eq D L). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) (* Goal: not (@eq Ax0 D L) *) { (* Goal: not (@eq Ax0 D L) *) intro. (* Goal: False *) assert (Per A D p) by (conclude cn_equalitysub). (* Goal: False *) assert (Per p D A) by (conclude lemma_8_2). (* Goal: False *) assert (Col p D E) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Per E D A) by (conclude lemma_collinearright). (* Goal: False *) assert (Per E D B) by (conclude_def SQ ). (* Goal: False *) assert (Out D A B) by (conclude lemma_erectedperpendicularunique). (* Goal: False *) assert (Col D A B) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col A D B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D N A) by (conclude_def Col ). (* Goal: False *) assert (Col A D N) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq D A) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq A D) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col D B N) by (conclude lemma_collinear4). (* Goal: False *) assert (Col N B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col N B D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B C D) by (conclude lemma_collinear4). (* Goal: False *) assert (nCol B C D) by (forward_using lemma_NCorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq L D) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B C E D) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col E D L) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B C L D) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par L D B C) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (TP B C L D) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS L D B C) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (nCol B C D) by (forward_using lemma_parallelNC). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col B C N) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (TS D B C A) by (conclude_def TS ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (TS L B C A) by (conclude lemma_planeseparation). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) let Tf:=fresh in assert (Tf:exists M, (BetS L M A /\ Col B C M /\ nCol B C L)) by (conclude_def TS );destruct Tf as [M];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq D E) by (forward_using lemma_NCdistinct). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq E D) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq L M) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Out L M A) by (conclude lemma_ray4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Out L A M) by (conclude lemma_ray5). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per E D B) by (conclude_def SQ ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col E D p) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col E D L) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col D p L) by (conclude lemma_collinear4). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col p L D) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per D L A) by (conclude lemma_collinearright). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per D L M) by (conclude lemma_8_3). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ eq B M). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) (* Goal: not (@eq Ax0 B M) *) { (* Goal: not (@eq Ax0 B M) *) intro. (* Goal: False *) assert (Per D L B) by (conclude cn_equalitysub). (* Goal: False *) assert (Per L D B) by (conclude lemma_collinearright). (* Goal: False *) assert (Per B D L) by (conclude lemma_8_2). (* Goal: False *) assert (~ Per B D L) by (conclude lemma_8_7). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq M B) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par L D C B) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col C B M) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par L D M B) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par L D B M) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B M L D) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B M D L) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par D L B M) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (TP D L B M) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS B M D L) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B M L D) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per L D B) by (conclude lemma_collinearright). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per B D L) by (conclude lemma_8_2). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B D L M) by (conclude lemma_twoperpsparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B D M L) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (PG B M L D) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par M L B D) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (TP M L B D) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS B D M L) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (BetS A M L) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par M B L D) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (CongA A M B M L D) by (conclude proposition_29C). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per M L D) by (conclude lemma_8_2). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per A M B) by (conclude lemma_equaltorightisright). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col B C B) by (conclude_def Col ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (BetS B M C) by (conclude lemma_altitudeofrighttriangle). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ eq M C). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) (* Goal: not (@eq Ax0 M C) *) { (* Goal: not (@eq Ax0 M C) *) intro. (* Goal: False *) assert (Per A C B) by (conclude cn_equalitysub). (* Goal: False *) assert (~ Per B A C) by (conclude lemma_8_7). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (~ eq L E). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) (* Goal: not (@eq Ax0 L E) *) { (* Goal: not (@eq Ax0 L E) *) intro. (* Goal: False *) assert (Par B D C E) by (conclude_def PG ). (* Goal: False *) assert (Par C E B D) by (conclude lemma_parallelsymmetric). (* Goal: False *) assert (Par M E B D) by (conclude cn_equalitysub). (* Goal: False *) assert (Par B D M E) by (conclude lemma_parallelsymmetric). (* Goal: False *) assert (Par B D C E) by (conclude lemma_parallelsymmetric). (* Goal: False *) assert (Par B D E C) by (forward_using lemma_parallelflip). (* Goal: False *) assert (Par B D E M) by (forward_using lemma_parallelflip). (* Goal: False *) assert (Col E C M) by (conclude lemma_Playfair). (* Goal: False *) assert (Col M C E) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col M C B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col C E B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B C E) by (forward_using lemma_collinearorder). (* Goal: False *) assert (nCol B C E) by (forward_using lemma_parallelNC). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B M L D) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B M D L) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col D L E) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq E L) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par B M E L) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par E L B M) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col B M C) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (neq C M) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par E L C M) by (conclude lemma_collinearparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par C M E L) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par M C E L) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Col D L E) by (forward_using lemma_collinearorder). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per E L M) by (conclude lemma_collinearright). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per M L E) by (conclude lemma_8_2). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per C E D) by (conclude_def SQ ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per D E C) by (conclude lemma_8_2). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Per L E C) by (conclude lemma_collinearright). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par M C L E) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par L E M C) by (conclude lemma_parallelsymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (TP L E M C) by (conclude lemma_paralleldef2B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (OS M C L E) by (conclude_def TP ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par M L E C) by (conclude lemma_twoperpsparallel). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Par M L C E) by (forward_using lemma_parallelflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (PG M C E L) by (conclude_def PG ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Cong B M D L) by (forward_using proposition_34). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Cong M C L E) by (forward_using proposition_34). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (Cong B C D E) by (forward_using proposition_34). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) assert (BetS D L E) by (conclude lemma_betweennesspreserved). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (@Per Ax0 D Y A))))))) *) close. Qed. End Euclid.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq path div choice. From mathcomp Require Import fintype tuple finfun bigop prime ssralg poly ssrnum ssrint rat. From mathcomp Require Import polydiv finalg perm zmodp matrix mxalgebra vector. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GRing.Theory Num.Theory. Local Open Scope ring_scope. Definition divz (m d : int) := let: (K, n) := match m with Posz n => (Posz, n) | Negz n => (Negz, n) end in sgz d * K (n %/ `|d|)%N. Definition modz (m d : int) : int := m - divz m d * d. Definition dvdz d m := (`|d| %| `|m|)%N. Definition gcdz m n := (gcdn `|m| `|n|)%:Z. Definition egcdz m n : int * int := if m == 0 then (0, (-1) ^+ (n < 0)%R) else let: (u, v) := egcdn `|m| `|n| in (sgz m * u, - (-1) ^+ (n < 0)%R * v%:Z). Definition coprimez m n := (gcdz m n == 1). Infix "%/" := divz : int_scope. Infix "%%" := modz : int_scope. Notation "d %| m" := (m \in dvdz d) : int_scope. Notation "m = n %[mod d ]" := (modz m d = modz n d) : int_scope. Notation "m == n %[mod d ]" := (modz m d == modz n d) : int_scope. Notation "m <> n %[mod d ]" := (modz m d <> modz n d) : int_scope. Notation "m != n %[mod d ]" := (modz m d != modz n d) : int_scope. Lemma divz_nat (n d : nat) : (n %/ d)%Z = (n %/ d)%N. Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz (Posz n) (Posz d)) (Posz (divn n d)) *) by case: d => // d; rewrite /divz /= mul1r. Qed. Lemma divzN m d : (m %/ - d)%Z = - (m %/ d)%Z. Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz m (@GRing.opp int_ZmodType d)) (@GRing.opp (GRing.Ring.zmodType int_Ring) (divz m d)) *) by case: m => n; rewrite /divz /= sgzN abszN mulNr. Qed. Lemma divz_abs m d : (m %/ `|d|)%Z = (-1) ^+ (d < 0)%R * (m %/ d)%Z. Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz m (@Num.Def.normr int_numDomainType d)) (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (divz m d)) *) by rewrite {3}[d]intEsign !mulr_sign; case: ifP => -> //; rewrite divzN opprK. Qed. Lemma div0z d : (0 %/ d)%Z = 0. Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz (GRing.zero int_ZmodType) d) (GRing.zero (GRing.Ring.zmodType int_Ring)) *) by rewrite -(canLR (signrMK _) (divz_abs _ _)) (divz_nat 0) div0n mulr0. Qed. Lemma divNz_nat m d : (d > 0)%N -> (Negz m %/ d)%Z = - (m %/ d).+1%:Z. Proof. (* Goal: forall _ : is_true (leq (S O) d), @eq (GRing.Ring.sort int_Ring) (divz (Negz m) (Posz d)) (@GRing.opp int_ZmodType (Posz (S (divn m d)))) *) by case: d => // d _; apply: mul1r. Qed. Lemma divz_eq m d : m = (m %/ d)%Z * d + (m %% d)%Z. Proof. (* Goal: @eq int m (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (divz m d) d) (modz m d)) *) by rewrite addrC subrK. Qed. Lemma modzN m d : (m %% - d)%Z = (m %% d)%Z. Proof. (* Goal: @eq int (modz m (@GRing.opp int_ZmodType d)) (modz m d) *) by rewrite /modz divzN mulrNN. Qed. Lemma modz_abs m d : (m %% `|d|%N)%Z = (m %% d)%Z. Proof. (* Goal: @eq int (modz m (Posz (absz d))) (modz m d) *) by rewrite {2}[d]intEsign mulr_sign; case: ifP; rewrite ?modzN. Qed. Lemma modz_nat (m d : nat) : (m %% d)%Z = (m %% d)%N. Proof. (* Goal: @eq int (modz (Posz m) (Posz d)) (Posz (modn m d)) *) by apply: (canLR (addrK _)); rewrite addrC divz_nat {1}(divn_eq m d). Qed. Lemma modNz_nat m d : (d > 0)%N -> (Negz m %% d)%Z = d%:Z - 1 - (m %% d)%:Z. Lemma modz_ge0 m d : d != 0 -> 0 <= (m %% d)%Z. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) d (GRing.zero int_ZmodType))), is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (modz m d)) *) rewrite -absz_gt0 -modz_abs => d_gt0. (* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (modz m (Posz (absz d)))) *) case: m => n; rewrite ?modNz_nat ?modz_nat // -addrA -opprD subr_ge0. (* Goal: is_true (@Num.Def.ler int_numDomainType (@GRing.add int_ZmodType (GRing.one int_Ring) (Posz (modn n (absz d)))) (Posz (absz d))) *) by rewrite lez_nat ltn_mod. Qed. Lemma mod0z d : (0 %% d)%Z = 0. Proof. by rewrite /modz div0z mul0r subrr. Qed. Proof. (* Goal: @eq int (modz (GRing.zero int_ZmodType) d) (GRing.zero int_ZmodType) *) by rewrite /modz div0z mul0r subrr. Qed. Lemma divz_small m d : 0 <= m < `|d|%:Z -> (m %/ d)%Z = 0. Proof. (* Goal: forall _ : is_true (andb (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) m) (@Num.Def.ltr int_numDomainType m (Posz (absz d)))), @eq (GRing.Ring.sort int_Ring) (divz m d) (GRing.zero (GRing.Ring.zmodType int_Ring)) *) rewrite -(canLR (signrMK _) (divz_abs _ _)); case: m => // n /divn_small. (* Goal: forall _ : @eq nat (divn n (absz d)) O, @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (divz (Posz n) (@Num.Def.normr int_numDomainType d))) (GRing.zero (GRing.Ring.zmodType int_Ring)) *) by rewrite divz_nat => ->; rewrite mulr0. Qed. Lemma divzMDl q m d : d != 0 -> ((q * d + m) %/ d)%Z = q + (m %/ d)%Z. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) d (GRing.zero (GRing.Ring.zmodType int_Ring)))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring q d) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) q (divz m d)) *) rewrite neqr_lt -oppr_gt0 => nz_d. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring q d) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) q (divz m d)) *) wlog{nz_d} d_gt0: q d / d > 0; last case: d => // d in d_gt0 *. move=> IH; case/orP: nz_d => /IH// /(_ (- q)). by rewrite mulrNN !divzN -opprD => /oppr_inj. wlog q_gt0: q m / q >= 0; last case: q q_gt0 => // q _. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (Posz q) d) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) (Posz q) (divz m d)) *) (* Goal: forall _ : forall (q : GRing.Ring.sort int_Ring) (m : GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (_ : is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) q)), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring q d) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) q (divz m d)), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring q d) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) q (divz m d)) *) move=> IH; case: q => n; first exact: IH; rewrite NegzE mulNr. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (Posz q) d) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) (Posz q) (divz m d)) *) (* Goal: @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (Posz (S n)) d)) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.opp int_ZmodType (Posz (S n))) (divz m d)) *) by apply: canRL (addKr _) _; rewrite -IH ?addNKr. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (Posz q) d) m) d) (@GRing.add (GRing.Ring.zmodType int_Ring) (Posz q) (divz m d)) *) case: m => n; first by rewrite !divz_nat divnMDl. have [le_qd_n | lt_qd_n] := leqP (q * d) n. rewrite divNz_nat // NegzE -(subnKC le_qd_n) divnMDl //. by rewrite -!addnS !PoszD !opprD !addNKr divNz_nat. rewrite divNz_nat // NegzE -PoszM subzn // divz_nat. apply: canRL (addrK _) _; congr _%:Z; rewrite addnC -divnMDl // mulSnr. rewrite -{3}(subnKC (ltn_pmod n d_gt0)) addnA addnS -divn_eq addnAC. by rewrite subnKC // divnMDl // divn_small ?addn0 // subnSK ?ltn_mod ?leq_subr. Qed. Qed. Lemma mulzK m d : d != 0 -> (m * d %/ d)%Z = m. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) d (GRing.zero (GRing.Ring.zmodType int_Ring)))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.mul int_Ring m d) d) m *) by move=> d_nz; rewrite -[m * d]addr0 divzMDl // div0z addr0. Qed. Lemma mulKz m d : d != 0 -> (d * m %/ d)%Z = m. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) d (GRing.zero (GRing.Ring.zmodType int_Ring)))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.mul int_Ring d m) d) m *) by move=> d_nz; rewrite mulrC mulzK. Qed. Lemma expzB p m n : p != 0 -> (m >= n)%N -> p ^+ (m - n) = (p ^+ m %/ p ^+ n)%Z. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) p (GRing.zero (GRing.Ring.zmodType int_Ring))))) (_ : is_true (leq n m)), @eq (GRing.Ring.sort int_Ring) (@GRing.exp int_Ring p (subn m n)) (divz (@GRing.exp int_Ring p m) (@GRing.exp int_Ring p n)) *) by move=> p_nz /subnK{2}<-; rewrite exprD mulzK // expf_neq0. Qed. Lemma modz1 m : (m %% 1)%Z = 0. Proof. (* Goal: @eq int (modz m (GRing.one int_Ring)) (GRing.zero int_ZmodType) *) by case: m => n; rewrite (modNz_nat, modz_nat) ?modn1. Qed. Lemma divzz d : (d %/ d)%Z = (d != 0). Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz d d) (Posz (nat_of_bool (negb (@eq_op int_eqType d (GRing.zero int_ZmodType))))) *) by have [-> // | d_nz] := altP eqP; rewrite -{1}[d]mul1r mulzK. Qed. Lemma ltz_pmod m d : d > 0 -> (m %% d)%Z < d. Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d), is_true (@Num.Def.ltr int_numDomainType (modz m d) d) *) case: m d => n [] // d d_gt0; first by rewrite modz_nat ltz_nat ltn_pmod. (* Goal: is_true (@Num.Def.ltr int_numDomainType (modz (Negz n) (Posz d)) (Posz d)) *) by rewrite modNz_nat // -lez_addr1 addrAC subrK ger_addl oppr_le0. Qed. Lemma ltz_mod m d : d != 0 -> (m %% d)%Z < `|d|. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) d (GRing.zero int_ZmodType))), is_true (@Num.Def.ltr int_numDomainType (modz m d) (@Num.Def.normr int_numDomainType d)) *) by rewrite -absz_gt0 -modz_abs => d_gt0; apply: ltz_pmod. Qed. Lemma divzMpl p m d : p > 0 -> (p * m %/ (p * d) = m %/ d)%Z. Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) p), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.mul (Num.NumDomain.ringType int_numDomainType) p m) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) p d)) (divz m d) *) case: p => // p p_gt0; wlog d_gt0: d / d > 0; last case: d => // d in d_gt0 *. by move=> IH; case/intP: d => [|d|d]; rewrite ?mulr0 ?divz0 ?mulrN ?divzN ?IH. rewrite {1}(divz_eq m d) mulrDr mulrCA divzMDl ?mulf_neq0 ?gtr_eqF // addrC. rewrite divz_small ?add0r // PoszM pmulr_rge0 ?modz_ge0 ?gtr_eqF //=. by rewrite ltr_pmul2l ?ltz_pmod. Qed. Qed. Arguments divzMpl [p m d]. Lemma divzMpr p m d : p > 0 -> (m * p %/ (d * p) = m %/ d)%Z. Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) p), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.mul (Num.NumDomain.ringType int_numDomainType) m p) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) d p)) (divz m d) *) by move=> p_gt0; rewrite -!(mulrC p) divzMpl. Qed. Arguments divzMpr [p m d]. Lemma lez_floor m d : d != 0 -> (m %/ d)%Z * d <= m. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) d (GRing.zero int_ZmodType))), is_true (@Num.Def.ler int_numDomainType (@GRing.mul int_Ring (divz m d) d) m) *) by rewrite -subr_ge0; apply: modz_ge0. Qed. Lemma lez_div m d : (`|(m %/ d)%Z| <= `|m|)%N. Proof. (* Goal: is_true (leq (absz (divz m d)) (absz m)) *) wlog d_gt0: d / d > 0; last case: d d_gt0 => // d d_gt0. (* Goal: is_true (leq (absz (divz m (Posz d))) (absz m)) *) (* Goal: forall _ : forall (d : int) (_ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d)), is_true (leq (absz (divz m d)) (absz m)), is_true (leq (absz (divz m d)) (absz m)) *) by move=> IH; case/intP: d => [|n|n]; rewrite ?divz0 ?divzN ?abszN // IH. (* Goal: is_true (leq (absz (divz m (Posz d))) (absz m)) *) case: m => n; first by rewrite divz_nat leq_div. (* Goal: is_true (leq (absz (divz (Negz n) (Posz d))) (absz (Negz n))) *) by rewrite divNz_nat // NegzE !abszN ltnS leq_div. Qed. Lemma ltz_ceil m d : d > 0 -> m < ((m %/ d)%Z + 1) * d. Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d), is_true (@Num.Def.ltr int_numDomainType m (@GRing.mul int_Ring (@GRing.add (GRing.Ring.zmodType int_Ring) (divz m d) (GRing.one int_Ring)) d)) *) by case: d => // d d_gt0; rewrite mulrDl mul1r -ltr_subl_addl ltz_mod ?gtr_eqF. Qed. Lemma ltz_divLR m n d : d > 0 -> ((m %/ d)%Z < n) = (m < n * d). Lemma lez_divRL m n d : d > 0 -> (m <= (n %/ d)%Z) = (m * d <= n). Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d), @eq bool (@Num.Def.ler int_numDomainType m (divz n d)) (@Num.Def.ler int_numDomainType (@GRing.mul (Num.NumDomain.ringType int_numDomainType) m d) n) *) by move=> d_gt0; rewrite !lerNgt ltz_divLR. Qed. Lemma divz_ge0 m d : d > 0 -> ((m %/ d)%Z >= 0) = (m >= 0). Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d), @eq bool (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (divz m d)) (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) m) *) by case: d m => // d [] n d_gt0; rewrite (divz_nat, divNz_nat). Qed. Lemma divzMA_ge0 m n p : n >= 0 -> (m %/ (n * p) = (m %/ n)%Z %/ p)%Z. Proof. (* Goal: forall _ : is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) n), @eq (GRing.Ring.sort int_Ring) (divz m (@GRing.mul (Num.NumDomain.ringType int_numDomainType) n p)) (divz (divz m n) p) *) case: n => // [[|n]] _; first by rewrite mul0r !divz0 div0z. (* Goal: @eq (GRing.Ring.sort int_Ring) (divz m (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (Posz (S n)) p)) (divz (divz m (Posz (S n))) p) *) wlog p_gt0: p / p > 0; last case: p => // p in p_gt0 *. by case/intP: p => [|p|p] IH; rewrite ?mulr0 ?divz0 ?mulrN ?divzN // IH. rewrite {2}(divz_eq m (n.+1%:Z * p)) mulrA mulrAC !divzMDl // ?gtr_eqF //. (* Goal: is_true (@Num.Def.ltr int_numDomainType (GRing.zero (GRing.Ring.zmodType int_Ring)) p) *) (* Goal: @eq (GRing.Ring.sort int_Ring) (divz m (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (Posz (S n)) p)) (@GRing.add (GRing.Ring.zmodType int_Ring) (divz m (@GRing.mul int_Ring (Posz (S n)) p)) (divz (divz (modz m (@GRing.mul int_Ring (Posz (S n)) p)) (Posz (S n))) p)) *) rewrite [rhs in _ + rhs]divz_small ?addr0 // ltz_divLR // divz_ge0 //. (* Goal: is_true (@Num.Def.ltr int_numDomainType (GRing.zero (GRing.Ring.zmodType int_Ring)) p) *) (* Goal: is_true (andb (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (modz m (@GRing.mul int_Ring (Posz (S n)) p))) (@Num.Def.ltr int_numDomainType (modz m (@GRing.mul int_Ring (Posz (S n)) p)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (Posz (absz p)) (Posz (S n))))) *) by rewrite mulrC ltz_pmod ?modz_ge0 ?gtr_eqF ?pmulr_lgt0. Qed. Qed. Lemma modz_small m d : 0 <= m < d -> (m %% d)%Z = m. Proof. (* Goal: forall _ : is_true (andb (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) m) (@Num.Def.ltr int_numDomainType m d)), @eq int (modz m d) m *) by case: m d => //= m [] // d; rewrite modz_nat => /modn_small->. Qed. Lemma modz_mod m d : ((m %% d)%Z = m %[mod d])%Z. Proof. (* Goal: @eq int (modz (modz m d) d) (modz m d) *) rewrite -!(modz_abs _ d); case: {d}`|d|%N => [|d]; first by rewrite !modz0. (* Goal: @eq int (modz (modz m (Posz (S d))) (Posz (S d))) (modz m (Posz (S d))) *) by rewrite modz_small ?modz_ge0 ?ltz_mod. Qed. Lemma modzMDl p m d : (p * d + m = m %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring p d) m) d) (modz m d) *) have [-> | d_nz] := eqVneq d 0; first by rewrite mulr0 add0r. (* Goal: @eq int (modz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring p d) m) d) (modz m d) *) by rewrite /modz divzMDl // mulrDl opprD addrACA subrr add0r. Qed. Lemma mulz_modr {p m d} : 0 < p -> p * (m %% d)%Z = ((p * m) %% (p * d))%Z. Lemma mulz_modl {p m d} : 0 < p -> (m %% d)%Z * p = ((m * p) %% (d * p))%Z. Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) p), @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (modz m d) p) (modz (@GRing.mul int_Ring m p) (@GRing.mul int_Ring d p)) *) by rewrite -!(mulrC p); apply: mulz_modr. Qed. Lemma modzDl m d : (d + m = m %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.add int_ZmodType d m) d) (modz m d) *) by rewrite -{1}[d]mul1r modzMDl. Qed. Lemma modzDr m d : (m + d = m %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.add int_ZmodType m d) d) (modz m d) *) by rewrite addrC modzDl. Qed. Lemma modzz d : (d %% d)%Z = 0. Proof. (* Goal: @eq int (modz d d) (GRing.zero int_ZmodType) *) by rewrite -{1}[d]addr0 modzDl mod0z. Qed. Lemma modzMl p d : (p * d %% d)%Z = 0. Proof. (* Goal: @eq int (modz (@GRing.mul int_Ring p d) d) (GRing.zero int_ZmodType) *) by rewrite -[p * d]addr0 modzMDl mod0z. Qed. Lemma modzMr p d : (d * p %% d)%Z = 0. Proof. (* Goal: @eq int (modz (@GRing.mul int_Ring d p) d) (GRing.zero int_ZmodType) *) by rewrite mulrC modzMl. Qed. Lemma modzDml m n d : ((m %% d)%Z + n = m + n %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.add int_ZmodType (modz m d) n) d) (modz (@GRing.add int_ZmodType m n) d) *) by rewrite {2}(divz_eq m d) -[_ * d + _ + n]addrA modzMDl. Qed. Lemma modzDmr m n d : (m + (n %% d)%Z = m + n %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.add int_ZmodType m (modz n d)) d) (modz (@GRing.add int_ZmodType m n) d) *) by rewrite !(addrC m) modzDml. Qed. Lemma modzDm m n d : ((m %% d)%Z + (n %% d)%Z = m + n %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.add int_ZmodType (modz m d) (modz n d)) d) (modz (@GRing.add int_ZmodType m n) d) *) by rewrite modzDml modzDmr. Qed. Lemma eqz_modDl p m n d : (p + m == p + n %[mod d])%Z = (m == n %[mod d])%Z. Proof. (* Goal: @eq bool (@eq_op int_eqType (modz (@GRing.add int_ZmodType p m) d) (modz (@GRing.add int_ZmodType p n) d)) (@eq_op int_eqType (modz m d) (modz n d)) *) have [-> | d_nz] := eqVneq d 0; first by rewrite !modz0 (inj_eq (addrI p)). (* Goal: @eq bool (@eq_op int_eqType (modz (@GRing.add int_ZmodType p m) d) (modz (@GRing.add int_ZmodType p n) d)) (@eq_op int_eqType (modz m d) (modz n d)) *) apply/eqP/eqP=> eq_mn; last by rewrite -modzDmr eq_mn modzDmr. (* Goal: @eq (Equality.sort int_eqType) (modz m d) (modz n d) *) by rewrite -(addKr p m) -modzDmr eq_mn modzDmr addKr. Qed. Lemma eqz_modDr p m n d : (m + p == n + p %[mod d])%Z = (m == n %[mod d])%Z. Proof. (* Goal: @eq bool (@eq_op int_eqType (modz (@GRing.add int_ZmodType m p) d) (modz (@GRing.add int_ZmodType n p) d)) (@eq_op int_eqType (modz m d) (modz n d)) *) by rewrite -!(addrC p) eqz_modDl. Qed. Lemma modzMml m n d : ((m %% d)%Z * n = m * n %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.mul int_Ring (modz m d) n) d) (modz (@GRing.mul int_Ring m n) d) *) by rewrite {2}(divz_eq m d) mulrDl mulrAC modzMDl. Qed. Lemma modzMmr m n d : (m * (n %% d)%Z = m * n %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.mul int_Ring m (modz n d)) d) (modz (@GRing.mul int_Ring m n) d) *) by rewrite !(mulrC m) modzMml. Qed. Lemma modzMm m n d : ((m %% d)%Z * (n %% d)%Z = m * n %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.mul int_Ring (modz m d) (modz n d)) d) (modz (@GRing.mul int_Ring m n) d) *) by rewrite modzMml modzMmr. Qed. Lemma modzXm k m d : ((m %% d)%Z ^+ k = m ^+ k %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.exp int_Ring (modz m d) k) d) (modz (@GRing.exp int_Ring m k) d) *) by elim: k => // k IHk; rewrite !exprS -modzMmr IHk modzMm. Qed. Lemma modzNm m d : (- (m %% d)%Z = - m %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.opp int_ZmodType (modz m d)) d) (modz (@GRing.opp int_ZmodType m) d) *) by rewrite -mulN1r modzMmr mulN1r. Qed. Lemma modz_absm m d : ((-1) ^+ (m < 0)%R * (m %% d)%Z = `|m|%:Z %[mod d])%Z. Proof. (* Goal: @eq int (modz (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType m (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (modz m d)) d) (modz (Posz (absz m)) d) *) by rewrite modzMmr -abszEsign. Qed. Canonical dvdz_keyed d := KeyedPred (dvdz_key d). Lemma dvdzE d m : (d %| m)%Z = (`|d| %| `|m|)%N. Proof. by []. Qed. Proof. (* Goal: @eq bool (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))) (dvdn (absz d) (absz m)) *) by []. Qed. Lemma dvd0z n : (0 %| n)%Z = (n == 0). Proof. by rewrite -absz_eq0 -dvd0n. Qed. Proof. (* Goal: @eq bool (@in_mem int n (@mem int (boolfunPredType int) (dvdz (GRing.zero int_ZmodType)))) (@eq_op int_eqType n (GRing.zero int_ZmodType)) *) by rewrite -absz_eq0 -dvd0n. Qed. Lemma dvd1z m : (1 %| m)%Z. Proof. exact: dvd1n. Qed. Proof. (* Goal: is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz (GRing.one int_Ring)))) *) exact: dvd1n. Qed. Lemma dvdz_mull d m n : (d %| n)%Z -> (d %| m * n)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz d))), is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m n) (@mem int (boolfunPredType int) (dvdz d))) *) by rewrite !dvdzE abszM; apply: dvdn_mull. Qed. Lemma dvdz_mulr d m n : (d %| m)%Z -> (d %| m * n)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m n) (@mem int (boolfunPredType int) (dvdz d))) *) by move=> d_m; rewrite mulrC dvdz_mull. Qed. Hint Resolve dvdz0 dvd1z dvdzz dvdz_mull dvdz_mulr : core. Lemma dvdz_mul d1 d2 m1 m2 : (d1 %| m1 -> d2 %| m2 -> d1 * d2 %| m1 * m2)%Z. Proof. (* Goal: forall (_ : is_true (@in_mem int m1 (@mem int (boolfunPredType int) (dvdz d1)))) (_ : is_true (@in_mem int m2 (@mem int (boolfunPredType int) (dvdz d2)))), is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m1 m2) (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring d1 d2)))) *) by rewrite !dvdzE !abszM; apply: dvdn_mul. Qed. Lemma dvdz_trans n d m : (d %| n -> n %| m -> d %| m)%Z. Proof. (* Goal: forall (_ : is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz d)))) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz n)))), is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))) *) by rewrite !dvdzE; apply: dvdn_trans. Qed. Lemma dvdzP d m : reflect (exists q, m = q * d) (d %| m)%Z. Proof. (* Goal: Bool.reflect (@ex (GRing.Ring.sort int_Ring) (fun q : GRing.Ring.sort int_Ring => @eq (GRing.Ring.sort int_Ring) m (@GRing.mul int_Ring q d))) (@in_mem (GRing.Ring.sort int_Ring) m (@mem int (boolfunPredType int) (dvdz d))) *) apply: (iffP dvdnP) => [] [q Dm]; last by exists `|q|%N; rewrite Dm abszM. (* Goal: @ex (GRing.Ring.sort int_Ring) (fun q : GRing.Ring.sort int_Ring => @eq (GRing.Ring.sort int_Ring) m (@GRing.mul int_Ring q d)) *) exists ((-1) ^+ (m < 0)%R * q%:Z * (-1) ^+ (d < 0)%R). (* Goal: @eq (GRing.Ring.sort int_Ring) m (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType m (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz q)) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) d) *) by rewrite -!mulrA -abszEsign -PoszM -Dm -intEsign. Qed. Arguments dvdzP {d m}. Lemma dvdz_mod0P d m : reflect (m %% d = 0)%Z (d %| m)%Z. Proof. (* Goal: Bool.reflect (@eq int (modz m d) (GRing.zero int_ZmodType)) (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))) *) apply: (iffP dvdzP) => [[q ->] | md0]; first by rewrite modzMl. (* Goal: @ex (GRing.Ring.sort int_Ring) (fun q : GRing.Ring.sort int_Ring => @eq (GRing.Ring.sort int_Ring) m (@GRing.mul int_Ring q d)) *) by rewrite (divz_eq m d) md0 addr0; exists (m %/ d)%Z. Qed. Arguments dvdz_mod0P {d m}. Lemma dvdz_eq d m : (d %| m)%Z = ((m %/ d)%Z * d == m). Proof. (* Goal: @eq bool (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))) (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul int_Ring (divz m d) d) m) *) by rewrite (sameP dvdz_mod0P eqP) subr_eq0 eq_sym. Qed. Lemma divzK d m : (d %| m)%Z -> (m %/ d)%Z * d = m. Proof. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (divz m d) d) m *) by rewrite dvdz_eq => /eqP. Qed. Lemma lez_divLR d m n : 0 < d -> (d %| m)%Z -> ((m %/ d)%Z <= n) = (m <= n * d). Proof. (* Goal: forall (_ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d)) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))), @eq bool (@Num.Def.ler int_numDomainType (divz m d) n) (@Num.Def.ler int_numDomainType m (@GRing.mul (Num.NumDomain.ringType int_numDomainType) n d)) *) by move=> /ler_pmul2r <- /divzK->. Qed. Lemma ltz_divRL d m n : 0 < d -> (d %| m)%Z -> (n < m %/ d)%Z = (n * d < m). Proof. (* Goal: forall (_ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d)) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))), @eq bool (@Num.Def.ltr int_numDomainType n (divz m d)) (@Num.Def.ltr int_numDomainType (@GRing.mul (Num.NumDomain.ringType int_numDomainType) n d) m) *) by move=> /ltr_pmul2r <- /divzK->. Qed. Lemma eqz_div d m n : d != 0 -> (d %| m)%Z -> (n == m %/ d)%Z = (n * d == m). Proof. (* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) d (GRing.zero int_ZmodType)))) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))), @eq bool (@eq_op (GRing.Ring.eqType int_Ring) n (divz m d)) (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul int_Ring n d) m) *) by move=> /mulIf/inj_eq <- /divzK->. Qed. Lemma eqz_mul d m n : d != 0 -> (d %| m)%Z -> (m == n * d) = (m %/ d == n)%Z. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) d (GRing.zero int_ZmodType)))) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))), @eq bool (@eq_op int_eqType m (@GRing.mul int_Ring n d)) (@eq_op (GRing.Ring.eqType int_Ring) (divz m d) n) *) by move=> d_gt0 dv_d_m; rewrite eq_sym -eqz_div // eq_sym. Qed. Lemma divz_mulAC d m n : (d %| m)%Z -> (m %/ d)%Z * n = (m * n %/ d)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (divz m d) n) (divz (@GRing.mul int_Ring m n) d) *) have [-> | d_nz] := eqVneq d 0; first by rewrite !divz0 mul0r. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (divz m d) n) (divz (@GRing.mul int_Ring m n) d) *) by move/divzK=> {2} <-; rewrite mulrAC mulzK. Qed. Lemma mulz_divA d m n : (d %| n)%Z -> m * (n %/ d)%Z = (m * n %/ d)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m (divz n d)) (divz (@GRing.mul int_Ring m n) d) *) by move=> dv_d_m; rewrite !(mulrC m) divz_mulAC. Qed. Lemma mulz_divCA d m n : (d %| m)%Z -> (d %| n)%Z -> m * (n %/ d)%Z = n * (m %/ d)%Z. Proof. (* Goal: forall (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))) (_ : is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz d)))), @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m (divz n d)) (@GRing.mul int_Ring n (divz m d)) *) by move=> dv_d_m dv_d_n; rewrite mulrC divz_mulAC ?mulz_divA. Qed. Lemma divzA m n p : (p %| n -> n %| m * p -> m %/ (n %/ p)%Z = m * p %/ n)%Z. Proof. (* Goal: forall (_ : is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz p)))) (_ : is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m p) (@mem int (boolfunPredType int) (dvdz n)))), @eq (GRing.Ring.sort int_Ring) (divz m (divz n p)) (divz (@GRing.mul int_Ring m p) n) *) move/divzK=> p_dv_n; have [->|] := eqVneq n 0; first by rewrite div0z !divz0. (* Goal: forall (_ : is_true (negb (@eq_op int_eqType n (GRing.zero int_ZmodType)))) (_ : is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m p) (@mem int (boolfunPredType int) (dvdz n)))), @eq (GRing.Ring.sort int_Ring) (divz m (divz n p)) (divz (@GRing.mul int_Ring m p) n) *) rewrite -{1 2}p_dv_n mulf_eq0 => /norP[pn_nz p_nz] /divzK; rewrite mulrA p_dv_n. (* Goal: forall _ : @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (divz (@GRing.mul int_Ring m p) n) (divz n p)) p) (@GRing.mul int_Ring m p), @eq (GRing.Ring.sort int_Ring) (divz m (divz n p)) (divz (@GRing.mul int_Ring m p) n) *) by move/mulIf=> {1} <- //; rewrite mulzK. Qed. Lemma divzMA m n p : (n * p %| m -> m %/ (n * p) = (m %/ n)%Z %/ p)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring n p)))), @eq (GRing.Ring.sort int_Ring) (divz m (@GRing.mul int_Ring n p)) (divz (divz m n) p) *) have [-> | nz_p] := eqVneq p 0; first by rewrite mulr0 !divz0. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring n p)))), @eq (GRing.Ring.sort int_Ring) (divz m (@GRing.mul int_Ring n p)) (divz (divz m n) p) *) have [-> | nz_n] := eqVneq n 0; first by rewrite mul0r !divz0 div0z. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring n p)))), @eq (GRing.Ring.sort int_Ring) (divz m (@GRing.mul int_Ring n p)) (divz (divz m n) p) *) by move/divzK=> {2} <-; rewrite mulrA mulrAC !mulzK. Qed. Lemma divzAC m n p : (n * p %| m -> (m %/ n)%Z %/ p = (m %/ p)%Z %/ n)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring n p)))), @eq (GRing.Ring.sort int_Ring) (divz (divz m n) p) (divz (divz m p) n) *) by move=> np_dv_mn; rewrite -!divzMA // mulrC. Qed. Lemma divzMl p m d : p != 0 -> (d %| m -> p * m %/ (p * d) = m %/ d)%Z. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) p (GRing.zero (GRing.Ring.zmodType int_Ring))))) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.mul int_Ring p m) (@GRing.mul int_Ring p d)) (divz m d) *) have [-> | nz_d nz_p] := eqVneq d 0; first by rewrite mulr0 !divz0. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.mul int_Ring p m) (@GRing.mul int_Ring p d)) (divz m d) *) by move/divzK=> {1}<-; rewrite mulrCA mulzK ?mulf_neq0. Qed. Lemma divzMr p m d : p != 0 -> (d %| m -> m * p %/ (d * p) = m %/ d)%Z. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) p (GRing.zero (GRing.Ring.zmodType int_Ring))))) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.mul int_Ring m p) (@GRing.mul int_Ring d p)) (divz m d) *) by rewrite -!(mulrC p); apply: divzMl. Qed. Lemma dvdz_mul2l p d m : p != 0 -> (p * d %| p * m)%Z = (d %| m)%Z. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) p (GRing.zero (GRing.Ring.zmodType int_Ring)))), @eq bool (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring p m) (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring p d)))) (@in_mem (GRing.Ring.sort int_Ring) m (@mem int (boolfunPredType int) (dvdz d))) *) by rewrite !dvdzE -absz_gt0 !abszM; apply: dvdn_pmul2l. Qed. Arguments dvdz_mul2l [p d m]. Lemma dvdz_mul2r p d m : p != 0 -> (d * p %| m * p)%Z = (d %| m)%Z. Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) p (GRing.zero (GRing.Ring.zmodType int_Ring)))), @eq bool (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring m p) (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring d p)))) (@in_mem (GRing.Ring.sort int_Ring) m (@mem int (boolfunPredType int) (dvdz d))) *) by rewrite !dvdzE -absz_gt0 !abszM; apply: dvdn_pmul2r. Qed. Arguments dvdz_mul2r [p d m]. Lemma dvdz_exp2l p m n : (m <= n)%N -> (p ^+ m %| p ^+ n)%Z. Proof. (* Goal: forall _ : is_true (leq m n), is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.exp int_Ring p n) (@mem int (boolfunPredType int) (dvdz (@GRing.exp int_Ring p m)))) *) by rewrite dvdzE !abszX; apply: dvdn_exp2l. Qed. Lemma dvdz_Pexp2l p m n : `|p| > 1 -> (p ^+ m %| p ^+ n)%Z = (m <= n)%N. Proof. (* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.one (Num.NumDomain.ringType int_numDomainType)) (@Num.Def.normr int_numDomainType p)), @eq bool (@in_mem (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@GRing.exp (Num.NumDomain.ringType int_numDomainType) p n) (@mem int (boolfunPredType int) (dvdz (@GRing.exp (Num.NumDomain.ringType int_numDomainType) p m)))) (leq m n) *) by rewrite dvdzE !abszX ltz_nat; apply: dvdn_Pexp2l. Qed. Lemma dvdz_exp2r m n k : (m %| n -> m ^+ k %| n ^+ k)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz m))), is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.exp int_Ring n k) (@mem int (boolfunPredType int) (dvdz (@GRing.exp int_Ring m k)))) *) by rewrite !dvdzE !abszX; apply: dvdn_exp2r. Qed. Fact dvdz_zmod_closed d : zmod_closed (dvdz d). Proof. (* Goal: @GRing.zmod_closed int_ZmodType (dvdz d) *) split=> [|_ _ /dvdzP[p ->] /dvdzP[q ->]]; first exact: dvdz0. (* Goal: is_true (@in_mem (GRing.Zmodule.sort int_ZmodType) (@GRing.add int_ZmodType (@GRing.mul int_Ring p d) (@GRing.opp int_ZmodType (@GRing.mul int_Ring q d))) (@mem (GRing.Zmodule.sort int_ZmodType) (predPredType (GRing.Zmodule.sort int_ZmodType)) (dvdz d))) *) by rewrite -mulrBl dvdz_mull. Qed. Canonical dvdz_addPred d := AddrPred (dvdz_zmod_closed d). Canonical dvdz_oppPred d := OpprPred (dvdz_zmod_closed d). Canonical dvdz_zmodPred d := ZmodPred (dvdz_zmod_closed d). Lemma dvdz_exp k d m : (0 < k)%N -> (d %| m -> d %| m ^+ k)%Z. Proof. (* Goal: forall (_ : is_true (leq (S O) k)) (_ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d)))), is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.exp int_Ring m k) (@mem int (boolfunPredType int) (dvdz d))) *) by case: k => // k _ d_dv_m; rewrite exprS dvdz_mulr. Qed. Lemma eqz_mod_dvd d m n : (m == n %[mod d])%Z = (d %| m - n)%Z. Proof. (* Goal: @eq bool (@eq_op int_eqType (modz m d) (modz n d)) (@in_mem (GRing.Zmodule.sort int_ZmodType) (@GRing.add int_ZmodType m (@GRing.opp int_ZmodType n)) (@mem int (boolfunPredType int) (dvdz d))) *) apply/eqP/dvdz_mod0P=> eq_mn. (* Goal: @eq (Equality.sort int_eqType) (modz m d) (modz n d) *) (* Goal: @eq int (modz (@GRing.add int_ZmodType m (@GRing.opp int_ZmodType n)) d) (GRing.zero int_ZmodType) *) by rewrite -modzDml eq_mn modzDml subrr mod0z. (* Goal: @eq (Equality.sort int_eqType) (modz m d) (modz n d) *) by rewrite -(subrK n m) -modzDml eq_mn add0r. Qed. Lemma divzDl m n d : (d %| m)%Z -> ((m + n) %/ d)%Z = (m %/ d)%Z + (n %/ d)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add int_ZmodType m n) d) (@GRing.add (GRing.Ring.zmodType int_Ring) (divz m d) (divz n d)) *) have [-> | d_nz] := eqVneq d 0; first by rewrite !divz0. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add int_ZmodType m n) d) (@GRing.add (GRing.Ring.zmodType int_Ring) (divz m d) (divz n d)) *) by move/divzK=> {1}<-; rewrite divzMDl. Qed. Lemma divzDr m n d : (d %| n)%Z -> ((m + n) %/ d)%Z = (m %/ d)%Z + (n %/ d)%Z. Proof. (* Goal: forall _ : is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz d))), @eq (GRing.Ring.sort int_Ring) (divz (@GRing.add int_ZmodType m n) d) (@GRing.add (GRing.Ring.zmodType int_Ring) (divz m d) (divz n d)) *) by move=> dv_n; rewrite addrC divzDl // addrC. Qed. Lemma Qint_dvdz (m d : int) : (d %| m)%Z -> ((m%:~R / d%:~R : rat) \is a Qint). Proof. (* Goal: forall _ : is_true (@in_mem int m (@mem int (boolfunPredType int) (dvdz d))), is_true (@in_mem rat (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) m) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)) : rat) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) *) case/dvdzP=> z ->; rewrite rmorphM /=; case: (altP (d =P 0)) => [->|dn0]. (* Goal: is_true (@in_mem rat (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) z) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) *) (* Goal: is_true (@in_mem rat (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) z) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (GRing.zero int_ZmodType))) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (GRing.zero int_ZmodType)))) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) *) by rewrite mulr0 mul0r. (* Goal: is_true (@in_mem rat (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) z) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) *) by rewrite mulfK ?intr_eq0 // rpred_int. Qed. Lemma Qnat_dvd (m d : nat) : (d %| m)%N -> ((m%:R / d%:R : rat) \is a Qnat). Proof. (* Goal: forall _ : is_true (dvdn d m), is_true (@in_mem rat (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) m) (@GRing.inv rat_unitRing (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)) : rat) (@mem rat (predPredType rat) (@has_quality (S O) rat Qnat))) *) move=> h; rewrite Qnat_def divr_ge0 ?ler0n // -[m%:R]/(m%:~R) -[d%:R]/(d%:~R). (* Goal: is_true (andb (@in_mem rat (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (Posz m)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (Posz d)))) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) true) *) by rewrite Qint_dvdz. Qed. Lemma gcdzz m : gcdz m m = `|m|%:Z. Proof. by rewrite /gcdz gcdnn. Qed. Proof. (* Goal: @eq int (gcdz m m) (Posz (absz m)) *) by rewrite /gcdz gcdnn. Qed. Lemma gcd0z m : gcdz 0 m = `|m|%:Z. Proof. by rewrite /gcdz gcd0n. Qed. Proof. (* Goal: @eq int (gcdz (GRing.zero int_ZmodType) m) (Posz (absz m)) *) by rewrite /gcdz gcd0n. Qed. Lemma gcd1z : left_zero 1 gcdz. Proof. by move=> m; rewrite /gcdz gcd1n. Qed. Proof. (* Goal: @left_zero (GRing.Ring.sort int_Ring) int (GRing.one int_Ring) gcdz *) by move=> m; rewrite /gcdz gcd1n. Qed. Lemma dvdz_gcdr m n : (gcdz m n %| n)%Z. Proof. exact: dvdn_gcdr. Qed. Proof. (* Goal: is_true (@in_mem int n (@mem int (boolfunPredType int) (dvdz (gcdz m n)))) *) exact: dvdn_gcdr. Qed. Lemma gcdz_eq0 m n : (gcdz m n == 0) = (m == 0) && (n == 0). Proof. (* Goal: @eq bool (@eq_op int_eqType (gcdz m n) (GRing.zero int_ZmodType)) (andb (@eq_op int_eqType m (GRing.zero int_ZmodType)) (@eq_op int_eqType n (GRing.zero int_ZmodType))) *) by rewrite -absz_eq0 eqn0Ngt gcdn_gt0 !negb_or -!eqn0Ngt !absz_eq0. Qed. Lemma gcdNz m n : gcdz (- m) n = gcdz m n. Proof. by rewrite /gcdz abszN. Qed. Proof. (* Goal: @eq int (gcdz (@GRing.opp int_ZmodType m) n) (gcdz m n) *) by rewrite /gcdz abszN. Qed. Lemma gcdz_modr m n : gcdz m (n %% m)%Z = gcdz m n. Proof. (* Goal: @eq int (gcdz m (modz n m)) (gcdz m n) *) rewrite -modz_abs /gcdz; move/absz: m => m. (* Goal: @eq int (Posz (gcdn m (absz (modz n (Posz m))))) (Posz (gcdn m (absz n))) *) have [-> | m_gt0] := posnP m; first by rewrite modz0. (* Goal: @eq int (Posz (gcdn m (absz (modz n (Posz m))))) (Posz (gcdn m (absz n))) *) case: n => n; first by rewrite modz_nat gcdn_modr. (* Goal: @eq int (Posz (gcdn m (absz (modz (Negz n) (Posz m))))) (Posz (gcdn m (absz (Negz n)))) *) rewrite modNz_nat // NegzE abszN {2}(divn_eq n m) -addnS gcdnMDl. (* Goal: @eq int (Posz (gcdn m (absz (@GRing.add int_ZmodType (@GRing.add int_ZmodType (Posz m) (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring))) (@GRing.opp int_ZmodType (Posz (modn n m))))))) (Posz (gcdn m (S (modn n m)))) *) rewrite -addrA -opprD -intS /=; set m1 := _.+1. (* Goal: @eq int (Posz (gcdn m (absz (@GRing.add int_ZmodType (Posz m) (@GRing.opp int_ZmodType (Posz m1)))))) (Posz (gcdn m m1)) *) have le_m1m: (m1 <= m)%N by apply: ltn_pmod. (* Goal: @eq int (Posz (gcdn m (absz (@GRing.add int_ZmodType (Posz m) (@GRing.opp int_ZmodType (Posz m1)))))) (Posz (gcdn m m1)) *) by rewrite subzn // !(gcdnC m) -{2 3}(subnK le_m1m) gcdnDl gcdnDr gcdnC. Qed. Lemma gcdz_modl m n : gcdz (m %% n)%Z n = gcdz m n. Proof. (* Goal: @eq int (gcdz (modz m n) n) (gcdz m n) *) by rewrite -!(gcdzC n) gcdz_modr. Qed. Lemma gcdzMDl q m n : gcdz m (q * m + n) = gcdz m n. Proof. (* Goal: @eq int (gcdz m (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring q m) n)) (gcdz m n) *) by rewrite -gcdz_modr modzMDl gcdz_modr. Qed. Lemma gcdzDl m n : gcdz m (m + n) = gcdz m n. Proof. (* Goal: @eq int (gcdz m (@GRing.add int_ZmodType m n)) (gcdz m n) *) by rewrite -{2}(mul1r m) gcdzMDl. Qed. Lemma gcdzDr m n : gcdz m (n + m) = gcdz m n. Proof. (* Goal: @eq int (gcdz m (@GRing.add int_ZmodType n m)) (gcdz m n) *) by rewrite addrC gcdzDl. Qed. Lemma gcdzMl n m : gcdz n (m * n) = `|n|%:Z. Proof. (* Goal: @eq int (gcdz n (@GRing.mul int_Ring m n)) (Posz (absz n)) *) by rewrite -[m * n]addr0 gcdzMDl gcdz0. Qed. Lemma gcdzMr n m : gcdz n (n * m) = `|n|%:Z. Proof. (* Goal: @eq int (gcdz n (@GRing.mul int_Ring n m)) (Posz (absz n)) *) by rewrite mulrC gcdzMl. Qed. Lemma gcdz_idPl {m n} : reflect (gcdz m n = `|m|%:Z) (m %| n)%Z. Proof. (* Goal: Bool.reflect (@eq int (gcdz m n) (Posz (absz m))) (@in_mem int n (@mem int (boolfunPredType int) (dvdz m))) *) by apply: (iffP gcdn_idPl) => [<- | []]. Qed. Lemma gcdz_idPr {m n} : reflect (gcdz m n = `|n|%:Z) (n %| m)%Z. Proof. (* Goal: Bool.reflect (@eq int (gcdz m n) (Posz (absz n))) (@in_mem int m (@mem int (boolfunPredType int) (dvdz n))) *) by rewrite gcdzC; apply: gcdz_idPl. Qed. Lemma expz_min e m n : e >= 0 -> e ^+ minn m n = gcdz (e ^+ m) (e ^+ n). Proof. (* Goal: forall _ : is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) e), @eq (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@GRing.exp (Num.NumDomain.ringType int_numDomainType) e (minn m n)) (gcdz (@GRing.exp (Num.NumDomain.ringType int_numDomainType) e m) (@GRing.exp (Num.NumDomain.ringType int_numDomainType) e n)) *) by case: e => // e _; rewrite /gcdz !abszX -expn_min -natz -natrX !natz. Qed. Lemma dvdz_gcd p m n : (p %| gcdz m n)%Z = (p %| m)%Z && (p %| n)%Z. Proof. (* Goal: @eq bool (@in_mem int (gcdz m n) (@mem int (boolfunPredType int) (dvdz p))) (andb (@in_mem int m (@mem int (boolfunPredType int) (dvdz p))) (@in_mem int n (@mem int (boolfunPredType int) (dvdz p)))) *) exact: dvdn_gcd. Qed. Lemma gcdzAC : right_commutative gcdz. Proof. (* Goal: @right_commutative int int gcdz *) by move=> m n p; rewrite /gcdz gcdnAC. Qed. Lemma gcdzA : associative gcdz. Proof. (* Goal: @associative int gcdz *) by move=> m n p; rewrite /gcdz gcdnA. Qed. Lemma gcdzCA : left_commutative gcdz. Proof. (* Goal: @left_commutative int int gcdz *) by move=> m n p; rewrite /gcdz gcdnCA. Qed. Lemma gcdzACA : interchange gcdz gcdz. Proof. (* Goal: @interchange int gcdz gcdz *) by move=> m n p q; rewrite /gcdz gcdnACA. Qed. Lemma mulz_gcdr m n p : `|m|%:Z * gcdz n p = gcdz (m * n) (m * p). Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (Posz (absz m)) (gcdz n p)) (gcdz (@GRing.mul int_Ring m n) (@GRing.mul int_Ring m p)) *) by rewrite -PoszM muln_gcdr -!abszM. Qed. Lemma mulz_gcdl m n p : gcdz m n * `|p|%:Z = gcdz (m * p) (n * p). Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (gcdz m n) (Posz (absz p))) (gcdz (@GRing.mul int_Ring m p) (@GRing.mul int_Ring n p)) *) by rewrite -PoszM muln_gcdl -!abszM. Qed. Lemma mulz_divCA_gcd n m : n * (m %/ gcdz n m)%Z = m * (n %/ gcdz n m)%Z. Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring n (divz m (gcdz n m))) (@GRing.mul int_Ring m (divz n (gcdz n m))) *) by rewrite mulz_divCA ?dvdz_gcdl ?dvdz_gcdr. Qed. Lemma coprimez_sym : symmetric coprimez. Proof. (* Goal: @symmetric int coprimez *) by move=> m n; apply: coprime_sym. Qed. Lemma coprimeNz m n : coprimez (- m) n = coprimez m n. Proof. (* Goal: @eq bool (coprimez (@GRing.opp int_ZmodType m) n) (coprimez m n) *) by rewrite coprimezE abszN. Qed. Lemma coprimezN m n : coprimez m (- n) = coprimez m n. Proof. (* Goal: @eq bool (coprimez m (@GRing.opp int_ZmodType n)) (coprimez m n) *) by rewrite coprimezE abszN. Qed. Variant egcdz_spec m n : int * int -> Type := EgcdzSpec u v of u * m + v * n = gcdz m n & coprimez u v : egcdz_spec m n (u, v). Lemma egcdzP m n : egcdz_spec m n (egcdz m n). Proof. (* Goal: egcdz_spec m n (egcdz m n) *) rewrite /egcdz; have [-> | m_nz] := altP eqP. (* Goal: egcdz_spec m n (let 'pair u v := egcdn (absz m) (absz n) in @pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (@sgz int_numDomainType m) (Posz u)) (@GRing.mul int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) (Posz v))) *) (* Goal: egcdz_spec (GRing.zero int_ZmodType) n (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (GRing.zero (GRing.Ring.zmodType int_Ring)) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) *) by split; [rewrite -abszEsign gcd0z | rewrite coprimezE absz_sign]. (* Goal: egcdz_spec m n (let 'pair u v := egcdn (absz m) (absz n) in @pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (@sgz int_numDomainType m) (Posz u)) (@GRing.mul int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) (Posz v))) *) have m_gt0 : (`|m| > 0)%N by rewrite absz_gt0. (* Goal: egcdz_spec m n (let 'pair u v := egcdn (absz m) (absz n) in @pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (@sgz int_numDomainType m) (Posz u)) (@GRing.mul int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) (Posz v))) *) case: egcdnP (coprime_egcdn `|n| m_gt0) => //= u v Duv _ co_uv; split. (* Goal: is_true (coprimez (@GRing.mul int_Ring (@sgz int_numDomainType m) (Posz u)) (@GRing.mul int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) (Posz v))) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@sgz int_numDomainType m) (Posz u)) m) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) (Posz v)) n)) (gcdz m n) *) rewrite !mulNr -!mulrA mulrCA -abszEsg mulrCA -abszEsign. (* Goal: is_true (coprimez (@GRing.mul int_Ring (@sgz int_numDomainType m) (Posz u)) (@GRing.mul int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) (Posz v))) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul (GRing.ComRing.ringType int_comRing) (Posz u) (Posz (absz m))) (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.mul (GRing.ComRing.ringType int_comRing) (Posz v) (Posz (absz n))))) (gcdz m n) *) by rewrite -!PoszM Duv addnC PoszD addrK. (* Goal: is_true (coprimez (@GRing.mul int_Ring (@sgz int_numDomainType m) (Posz u)) (@GRing.mul int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))))) (Posz v))) *) by rewrite coprimezE abszM absz_sg m_nz mul1n mulNr abszN abszMsign. Qed. Lemma Bezoutz m n : {u : int & {v : int | u * m + v * n = gcdz m n}}. Proof. (* Goal: @sigT int (fun u : int => @sig int (fun v : int => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring u m) (@GRing.mul int_Ring v n)) (gcdz m n))) *) by exists (egcdz m n).1, (egcdz m n).2; case: egcdzP. Qed. Lemma coprimezP m n : reflect (exists uv, uv.1 * m + uv.2 * n = 1) (coprimez m n). Proof. (* Goal: Bool.reflect (@ex (prod (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring)) (fun uv : prod (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) uv) m) (@GRing.mul int_Ring (@snd (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) uv) n)) (GRing.one int_Ring))) (coprimez m n) *) apply: (iffP eqP) => [<-| [[u v] /= Duv]]. (* Goal: @eq int (gcdz m n) (GRing.one int_Ring) *) (* Goal: @ex (prod (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring)) (fun uv : prod (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) uv) m) (@GRing.mul int_Ring (@snd (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) uv) n)) (gcdz m n)) *) by exists (egcdz m n); case: egcdzP. (* Goal: @eq int (gcdz m n) (GRing.one int_Ring) *) congr _%:Z; apply: gcdn_def; rewrite ?dvd1n // => d dv_d_n dv_d_m. (* Goal: is_true (dvdn d (S O)) *) by rewrite -(dvdzE d 1) -Duv [m]intEsg [n]intEsg rpredD ?dvdz_mull. Qed. Lemma Gauss_dvdz m n p : coprimez m n -> (m * n %| p)%Z = (m %| p)%Z && (n %| p)%Z. Proof. (* Goal: forall _ : is_true (coprimez m n), @eq bool (@in_mem int p (@mem int (boolfunPredType int) (dvdz (@GRing.mul int_Ring m n)))) (andb (@in_mem int p (@mem int (boolfunPredType int) (dvdz m))) (@in_mem int p (@mem int (boolfunPredType int) (dvdz n)))) *) by move/Gauss_dvd <-; rewrite -abszM. Qed. Lemma Gauss_dvdzr m n p : coprimez m n -> (m %| n * p)%Z = (m %| p)%Z. Proof. (* Goal: forall _ : is_true (coprimez m n), @eq bool (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring n p) (@mem int (boolfunPredType int) (dvdz m))) (@in_mem (GRing.Ring.sort int_Ring) p (@mem int (boolfunPredType int) (dvdz m))) *) by rewrite dvdzE abszM => /Gauss_dvdr->. Qed. Lemma Gauss_dvdzl m n p : coprimez m p -> (m %| n * p)%Z = (m %| n)%Z. Proof. (* Goal: forall _ : is_true (coprimez m p), @eq bool (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring n p) (@mem int (boolfunPredType int) (dvdz m))) (@in_mem (GRing.Ring.sort int_Ring) n (@mem int (boolfunPredType int) (dvdz m))) *) by rewrite mulrC; apply: Gauss_dvdzr. Qed. Lemma Gauss_gcdzr p m n : coprimez p m -> gcdz p (m * n) = gcdz p n. Proof. (* Goal: forall _ : is_true (coprimez p m), @eq int (gcdz p (@GRing.mul int_Ring m n)) (gcdz p n) *) by rewrite /gcdz abszM => /Gauss_gcdr->. Qed. Lemma Gauss_gcdzl p m n : coprimez p n -> gcdz p (m * n) = gcdz p m. Proof. (* Goal: forall _ : is_true (coprimez p n), @eq int (gcdz p (@GRing.mul int_Ring m n)) (gcdz p m) *) by move=> co_pn; rewrite mulrC Gauss_gcdzr. Qed. Lemma coprimez_mulr p m n : coprimez p (m * n) = coprimez p m && coprimez p n. Proof. (* Goal: @eq bool (coprimez p (@GRing.mul int_Ring m n)) (andb (coprimez p m) (coprimez p n)) *) by rewrite -coprime_mulr -abszM. Qed. Lemma coprimez_mull p m n : coprimez (m * n) p = coprimez m p && coprimez n p. Proof. (* Goal: @eq bool (coprimez (@GRing.mul int_Ring m n) p) (andb (coprimez m p) (coprimez n p)) *) by rewrite -coprime_mull -abszM. Qed. Lemma coprimez_pexpl k m n : (0 < k)%N -> coprimez (m ^+ k) n = coprimez m n. Proof. (* Goal: forall _ : is_true (leq (S O) k), @eq bool (coprimez (@GRing.exp int_Ring m k) n) (coprimez m n) *) by rewrite /coprimez /gcdz abszX; apply: coprime_pexpl. Qed. Lemma coprimez_pexpr k m n : (0 < k)%N -> coprimez m (n ^+ k) = coprimez m n. Proof. (* Goal: forall _ : is_true (leq (S O) k), @eq bool (coprimez m (@GRing.exp int_Ring n k)) (coprimez m n) *) by move=> k_gt0; rewrite !(coprimez_sym m) coprimez_pexpl. Qed. Lemma coprimez_expl k m n : coprimez m n -> coprimez (m ^+ k) n. Proof. (* Goal: forall _ : is_true (coprimez m n), is_true (coprimez (@GRing.exp int_Ring m k) n) *) by rewrite /coprimez /gcdz abszX; apply: coprime_expl. Qed. Lemma coprimez_expr k m n : coprimez m n -> coprimez m (n ^+ k). Proof. (* Goal: forall _ : is_true (coprimez m n), is_true (coprimez m (@GRing.exp int_Ring n k)) *) by rewrite !(coprimez_sym m); apply: coprimez_expl. Qed. Lemma coprimez_dvdl m n p : (m %| n)%N -> coprimez n p -> coprimez m p. Proof. (* Goal: forall (_ : is_true (dvdn m n)) (_ : is_true (coprimez (Posz n) p)), is_true (coprimez (Posz m) p) *) exact: coprime_dvdl. Qed. Lemma coprimez_dvdr m n p : (m %| n)%N -> coprimez p n -> coprimez p m. Proof. (* Goal: forall (_ : is_true (dvdn m n)) (_ : is_true (coprimez p (Posz n))), is_true (coprimez p (Posz m)) *) exact: coprime_dvdr. Qed. Lemma dvdz_pexp2r m n k : (k > 0)%N -> (m ^+ k %| n ^+ k)%Z = (m %| n)%Z. Proof. (* Goal: forall _ : is_true (leq (S O) k), @eq bool (@in_mem (GRing.Ring.sort int_Ring) (@GRing.exp int_Ring n k) (@mem int (boolfunPredType int) (dvdz (@GRing.exp int_Ring m k)))) (@in_mem (GRing.Ring.sort int_Ring) n (@mem int (boolfunPredType int) (dvdz m))) *) by rewrite dvdzE !abszX; apply: dvdn_pexp2r. Qed. Section Chinese. Variables m1 m2 : int. Hypothesis co_m12 : coprimez m1 m2. Lemma zchinese_remainder x y : (x == y %[mod m1 * m2])%Z = (x == y %[mod m1])%Z && (x == y %[mod m2])%Z. Proof. (* Goal: @eq bool (@eq_op int_eqType (modz x (@GRing.mul int_Ring m1 m2)) (modz y (@GRing.mul int_Ring m1 m2))) (andb (@eq_op int_eqType (modz x m1) (modz y m1)) (@eq_op int_eqType (modz x m2) (modz y m2))) *) by rewrite !eqz_mod_dvd Gauss_dvdz. Qed. Definition zchinese r1 r2 := r1 * m2 * (egcdz m1 m2).2 + r2 * m1 * (egcdz m1 m2).1. Lemma zchinese_modl r1 r2 : (zchinese r1 r2 = r1 %[mod m1])%Z. Proof. (* Goal: @eq int (modz (zchinese r1 r2) m1) (modz r1 m1) *) rewrite /zchinese; have [u v /= Duv _] := egcdzP m1 m2. (* Goal: @eq int (modz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring r1 m2) v) (@GRing.mul int_Ring (@GRing.mul int_Ring r2 m1) u)) m1) (modz r1 m1) *) rewrite -{2}[r1]mulr1 -((gcdz _ _ =P 1) co_m12) -Duv. (* Goal: @eq int (modz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring r1 m2) v) (@GRing.mul int_Ring (@GRing.mul int_Ring r2 m1) u)) m1) (modz (@GRing.mul int_Ring r1 (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring u m1) (@GRing.mul int_Ring v m2))) m1) *) by rewrite mulrDr mulrAC addrC (mulrAC r2) !mulrA !modzMDl. Qed. Lemma zchinese_modr r1 r2 : (zchinese r1 r2 = r2 %[mod m2])%Z. Proof. (* Goal: @eq int (modz (zchinese r1 r2) m2) (modz r2 m2) *) rewrite /zchinese; have [u v /= Duv _] := egcdzP m1 m2. (* Goal: @eq int (modz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring r1 m2) v) (@GRing.mul int_Ring (@GRing.mul int_Ring r2 m1) u)) m2) (modz r2 m2) *) rewrite -{2}[r2]mulr1 -((gcdz _ _ =P 1) co_m12) -Duv. (* Goal: @eq int (modz (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring r1 m2) v) (@GRing.mul int_Ring (@GRing.mul int_Ring r2 m1) u)) m2) (modz (@GRing.mul int_Ring r2 (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring u m1) (@GRing.mul int_Ring v m2))) m2) *) by rewrite mulrAC modzMDl mulrAC addrC mulrDr !mulrA modzMDl. Qed. Lemma zchinese_mod x : (x = zchinese (x %% m1)%Z (x %% m2)%Z %[mod m1 * m2])%Z. Proof. (* Goal: @eq int (modz x (@GRing.mul int_Ring m1 m2)) (modz (zchinese (modz x m1) (modz x m2)) (@GRing.mul int_Ring m1 m2)) *) apply/eqP; rewrite zchinese_remainder //. (* Goal: is_true (andb (@eq_op int_eqType (modz x m1) (modz (zchinese (modz x m1) (modz x m2)) m1)) (@eq_op int_eqType (modz x m2) (modz (zchinese (modz x m1) (modz x m2)) m2))) *) by rewrite zchinese_modl zchinese_modr !modz_mod !eqxx. Qed. End Chinese. Section ZpolyScale. Definition zcontents p := sgz (lead_coef p) * \big[gcdn/0%N]_(i < size p) `|(p`_i)%R|%N. Lemma sgz_contents p : sgz (zcontents p) = sgz (lead_coef p). Proof. (* Goal: @eq int (@sgz int_numDomainType (zcontents p)) (@sgz int_numDomainType (@lead_coef (Num.NumDomain.ringType int_numDomainType) p)) *) rewrite /zcontents mulrC sgzM sgz_id; set d := _%:Z. (* Goal: @eq int (@GRing.mul int_Ring (@sgz (Num.RealDomain.numDomainType int_realDomainType) d) (@sgz int_numDomainType (@lead_coef (Num.NumDomain.ringType int_numDomainType) p))) (@sgz int_numDomainType (@lead_coef (Num.NumDomain.ringType int_numDomainType) p)) *) have [-> | nz_p] := eqVneq p 0; first by rewrite lead_coef0 mulr0. (* Goal: @eq int (@GRing.mul int_Ring (@sgz (Num.RealDomain.numDomainType int_realDomainType) d) (@sgz int_numDomainType (@lead_coef (Num.NumDomain.ringType int_numDomainType) p))) (@sgz int_numDomainType (@lead_coef (Num.NumDomain.ringType int_numDomainType) p)) *) rewrite gtr0_sgz ?mul1r // ltz_nat polySpred ?big_ord_recr //= -lead_coefE. (* Goal: is_true (leq (S O) (gcdn (@BigOp.bigop nat (ordinal (Nat.pred (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) O (index_enum (ordinal_finType (Nat.pred (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p))))) (fun i : ordinal (Nat.pred (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) => @BigBody nat (ordinal (Nat.pred (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) i gcdn true (absz (@nth int (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (Nat.pred (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) i))))) (absz (@lead_coef int_Ring p)))) *) by rewrite gcdn_gt0 orbC absz_gt0 lead_coef_eq0 nz_p. Qed. Lemma zcontents_eq0 p : (zcontents p == 0) = (p == 0). Proof. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType int_Ring) (zcontents p) (GRing.zero (GRing.Ring.zmodType int_Ring))) (@eq_op (poly_eqType (Num.NumDomain.ringType int_numDomainType)) p (GRing.zero (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))) *) by rewrite -sgz_eq0 sgz_contents sgz_eq0 lead_coef_eq0. Qed. Lemma zcontents0 : zcontents 0 = 0. Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (zcontents (GRing.zero (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))) (GRing.zero (GRing.Ring.zmodType int_Ring)) *) by apply/eqP; rewrite zcontents_eq0. Qed. Lemma zcontentsZ a p : zcontents (a *: p) = a * zcontents p. Proof. (* Goal: @eq (GRing.Ring.sort int_Ring) (zcontents (@GRing.scale (Num.NumDomain.ringType int_numDomainType) (poly_lmodType (Num.NumDomain.ringType int_numDomainType)) a p)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) a (zcontents p)) *) have [-> | nz_a] := eqVneq a 0; first by rewrite scale0r mul0r zcontents0. (* Goal: @eq (GRing.Ring.sort int_Ring) (zcontents (@GRing.scale (Num.NumDomain.ringType int_numDomainType) (poly_lmodType (Num.NumDomain.ringType int_numDomainType)) a p)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) a (zcontents p)) *) rewrite {2}[a]intEsg mulrCA -mulrA -PoszM big_distrr /= mulrCA mulrA -sgzM. (* Goal: @eq int (zcontents (@GRing.scale (Num.NumDomain.ringType int_numDomainType) (poly_lmodType (Num.NumDomain.ringType int_numDomainType)) a p)) (@GRing.mul (GRing.ComRing.ringType (Num.NumDomain.comRingType int_numDomainType)) (@sgz (Num.RealDomain.numDomainType int_realDomainType) (@GRing.mul (Num.RealDomain.ringType int_realDomainType) a (@lead_coef (Num.NumDomain.ringType int_numDomainType) p))) (Posz (@BigOp.bigop nat (ordinal (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) O (index_enum (ordinal_finType (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) (fun i : ordinal (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) => @BigBody nat (ordinal (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) i gcdn true (muln (absz a) (absz (@nth int (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) i)))))))) *) rewrite -lead_coefZ; congr (_ * _%:Z); rewrite size_scale //. (* Goal: @eq nat (@BigOp.bigop nat (Finite.sort (ordinal_finType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType))) (@polyseq (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) p)))) O (index_enum (ordinal_finType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType))) (@polyseq (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) p)))) (fun i : ordinal (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType))) (@polyseq (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) p)) => @BigBody nat (ordinal (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType))) (@polyseq (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) p))) i gcdn true (absz (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) (@GRing.scale (Num.NumDomain.ringType int_numDomainType) (poly_lmodType (Num.NumDomain.ringType int_numDomainType)) a p)) (@nat_of_ord (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType))) (@polyseq (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) p)) i))))) (@BigOp.bigop nat (ordinal (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) O (index_enum (ordinal_finType (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) (fun i : ordinal (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) => @BigBody nat (ordinal (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) i gcdn true (muln (absz a) (absz (@nth int (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) i)))))) *) by apply: eq_bigr => i _; rewrite coefZ abszM. Qed. Lemma zcontents_monic p : p \is monic -> zcontents p = 1. Proof. (* Goal: forall _ : is_true (@in_mem (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) p (@mem (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) (predPredType (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType))))) (@has_quality O (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) (@monic (Num.NumDomain.ringType int_numDomainType))))), @eq (GRing.Ring.sort int_Ring) (zcontents p) (GRing.one int_Ring) *) move=> mon_p; rewrite /zcontents polySpred ?monic_neq0 //. (* Goal: @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (@sgz int_numDomainType (@lead_coef (Num.NumDomain.ringType int_numDomainType) p)) (Posz (@BigOp.bigop nat (Finite.sort (ordinal_finType (S (Nat.pred (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))))) O (index_enum (ordinal_finType (S (Nat.pred (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))))) (fun i : ordinal (S (Nat.pred (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) => @BigBody nat (ordinal (S (Nat.pred (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p))))) i gcdn true (absz (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (S (Nat.pred (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) i))))))) (GRing.one int_Ring) *) by rewrite big_ord_recr /= -lead_coefE (monicP mon_p) gcdn1. Qed. Lemma dvdz_contents a p : (a %| zcontents p)%Z = (p \is a polyOver (dvdz a)). Proof. (* Goal: @eq bool (@in_mem (GRing.Ring.sort int_Ring) (zcontents p) (@mem int (boolfunPredType int) (dvdz a))) (@in_mem (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) p (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality (S O) (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@polyOver int_Ring (dvdz a))))) *) rewrite dvdzE abszM absz_sg lead_coef_eq0. (* Goal: @eq bool (dvdn (absz a) (muln (nat_of_bool (negb (@eq_op (poly_eqType int_Ring) p (GRing.zero (poly_zmodType int_Ring))))) (absz (Posz (@BigOp.bigop nat (Finite.sort (ordinal_finType (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) O (index_enum (ordinal_finType (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) (fun i : ordinal (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) => @BigBody nat (ordinal (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) i gcdn true (absz (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) i))))))))) (@in_mem (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) p (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality (S O) (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@polyOver int_Ring (dvdz a))))) *) have [-> | nz_p] := altP eqP; first by rewrite mul0n dvdn0 rpred0. (* Goal: @eq bool (dvdn (absz a) (muln (nat_of_bool (negb false)) (absz (Posz (@BigOp.bigop nat (Finite.sort (ordinal_finType (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) O (index_enum (ordinal_finType (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)))) (fun i : ordinal (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) => @BigBody nat (ordinal (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p))) i gcdn true (absz (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) i))))))))) (@in_mem (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) p (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality (S O) (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@polyOver int_Ring (dvdz a))))) *) rewrite mul1n; apply/dvdn_biggcdP/(all_nthP 0)=> a_dv_p i ltip /=. (* Goal: is_true (dvdn (absz a) (absz (@nth int (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) i)))) *) (* Goal: is_true (@in_mem int (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p) i) (@mem int (predPredType int) (dvdz a))) *) exact: (a_dv_p (Ordinal ltip)). (* Goal: is_true (dvdn (absz a) (absz (@nth int (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType))) (@polyseq (Num.NumDomain.ringType int_numDomainType) p) (@nat_of_ord (@size int (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) i)))) *) exact: a_dv_p. Qed. Lemma map_poly_divzK {a} p : p \is a polyOver (dvdz a) -> a *: map_poly (divz^~ a) p = p. Proof. (* Goal: forall _ : is_true (@in_mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) p (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality (S O) (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@polyOver int_Ring (dvdz a))))), @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) (@GRing.scale int_Ring (poly_lmodType int_Ring) a (@map_poly int_Ring int_Ring (fun x : GRing.Ring.sort int_Ring => divz x a) p)) p *) move/polyOverP=> a_dv_p; apply/polyP=> i. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring (@GRing.scale int_Ring (poly_lmodType int_Ring) a (@map_poly int_Ring int_Ring (fun x : GRing.Ring.sort int_Ring => divz x a) p))) i) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p) i) *) by rewrite coefZ coef_map_id0 ?div0z // mulrC divzK. Qed. Lemma polyOver_dvdzP a p : reflect (exists q, p = a *: q) (p \is a polyOver (dvdz a)). Proof. (* Goal: Bool.reflect (@ex (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) (fun q : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) p (@GRing.scale int_Ring (poly_lmodType int_Ring) a q))) (@in_mem (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) p (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality (S O) (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@polyOver int_Ring (dvdz a))))) *) apply: (iffP idP) => [/map_poly_divzK | [q ->]]. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) (@GRing.scale int_Ring (poly_lmodType int_Ring) a q) (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality (S O) (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@polyOver int_Ring (dvdz a))))) *) (* Goal: forall _ : @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) (@GRing.scale int_Ring (poly_lmodType int_Ring) a (@map_poly int_Ring int_Ring (fun x : GRing.Ring.sort int_Ring => divz x a) p)) p, @ex (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) (fun q : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) p (@GRing.scale int_Ring (poly_lmodType int_Ring) a q)) *) by exists (map_poly (divz^~ a) p). (* Goal: is_true (@in_mem (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) (@GRing.scale int_Ring (poly_lmodType int_Ring) a q) (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality (S O) (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@polyOver int_Ring (dvdz a))))) *) by apply/polyOverP=> i; rewrite coefZ dvdz_mulr. Qed. Definition zprimitive p := map_poly (divz^~ (zcontents p)) p. Lemma zpolyEprim p : p = zcontents p *: zprimitive p. Proof. (* Goal: @eq (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) p (@GRing.scale int_Ring (poly_lmodType int_Ring) (zcontents p) (zprimitive p)) *) by rewrite map_poly_divzK // -dvdz_contents. Qed. Lemma zprimitive0 : zprimitive 0 = 0. Proof. (* Goal: @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (GRing.zero (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))) (GRing.zero (poly_zmodType int_Ring)) *) by apply/polyP=> i; rewrite coef0 coef_map_id0 ?div0z // zcontents0 divz0. Qed. Lemma zprimitive_eq0 p : (zprimitive p == 0) = (p == 0). Proof. (* Goal: @eq bool (@eq_op (poly_eqType int_Ring) (zprimitive p) (GRing.zero (poly_zmodType int_Ring))) (@eq_op (poly_eqType (Num.NumDomain.ringType int_numDomainType)) p (GRing.zero (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))) *) apply/idP/idP=> /eqP p0; first by rewrite [p]zpolyEprim p0 scaler0. (* Goal: is_true (@eq_op (poly_eqType int_Ring) (zprimitive p) (GRing.zero (poly_zmodType int_Ring))) *) by rewrite p0 zprimitive0. Qed. Lemma size_zprimitive p : size (zprimitive p) = size p. Proof. (* Goal: @eq nat (@size (GRing.Ring.sort int_Ring) (@polyseq int_Ring (zprimitive p))) (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) *) have [-> | ] := eqVneq p 0; first by rewrite zprimitive0. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (Num.NumDomain.ringType int_numDomainType)) p (GRing.zero (poly_zmodType (Num.NumDomain.ringType int_numDomainType))))), @eq nat (@size (GRing.Ring.sort int_Ring) (@polyseq int_Ring (zprimitive p))) (@size (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@polyseq (Num.NumDomain.ringType int_numDomainType) p)) *) by rewrite {1 3}[p]zpolyEprim scale_poly_eq0 => /norP[/size_scale-> _]. Qed. Lemma sgz_lead_primitive p : sgz (lead_coef (zprimitive p)) = (p != 0). Lemma zcontents_primitive p : zcontents (zprimitive p) = (p != 0). Lemma zprimitive_id p : zprimitive (zprimitive p) = zprimitive p. Proof. (* Goal: @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (zprimitive p)) (zprimitive p) *) have [-> | nz_p] := eqVneq p 0; first by rewrite !zprimitive0. (* Goal: @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (zprimitive p)) (zprimitive p) *) by rewrite {2}[zprimitive p]zpolyEprim zcontents_primitive nz_p scale1r. Qed. Lemma zprimitive_monic p : p \in monic -> zprimitive p = p. Proof. (* Goal: forall _ : is_true (@in_mem (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) p (@mem (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) (predPredType (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType))))) (@has_quality O (@poly_of (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)))) (@monic (Num.NumDomain.ringType int_numDomainType))))), @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive p) p *) by move=> mon_p; rewrite {2}[p]zpolyEprim zcontents_monic ?scale1r. Qed. Lemma zprimitiveZ a p : a != 0 -> zprimitive (a *: p) = zprimitive p. Lemma zprimitive_min p a q : p != 0 -> p = a *: q -> {b | sgz b = sgz (lead_coef q) & q = b *: zprimitive p}. Lemma zprimitive_irr p a q : p != 0 -> zprimitive p = a *: q -> a = sgz (lead_coef q). Proof. (* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType (poly_zmodType (Num.NumDomain.ringType int_numDomainType))) p (GRing.zero (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))))) (_ : @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive p) (@GRing.scale int_Ring (poly_lmodType int_Ring) a q)), @eq (GRing.Ring.sort int_Ring) a (@sgz int_numDomainType (@lead_coef int_Ring q)) *) move=> nz_p Dp; have: p = (a * zcontents p) *: q. (* Goal: forall _ : @eq (Equality.sort (GRing.Zmodule.eqType (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))) p (@GRing.scale int_Ring (poly_lmodType int_Ring) (@GRing.mul int_Ring a (zcontents p)) q), @eq (GRing.Ring.sort int_Ring) a (@sgz int_numDomainType (@lead_coef int_Ring q)) *) (* Goal: @eq (Equality.sort (GRing.Zmodule.eqType (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))) p (@GRing.scale int_Ring (poly_lmodType int_Ring) (@GRing.mul int_Ring a (zcontents p)) q) *) by rewrite mulrC -scalerA -Dp -zpolyEprim. (* Goal: forall _ : @eq (Equality.sort (GRing.Zmodule.eqType (poly_zmodType (Num.NumDomain.ringType int_numDomainType)))) p (@GRing.scale int_Ring (poly_lmodType int_Ring) (@GRing.mul int_Ring a (zcontents p)) q), @eq (GRing.Ring.sort int_Ring) a (@sgz int_numDomainType (@lead_coef int_Ring q)) *) case/zprimitive_min=> // b <- /eqP. (* Goal: forall _ : is_true (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType))) (poly_lmodType (Num.NumDomain.ringType int_numDomainType))) (@GRing.Lmodule.base (Num.NumDomain.ringType int_numDomainType) (@GRing.Lmodule.sort (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType))) (poly_lmodType (Num.NumDomain.ringType int_numDomainType))) (@GRing.Lmodule.class (Num.NumDomain.ringType int_numDomainType) (Phant (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType))) (poly_lmodType (Num.NumDomain.ringType int_numDomainType)))))) q (@GRing.scale (Num.NumDomain.ringType int_numDomainType) (poly_lmodType (Num.NumDomain.ringType int_numDomainType)) b (zprimitive p))), @eq (GRing.Ring.sort int_Ring) a (@sgz int_numDomainType b) *) rewrite Dp -{1}[q]scale1r scalerA -subr_eq0 -scalerBl scale_poly_eq0 subr_eq0. (* Goal: forall _ : is_true (orb (@eq_op (GRing.Zmodule.eqType (GRing.IntegralDomain.zmodType (Num.NumDomain.idomainType int_numDomainType))) (GRing.one int_Ring) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) b a)) (@eq_op (poly_eqType (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType))) q (GRing.zero (poly_zmodType (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)))))), @eq (GRing.Ring.sort int_Ring) a (@sgz int_numDomainType b) *) have{Dp} /negPf->: q != 0. (* Goal: forall _ : is_true (orb (@eq_op (GRing.Zmodule.eqType (GRing.IntegralDomain.zmodType (Num.NumDomain.idomainType int_numDomainType))) (GRing.one int_Ring) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) b a)) false), @eq (GRing.Ring.sort int_Ring) a (@sgz int_numDomainType b) *) (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))) q (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.base int_Ring (@GRing.Lmodule.sort int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring)) (@GRing.Lmodule.class int_Ring (Phant (GRing.Ring.sort int_Ring)) (poly_lmodType int_Ring))))))) *) by apply: contraNneq nz_p; rewrite -zprimitive_eq0 Dp => ->; rewrite scaler0. (* Goal: forall _ : is_true (orb (@eq_op (GRing.Zmodule.eqType (GRing.IntegralDomain.zmodType (Num.NumDomain.idomainType int_numDomainType))) (GRing.one int_Ring) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) b a)) false), @eq (GRing.Ring.sort int_Ring) a (@sgz int_numDomainType b) *) by case: b a => [[|[|b]] | [|b]] [[|[|a]] | [|a]] //; rewrite mulr0. Qed. Lemma zcontentsM p q : zcontents (p * q) = zcontents p * zcontents q. Lemma zprimitiveM p q : zprimitive (p * q) = zprimitive p * zprimitive q. Proof. (* Goal: @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q)) (@GRing.mul (poly_ringType int_Ring) (zprimitive p) (zprimitive q)) *) have [pq_0|] := eqVneq (p * q) 0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (poly_ringType (Num.NumDomain.ringType int_numDomainType))) (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q) (GRing.zero (GRing.Ring.zmodType (poly_ringType (Num.NumDomain.ringType int_numDomainType)))))), @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q)) (@GRing.mul (poly_ringType int_Ring) (zprimitive p) (zprimitive q)) *) (* Goal: @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q)) (@GRing.mul (poly_ringType int_Ring) (zprimitive p) (zprimitive q)) *) rewrite pq_0; move/eqP: pq_0; rewrite mulf_eq0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (poly_ringType (Num.NumDomain.ringType int_numDomainType))) (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q) (GRing.zero (GRing.Ring.zmodType (poly_ringType (Num.NumDomain.ringType int_numDomainType)))))), @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q)) (@GRing.mul (poly_ringType int_Ring) (zprimitive p) (zprimitive q)) *) (* Goal: forall _ : is_true (orb (@eq_op (GRing.IntegralDomain.eqType (poly_idomainType (Num.NumDomain.idomainType int_numDomainType))) p (GRing.zero (GRing.IntegralDomain.zmodType (poly_idomainType (Num.NumDomain.idomainType int_numDomainType))))) (@eq_op (GRing.IntegralDomain.eqType (poly_idomainType (Num.NumDomain.idomainType int_numDomainType))) q (GRing.zero (GRing.IntegralDomain.zmodType (poly_idomainType (Num.NumDomain.idomainType int_numDomainType)))))), @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (GRing.zero (GRing.Ring.zmodType (poly_ringType (Num.NumDomain.ringType int_numDomainType))))) (@GRing.mul (poly_ringType int_Ring) (zprimitive p) (zprimitive q)) *) by case/pred2P=> ->; rewrite !zprimitive0 (mul0r, mulr0). (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (poly_ringType (Num.NumDomain.ringType int_numDomainType))) (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q) (GRing.zero (GRing.Ring.zmodType (poly_ringType (Num.NumDomain.ringType int_numDomainType)))))), @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (zprimitive (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q)) (@GRing.mul (poly_ringType int_Ring) (zprimitive p) (zprimitive q)) *) rewrite -zcontents_eq0 -polyC_eq0 => /mulfI; apply; rewrite !mul_polyC. (* Goal: @eq (GRing.Ring.sort (GRing.IntegralDomain.ringType (poly_idomainType int_iDomain))) (@GRing.scale (GRing.IntegralDomain.ringType int_iDomain) (poly_lmodType (GRing.IntegralDomain.ringType int_iDomain)) (zcontents (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q)) (zprimitive (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q))) (@GRing.scale (GRing.IntegralDomain.ringType int_iDomain) (poly_lmodType (GRing.IntegralDomain.ringType int_iDomain)) (zcontents (@GRing.mul (poly_ringType (Num.NumDomain.ringType int_numDomainType)) p q)) (@GRing.mul (poly_ringType int_Ring) (zprimitive p) (zprimitive q))) *) by rewrite -zpolyEprim zcontentsM -scalerA scalerAr scalerAl -!zpolyEprim. Qed. Lemma dvdpP_int p q : p %| q -> {r | q = zprimitive p * r}. Proof. (* Goal: forall _ : is_true (Pdiv.Field.dvdp (Num.NumDomain.idomainType int_numDomainType) p q), @sig (GRing.Ring.sort (poly_ringType int_Ring)) (fun r : GRing.Ring.sort (poly_ringType int_Ring) => @eq (@poly_of (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) (Phant (GRing.IntegralDomain.sort (Num.NumDomain.idomainType int_numDomainType)))) q (@GRing.mul (poly_ringType int_Ring) (zprimitive p) r)) *) case/Pdiv.Idomain.dvdpP/sig2_eqW=> [[c r] /= nz_c Dpr]. (* Goal: @sig (@poly_of int_Ring (Phant int)) (fun r : @poly_of int_Ring (Phant int) => @eq (@poly_of (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) (Phant int)) q (@GRing.mul (poly_ringType int_Ring) (zprimitive p) r)) *) exists (zcontents q *: zprimitive r); rewrite -scalerAr. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType (Num.NumDomain.idomainType int_numDomainType)) (Phant int)) q (@GRing.scale (GRing.ComRing.ringType int_comRing) (@GRing.Lalgebra.lmod_ringType (GRing.ComRing.ringType int_comRing) (Phant (GRing.Ring.sort (GRing.ComRing.ringType int_comRing))) (@GRing.Algebra.lalgType (GRing.ComRing.ringType int_comRing) (Phant (GRing.Ring.sort (GRing.ComRing.ringType int_comRing))) (poly_algType int_comRing))) (zcontents q) (@GRing.mul (@GRing.Algebra.ringType (GRing.ComRing.ringType int_comRing) (Phant (GRing.ComRing.sort int_comRing)) (poly_algType int_comRing)) (zprimitive p) (zprimitive r))) *) by rewrite -zprimitiveM mulrC -Dpr zprimitiveZ // -zpolyEprim. Qed. Local Notation pZtoQ := (map_poly (intr : int -> rat)). Lemma size_rat_int_poly p : size (pZtoQ p) = size p. Proof. (* Goal: @eq nat (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) : forall _ : int, rat) p))) (@size (GRing.Ring.sort int_Ring) (@polyseq int_Ring p)) *) by apply: size_map_inj_poly; first apply: intr_inj. Qed. Lemma rat_poly_scale (p : {poly rat}) : {q : {poly int} & {a | a != 0 & p = a%:~R^-1 *: pZtoQ q}}. Lemma dvdp_rat_int p q : (pZtoQ p %| pZtoQ q) = (p %| q). Lemma dvdpP_rat_int p q : p %| pZtoQ q -> {p1 : {poly int} & {a | a != 0 & p = a *: pZtoQ p1} & {r | q = p1 * r}}. Proof. (* Goal: forall _ : is_true (Pdiv.Field.dvdp rat_iDomain p (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) : forall _ : int, rat) q)), @sigT2 (@poly_of int_Ring (Phant int)) (fun p1 : @poly_of int_Ring (Phant int) => @sig2 (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) a (GRing.zero (GRing.Ring.zmodType rat_Ring))))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) p (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) : forall _ : int, rat) p1)))) (fun p1 : @poly_of int_Ring (Phant int) => @sig (GRing.Ring.sort (poly_ringType int_Ring)) (fun r : GRing.Ring.sort (poly_ringType int_Ring) => @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) q (@GRing.mul (poly_ringType int_Ring) p1 r))) *) have{p} [p [a nz_a ->]] := rat_poly_scale p. (* Goal: forall _ : is_true (Pdiv.Field.dvdp rat_iDomain (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) q)), @sigT2 (@poly_of int_Ring (Phant int)) (fun p1 : @poly_of int_Ring (Phant int) => @sig2 (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) a (GRing.zero (GRing.Ring.zmodType rat_Ring))))) (fun a0 : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a0 (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1)))) (fun p1 : @poly_of int_Ring (Phant int) => @sig (GRing.Ring.sort (poly_ringType int_Ring)) (fun r : GRing.Ring.sort (poly_ringType int_Ring) => @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) q (@GRing.mul (poly_ringType int_Ring) p1 r))) *) rewrite dvdp_scalel ?invr_eq0 ?intr_eq0 // dvdp_rat_int => dv_p_q. (* Goal: @sigT2 (@poly_of int_Ring (Phant int)) (fun p1 : @poly_of int_Ring (Phant int) => @sig2 (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) a (GRing.zero (GRing.Ring.zmodType rat_Ring))))) (fun a0 : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a0 (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1)))) (fun p1 : @poly_of int_Ring (Phant int) => @sig (GRing.Ring.sort (poly_ringType int_Ring)) (fun r : GRing.Ring.sort (poly_ringType int_Ring) => @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) q (@GRing.mul (poly_ringType int_Ring) p1 r))) *) exists (zprimitive p); last exact: dvdpP_int. (* Goal: @sig2 (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) a (GRing.zero (GRing.Ring.zmodType rat_Ring))))) (fun a0 : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a0 (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (zprimitive p)))) *) have [-> | nz_p] := eqVneq p 0. (* Goal: @sig2 (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) a (GRing.zero (GRing.Ring.zmodType rat_Ring))))) (fun a0 : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a0 (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (zprimitive p)))) *) (* Goal: @sig2 (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) a (GRing.zero (GRing.Ring.zmodType rat_Ring))))) (fun a0 : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (GRing.zero (poly_zmodType int_Ring)))) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a0 (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (zprimitive (GRing.zero (poly_zmodType int_Ring)))))) *) by exists 1; rewrite ?oner_eq0 // zprimitive0 map_poly0 !scaler0. (* Goal: @sig2 (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (fun a : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) a (GRing.zero (GRing.Ring.zmodType rat_Ring))))) (fun a0 : Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) => @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a0 (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (zprimitive p)))) *) exists ((zcontents p)%:~R / a%:~R). (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (zcontents p)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a))) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (zprimitive p))) *) (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (zcontents p)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a))) (GRing.zero (GRing.Ring.zmodType rat_Ring)))) *) by rewrite mulf_neq0 ?invr_eq0 ?intr_eq0 ?zcontents_eq0. (* Goal: @eq (@poly_of (GRing.IntegralDomain.ringType rat_iDomain) (Phant (GRing.IntegralDomain.sort rat_iDomain))) (@GRing.scale (GRing.UnitRing.ringType rat_unitRing) (poly_lmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a)) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p)) (@GRing.scale rat_Ring (poly_lmodType rat_Ring) (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (zcontents p)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a))) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (zprimitive p))) *) by rewrite mulrC -scalerA -map_polyZ -zpolyEprim. Qed. End ZpolyScale. Lemma int_Smith_normal_form m n (M : 'M[int]_(m, n)) : {L : 'M[int]_m & L \in unitmx & {R : 'M[int]_n & R \in unitmx & {d : seq int | sorted dvdz d & M = L *m (\matrix_(i, j) (d`_i *+ (i == j :> nat))) *m R}}}. Definition inIntSpan (V : zmodType) m (s : m.-tuple V) v := exists a : int ^ m, v = \sum_(i < m) s`_i *~ a i. Lemma dec_Qint_span (vT : vectType rat) m (s : m.-tuple vT) v :
Require Import Ensf_types. Inductive dans : Elt -> Ensf -> Prop := | dans_add1 : forall (x : Elt) (e : Ensf), dans x (add x e) | dans_add2 : forall (x y : Elt) (e : Ensf), dans x e -> dans x (add y e). Hint Resolve dans_add1 dans_add2. Lemma dans_add : forall (x y : Elt) (e : Ensf), dans x (add y e) -> y = x \/ dans x e. Proof. (* Goal: forall (x y : Elt) (e : Ensf) (_ : dans x (add y e)), or (@eq Elt y x) (dans x e) *) intros x y e H. (* Goal: or (@eq Elt y x) (dans x e) *) simple inversion H. (* Goal: forall _ : dans x0 e0, or (@eq Elt y x) (dans x e) *) (* Goal: or (@eq Elt y x) (dans x e) *) left. (* Goal: forall _ : dans x0 e0, or (@eq Elt y x) (dans x e) *) (* Goal: @eq Elt y x *) injection H1. (* Goal: forall _ : dans x0 e0, or (@eq Elt y x) (dans x e) *) (* Goal: forall (_ : @eq Ensf e0 e) (_ : @eq Elt x0 y), @eq Elt y x *) intros. (* Goal: forall _ : dans x0 e0, or (@eq Elt y x) (dans x e) *) (* Goal: @eq Elt y x *) apply trans_equal with x0; [ auto | assumption ]. (* Goal: forall _ : dans x0 e0, or (@eq Elt y x) (dans x e) *) intro. (* Goal: or (@eq Elt y x) (dans x e) *) right. (* Goal: dans x e *) injection H2. (* Goal: forall (_ : @eq Ensf e0 e) (_ : @eq Elt y0 y), dans x e *) intros. (* Goal: dans x e *) rewrite <- H3. (* Goal: dans x e0 *) rewrite <- H1. (* Goal: dans x0 e0 *) assumption. Qed. Lemma dans_add_contr : forall (x y : Elt) (e : Ensf), y <> x -> ~ dans x e -> ~ dans x (add y e). Lemma empty_empty : forall E : Elt, ~ dans E empty. Proof. (* Goal: forall E : Elt, not (dans E empty) *) unfold not in |- *; intros E H. (* Goal: False *) simple inversion H; [ discriminate H1 | discriminate H2 ]. Qed. Hint Resolve empty_empty. Lemma dans_empty_imp_P : forall (x : Elt) (P : Prop), dans x empty -> P. Proof. (* Goal: forall (x : Elt) (P : Prop) (_ : dans x empty), P *) intros. (* Goal: P *) elimtype False. (* Goal: False *) cut (~ dans x empty); auto. Qed. Lemma singl2 : forall x : Elt, dans x (singleton x). Proof. (* Goal: forall x : Elt, dans x (singleton x) *) unfold singleton in |- *. (* Goal: forall x : Elt, dans x (add x empty) *) auto. Qed. Hint Resolve singl2. Unset Structural Injection. Lemma singl2_inv : forall x e : Elt, dans x (singleton e) -> x = e :>Elt. Proof. (* Goal: forall (x e : Elt) (_ : dans x (singleton e)), @eq Elt x e *) unfold singleton in |- *. (* Goal: forall (x e : Elt) (_ : dans x (add e empty)), @eq Elt x e *) intros x e H. (* Goal: @eq Elt x e *) simple inversion H. (* Goal: forall _ : dans x0 e0, @eq Elt x e *) (* Goal: @eq Elt x e *) injection H1; intros. (* Goal: forall _ : dans x0 e0, @eq Elt x e *) (* Goal: @eq Elt x e *) rewrite <- H0; assumption. (* Goal: forall _ : dans x0 e0, @eq Elt x e *) injection H2; intros. (* Goal: @eq Elt x e *) apply dans_empty_imp_P with x0. (* Goal: dans x0 empty *) rewrite <- H0; assumption. Qed. Hint Resolve singl2_inv.
From mathcomp Require Import ssreflect ssrbool ssrnat eqtype ssrfun seq. From mathcomp Require Import choice path finset finfun fintype bigop. From mathcomp Require Import bigenough. Set Implicit Arguments. Unset Strict Implicit. Import Prenex Implicits. Reserved Notation "{fset K }" (at level 0, format "{fset K }"). Reserved Notation "A `&` B" (at level 48, left associativity). Reserved Notation "A `*` B" (at level 46, left associativity). Reserved Notation "A `+` B" (at level 54, left associativity). Reserved Notation "A +` B" (at level 54, left associativity). Reserved Notation "A `|` B" (at level 52, left associativity). Reserved Notation "a |` A" (at level 52, left associativity). Reserved Notation "A `\` B" (at level 50, left associativity). Reserved Notation "A `\ b" (at level 50, left associativity). Reserved Notation "{fmap T }" (at level 0, format "{fmap T }"). Reserved Notation "x .[ k <- v ]" (at level 2, k at level 200, v at level 200, format "x .[ k <- v ]"). Reserved Notation "x .[~ k ]" (at level 2, k at level 200, format "x .[~ k ]"). Reserved Notation "x .[& k ]" (at level 2, k at level 200, format "x .[& k ]"). Reserved Notation "x .[\ k ]" (at level 2, k at level 200, format "x .[\ k ]"). Reserved Notation "x .[? k ]" (at level 2, k at level 200, format "x .[? k ]"). Reserved Infix "`~`" (at level 52). Reserved Notation "[ 'fset' k ]" (at level 0, k at level 99, format "[ 'fset' k ]"). Local Notation predOfType T := (sort_of_simpl_pred (@pred_of_argType T)). Section extra. Lemma mem_remF (T : eqType) (s : seq T) x : uniq s -> x \in rem x s = false. Proof. (* Goal: forall _ : is_true (@uniq T s), @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@rem T x s))) false *) by move=> us; rewrite mem_rem_uniq // inE eqxx. Qed. Definition ffun0 (T : finType) (X : Type) : #|T| = 0 -> {ffun T -> X}. Proof. (* Goal: forall _ : @eq nat (@card T (@mem (Equality.sort (Finite.eqType T)) (predPredType (Equality.sort (Finite.eqType T))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T)))))) O, @finfun_of T X (Phant (forall _ : Finite.sort T, X)) *) by move=> T0; split; rewrite T0; exists nil. Qed. Definition oextract (T : Type) (o : option T) : o -> T := if o is Some t return o -> T then fun=> t else False_rect T \o notF. Lemma oextractE (T : Type) (x : T) (xP : Some x) : oextract xP = x. Proof. (* Goal: @eq T (@oextract T (@Some T x) xP) x *) by []. Qed. Lemma Some_oextract T (x : option T) (x_ex : x) : Some (oextract x_ex) = x. Proof. (* Goal: @eq (option T) (@Some T (@oextract T x x_ex)) x *) by case: x x_ex. Qed. Definition ojoin T (x : option (option T)) := if x is Some y then y else None. Lemma Some_ojoin T (x : option (option T)) : x -> Some (ojoin x) = x. Proof. (* Goal: forall _ : is_true (@isSome (option T) x), @eq (option (option T)) (@Some (option T) (@ojoin T x)) x *) by case : x. Qed. Lemma ojoinT T (x : option (option T)) : ojoin x -> x. Proof. (* Goal: forall _ : is_true (@isSome T (@ojoin T x)), is_true (@isSome (option T) x) *) by case: x. Qed. Section AllSigs. Variables (S : Type) (T : S -> Type) (R : Type) (f : forall x, T x -> R). Implicit Types (s : seq S) (t : forall x, seq (T x)). Definition allsigs s t := foldr (fun x => cat (map (@f x) (t x))) [::] s. Lemma size_allsigs s t : size (allsigs s t) = sumn [seq size (t x) | x <- s]. Proof. (* Goal: @eq nat (@size R (allsigs s t)) (sumn (@map S nat (fun x : S => @size (T x) (t x)) s)) *) by elim: s => //= x s IHs; rewrite size_cat size_map IHs. Qed. Lemma allsigs_cat s1 s2 t : allsigs (s1 ++ s2) t = allsigs s1 t ++ allsigs s2 t. Proof. (* Goal: @eq (list R) (allsigs (@cat S s1 s2) t) (@cat R (allsigs s1 t) (allsigs s2 t)) *) by elim: s1 => //= x s1 ->; rewrite catA. Qed. End AllSigs. Lemma allsigs_comp S (T : S -> Type) R R' (f : forall x, T x -> R) (g : R -> R') s t : allsigs (fun x y => g (f x y)) s t = map g (allsigs f s t). Proof. (* Goal: @eq (list R') (@allsigs S T R' (fun (x : S) (y : T x) => g (f x y)) s t) (@map R R' g (@allsigs S T R f s t)) *) by elim: s => //= x s ->; rewrite map_cat map_comp. Qed. Prenex Implicits allsigs. Notation "[ 'seq' E | i <- s & j <- t ]" := (allsigs (fun i j => E) s (fun i => t)) (at level 0, E at level 99, i ident, j ident, format "[ '[hv' 'seq' E '/ ' | i <- s & '/ ' j <- t ] ']'") : seq_scope. Notation "[ 'seq' E | i : T <- s & j : U <- t ]" := (allsigs (fun (i : T) (j : U) => E) s (fun i : T => t)) (at level 0, E at level 99, i ident, j ident, only parsing) : seq_scope. Section EqAllSigs. Variables (S : eqType) (T : S -> eqType). Implicit Types (R : eqType) (s : seq S) (t : forall x, seq (T x)). Lemma allsigsP R (f : forall x, T x -> R) s t z : reflect (exists p : sigT T, [/\ tag p \in s, tagged p \in t (tag p) & z = f (tag p) (tagged p)]) (z \in allsigs f s t). Proof. (* Goal: Bool.reflect (@ex (@sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x))) (fun p : @sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) => and3 (is_true (@in_mem (Equality.sort S) (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort S) (seq_predType S) s))) (is_true (@in_mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => (fun x0 : Equality.sort S => Equality.sort (T x0)) x) p))) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (seq_predType (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (t (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (@eq (Equality.sort R) z (f (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allsigs (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) (Equality.sort R) f s t))) *) elim: s => [|x s IHs /=]; first by right=> [[p []]]. (* Goal: Bool.reflect (@ex (@sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x))) (fun p : @sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) => and3 (is_true (@in_mem (Equality.sort S) (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (seq_predType (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (t (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (@eq (Equality.sort R) z (f (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@cat (Equality.sort R) (@map (Equality.sort (T x)) (Equality.sort R) (f x) (t x)) (@allsigs (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) (Equality.sort R) f s t)))) *) rewrite mem_cat; have [fxt_z | not_fxt_z] := altP mapP. (* Goal: Bool.reflect (@ex (@sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x))) (fun p : @sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) => and3 (is_true (@in_mem (Equality.sort S) (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (seq_predType (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (t (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (@eq (Equality.sort R) z (f (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (orb false (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allsigs (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) (Equality.sort R) f s t)))) *) (* Goal: Bool.reflect (@ex (@sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x))) (fun p : @sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) => and3 (is_true (@in_mem (Equality.sort S) (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (seq_predType (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (t (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (@eq (Equality.sort R) z (f (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (orb true (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allsigs (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) (Equality.sort R) f s t)))) *) by left; have [y t_y ->] := fxt_z; exists (Tagged T y); rewrite mem_head. (* Goal: Bool.reflect (@ex (@sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x))) (fun p : @sigT (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) => and3 (is_true (@in_mem (Equality.sort S) (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@mem (Equality.sort (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (seq_predType (T (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))) (t (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (@eq (Equality.sort R) z (f (@tag (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p) (@tagged (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) p))))) (orb false (@in_mem (Equality.sort R) z (@mem (Equality.sort R) (seq_predType R) (@allsigs (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) (Equality.sort R) f s t)))) *) apply: (iffP IHs) => [] [[x' y] /= [s_x' t_y def_z]]; exists (Tagged T y) => /=. (* Goal: and3 (is_true (@in_mem (Equality.sort S) x' (@mem (Equality.sort S) (seq_predType S) s))) (is_true (@in_mem (Equality.sort (T x')) y (@mem (Equality.sort (T x')) (seq_predType (T x')) (t x')))) (@eq (Equality.sort R) z (f x' y)) *) (* Goal: and3 (is_true (@in_mem (Equality.sort S) x' (@mem (Equality.sort S) (seq_predType S) (@cons (Equality.sort S) x s)))) (is_true (@in_mem (Equality.sort (T x')) y (@mem (Equality.sort (T x')) (seq_predType (T x')) (t x')))) (@eq (Equality.sort R) z (f x' y)) *) by rewrite !inE predU1r. (* Goal: and3 (is_true (@in_mem (Equality.sort S) x' (@mem (Equality.sort S) (seq_predType S) s))) (is_true (@in_mem (Equality.sort (T x')) y (@mem (Equality.sort (T x')) (seq_predType (T x')) (t x')))) (@eq (Equality.sort R) z (f x' y)) *) have [def_x' | //] := predU1P s_x'. (* Goal: and3 (is_true (@in_mem (Equality.sort S) x' (@mem (Equality.sort S) (seq_predType S) s))) (is_true (@in_mem (Equality.sort (T x')) y (@mem (Equality.sort (T x')) (seq_predType (T x')) (t x')))) (@eq (Equality.sort R) z (f x' y)) *) by do [case: _ / def_x'; rewrite def_z map_f] in s_x' not_fxt_z *. Qed. Qed. Lemma mem_allsigs R (f : forall x, T x -> R) s1 t1 s2 t2 : s1 =i s2 -> (forall x, x \in s1 -> t1 x =i t2 x) -> allsigs f s1 t1 =i allsigs f s2 t2. Proof. (* Goal: forall (_ : @eq_mem (Equality.sort S) (@mem (Equality.sort S) (seq_predType S) s1) (@mem (Equality.sort S) (seq_predType S) s2)) (_ : forall (x : Equality.sort S) (_ : is_true (@in_mem (Equality.sort S) x (@mem (Equality.sort S) (seq_predType S) s1))), @eq_mem (Equality.sort (T x)) (@mem (Equality.sort (T x)) (seq_predType (T x)) (t1 x)) (@mem (Equality.sort (T x)) (seq_predType (T x)) (t2 x))), @eq_mem (Equality.sort R) (@mem (Equality.sort R) (seq_predType R) (@allsigs (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) (Equality.sort R) f s1 t1)) (@mem (Equality.sort R) (seq_predType R) (@allsigs (Equality.sort S) (fun x : Equality.sort S => Equality.sort (T x)) (Equality.sort R) f s2 t2)) *) move=> eq_s eq_t z; apply/allsigsP/allsigsP=> [] [p fpz]; exists p => []; by move: fpz (fpz) => [???]; rewrite eq_s eq_t //= 1?eq_s. Qed. Lemma allsigs_catr R (f : forall x, T x -> R) s t1 t2 : allsigs f s (fun x => t1 x ++ t2 x) =i allsigs f s t1 ++ allsigs f s t2. Lemma allsigs_uniq R (f : forall x, T x -> R) s t : uniq s -> (forall x, x \in s -> uniq (t x)) -> {in [seq Tagged T y | x <- s & y <- t x] &, injective (fun p : sigT T => f (tag p) (tagged p))} -> uniq (allsigs f s t). End EqAllSigs. Lemma big_allsigs (R : Type) (idx : R) (op : Monoid.law idx) Proof. (* Goal: @eq R (@BigOp.bigop R (@sigT I1 (fun x : I1 => I2 x)) idx (@allsigs I1 (fun i1 : I1 => I2 i1) (@sigT I1 (fun x : I1 => I2 x)) (fun (i1 : I1) (i2 : (fun i2 : I1 => I2 i2) i1) => @Tagged I1 i1 I2 i2) r1 (fun i1 : I1 => r2 i1)) (fun i : @sigT I1 (fun x : I1 => I2 x) => @BigBody R (@sigT I1 (fun x : I1 => I2 x)) i (@Monoid.operator R idx op) true (F i))) (@BigOp.bigop R I1 idx r1 (fun i1 : I1 => @BigBody R I1 i1 (@Monoid.operator R idx op) true (@BigOp.bigop R (I2 i1) idx (r2 i1) (fun i2 : I2 i1 => @BigBody R (I2 i1) i2 (@Monoid.operator R idx op) true (F (@Tagged I1 i1 I2 i2)))))) *) elim: r1 => [|i1 r1 IHr1]; rewrite !(big_nil, big_cons)//= big_cat {}IHr1. (* Goal: @eq R (@Monoid.operator R idx op (@BigOp.bigop R (@sigT I1 (fun x : I1 => I2 x)) idx (@map (I2 i1) (@sigT I1 (fun x : I1 => I2 x)) (fun i2 : I2 i1 => @Tagged I1 i1 I2 i2) (r2 i1)) (fun i : @sigT I1 (fun x : I1 => I2 x) => @BigBody R (@sigT I1 (fun x : I1 => I2 x)) i (@Monoid.operator R idx op) true (F i))) (@BigOp.bigop R I1 idx r1 (fun i1 : I1 => @BigBody R I1 i1 (@Monoid.operator R idx op) true (@BigOp.bigop R (I2 i1) idx (r2 i1) (fun i2 : I2 i1 => @BigBody R (I2 i1) i2 (@Monoid.operator R idx op) true (F (@Tagged I1 i1 I2 i2))))))) (@Monoid.operator R idx op (@BigOp.bigop R (I2 i1) idx (r2 i1) (fun i2 : I2 i1 => @BigBody R (I2 i1) i2 (@Monoid.operator R idx op) true (F (@Tagged I1 i1 I2 i2)))) (@BigOp.bigop R I1 idx r1 (fun j : I1 => @BigBody R I1 j (@Monoid.operator R idx op) true (@BigOp.bigop R (I2 j) idx (r2 j) (fun i2 : I2 j => @BigBody R (I2 j) i2 (@Monoid.operator R idx op) true (F (@Tagged I1 j I2 i2))))))) *) by case: (r2 i1) => [|i2 r21]; rewrite /= !(big_nil, big_cons)//= big_map. Qed. Section NatHomomorphism. Variable T : Type. Lemma homo_ltn_in (D : pred nat) (f : nat -> T) (r : T -> T -> Prop) : (forall y x z, r x y -> r y z -> r x z) -> {in D &, forall i j k, i < k < j -> k \in D} -> {in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} -> Lemma homo_ltn (f : nat -> T) (r : T -> T -> Prop) : (forall y x z, r x y -> r y z -> r x z) -> (forall i, r (f i) (f i.+1)) -> {homo f : i j / i < j >-> r i j}. Proof. (* Goal: forall (_ : forall (y x z : T) (_ : r x y) (_ : r y z), r x z) (_ : forall i : nat, r (f i) (f (S i))), @homomorphism_2 nat T f (fun i j : nat => is_true (leq (S i) j)) (fun i j : T => r i j) *) by move=> /(@homo_ltn_in predT f) fr fS i j; apply: fr. Qed. Lemma homo_leq_in (D : pred nat) (f : nat -> T) (r : T -> T -> Prop) : (forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) -> {in D &, forall i j k, i < k < j -> k \in D} -> {in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} -> Proof. (* Goal: forall (_ : forall x : T, r x x) (_ : forall (y x z : T) (_ : r x y) (_ : r y z), r x z) (_ : @prop_in2 nat (@mem nat (predPredType nat) D) (fun i j : nat => forall (k : nat) (_ : is_true (andb (leq (S i) k) (leq (S k) j))), is_true (@in_mem nat k (@mem nat (predPredType nat) D))) (inPhantom (forall (i j k : nat) (_ : is_true (andb (leq (S i) k) (leq (S k) j))), is_true (@in_mem nat k (@mem nat (predPredType nat) D))))) (_ : @prop_in1 nat (@mem nat (predPredType nat) D) (fun i : nat => forall _ : is_true (@in_mem nat (S i) (@mem nat (predPredType nat) D)), r (f i) (f (S i))) (inPhantom (forall (i : nat) (_ : is_true (@in_mem nat (S i) (@mem nat (predPredType nat) D))), r (f i) (f (S i))))), @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => forall _ : (fun i j : nat => is_true (leq i j)) x y, (fun i j : T => r i j) (f x) (f y)) (inPhantom (@homomorphism_2 nat T f (fun i j : nat => is_true (leq i j)) (fun i j : T => r i j))) *) move=> r_refl r_trans Dcx /(homo_ltn_in r_trans Dcx) lt_r i j iD jD. (* Goal: forall _ : is_true (leq i j), r (f i) (f j) *) by rewrite leq_eqVlt => /predU1P[->//|/lt_r]; apply. Qed. Lemma homo_leq (f : nat -> T) (r : T -> T -> Prop) : (forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) -> (forall i, r (f i) (f i.+1)) -> {homo f : i j / i <= j >-> r i j}. Proof. (* Goal: forall (_ : forall x : T, r x x) (_ : forall (y x z : T) (_ : r x y) (_ : r y z), r x z) (_ : forall i : nat, r (f i) (f (S i))), @homomorphism_2 nat T f (fun i j : nat => is_true (leq i j)) (fun i j : T => r i j) *) by move=> rrefl /(@homo_leq_in predT f r) fr fS i j; apply: fr. Qed. End NatHomomorphism. End extra. Module Type SortKeysSig. Section SortKeys. Variable (K : choiceType). Implicit Types (k : K) (ks : seq K). Axiom f : seq K -> seq K. Axiom perm : forall s, perm_eq (f s) (undup s). Axiom uniq : forall s, uniq (f s). Axiom E : forall (s : seq K), f s =i s. Axiom eq : forall (s s' : seq K), s =i s' <-> f s = f s'. End SortKeys. End SortKeysSig. Module SortKeys : SortKeysSig. Section SortKeys. Variable (K : choiceType). Implicit Types (k : K) (ks : seq K). Definition f (s : seq K) := choose (perm_eq (undup s)) (undup s). Fact perm s : perm_eq (f s) (undup s). Proof. (* Goal: is_true (@perm_eq (Choice.eqType K) (f s) (@undup (Choice.eqType K) s)) *) by rewrite perm_eq_sym chooseP. Qed. Fact uniq s : uniq (f s). Proof. (* Goal: is_true (@uniq (Choice.eqType K) (f s)) *) by rewrite (perm_eq_uniq (perm _)) undup_uniq. Qed. Fact E (s : seq K) : f s =i s. Proof. (* Goal: @eq_mem (Equality.sort (Choice.eqType K)) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (f s)) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) s) *) by move=> x; rewrite (perm_eq_mem (perm _)) mem_undup. Qed. Lemma eq (s s' : seq K) : s =i s' <-> f s = f s'. Proof. (* Goal: iff (@eq_mem (Equality.sort (Choice.eqType K)) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) s) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) s')) (@eq (Choice.sort (seq_choiceType K)) (f s) (f s')) *) split=> [eq_ss'|eq_ss' k]; last by rewrite -E eq_ss' E. (* Goal: @eq (Choice.sort (seq_choiceType K)) (f s) (f s') *) rewrite /f; have peq_ss' : perm_eq (undup s) (undup s'). (* Goal: @eq (Choice.sort (seq_choiceType K)) (@choose (seq_choiceType K) (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) s)) (@undup (Choice.eqType K) s)) (@choose (seq_choiceType K) (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) s')) (@undup (Choice.eqType K) s')) *) (* Goal: is_true (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) s) (@undup (Choice.eqType K) s')) *) by apply: uniq_perm_eq; rewrite ?undup_uniq // => x; rewrite !mem_undup. (* Goal: @eq (Choice.sort (seq_choiceType K)) (@choose (seq_choiceType K) (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) s)) (@undup (Choice.eqType K) s)) (@choose (seq_choiceType K) (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) s')) (@undup (Choice.eqType K) s')) *) rewrite (@choose_id _ _ _ (undup s')) //=; apply: eq_choose => x /=. (* Goal: @eq bool (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) s) x) (@perm_eq (Choice.eqType K) (@undup (Choice.eqType K) s') x) *) by apply: sym_left_transitive; [exact: perm_eq_sym|exact: perm_eq_trans|]. Qed. End SortKeys. End SortKeys. Hint Resolve SortKeys.perm. Hint Resolve SortKeys.uniq. Hint Resolve SortKeys.E. Notation sort_keys := SortKeys.f. Notation sort_keys_perm := SortKeys.perm. Notation sort_keys_uniq := SortKeys.uniq. Notation sort_keysE := SortKeys.E. Notation eq_sort_keys := SortKeys.eq. Section ChoiceKeys. Variable (K : choiceType). Implicit Types (k : K) (ks : seq K). Lemma mem_sort_keys ks k : k \in ks -> k \in sort_keys ks. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) k (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) ks)), is_true (@in_mem (Choice.sort K) k (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@SortKeys.f K ks))) *) by rewrite sort_keysE. Qed. Lemma mem_sort_keys_intro ks k : k \in sort_keys ks -> k \in ks. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) k (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@SortKeys.f K ks))), is_true (@in_mem (Choice.sort K) k (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) ks)) *) by rewrite sort_keysE. Qed. Lemma sort_keys_nil : sort_keys [::] = [::] :> seq K. Proof. (* Goal: @eq (list (Choice.sort K)) (@SortKeys.f K (@nil (Choice.sort K))) (@nil (Choice.sort K)) *) have := sort_keysE ([::] : seq K). (* Goal: forall _ : @eq_mem (Equality.sort (Choice.eqType K)) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@SortKeys.f K (@nil (Choice.sort K)))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@nil (Choice.sort K))), @eq (list (Choice.sort K)) (@SortKeys.f K (@nil (Choice.sort K))) (@nil (Choice.sort K)) *) by case: sort_keys => //= a l /(_ a); rewrite mem_head. Qed. Lemma sort_keys_id ks : sort_keys (sort_keys ks) = sort_keys ks. Proof. (* Goal: @eq (list (Choice.sort K)) (@SortKeys.f K (@SortKeys.f K ks)) (@SortKeys.f K ks) *) by have /eq_sort_keys := sort_keysE ks. Qed. Definition canonical_keys ks := sort_keys ks == ks. Lemma canonical_uniq ks : canonical_keys ks -> uniq ks. Proof. (* Goal: forall _ : is_true (canonical_keys ks), is_true (@uniq (Choice.eqType K) ks) *) by move=> /eqP <-; exact: sort_keys_uniq. Qed. Lemma canonical_sort_keys ks : canonical_keys (sort_keys ks). Proof. (* Goal: is_true (canonical_keys (@SortKeys.f K ks)) *) by rewrite /canonical_keys sort_keys_id. Qed. Lemma canonical_eq_keys ks ks' : canonical_keys ks -> canonical_keys ks' -> ks =i ks' -> ks = ks'. Proof. (* Goal: forall (_ : is_true (canonical_keys ks)) (_ : is_true (canonical_keys ks')) (_ : @eq_mem (Equality.sort (Choice.eqType K)) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) ks) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) ks')), @eq (list (Choice.sort K)) ks ks' *) move=> /eqP; case: _ /; move=> /eqP; case: _ / => eq_ks_ks'. (* Goal: @eq (list (Choice.sort K)) (@SortKeys.f K ks) (@SortKeys.f K ks') *) by apply/eq_sort_keys => x; rewrite -sort_keysE eq_ks_ks' sort_keysE. Qed. Lemma size_sort_keys ks : size (sort_keys ks) = size (undup ks). Proof. (* Goal: @eq nat (@size (Choice.sort K) (@SortKeys.f K ks)) (@size (Equality.sort (Choice.eqType K)) (@undup (Choice.eqType K) ks)) *) exact: perm_eq_size. Qed. End ChoiceKeys. Arguments eq_sort_keys {K s s'}. Section Def. Variables (K : choiceType). Structure finSet : Type := mkFinSet { enum_fset :> seq K; _ : canonical_keys enum_fset }. Definition finset_of (_ : phant K) := finSet. End Def. Identity Coercion type_of_finset : finset_of >-> finSet. Notation "{fset T }" := (@finset_of _ (Phant T)) : type_scope. Definition pred_of_finset (K : choiceType) (f : finSet K) : pred K := fun k => k \in (enum_fset f). Canonical finSetPredType (K : choiceType) := Eval hnf in mkPredType (@pred_of_finset K). Section FinSetCanonicals. Variable (K : choiceType). Canonical fsetType := Eval hnf in [subType for (@enum_fset K)]. Definition fset_eqMixin := Eval hnf in [eqMixin of {fset K} by <:]. Canonical fset_eqType := Eval hnf in EqType {fset K} fset_eqMixin. Definition fset_choiceMixin := Eval hnf in [choiceMixin of {fset K} by <:]. Canonical fset_choiceType := Eval hnf in ChoiceType {fset K} fset_choiceMixin. End FinSetCanonicals. Section FinTypeSet. Variables (K : choiceType) (A : finSet K). Lemma keys_canonical : canonical_keys (enum_fset A). Proof. (* Goal: is_true (@canonical_keys K (@enum_fset K A)) *) by case: A. Qed. Lemma fset_uniq : uniq (enum_fset A). Proof. (* Goal: is_true (@uniq (Choice.eqType K) (@enum_fset K A)) *) by rewrite canonical_uniq // keys_canonical. Qed. Record fset_sub_type : predArgType := FSetSub {fsval : K; fsvalP : in_mem fsval (@mem K _ A)}. Canonical fset_sub_subType := Eval hnf in [subType for fsval]. Definition fset_sub_eqMixin := Eval hnf in [eqMixin of fset_sub_type by <:]. Canonical fset_sub_eqType := Eval hnf in EqType fset_sub_type fset_sub_eqMixin. Definition fset_sub_choiceMixin := Eval hnf in [choiceMixin of fset_sub_type by <:]. Canonical fset_sub_choiceType := Eval hnf in ChoiceType fset_sub_type fset_sub_choiceMixin. Definition fset_sub_enum : seq fset_sub_type := undup (pmap insub (enum_fset A)). Lemma mem_fset_sub_enum x : x \in fset_sub_enum. Proof. (* Goal: is_true (@in_mem (Equality.sort fset_sub_eqType) x (@mem (Equality.sort fset_sub_eqType) (seq_predType fset_sub_eqType) fset_sub_enum)) *) by rewrite mem_undup mem_pmap -valK map_f // fsvalP. Qed. Lemma val_fset_sub_enum : map val fset_sub_enum = enum_fset A. Definition fset_sub_pickle x := index x fset_sub_enum. Definition fset_sub_unpickle n := nth None (map some fset_sub_enum) n. Lemma fset_sub_pickleK : pcancel fset_sub_pickle fset_sub_unpickle. Proof. (* Goal: @pcancel nat (Equality.sort fset_sub_eqType) fset_sub_pickle fset_sub_unpickle *) rewrite /fset_sub_unpickle => x. (* Goal: @eq (option (Equality.sort fset_sub_eqType)) (@nth (option fset_sub_type) (@None fset_sub_type) (@map fset_sub_type (option fset_sub_type) (@Some fset_sub_type) fset_sub_enum) (fset_sub_pickle x)) (@Some (Equality.sort fset_sub_eqType) x) *) by rewrite (nth_map x) ?nth_index ?index_mem ?mem_fset_sub_enum. Qed. Definition fset_sub_countMixin := CountMixin fset_sub_pickleK. Canonical fset_sub_countType := Eval hnf in CountType fset_sub_type fset_sub_countMixin. Definition fset_sub_finMixin := Eval hnf in UniqFinMixin (undup_uniq _) mem_fset_sub_enum. Canonical fset_sub_finType := Eval hnf in FinType fset_sub_type fset_sub_finMixin. Canonical fset_sub_subfinType := [subFinType of fset_sub_type]. Lemma enum_fsetE : enum_fset A = [seq val i | i <- enum fset_sub_type]. Proof. (* Goal: @eq (list (Choice.sort K)) (@enum_fset K A) (@map (@sub_sort (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) fset_sub_subfinType)) (Choice.sort K) (fun i : @sub_sort (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) fset_sub_subfinType) => @val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) fset_sub_subfinType) i) (@enum_mem fset_sub_finType (@mem fset_sub_type (predPredType fset_sub_type) (@sort_of_simpl_pred fset_sub_type (pred_of_argType fset_sub_type))))) *) by rewrite enumT unlock val_fset_sub_enum. Qed. Lemma cardfE : size (enum_fset A) = #|fset_sub_type|. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K A)) (@card fset_sub_finType (@mem fset_sub_type (predPredType fset_sub_type) (@sort_of_simpl_pred fset_sub_type (pred_of_argType fset_sub_type)))) *) by rewrite cardE enum_fsetE size_map. Qed. End FinTypeSet. Identity Coercion finSet_sub_type : finset_of >-> finSet. Coercion fset_sub_type : finSet >-> predArgType. Hint Resolve fsvalP fset_uniq mem_fset_sub_enum. Delimit Scope fset_scope with fset. Local Open Scope fset_scope. Notation "[` kf ]" := (FSetSub kf) (format "[` kf ]") : fset_scope. Lemma fsetsubE (T : choiceType) (A : {fset T}) (x : A) (xA : val x \in A) : [` xA] = x. Proof. (* Goal: @eq (@fset_sub_type T A) (@FSetSub T A (@val (Choice.sort T) (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) A)) (@fset_sub_subType T A) x) xA) x *) by apply/val_inj => /=. Qed. Notation "#|` A |" := (size (enum_fset A)) (at level 0, A at level 99, format "#|` A |") : nat_scope. Definition fset_predT {T : choiceType} {A : {fset T}} : simpl_pred A := @predT A. Coercion set_of_fset (K : choiceType) (A : {fset K}) : {set A} := [set x in {: A}]. Arguments pred_of_finset : simpl never. Section SeqFset. Variable finset_key : unit. Definition seq_fset : forall K : choiceType, seq K -> {fset K} := locked_with finset_key (fun K s => mkFinSet (@canonical_sort_keys K s)). Variable (K : choiceType) (s : seq K). Lemma seq_fsetE : seq_fset s =i s. Proof. (* Goal: @eq_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) (@seq_fset K s)) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) s) *) by move=> a; rewrite [seq_fset]unlock sort_keysE. Qed. Lemma size_seq_fset : size (seq_fset s) = size (undup s). Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@seq_fset K s))) (@size (Equality.sort (Choice.eqType K)) (@undup (Choice.eqType K) s)) *) by rewrite [seq_fset]unlock /= size_sort_keys. Qed. Lemma seq_fset_uniq : uniq (seq_fset s). Proof. (* Goal: is_true (@uniq (Choice.eqType K) (@enum_fset K (@seq_fset K s))) *) by rewrite [seq_fset]unlock /= sort_keys_uniq. Qed. Lemma seq_fset_perm : perm_eq (seq_fset s) (undup s). Proof. (* Goal: is_true (@perm_eq (Choice.eqType K) (@enum_fset K (@seq_fset K s)) (@undup (Choice.eqType K) s)) *) by rewrite [seq_fset]unlock //= sort_keys_perm. Qed. End SeqFset. Hint Resolve keys_canonical. Hint Resolve sort_keys_uniq. Canonical finSetSubType K := [subType for (@enum_fset K)]. Definition finSetEqMixin (K : choiceType) := [eqMixin of {fset K} by <:]. Canonical finSetEqType (K : choiceType) := EqType {fset K} (finSetEqMixin K). Definition finSetChoiceMixin (K : choiceType) := [choiceMixin of {fset K} by <:]. Canonical finSetChoiceType (K : choiceType) := ChoiceType {fset K} (finSetChoiceMixin K). Section FinPredStruct. Structure finpredType (T : eqType) := FinPredType { finpred_sort :> Type; tofinpred : finpred_sort -> pred T; _ : {mem : finpred_sort -> mem_pred T | isMem tofinpred mem}; _ : {finpred_seq : finpred_sort -> seq T | ((forall p, uniq (finpred_seq p)) * forall p x, x \in finpred_seq p = tofinpred p x)%type} }. Canonical finpredType_predType (T : eqType) (fpT : finpredType T) := @PredType T (finpred_sort fpT) (@tofinpred T fpT) (let: FinPredType _ _ mem _ := fpT in mem). Definition enum_finpred (T : eqType) (fpT : finpredType T) : fpT -> seq T := let: FinPredType _ _ _ (exist s _) := fpT in s. Lemma enum_finpred_uniq (T : eqType) (fpT : finpredType T) (p : fpT) : uniq (enum_finpred p). Proof. (* Goal: is_true (@uniq T (@enum_finpred T fpT p)) *) by case: fpT p => ??? [s sE] p; rewrite sE. Qed. Lemma enum_finpredE (T : eqType) (fpT : finpredType T) (p : fpT) : enum_finpred p =i p. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (@enum_finpred T fpT p)) (@mem (Equality.sort T) (@finpredType_predType T fpT) p) *) by case: fpT p => ??? [s sE] p x; rewrite sE -topredE. Qed. Lemma mkFinPredType_of_subproof (T : eqType) (pT : predType T) (fpred_seq : pT -> seq T) (pred_fsetE : forall p, fpred_seq p =i p) : forall p x, x \in fpred_seq p = topred p x. Proof. (* Goal: forall (p : @pred_sort (Equality.sort T) pT) (x : Equality.sort T), @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (fpred_seq p))) (@topred (Equality.sort T) pT p x) *) by move=> p x; rewrite topredE pred_fsetE. Qed. Definition mkFinPredType_of (T : eqType) (U : Type) := fun (pT : predType T) & pred_sort pT -> U => fun a mP (pT' := @PredType T U a mP) & phant_id pT' pT => fun (fpred_seq : pT' -> seq T) (fpred_seq_uniq : forall p, uniq (fpred_seq p)) (fpred_seqE : forall p, fpred_seq p =i p) => @FinPredType T U a mP (exist _ fpred_seq (fpred_seq_uniq, (mkFinPredType_of_subproof fpred_seqE))). Definition clone_finpredType (T : eqType) (U : Type) := fun (pT : finpredType T) & finpred_sort pT -> U => fun a mP pP (pT' := @FinPredType T U a mP pP) & phant_id pT' pT => pT'. Structure is_finite (T : eqType) (P : pred T) := IsFinite { seq_of_is_finite :> seq T; _ : uniq seq_of_is_finite; _ : forall x, x \in seq_of_is_finite = P x; }. Lemma is_finite_uniq (T : eqType) (P : pred T) (p : is_finite P) : uniq p. Proof. (* Goal: is_true (@uniq T (@seq_of_is_finite T P p)) *) by case: p. Qed. Lemma is_finiteE (T : eqType) (P : pred T) (p : is_finite P) x : x \in (seq_of_is_finite p) = P x. Proof. (* Goal: @eq bool (@in_mem (Equality.sort T) x (@mem (Equality.sort T) (seq_predType T) (@seq_of_is_finite T P p))) (P x) *) by case: p. Qed. Structure finpred (T : eqType) (pT : predType T) := FinPred { pred_of_finpred :> pT; _ : is_finite [pred x in pred_of_finpred] }. Definition enum_fin (T : eqType) (pT : predType T) (p : finpred pT) : seq T := let: FinPred _ fp := p in fp. Lemma enum_fin_uniq (T : eqType) (pT : predType T) (p : finpred pT) : uniq (enum_fin p). Proof. (* Goal: is_true (@uniq T (@enum_fin T pT p)) *) by case: p => ?[]. Qed. Lemma enum_finE (T : eqType) (pT : predType T) (p : finpred pT) : enum_fin p =i (pred_of_finpred p). Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (@enum_fin T pT p)) (@mem (Equality.sort T) pT (@pred_of_finpred T pT p)) *) by case: p => ?[]. Qed. Canonical fin_finpred (T : eqType) (pT : finpredType T) (p : pT) := @FinPred _ _ p (@IsFinite _ _ (enum_finpred p) (enum_finpred_uniq p) (enum_finpredE p)). Definition finpred_of (T : eqType) (pT : predType T) (p : pT) (fp : finpred pT) & phantom pT fp : finpred pT := fp. Structure finmempred (T : eqType) := FinMemPred { pred_of_finmempred :> mem_pred T; _ : is_finite (fun x => in_mem x pred_of_finmempred) }. Definition enum_finmem (T : eqType) (p : finmempred T) : seq T := let: FinMemPred _ fp := p in fp. Lemma enum_finmem_uniq (T : eqType) (p : finmempred T) : uniq (enum_finmem p). Proof. (* Goal: is_true (@uniq T (@enum_finmem T p)) *) by case: p => ?[]. Qed. Lemma enum_finmemE (T : eqType) (p : finmempred T) : enum_finmem p =i p. Proof. (* Goal: @eq_mem (Equality.sort T) (@mem (Equality.sort T) (seq_predType T) (@enum_finmem T p)) (@mem (Equality.sort T) (predPredType (Equality.sort T)) (@pred_of_mem (Equality.sort T) (@pred_of_finmempred T p))) *) by case: p => ?[]. Qed. Definition finmempred_of (T : eqType) (P : pred T) (mP : finmempred T) & phantom (mem_pred T) mP : finmempred T := mP. Canonical seq_finpredType (T : eqType) := mkFinPredType (seq T) undup (@undup_uniq T) (@mem_undup T). End CanonicalFinPred. Local Notation imfset_def key := (fun (T K : choiceType) (f : T -> K) (p : finmempred T) of phantom (mem_pred T) p => seq_fset key [seq f x | x <- enum_finmem p]). Local Notation imfset2_def key := (fun (K T1 : choiceType) (T2 : T1 -> choiceType) (f : forall x : T1, T2 x -> K) (p1 : finmempred T1) (p2 : forall x : T1, finmempred (T2 x)) of phantom (mem_pred T1) p1 & phantom (forall x, mem_pred (T2 x)) p2 => seq_fset key (allsigs f (enum_finmem p1) (fun x => enum_finmem (p2 x)))). Module Type ImfsetSig. Parameter imfset : forall (key : unit) (T K : choiceType) (f : T -> K) (p : finmempred T), phantom (mem_pred T) p -> {fset K}. Parameter imfset2 : forall (key : unit) (K T1 : choiceType) (T2 : T1 -> choiceType)(f : forall x : T1, T2 x -> K) (p1 : finmempred T1) (p2 : forall x : T1, finmempred (T2 x)), phantom (mem_pred T1) p1 -> phantom (forall x, mem_pred (T2 x)) p2 -> {fset K}. Axiom imfsetE : forall key, imfset key = imfset_def key. Axiom imfset2E : forall key, imfset2 key = imfset2_def key. End ImfsetSig. Module Imfset : ImfsetSig. Definition imfset key := imfset_def key. Definition imfset2 key := imfset2_def key. Lemma imfset2E key : imfset2 key = imfset2_def key. Proof. by []. Qed. Proof. (* Goal: @eq (forall (K T1 : Choice.type) (T2 : forall _ : Choice.sort T1, Choice.type) (_ : forall (x : Choice.sort T1) (_ : Choice.sort (T2 x)), Choice.sort K) (p1 : finmempred (Choice.eqType T1)) (p2 : forall x : Choice.sort T1, finmempred (Choice.eqType (T2 x))) (_ : phantom (mem_pred (Choice.sort T1)) (@pred_of_finmempred (Choice.eqType T1) p1)) (_ : phantom (forall x : Choice.sort T1, mem_pred (Choice.sort (T2 x))) (fun x : Choice.sort T1 => @pred_of_finmempred (Choice.eqType (T2 x)) (p2 x))), @finset_of K (Phant (Choice.sort K))) (@imfset2 key) (fun (K T1 : Choice.type) (T2 : forall _ : Choice.sort T1, Choice.type) (f : forall (x : Choice.sort T1) (_ : Choice.sort (T2 x)), Choice.sort K) (p1 : finmempred (Choice.eqType T1)) (p2 : forall x : Choice.sort T1, finmempred (Choice.eqType (T2 x))) (_ : phantom (mem_pred (Choice.sort T1)) (@pred_of_finmempred (Choice.eqType T1) p1)) (_ : phantom (forall x : Choice.sort T1, mem_pred (Choice.sort (T2 x))) (fun x : Choice.sort T1 => @pred_of_finmempred (Choice.eqType (T2 x)) (p2 x))) => @seq_fset key K (@allsigs (Choice.sort T1) (fun x : Choice.sort T1 => Choice.sort (T2 x)) (Choice.sort K) f (@enum_finmem (Choice.eqType T1) p1) (fun x : Choice.sort T1 => @enum_finmem (Choice.eqType (T2 x)) (p2 x)))) *) by []. Qed. Notation "f @` A" := (f @`[imfset_key] A) (at level 24) : fset_scope. Notation "f @2` ( A , B )" := (f @2`[imfset_key] (A, B)) (at level 24, format "f @2` ( A , B )") : fset_scope. Notation "[ 'fset' E | x : T 'in' A ]" := ((fun x : T => E) @` A) (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A ]" := [fset E | x : _ in A] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A ]" := [fset E | x : _ in {: A} ] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T 'in' A ]" := [fset (x : T) | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T 'in' A | P ]" := [fset (x : T) | x in [pred x in A | P]] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x 'in' A | P ]" := [fset x : _ in A | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x 'in' A ]" := [fset x : _ in A ] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T | P ]" := [fset x in {: T} | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T | P & Q ]" := [fset x : T | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x : T 'in' A | P & Q ]" := [fset x : T in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' x 'in' A | P & Q ]" := [fset x in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : T 'in' A , y : T' 'in' B ]" := ((fun (x : T) (y : T') => E) @2` (A, fun x => B)) (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y 'in' B ]" := [fset E | x : _ in A, y : _ in B] (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : T 'in' A ]" := ((fun x : T => E) @`[key] A) (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A ]" := [fset[key] E | x : _ in A] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A ]" := [fset[key] E | x : _ in {: A} ] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T 'in' A ]" := [fset[key] (x : T) | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T 'in' A | P ]" := [fset[key] (x : T) | x in [pred x in A | P]] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x 'in' A | P ]" := [fset[key] x : _ in A | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x 'in' A ]" := [fset[key] x : _ in A ] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T | P ]" := [fset[key] x in {: T} | P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T | P & Q ]" := [fset[key] x : T | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x : T 'in' A | P & Q ]" := [fset[key] x : T in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] x 'in' A | P & Q ]" := [fset[key] x in A | P && Q] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : T 'in' A , y : T' 'in' B ]" := ((fun (x : T) (y : T') => E) @2` (A, fun x => B)) (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A , y 'in' B ]" := [fset[key] E | x : _ in A, y : _ in B] (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y : B ]" := [fset[key] E | x : _ in {: A}, y : _ in {: B}] (at level 0, E, x at level 99, A at level 200, y at level 99, only parsing) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A ]" := [fset[_] E | x in A] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A ] ']'") : fset_scope. Notation "[ 'f' 'set' E | x : A ]" := [fset[_] E | x : A] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A ] ']'") : fset_scope. Notation "[ 'f' 'set' x 'in' A | P ]" := [fset[_] x in A | P] (at level 0, x at level 99, format "[ 'f' 'set' x 'in' A | P ]") : fset_scope. Notation "[ 'f' 'set' x 'in' A ]" := [fset[_] x in A] (at level 0, x at level 99, format "[ 'f' 'set' x 'in' A ]") : fset_scope. Notation "[ 'f' 'set' x : T | P ]" := [fset[_] x : T | P] (at level 0, x at level 99, format "[ 'f' 'set' x : T | P ]") : fset_scope. Notation "[ 'f' 'set' x : T | P & Q ]" := [fset[_] x : T | P & Q] (at level 0, x at level 99, format "[ 'f' 'set' x : T | P & Q ]") : fset_scope. Notation "[ 'f' 'set' x 'in' A | P & Q ]" := [fset[_] x in A | P & Q] (at level 0, x at level 99, format "[ 'f' 'set' x 'in' A | P & Q ]") : fset_scope. Notation "[ 'f' 'set' E | x 'in' A , y 'in' B ]" := [fset[_] E | x in A, y in B] (at level 0, E, x at level 99, A at level 200, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/' y 'in' B ] ']'" ) : fset_scope. Section Ops. Context {K K': choiceType}. Implicit Types (a b c : K) (A B C D : {fset K}) (E : {fset K'}) (s : seq K). Definition fset0 : {fset K} := @mkFinSet K [::] (introT eqP (@sort_keys_nil K)). Definition fset1 a : {fset K} := [fset[fset1_key] x in [:: a]]. Definition fsetU A B := [fset[fsetU_key] x in enum_fset A ++ enum_fset B]. Definition fsetI A B := [fset[fsetI_key] x in A | x \in B]. Definition fsetD A B := [fset[fsetD_key] x in A | x \notin B]. Definition fsetM A E := [fset[fsetM_key] (x, y) | x : K in A, y : K' in E]. Definition fsubset A B := fsetI A B == A. Definition fproper A B := fsubset A B && ~~ fsubset B A. Definition fdisjoint A B := (fsetI A B == fset0). End Ops. Notation "[ 'fset' a ]" := (fset1 a) (at level 0, a at level 99, format "[ 'fset' a ]") : fset_scope. Notation "[ 'fset' a : T ]" := [fset (a : T)] (at level 0, a at level 99, format "[ 'fset' a : T ]") : fset_scope. Notation "A `|` B" := (fsetU A B) : fset_scope. Notation "a |` A" := ([fset a] `|` A) : fset_scope. Notation "[ 'fset' a1 ; a2 ; .. ; an ]" := (fsetU .. (a1 |` [fset a2]) .. [fset an]) (at level 0, a1 at level 99, format "[ 'fset' a1 ; a2 ; .. ; an ]") : fset_scope. Notation "A `&` B" := (fsetI A B) : fset_scope. Notation "A `*` B" := (fsetM A B) : fset_scope. Notation "A `\` B" := (fsetD A B) : fset_scope. Notation "A `\ a" := (A `\` [fset a]) : fset_scope. Notation "A `<=` B" := (fsubset A B) (at level 70, no associativity) : fset_scope. Notation "A `<` B" := (fproper A B) (at level 70, no associativity) : fset_scope. Notation "[ 'disjoint' A & B ]" := (fdisjoint A B) : fset_scope. Notation "[ 'fset' E | x 'in' A & P ]" := [fset E | x in [pred x in A | P]] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A & P ]" := [fset E | x in {: A} & P] (at level 0, E, x at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y 'in' B ]" := [fset E | x in {: A}, y in B] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y : B ]" := [fset E | x in A, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y : B ]" := [fset E | x in {: A}, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y 'in' B & P ]" := [fset E | x in A, y in [pred y in B | P]] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y 'in' B & P ]" := [fset E | x in {: A}, y in B & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x 'in' A , y : B & P ]" := [fset E | x in A, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset' E | x : A , y : B & P ]" := [fset E | x in {: A}, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x 'in' A ]" := [fset val x | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x 'in' A | P ]" := [fset val x | x in A & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x 'in' A | P & Q ]" := [fsetval x in A | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x : A ]" := [fset val x | x in {: A}] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x : A | P ]" := [fset val x | x in {: A} & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval' x : A | P & Q ]" := [fsetval x in {: A} | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A & P ]" := [fset[key] E | x in [pred x in A | P]] (at level 0, E, x at level 99, only parsing). Notation "[ 'fset[' key ] E | x : A & P ]" := [fset[key] E | x in {: A} & P] (at level 0, E, x at level 99, only parsing). Notation "[ 'fset[' key ] E | x : A , y 'in' B ]" := [fset[key] E | x in {: A}, y in B] (at level 0, E, x, y at level 99, only parsing). Notation "[ 'fset[' key ] E | x 'in' A , y : B ]" := [fset[key] E | x in A, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y : B ]" := [fset[key] E | x in {: A}, y in {: B}] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A , y 'in' B & P ]" := [fset[key] E | x in A, y in [pred y in B | P]] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y 'in' B & P ]" := [fset[key] E | x in {: A}, y in B & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x 'in' A , y : B & P ]" := [fset[key] E | x in A, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fset[' key ] E | x : A , y : B & P ]" := [fset[key] E | x in {: A}, y in {: B} & P] (at level 0, E, x, y at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x 'in' A ]" := [fset[key] val x | x in A] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x 'in' A | P ]" := [fset[key] val x | x in A & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x 'in' A | P & Q ]" := [fsetval[key] x in A | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x : A ]" := [fset[key] val x | x in {: A}] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x : A | P ]" := [fset[key] val x | x in {: A} & P] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'fsetval[' key ] x : A | P & Q ]" := [fsetval[key] x in {: A} | (P && Q)] (at level 0, x at level 99, only parsing) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A & P ]" := [fset[_] E | x in A & P] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A '/ ' & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A & P ]" := [fset[_] E | x : A & P] (at level 0, E, x at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A '/ ' & P ] ']'") : fset_scope. Notation "[ 'f' 'set' E | x : A , y 'in' B ]" := [fset[_] E | x : A, y in B] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y 'in' B ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A , y : B ]" := [fset[_] E | x in A, y : B] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/ ' y : B ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A , y : B ]" := [fset[_] E | x : A, y : B] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y : B ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A , y 'in' B & P ]" := [fset[_] E | x in A, y in B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/ ' y 'in' B '/ ' & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A , y 'in' B & P ]" := [fset[_] E | x : A, y in B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y 'in' B & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x 'in' A , y : B & P ]" := [fset[_] E | x in A, y : B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/ ' y : B & P ] ']'" ) : fset_scope. Notation "[ 'f' 'set' E | x : A , y : B & P ]" := [fset[_] E | x : A, y : B & P] (at level 0, E, x, y at level 99, format "[ '[hv' 'f' 'set' E '/ ' | x : A , '/ ' y : B & P ] ']'" ) : fset_scope. Notation "[ 'f' 'setval' x 'in' A ]" := [fset[_] val x | x in A] (at level 0, x at level 99, format "[ 'f' 'setval' x 'in' A ]") : fset_scope. Notation "[ 'f' 'setval' x 'in' A | P ]" := [fset[_] val x | x in A & P] (at level 0, x at level 99, format "[ 'f' 'setval' x 'in' A | P ]") : fset_scope. Notation "[ 'f' 'setval' x 'in' A | P & Q ]" := [fsetval[_] x in A | (P && Q)] (at level 0, x at level 99, format "[ 'f' 'setval' x 'in' A | P & Q ]") : fset_scope. Notation "[ 'f' 'setval' x : A ]" := [fsetval[_] x : A] (at level 0, x at level 99, format "[ 'f' 'setval' x : A ]") : fset_scope. Notation "[ 'f' 'setval' x : A | P ]" := [fsetval[_] x : A | P] (at level 0, x at level 99, format "[ 'f' 'setval' x : A | P ]") : fset_scope. Notation "[ 'f' 'setval' x : A | P & Q ]" := [fsetval[_] x : A | (P && Q)] (at level 0, x at level 99, format "[ 'f' 'setval' x : A | P & Q ]") : fset_scope. Section imfset. Variables (key : unit) (K : choiceType). Implicit Types (A B : {fset K}). Lemma imfsetP (T : choiceType) (f : T -> K) (p : finmempred T) (k : K) : reflect (exists2 x : T, in_mem x p & k = f x) (k \in imfset key f p). Proof. (* Goal: Bool.reflect (@ex2 (Choice.sort T) (fun x : Choice.sort T => is_true (@in_mem (Choice.sort T) x (@pred_of_finmempred (Choice.eqType T) p))) (fun x : Choice.sort T => @eq (Choice.sort K) k (f x))) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))))) *) rewrite unlock seq_fsetE /=; apply: (iffP mapP) => [] [x xp eqkf]; by exists x => //=; move: xp; rewrite enum_finmemE. Qed. Lemma in_imfset (T : choiceType) (f : T -> K) (p : finmempred T) (x : T) : in_mem x p -> f x \in imfset key f p. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort T) x (@pred_of_finmempred (Choice.eqType T) p)), is_true (@in_mem (Choice.sort K) (f x) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))))) *) by move=> px; apply/imfsetP; exists x. Qed. Lemma imfset_rec (T : choiceType) (f : T -> K) (p : finmempred T) (P : imfset key f p -> Prop) : (forall (x : T) (px : in_mem x p), P [` in_imfset f px ]) -> forall k, P k. Proof. (* Goal: forall (_ : forall (x : Choice.sort T) (px : is_true (@in_mem (Choice.sort T) x (@pred_of_finmempred (Choice.eqType T) p))), P (@FSetSub K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))) (f x) (@in_imfset T f p x px))) (k : @fset_sub_type K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p)))), P k *) move=> PP v; have /imfsetP [k pk vv_eq] := valP v. (* Goal: P v *) pose vP := in_imfset f pk; suff -> : P v = P [` vP] by apply: PP. (* Goal: @eq Prop (P v) (P (@FSetSub K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))) (f k) vP)) *) by congr P; apply/val_inj => /=; rewrite vv_eq. Qed. Lemma mem_imfset (T : choiceType) (f : T -> K) (p : finmempred T) : injective f -> forall (x : T), (f x \in imfset key f p) = (in_mem x p). Proof. (* Goal: forall (_ : @injective (Choice.sort K) (Choice.sort T) f) (x : Choice.sort T), @eq bool (@in_mem (Choice.sort K) (f x) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))))) (@in_mem (Choice.sort T) x (@pred_of_finmempred (Choice.eqType T) p)) *) by move=> f_inj x; rewrite unlock seq_fsetE mem_map// enum_finmemE. Qed. Lemma imfset2P (T1 : choiceType) (T2 : T1 -> choiceType) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) k : reflect (exists2 x : T1, in_mem x p1 & exists2 y : T2 x, in_mem y (p2 x) & k = f x y) (k \in imfset2 key f p1 p2). Lemma in_imfset2 (T1 : choiceType) (T2 : T1 -> choiceType) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) (x : T1) (y : T2 x) : in_mem x p1 -> in_mem y (p2 x) -> f x y \in imfset2 key f p1 p2. Proof. (* Goal: forall (_ : is_true (@in_mem (Choice.sort T1) x (@pred_of_finmempred (Choice.eqType T1) p1))) (_ : is_true (@in_mem (Choice.sort (T2 x)) y (@pred_of_finmempred (Choice.eqType (T2 x)) (p2 x)))), is_true (@in_mem (Choice.sort K) (f x y) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset2 key K T1 T2 f p1 p2 (Phantom (mem_pred (Equality.sort (Choice.eqType T1))) (@pred_of_finmempred (Choice.eqType T1) p1)) (Phantom (forall x0 : Choice.sort T1, mem_pred (Equality.sort (Choice.eqType (T2 x0)))) (fun x : Choice.sort T1 => @pred_of_finmempred (Choice.eqType (T2 x)) (p2 x)))))) *) by move=> xD1 yD2; apply/imfset2P; exists x => //; exists y. Qed. Lemma mem_imfset2 (T1 : choiceType) (T2 : T1 -> choiceType) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) (x : T1) (y : T2 x) : injective (fun x : sigT T2 => f (tag x) (tagged x)) -> f x y \in imfset2 key f p1 p2 = (in_mem x p1) && (in_mem y (p2 x)). Lemma enum_imfset (T : choiceType) (f : T -> K) (p : finmempred T) : {in p &, injective f} -> perm_eq (imfset key f p) [seq f x | x <- enum_finmem p]. Proof. (* Goal: forall _ : @prop_in2 (Equality.sort (Choice.eqType T)) (@mem (Equality.sort (Choice.eqType T)) (predPredType (Equality.sort (Choice.eqType T))) (@pred_of_mem (Equality.sort (Choice.eqType T)) (@pred_of_finmempred (Choice.eqType T) p))) (fun x1 x2 : Choice.sort T => forall _ : @eq (Choice.sort K) (f x1) (f x2), @eq (Choice.sort T) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort T) f)), is_true (@perm_eq (Choice.eqType K) (@enum_fset K (@Imfset.imfset key T K f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p)))) (@map (Choice.sort T) (Choice.sort K) (fun x : Choice.sort T => f x) (@enum_finmem (Choice.eqType T) p))) *) move=> f_inj; rewrite unlock -[X in perm_eq _ X]undup_id ?seq_fset_perm//. (* Goal: is_true (@uniq (Choice.eqType K) (@map (Choice.sort T) (Choice.sort K) (fun x : Choice.sort T => f x) (@enum_finmem (Choice.eqType T) p))) *) rewrite map_inj_in_uniq ?enum_finmem_uniq // => ??. (* Goal: forall (_ : is_true (@in_mem (Equality.sort (Choice.eqType T)) _x_ (@mem (Equality.sort (Choice.eqType T)) (seq_predType (Choice.eqType T)) (@enum_finmem (Choice.eqType T) p)))) (_ : is_true (@in_mem (Equality.sort (Choice.eqType T)) _y_ (@mem (Equality.sort (Choice.eqType T)) (seq_predType (Choice.eqType T)) (@enum_finmem (Choice.eqType T) p)))) (_ : @eq (Equality.sort (Choice.eqType K)) (f _x_) (f _y_)), @eq (Equality.sort (Choice.eqType T)) _x_ _y_ *) by rewrite ?enum_finmemE; apply: f_inj. Qed. Lemma enum_imfset2 (T1 : choiceType) (T2 : T1 -> choiceType) (f : forall x, T2 x -> K) (p1 : finmempred T1) (p2 : forall x, finmempred (T2 x)) : {in [pred t | p1 (tag t) & p2 _ (tagged t)] &, injective (fun t : sigT T2 => f (tag t) (tagged t))} -> perm_eq (imfset2 key f p1 p2) (allsigs f (enum_finmem p1) (fun x => enum_finmem (p2 x))). End imfset. Section in_imfset. Variable (key : unit) (K : choiceType). Implicit Types (A B : {fset K}) (a b : K). Lemma in_fset (p : finmempred K) (k : K) : (k \in imfset key id p) = in_mem k p. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key K K (fun x : Choice.sort K => x) p (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@pred_of_finmempred (Choice.eqType K) p))))) (@in_mem (Choice.sort K) k (@pred_of_finmempred (Choice.eqType K) p)) *) by rewrite mem_imfset; apply: inj_id. Qed. Lemma val_in_fset A (p : finmempred _) (k : A) : (val k \in imfset key val p) = (in_mem k p). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A) k) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) p (Phantom (mem_pred (Equality.sort (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))))) (@pred_of_finmempred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))) p))))) (@in_mem (@fset_sub_type K A) k (@pred_of_finmempred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))) p)) *) by rewrite mem_imfset ?in_finmempred //; exact: val_inj. Qed. Lemma in_fset_val A (p : finmempred [eqType of A]) (k : K) : (k \in imfset key val p) = if insub k is Some a then in_mem a p else false. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) p (Phantom (mem_pred (Equality.sort (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)))) (@pred_of_finmempred (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)) p))))) match @insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A) k with | Some a => @in_mem (@sub_sort (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) a (@pred_of_finmempred (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)) p) | None => false end *) have [a _ <- /=|kNA] := insubP; first by rewrite val_in_fset. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) p (Phantom (mem_pred (Equality.sort (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)))) (@pred_of_finmempred (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)) p))))) false *) by apply/imfsetP => [] [a _ k_def]; move: kNA; rewrite k_def [_ \in _]valP. Qed. Lemma in_fset_valT A (p : finmempred _) (k : K) (kA : k \in A) : (k \in imfset key val p) = in_mem [` kA] p. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) p (Phantom (mem_pred (Equality.sort (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))))) (@pred_of_finmempred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))) p))))) (@in_mem (@fset_sub_type K A) (@FSetSub K A k kA) (@pred_of_finmempred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))) p)) *) by rewrite in_fset_val insubT /=. Qed. Lemma in_fset_valP A (p : finmempred _) (k : K) : reflect {kA : k \in A & in_mem [` kA] p} (k \in imfset key val p). Lemma in_fset_valF A (p : finmempred [eqType of A]) (k : K) : k \notin A -> (k \in imfset key val p) = false. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A))), @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) p (Phantom (mem_pred (Equality.sort (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)))) (@pred_of_finmempred (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)) p))))) false *) by apply: contraNF => /imfsetP[/= a Xa->]. Qed. Lemma in_fset_nil a : a \in [fset[key] x in [::]] = false. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) (@nil (Equality.sort (Choice.eqType K))))) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@nil (Equality.sort (Choice.eqType K)))))))) false *) by rewrite !mem_imfset. Qed. Lemma in_fset_cons x (xs : seq K) a : (a \in [fset[key] x in x :: xs]) = ((a == x) || (a \in [fset[key] x in xs])). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) (@cons (Choice.sort K) x xs))) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@cons (Choice.sort K) x xs)))))) (orb (@eq_op (Choice.eqType K) a x) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) xs)) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) xs)))))) *) by rewrite !mem_imfset. Qed. Lemma in_fset_cat (xs ys : seq K) a : (a \in [fset[key] x in xs ++ ys]) = ((a \in [fset[key] x in xs]) || (a \in [fset[key] x in ys])). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) (@cat (Choice.sort K) xs ys))) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@cat (Choice.sort K) xs ys)))))) (orb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) xs)) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) xs))))) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) ys)) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) ys)))))) *) by rewrite !mem_imfset//= mem_cat. Qed. Definition in_fset_ (key : unit) := (in_fset_cons, in_fset_nil, in_fset_cat, in_fset). Lemma card_in_imfset (T T' : choiceType) (f : T -> T') (p : finmempred T) : {in p &, injective f} -> #|` (imfset key f p)| = (size (enum_finmem p)). Proof. (* Goal: forall _ : @prop_in2 (Equality.sort (Choice.eqType T)) (@mem (Equality.sort (Choice.eqType T)) (predPredType (Equality.sort (Choice.eqType T))) (@pred_of_mem (Equality.sort (Choice.eqType T)) (@pred_of_finmempred (Choice.eqType T) p))) (fun x1 x2 : Choice.sort T => forall _ : @eq (Choice.sort T') (f x1) (f x2), @eq (Choice.sort T) x1 x2) (inPhantom (@injective (Choice.sort T') (Choice.sort T) f)), @eq nat (@size (Choice.sort T') (@enum_fset T' (@Imfset.imfset key T T' f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))))) (@size (Equality.sort (Choice.eqType T)) (@enum_finmem (Choice.eqType T) p)) *) move=> f_inj; rewrite unlock /= size_seq_fset undup_id ?size_map//. (* Goal: is_true (@uniq (Choice.eqType T') (@map (Choice.sort T) (Choice.sort T') (fun x : Choice.sort T => f x) (@enum_finmem (Choice.eqType T) p))) *) rewrite map_inj_in_uniq ?enum_finmem_uniq// => ??. (* Goal: forall (_ : is_true (@in_mem (Equality.sort (Choice.eqType T)) _x_ (@mem (Equality.sort (Choice.eqType T)) (seq_predType (Choice.eqType T)) (@enum_finmem (Choice.eqType T) p)))) (_ : is_true (@in_mem (Equality.sort (Choice.eqType T)) _y_ (@mem (Equality.sort (Choice.eqType T)) (seq_predType (Choice.eqType T)) (@enum_finmem (Choice.eqType T) p)))) (_ : @eq (Equality.sort (Choice.eqType T')) (f _x_) (f _y_)), @eq (Equality.sort (Choice.eqType T)) _x_ _y_ *) by rewrite !enum_finmemE; apply: f_inj. Qed. Lemma card_imfset (T T' : choiceType) (f : T -> T') (p : finmempred _) : injective f -> #|` (imfset key f p)| = size (enum_finmem p). Proof. (* Goal: forall _ : @injective (Choice.sort T') (Choice.sort T) f, @eq nat (@size (Choice.sort T') (@enum_fset T' (@Imfset.imfset key T T' f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))))) (@size (Equality.sort (Choice.eqType T)) (@enum_finmem (Choice.eqType T) p)) *) by move=> f_inj; rewrite card_in_imfset //= => x y ? ?; apply: f_inj. Qed. Lemma leq_imfset_card (T T' : choiceType) (f : T -> T') (p : finmempred _) : (#|` imfset key f p| <= size (enum_finmem p))%N. Proof. (* Goal: is_true (leq (@size (Choice.sort T') (@enum_fset T' (@Imfset.imfset key T T' f p (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@pred_of_finmempred (Choice.eqType T) p))))) (@size (Equality.sort (Choice.eqType T)) (@enum_finmem (Choice.eqType T) p))) *) by rewrite unlock size_seq_fset (leq_trans (size_undup _)) ?size_map. Qed. End in_imfset. Section Theory. Variables (key : unit) (K K': choiceType). Implicit Types (a b x : K) (A B C D : {fset K}) (E : {fset K'}) (pA pB pC : pred K) (s : seq K). Lemma fsetP {A B} : A =i B <-> A = B. Proof. (* Goal: iff (@eq_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A) (@mem (Choice.sort K) (finSetPredType K) B)) (@eq (@finset_of K (Phant (Choice.sort K))) A B) *) by split=> [eqAB|-> //]; apply/val_inj/canonical_eq_keys => //= a. Qed. CoInductive in_fset_spec (A : {fset K}) (x : K) : K -> bool -> Prop := | InFset (u : A) & x = val u : in_fset_spec A x (val u) true | OutFset of x \notin A : in_fset_spec A x x false. Lemma in_fsetP A x : in_fset_spec A x x (x \in A). Proof. (* Goal: in_fset_spec A x x (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) *) have [xA|xNA] := boolP (x \in A); last by constructor. (* Goal: in_fset_spec A x x true *) by have {2}-> : x = val [` xA] by []; constructor. Qed. Lemma fset_eqP {A B} : reflect (A =i B) (A == B). Proof. (* Goal: Bool.reflect (@eq_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A) (@mem (Choice.sort K) (finSetPredType K) B)) (@eq_op (fset_eqType K) A B) *) exact: (equivP eqP (iff_sym fsetP)). Qed. Lemma in_fset1 a' a : a \in [fset a'] = (a == a'). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fset1 K a'))) (@eq_op (Choice.eqType K) a a') *) by rewrite !in_fset_ orbF. Qed. Lemma in_fsetU A B a : (a \in A `|` B) = (a \in A) || (a \in B). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetU K A B))) (orb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) *) by rewrite !in_fset_. Qed. Lemma in_fset1U a' A a : (a \in a' |` A) = (a == a') || (a \in A). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fset1 K a') A))) (orb (@eq_op (Choice.eqType K) a a') (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))) *) by rewrite in_fsetU in_fset1. Qed. Lemma in_fsetI A B a : (a \in A `&` B) = (a \in A) && (a \in B). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetI K A B))) (andb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) *) by rewrite in_fset. Qed. Lemma in_fsetD A B a : (a \in A `\` B) = (a \notin B) && (a \in A). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A B))) (andb (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))) *) by rewrite in_fset andbC. Qed. Lemma in_fsetD1 A b a : (a \in A `\ b) = (a != b) && (a \in A). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A (@fset1 K b)))) (andb (negb (@eq_op (Choice.eqType K) a b)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))) *) by rewrite in_fsetD in_fset1. Qed. Lemma in_fsetM A E (u : K * K') : (u \in A `*` E) = (u.1 \in A) && (u.2 \in E). Proof. (* Goal: @eq bool (@in_mem (prod (Choice.sort K) (Choice.sort K')) u (@mem (Choice.sort (prod_choiceType K K')) (finSetPredType (prod_choiceType K K')) (@fsetM K K' A E))) (andb (@in_mem (Choice.sort K) (@fst (Choice.sort K) (Choice.sort K') u) (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K') (@snd (Choice.sort K) (Choice.sort K') u) (@mem (Choice.sort K') (finSetPredType K') E))) *) by case: u => /= x y; rewrite mem_imfset2//= => -[??] [??] [-> ->]. Qed. Definition in_fsetE := (@in_fset_ imfset_key, val_in_fset, in_fset0, in_fset1, in_fsetU, in_fsetI, in_fsetD, in_fsetM, in_fset1U, in_fsetD1). Let inE := (inE, in_fsetE). Lemma fsetIC (A B : {fset K}) : A `&` B = B `&` A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A B) (@fsetI K B A) *) by apply/fsetP => a; rewrite !inE andbC. Qed. Lemma fsetUC (A B : {fset K}) : A `|` B = B `|` A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A B) (@fsetU K B A) *) by apply/fsetP => a; rewrite !inE orbC. Qed. Lemma fset0I A : fset0 `&` A = fset0. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fset0 K) A) (@fset0 K) *) by apply/fsetP => x; rewrite !inE andFb. Qed. Lemma fsetI0 A : A `&` fset0 = fset0. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fset0 K)) (@fset0 K) *) by rewrite fsetIC fset0I. Qed. Lemma fsetIA A B C : A `&` (B `&` C) = A `&` B `&` C. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetI K B C)) (@fsetI K (@fsetI K A B) C) *) by apply/fsetP=> x; rewrite !inE andbA. Qed. Lemma fsetICA A B C : A `&` (B `&` C) = B `&` (A `&` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetI K B C)) (@fsetI K B (@fsetI K A C)) *) by rewrite !fsetIA (fsetIC A). Qed. Lemma fsetIAC A B C : A `&` B `&` C = A `&` C `&` B. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetI K A B) C) (@fsetI K (@fsetI K A C) B) *) by rewrite -!fsetIA (fsetIC B). Qed. Lemma fsetIACA A B C D : (A `&` B) `&` (C `&` D) = (A `&` C) `&` (B `&` D). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetI K A B) (@fsetI K C D)) (@fsetI K (@fsetI K A C) (@fsetI K B D)) *) by rewrite -!fsetIA (fsetICA B). Qed. Lemma fsetIid A : A `&` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A A) A *) by apply/fsetP=> x; rewrite inE andbb. Qed. Lemma fsetIIl A B C : A `&` B `&` C = (A `&` C) `&` (B `&` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetI K A B) C) (@fsetI K (@fsetI K A C) (@fsetI K B C)) *) by rewrite fsetIA !(fsetIAC _ C) -(fsetIA _ C) fsetIid. Qed. Lemma fsetIIr A B C : A `&` (B `&` C) = (A `&` B) `&` (A `&` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetI K B C)) (@fsetI K (@fsetI K A B) (@fsetI K A C)) *) by rewrite !(fsetIC A) fsetIIl. Qed. Lemma fsetUA A B C : A `|` (B `|` C) = A `|` B `|` C. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetU K B C)) (@fsetU K (@fsetU K A B) C) *) by apply/fsetP => x; rewrite !inE orbA. Qed. Lemma fsetUCA A B C : A `|` (B `|` C) = B `|` (A `|` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetU K B C)) (@fsetU K B (@fsetU K A C)) *) by rewrite !fsetUA (fsetUC B). Qed. Lemma fsetUAC A B C : A `|` B `|` C = A `|` C `|` B. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetU K A B) C) (@fsetU K (@fsetU K A C) B) *) by rewrite -!fsetUA (fsetUC B). Qed. Lemma fsetUACA A B C D : (A `|` B) `|` (C `|` D) = (A `|` C) `|` (B `|` D). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetU K A B) (@fsetU K C D)) (@fsetU K (@fsetU K A C) (@fsetU K B D)) *) by rewrite -!fsetUA (fsetUCA B). Qed. Lemma fsetUid A : A `|` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A A) A *) by apply/fsetP=> x; rewrite inE orbb. Qed. Lemma fsetUUl A B C : A `|` B `|` C = (A `|` C) `|` (B `|` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetU K A B) C) (@fsetU K (@fsetU K A C) (@fsetU K B C)) *) by rewrite fsetUA !(fsetUAC _ C) -(fsetUA _ C) fsetUid. Qed. Lemma fsetUUr A B C : A `|` (B `|` C) = (A `|` B) `|` (A `|` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetU K B C)) (@fsetU K (@fsetU K A B) (@fsetU K A C)) *) by rewrite !(fsetUC A) fsetUUl. Qed. Lemma fsetIUr A B C : A `&` (B `|` C) = (A `&` B) `|` (A `&` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetU K B C)) (@fsetU K (@fsetI K A B) (@fsetI K A C)) *) by apply/fsetP=> x; rewrite !inE andb_orr. Qed. Lemma fsetIUl A B C : (A `|` B) `&` C = (A `&` C) `|` (B `&` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetU K A B) C) (@fsetU K (@fsetI K A C) (@fsetI K B C)) *) by apply/fsetP=> x; rewrite !inE andb_orl. Qed. Lemma fsetUIr A B C : A `|` (B `&` C) = (A `|` B) `&` (A `|` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetI K B C)) (@fsetI K (@fsetU K A B) (@fsetU K A C)) *) by apply/fsetP=> x; rewrite !inE orb_andr. Qed. Lemma fsetUIl A B C : (A `&` B) `|` C = (A `|` C) `&` (B `|` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetI K A B) C) (@fsetI K (@fsetU K A C) (@fsetU K B C)) *) by apply/fsetP=> x; rewrite !inE orb_andl. Qed. Lemma fsetUKC A B : (A `|` B) `&` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetU K A B) A) A *) by apply/fsetP=> x; rewrite !inE orbK. Qed. Lemma fsetUK A B : (B `|` A) `&` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetU K B A) A) A *) by rewrite fsetUC fsetUKC. Qed. Lemma fsetKUC A B : A `&` (B `|` A) = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetU K B A)) A *) by rewrite fsetIC fsetUK. Qed. Lemma fsetKU A B : A `&` (A `|` B) = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetU K A B)) A *) by rewrite fsetIC fsetUKC. Qed. Lemma fsetIKC A B : (A `&` B) `|` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetI K A B) A) A *) by apply/fsetP=> x; rewrite !inE andbK. Qed. Lemma fsetIK A B : (B `&` A) `|` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetI K B A) A) A *) by rewrite fsetIC fsetIKC. Qed. Lemma fsetKIC A B : A `|` (B `&` A) = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetI K B A)) A *) by rewrite fsetUC fsetIK. Qed. Lemma fsetKI A B : A `|` (A `&` B) = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetI K A B)) A *) by rewrite fsetIC fsetKIC. Qed. Lemma fsetUKid A B : B `|` A `|` A = B `|` A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetU K B A) A) (@fsetU K B A) *) by rewrite -fsetUA fsetUid. Qed. Lemma fsetUKidC A B : A `|` B `|` A = A `|` B. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetU K A B) A) (@fsetU K A B) *) by rewrite fsetUAC fsetUid. Qed. Lemma fsetKUid A B : A `|` (A `|` B) = A `|` B. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetU K A B)) (@fsetU K A B) *) by rewrite fsetUA fsetUid. Qed. Lemma fsetKUidC A B : A `|` (B `|` A) = B `|` A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetU K B A)) (@fsetU K B A) *) by rewrite fsetUCA fsetUid. Qed. Lemma fsetIKid A B : B `&` A `&` A = B `&` A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetI K B A) A) (@fsetI K B A) *) by rewrite -fsetIA fsetIid. Qed. Lemma fsetIKidC A B : A `&` B `&` A = A `&` B. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetI K A B) A) (@fsetI K A B) *) by rewrite fsetIAC fsetIid. Qed. Lemma fsetKIid A B : A `&` (A `&` B) = A `&` B. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetI K A B)) (@fsetI K A B) *) by rewrite fsetIA fsetIid. Qed. Lemma fsetKIidC A B : A `&` (B `&` A) = B `&` A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetI K B A)) (@fsetI K B A) *) by rewrite fsetICA fsetIid. Qed. Lemma fsubsetP {A B} : reflect {subset A <= B} (A `<=` B). Proof. (* Goal: Bool.reflect (@sub_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A) (@mem (Choice.sort K) (finSetPredType K) B)) (@fsubset K A B) *) apply: (iffP fset_eqP) => AsubB a; first by rewrite -AsubB inE => /andP[]. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetI K A B))) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) *) by rewrite inE; have [/AsubB|] := boolP (a \in A). Qed. Lemma fset_sub_val A (p : finmempred [eqType of A]) : (imfset key val p) `<=` A. Proof. (* Goal: is_true (@fsubset K (@Imfset.imfset key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) p (Phantom (mem_pred (Equality.sort (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)))) (@pred_of_finmempred (@Equality.clone (@fset_sub_type K A) (@fset_sub_eqType K A) (@fset_sub_eqMixin K A) (fun x : Equality.sort (@fset_sub_eqType K A) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K A) (@fset_sub_eqMixin K A)) => x)) p))) A) *) by apply/fsubsetP => k /in_fset_valP []. Qed. Lemma fset_sub A (P : pred K) : [fset x in A | P x] `<=` A. Proof. (* Goal: is_true (@fsubset K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K A)) P)) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (P x)))))) A) *) by apply/fsubsetP => k; rewrite in_fset inE /= => /andP []. Qed. Lemma fsetD_eq0 (A B : {fset K}) : (A `\` B == fset0) = (A `<=` B). Proof. (* Goal: @eq bool (@eq_op (fset_eqType K) (@fsetD K A B) (@fset0 K)) (@fsubset K A B) *) apply/fset_eqP/fsubsetP => sAB a. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A B))) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fset0 K))) *) (* Goal: forall _ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)), is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B)) *) by move=> aA; have := sAB a; rewrite !inE aA andbT => /negPn. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A B))) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fset0 K))) *) by rewrite !inE andbC; apply/negP => /andP [/sAB ->]. Qed. Hint Resolve fsubset_refl. Definition fincl A B (AsubB : A `<=` B) (a : A) : B := [` (fsubsetP AsubB) _ (valP a)]. Definition fsub B A : {set B} := [set x : B | val x \in A]. Lemma fsubE A B (AsubB : A `<=` B) : fsub B A = [set fincl AsubB x | x : A]. Lemma fincl_fsub A B (AsubB : A `<=` B) (a : A) : fincl AsubB a \in fsub B A. Proof. (* Goal: is_true (@in_mem (@fset_sub_type K B) (@fincl A B AsubB a) (@mem (Finite.sort (@fset_sub_finType K B)) (predPredType (Finite.sort (@fset_sub_finType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) *) by rewrite inE /= (valP a). Qed. Lemma in_fsub B A (b : B) : (b \in fsub B A) = (val b \in A). Proof. (* Goal: @eq bool (@in_mem (@fset_sub_type K B) b (@mem (Finite.sort (@fset_sub_finType K B)) (predPredType (Finite.sort (@fset_sub_finType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B) b) (@mem (Choice.sort K) (finSetPredType K) A)) *) by rewrite inE. Qed. Lemma subset_fsubE C A B : A `<=` C -> B `<=` C -> (fsub C A \subset fsub C B) = (A `<=` B). Proof. (* Goal: forall (_ : is_true (@fsubset K A C)) (_ : is_true (@fsubset K B C)), @eq bool (@subset (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) (@fsubset K A B) *) move=> sAC sBC; apply/subsetP/fsubsetP => sAB a; last first. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)), is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B)) *) (* Goal: forall _ : is_true (@in_mem (Finite.sort (@fset_sub_finType K C)) a (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A)))), is_true (@in_mem (Finite.sort (@fset_sub_finType K C)) a (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) by rewrite !inE => /sAB. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)), is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B)) *) by move=> aA; have := sAB _ (fincl_fsub sAC [` aA]); rewrite inE. Qed. Lemma fsubset_trans : transitive (@fsubset K). Proof. (* Goal: @transitive (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) by move=>??? s t ; apply/fsubsetP => a /(fsubsetP s) /(fsubsetP t). Qed. Lemma subset_fsub A B C : A `<=` B -> B `<=` C -> fsub C A \subset fsub C B. Proof. (* Goal: forall (_ : is_true (@fsubset K A B)) (_ : is_true (@fsubset K B C)), is_true (@subset (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) by move=> sAB sBC; rewrite subset_fsubE // (fsubset_trans sAB). Qed. Lemma fsetIidPl {A B} : reflect (A `&` B = A) (A `<=` B). Proof. (* Goal: Bool.reflect (@eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A B) A) (@fsubset K A B) *) exact: eqP. Qed. Lemma fsetIidPr {A B} : reflect (A `&` B = B) (B `<=` A). Proof. (* Goal: Bool.reflect (@eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A B) B) (@fsubset K B A) *) by rewrite fsetIC; apply: fsetIidPl. Qed. Lemma fsubsetIidl A B : (A `<=` A `&` B) = (A `<=` B). Proof. (* Goal: @eq bool (@fsubset K A (@fsetI K A B)) (@fsubset K A B) *) by apply/fsubsetP/fsubsetP=> sAB a aA; have := sAB _ aA; rewrite !inE ?aA. Qed. Lemma fsubsetIidr A B : (B `<=` A `&` B) = (B `<=` A). Proof. (* Goal: @eq bool (@fsubset K B (@fsetI K A B)) (@fsubset K B A) *) by rewrite fsetIC fsubsetIidl. Qed. Lemma fsetUidPr A B : reflect (A `|` B = B) (A `<=` B). Proof. (* Goal: Bool.reflect (@eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A B) B) (@fsubset K A B) *) apply: (iffP fsubsetP) => sAB; last by move=> a aA; rewrite -sAB inE aA. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A B) B *) by apply/fsetP => b; rewrite inE; have [/sAB|//] := boolP (_ \in _). Qed. Lemma fsetUidPl A B : reflect (A `|` B = A) (B `<=` A). Proof. (* Goal: Bool.reflect (@eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A B) A) (@fsubset K B A) *) by rewrite fsetUC; apply/fsetUidPr. Qed. Lemma fsubsetUl A B : A `<=` A `|` B. Proof. (* Goal: is_true (@fsubset K A (@fsetU K A B)) *) by apply/fsubsetP => a; rewrite inE => ->. Qed. Hint Resolve fsubsetUl. Lemma fsubsetUr A B : B `<=` A `|` B. Proof. (* Goal: is_true (@fsubset K B (@fsetU K A B)) *) by rewrite fsetUC. Qed. Hint Resolve fsubsetUr. Lemma fsubsetU1 x A : A `<=` x |` A. Proof. (* Goal: is_true (@fsubset K A (@fsetU K (@fset1 K x) A)) *) by rewrite fsubsetUr. Qed. Hint Resolve fsubsetU1. Lemma fsubsetU A B C : (A `<=` B) || (A `<=` C) -> A `<=` B `|` C. Proof. (* Goal: forall _ : is_true (orb (@fsubset K A B) (@fsubset K A C)), is_true (@fsubset K A (@fsetU K B C)) *) by move=> /orP [] /fsubset_trans ->. Qed. Lemma fincl_inj A B (AsubB : A `<=` B) : injective (fincl AsubB). Proof. (* Goal: @injective (@fset_sub_type K B) (@fset_sub_type K A) (@fincl A B AsubB) *) by move=> a b [eq_ab]; apply: val_inj. Qed. Hint Resolve fincl_inj. Lemma fsub_inj B : {in [pred A | A `<=` B] &, injective (fsub B)}. Proof. (* Goal: @prop_in2 (@finset_of K (Phant (Choice.sort K))) (@mem (@finset_of K (Phant (Choice.sort K))) (simplPredType (@finset_of K (Phant (Choice.sort K)))) (@SimplPred (@finset_of K (Phant (Choice.sort K))) (fun A : @finset_of K (Phant (Choice.sort K)) => @fsubset K A B))) (fun x1 x2 : @finset_of K (Phant (Choice.sort K)) => forall _ : @eq (@set_of (@fset_sub_finType K B) (Phant (@fset_sub_type K B))) (fsub B x1) (fsub B x2), @eq (@finset_of K (Phant (Choice.sort K))) x1 x2) (inPhantom (@injective (@set_of (@fset_sub_finType K B) (Phant (@fset_sub_type K B))) (@finset_of K (Phant (Choice.sort K))) (fsub B))) *) move=> A A'; rewrite -!topredE /= => sAB sA'B /setP eqAA'; apply/fsetP => a. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A')) *) apply/idP/idP => mem_a. (* Goal: is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) *) (* Goal: is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A')) *) by have := eqAA' (fincl sAB [` mem_a]); rewrite !inE // => <-. (* Goal: is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) *) by have := eqAA' (fincl sA'B [` mem_a]); rewrite !inE // => ->. Qed. Hint Resolve fsub_inj. Lemma eqEfsubset A B : (A == B) = (A `<=` B) && (B `<=` A). Proof. (* Goal: @eq bool (@eq_op (fset_eqType K) A B) (andb (@fsubset K A B) (@fsubset K B A)) *) apply/eqP/andP => [-> //|[/fsubsetP AB /fsubsetP BA]]. (* Goal: @eq (Equality.sort (fset_eqType K)) A B *) by apply/fsetP=> x; apply/idP/idP=> [/AB|/BA]. Qed. Lemma subEfproper A B : A `<=` B = (A == B) || (A `<` B). Proof. (* Goal: @eq bool (@fsubset K A B) (orb (@eq_op (fset_eqType K) A B) (@fproper K A B)) *) by rewrite eqEfsubset -andb_orr orbN andbT. Qed. Lemma fproper_sub A B : A `<` B -> A `<=` B. Proof. (* Goal: forall _ : is_true (@fproper K A B), is_true (@fsubset K A B) *) by rewrite subEfproper orbC => ->. Qed. Lemma eqVfproper A B : A `<=` B -> A = B \/ A `<` B. Proof. (* Goal: forall _ : is_true (@fsubset K A B), or (@eq (@finset_of K (Phant (Choice.sort K))) A B) (is_true (@fproper K A B)) *) by rewrite subEfproper => /predU1P. Qed. Lemma fproperEneq A B : A `<` B = (A != B) && (A `<=` B). Proof. (* Goal: @eq bool (@fproper K A B) (andb (negb (@eq_op (fset_eqType K) A B)) (@fsubset K A B)) *) by rewrite andbC eqEfsubset negb_and andb_orr andbN. Qed. Lemma fproper_neq A B : A `<` B -> A != B. Proof. (* Goal: forall _ : is_true (@fproper K A B), is_true (negb (@eq_op (fset_eqType K) A B)) *) by rewrite fproperEneq; case/andP. Qed. Lemma fproper_irrefl A : ~~ (A `<` A). Proof. (* Goal: is_true (negb (@fproper K A A)) *) by rewrite fproperEneq eqxx. Qed. Lemma eqEfproper A B : (A == B) = (A `<=` B) && ~~ (A `<` B). Proof. (* Goal: @eq bool (@eq_op (fset_eqType K) A B) (andb (@fsubset K A B) (negb (@fproper K A B))) *) by rewrite negb_and negbK andb_orr andbN eqEfsubset. Qed. Lemma card_fsub B A : A `<=` B -> #|fsub B A| = #|` A|. Proof. (* Goal: forall _ : is_true (@fsubset K A B), @eq nat (@card (@fset_sub_finType K B) (@mem (Finite.sort (@fset_sub_finType K B)) (predPredType (Finite.sort (@fset_sub_finType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (@size (Choice.sort K) (@enum_fset K A)) *) by move=> sAB; rewrite cardfE fsubE card_imset //; apply: fincl_inj. Qed. Lemma eqEfcard A B : (A == B) = (A `<=` B) && (#|` B| <= #|` A|)%N. Proof. (* Goal: @eq bool (@eq_op (fset_eqType K) A B) (andb (@fsubset K A B) (leq (@size (Choice.sort K) (@enum_fset K B)) (@size (Choice.sort K) (@enum_fset K A)))) *) rewrite -(inj_in_eq (@fsub_inj (A `|` B))) -?topredE //=. (* Goal: @eq bool (@eq_op (set_of_eqType (@fset_sub_finType K (@fsetU K A B))) (fsub (@fsetU K A B) A) (fsub (@fsetU K A B) B)) (andb (@fsubset K A B) (leq (@size (Choice.sort K) (@enum_fset K B)) (@size (Choice.sort K) (@enum_fset K A)))) *) by rewrite eqEcard !(@subset_fsubE (A `|` B)) ?(@card_fsub (A `|` B)). Qed. Lemma fproperEcard A B : (A `<` B) = (A `<=` B) && (#|` A| < #|` B|)%N. Proof. (* Goal: @eq bool (@fproper K A B) (andb (@fsubset K A B) (leq (S (@size (Choice.sort K) (@enum_fset K A))) (@size (Choice.sort K) (@enum_fset K B)))) *) by rewrite fproperEneq ltnNge andbC eqEfcard; case: (A `<=` B). Qed. Lemma fsubset_leqif_cards A B : A `<=` B -> (#|` A| <= #|` B| ?= iff (A == B))%N. Proof. (* Goal: forall _ : is_true (@fsubset K A B), leqif (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K B)) (@eq_op (fset_eqType K) A B) *) rewrite -!(@card_fsub (A `|` B)) // -(@subset_fsubE (A `|` B)) //. (* Goal: forall _ : is_true (@subset (@fset_sub_finType K (@fsetU K A B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) A))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) B)))), leqif (@card (@fset_sub_finType K (@fsetU K A B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) A)))) (@card (@fset_sub_finType K (@fsetU K A B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) B)))) (@eq_op (fset_eqType K) A B) *) by move=> /subset_leqif_cards; rewrite (inj_in_eq (@fsub_inj _)) -?topredE /=. Qed. Lemma fsub0set A : fset0 `<=` A. Proof. (* Goal: is_true (@fsubset K (@fset0 K) A) *) by apply/fsubsetP=> x; rewrite inE. Qed. Hint Resolve fsub0set. Lemma fsubset0 A : (A `<=` fset0) = (A == fset0). Proof. (* Goal: @eq bool (@fsubset K A (@fset0 K)) (@eq_op (fset_eqType K) A (@fset0 K)) *) by rewrite eqEfsubset fsub0set andbT. Qed. Lemma fproper0 A : (fset0 `<` A) = (A != fset0). Proof. (* Goal: @eq bool (@fproper K (@fset0 K) A) (negb (@eq_op (fset_eqType K) A (@fset0 K))) *) by rewrite /fproper fsub0set fsubset0. Qed. Lemma fproperE A B : (A `<` B) = (A `<=` B) && ~~ (B `<=` A). Proof. (* Goal: @eq bool (@fproper K A B) (andb (@fsubset K A B) (negb (@fsubset K B A))) *) by []. Qed. Lemma fsubEproper A B : (A `<=` B) = (A == B) || (A `<` B). Proof. (* Goal: @eq bool (@fsubset K A B) (orb (@eq_op (fset_eqType K) A B) (@fproper K A B)) *) by rewrite fproperEneq; case: eqP => //= ->; apply: fsubset_refl. Qed. Lemma fsubset_leq_card A B : A `<=` B -> (#|` A| <= #|` B|)%N. Proof. (* Goal: forall _ : is_true (@fsubset K A B), is_true (leq (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K B))) *) by move=> /fsubset_leqif_cards ->. Qed. Lemma fproper_ltn_card A B : A `<` B -> (#|` A| < #|` B|)%N. Proof. (* Goal: forall _ : is_true (@fproper K A B), is_true (leq (S (@size (Choice.sort K) (@enum_fset K A))) (@size (Choice.sort K) (@enum_fset K B))) *) by rewrite fproperEcard => /andP []. Qed. Lemma fsubset_cardP A B : #|` A| = #|` B| -> reflect (A =i B) (A `<=` B). Proof. (* Goal: forall _ : @eq nat (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K B)), Bool.reflect (@eq_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A) (@mem (Choice.sort K) (finSetPredType K) B)) (@fsubset K A B) *) move=> eq_cardAB; apply: (iffP idP) => [/eqVfproper [->//|]|/fsetP -> //]. (* Goal: forall _ : is_true (@fproper K A B), @eq_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A) (@mem (Choice.sort K) (finSetPredType K) B) *) by rewrite fproperEcard eq_cardAB ltnn andbF. Qed. Lemma fproper_sub_trans B A C : A `<` B -> B `<=` C -> A `<` C. Proof. (* Goal: forall (_ : is_true (@fproper K A B)) (_ : is_true (@fsubset K B C)), is_true (@fproper K A C) *) rewrite !fproperEcard => /andP [sAB lt_AB] sBC. (* Goal: is_true (andb (@fsubset K A C) (leq (S (@size (Choice.sort K) (@enum_fset K A))) (@size (Choice.sort K) (@enum_fset K C)))) *) by rewrite (fsubset_trans sAB) //= (leq_trans lt_AB) // fsubset_leq_card. Qed. Lemma fsub_proper_trans B A C : A `<=` B -> B `<` C -> A `<` C. Proof. (* Goal: forall (_ : is_true (@fsubset K A B)) (_ : is_true (@fproper K B C)), is_true (@fproper K A C) *) rewrite !fproperEcard => sAB /andP [sBC lt_BC]. (* Goal: is_true (andb (@fsubset K A C) (leq (S (@size (Choice.sort K) (@enum_fset K A))) (@size (Choice.sort K) (@enum_fset K C)))) *) by rewrite (fsubset_trans sAB) //= (leq_ltn_trans _ lt_BC) // fsubset_leq_card. Qed. Lemma fsubset_neq0 A B : A `<=` B -> A != fset0 -> B != fset0. Proof. (* Goal: forall (_ : is_true (@fsubset K A B)) (_ : is_true (negb (@eq_op (fset_eqType K) A (@fset0 K)))), is_true (negb (@eq_op (fset_eqType K) B (@fset0 K))) *) by rewrite -!fproper0 => sAB /fproper_sub_trans->. Qed. Lemma fsub0 A : fsub A fset0 = set0 :> {set A}. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (fsub A (@fset0 K)) (@set0 (@fset_sub_finType K A)) *) by apply/setP => x; rewrite !inE. Qed. Lemma fsubT A : fsub A A = [set : A]. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (fsub A A) (@setTfor (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) *) by apply/setP => x; rewrite !inE (valP x). Qed. Lemma fsub1 A a (aA : a \in A) : fsub A [fset a] = [set [` aA]] :> {set A}. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (fsub A (@fset1 K a)) (@set1 (@fset_sub_finType K A) (@FSetSub K A a aA)) *) by apply/setP=> x; rewrite !inE; congr eq_op. Qed. Lemma fsubU C A B : fsub C (A `|` B) = fsub C A :|: fsub C B. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K C) (Phant (@fset_sub_type K C))) (fsub C (@fsetU K A B)) (@setU (@fset_sub_finType K C) (fsub C A) (fsub C B)) *) by apply/setP => x; rewrite !inE. Qed. Lemma fsubI C A B : fsub C (A `&` B) = fsub C A :&: fsub C B. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K C) (Phant (@fset_sub_type K C))) (fsub C (@fsetI K A B)) (@setI (@fset_sub_finType K C) (fsub C A) (fsub C B)) *) by apply/setP => x; rewrite !inE. Qed. Lemma fsubD C A B : fsub C (A `\` B) = fsub C A :\: fsub C B. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K C) (Phant (@fset_sub_type K C))) (fsub C (@fsetD K A B)) (@setD (@fset_sub_finType K C) (fsub C A) (fsub C B)) *) by apply/setP => x; rewrite !inE andbC. Qed. Lemma fsubD1 C A b (bC : b \in C) : fsub C (A `\ b) = fsub C A :\ [` bC]. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K C) (Phant (@fset_sub_type K C))) (fsub C (@fsetD K A (@fset1 K b))) (@setD (@fset_sub_finType K C) (fsub C A) (@set1 (@fset_sub_finType K C) (@FSetSub K C b bC))) *) by rewrite fsubD fsub1. Qed. Lemma fsub_eq0 A B : A `<=` B -> (fsub B A == set0) = (A == fset0). Proof. (* Goal: forall _ : is_true (@fsubset K A B), @eq bool (@eq_op (set_of_eqType (@fset_sub_finType K B)) (fsub B A) (@set0 (@fset_sub_finType K B))) (@eq_op (fset_eqType K) A (@fset0 K)) *) by move=> sAB; rewrite -fsub0 (inj_in_eq (@fsub_inj _)) -?topredE /=. Qed. Lemma fset_0Vmem A : (A = fset0) + {x : K | x \in A}. Proof. (* Goal: sum (@eq (@finset_of K (Phant (Choice.sort K))) A (@fset0 K)) (@sig (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) have [|[x mem_x]] := set_0Vmem (fsub A A); last first. (* Goal: forall _ : @eq (@set_of (@fset_sub_finType K A) (Phant (Finite.sort (@fset_sub_finType K A)))) (fsub A A) (@set0 (@fset_sub_finType K A)), sum (@eq (@finset_of K (Phant (Choice.sort K))) A (@fset0 K)) (@sig (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) (* Goal: sum (@eq (@finset_of K (Phant (Choice.sort K))) A (@fset0 K)) (@sig (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) by right; exists (val x); rewrite inE // in mem_x. (* Goal: forall _ : @eq (@set_of (@fset_sub_finType K A) (Phant (Finite.sort (@fset_sub_finType K A)))) (fsub A A) (@set0 (@fset_sub_finType K A)), sum (@eq (@finset_of K (Phant (Choice.sort K))) A (@fset0 K)) (@sig (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) by move=> /eqP; rewrite fsub_eq0 // => /eqP; left. Qed. Lemma fset1P x a : reflect (x = a) (x \in [fset a]). Proof. (* Goal: Bool.reflect (@eq (Choice.sort K) x a) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fset1 K a))) *) by rewrite inE; exact: eqP. Qed. Lemma fset11 x : x \in [fset x]. Proof. (* Goal: is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fset1 K x))) *) by rewrite inE. Qed. Lemma fset1_inj : injective (@fset1 K). Proof. (* Goal: @injective (@finset_of K (Phant (Choice.sort K))) (Choice.sort K) (@fset1 K) *) by move=> a b eqsab; apply/fset1P; rewrite -eqsab fset11. Qed. Lemma fset1UP x a B : reflect (x = a \/ x \in B) (x \in a |` B). Proof. (* Goal: Bool.reflect (or (@eq (Choice.sort K) x a) (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fset1 K a) B))) *) by rewrite !inE; exact: predU1P. Qed. Lemma fset_cons a s : [fset[key] x in a :: s] = a |` [fset[key] x in s]. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) (@cons (Choice.sort K) a s))) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@cons (Choice.sort K) a s)))) (@fsetU K (@fset1 K a) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) s)) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) s)))) *) by apply/fsetP=> x; rewrite in_fset_cons !inE. Qed. Lemma fset_nil : [fset[key] x in [::] : seq K] = fset0. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) (@nil (Choice.sort K)))) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@nil (Choice.sort K) : list (Choice.sort K))))) (@fset0 K) *) by apply/fsetP=> x; rewrite in_fset_nil. Qed. Lemma fset_cat s s' : [fset[key] x in s ++ s'] = [fset[key] x in s] `|` [fset[key] x in s']. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) (@cat (Choice.sort K) s s'))) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@cat (Choice.sort K) s s')))) (@fsetU K (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) s)) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) s))) (@Imfset.imfset key K K (fun x : Choice.sort K => x : Choice.sort K) (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fin_finpred (Choice.eqType K) (seq_finpredType (Choice.eqType K)) s')) (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) s')))) *) by apply/fsetP=> x; rewrite !inE !in_fset_cat. Qed. Lemma fset1Ur x a B : x \in B -> x \in a |` B. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)), is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fset1 K a) B))) *) by move=> Bx; rewrite !inE predU1r. Qed. Lemma fsetU1l x A b : x \in A -> x \in A `|` [fset b]. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)), is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K A (@fset1 K b)))) *) by move=> Ax; rewrite !inE Ax. Qed. Lemma fsetU1r A b : b \in A `|` [fset b]. Proof. (* Goal: is_true (@in_mem (Choice.sort K) b (@mem (Choice.sort K) (finSetPredType K) (@fsetU K A (@fset1 K b)))) *) by rewrite !inE eqxx orbT. Qed. Lemma fsetD1P x A b : reflect (x != b /\ x \in A) (x \in A `\ b). Proof. (* Goal: Bool.reflect (and (is_true (negb (@eq_op (Choice.eqType K) x b))) (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A (@fset1 K b)))) *) by rewrite !inE; exact: andP. Qed. Lemma fsetD1K a A : a \in A -> a |` (A `\ a) = A. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)), @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fset1 K a) (@fsetD K A (@fset1 K a))) A *) by move=> Aa; apply/fsetP=> x; rewrite !inE; case: eqP => // ->. Qed. Lemma fsetU1K a B : a \notin B -> (a |` B) `\ a = B. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))), @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K (@fsetU K (@fset1 K a) B) (@fset1 K a)) B *) by move/negPf=> nBa; apply/fsetP=> x; rewrite !inE; case: eqP => // ->. Qed. Lemma fset2P x a b : reflect (x = a \/ x = b) (x \in [fset a; b]). Proof. (* Goal: Bool.reflect (or (@eq (Choice.sort K) x a) (@eq (Choice.sort K) x b)) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fset1 K a) (@fset1 K b)))) *) by rewrite !inE; apply: (iffP orP) => [] [] /eqP ->; [left|right|left|right]. Qed. Lemma in_fset2 x a b : (x \in [fset a; b]) = (x == a) || (x == b). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fset1 K a) (@fset1 K b)))) (orb (@eq_op (Choice.eqType K) x a) (@eq_op (Choice.eqType K) x b)) *) by rewrite !inE. Qed. Lemma fset21 a b : a \in [fset a; b]. Proof. by rewrite fset1U1. Qed. Proof. (* Goal: is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fset1 K a) (@fset1 K b)))) *) by rewrite fset1U1. Qed. Lemma fsetUP x A B : reflect (x \in A \/ x \in B) (x \in A `|` B). Proof. (* Goal: Bool.reflect (or (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K A B))) *) by rewrite !inE; exact: orP. Qed. Lemma fsetULVR x A B : x \in A `|` B -> (x \in A) + (x \in B). Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K A B))), sum (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))) *) by rewrite inE; case: (x \in A); [left|right]. Qed. Lemma fsetUS A B C : A `<=` B -> C `|` A `<=` C `|` B. Proof. (* Goal: forall _ : is_true (@fsubset K A B), is_true (@fsubset K (@fsetU K C A) (@fsetU K C B)) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (orb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))), is_true (orb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))) *) by case: (x \in C) => //; exact: (fsubsetP sAB). Qed. Lemma fsetSU A B C : A `<=` B -> A `|` C `<=` B `|` C. Proof. (* Goal: forall _ : is_true (@fsubset K A B), is_true (@fsubset K (@fsetU K A C) (@fsetU K B C)) *) by move=> sAB; rewrite -!(fsetUC C) fsetUS. Qed. Lemma fsetUSS A B C D : A `<=` C -> B `<=` D -> A `|` B `<=` C `|` D. Proof. (* Goal: forall (_ : is_true (@fsubset K A C)) (_ : is_true (@fsubset K B D)), is_true (@fsubset K (@fsetU K A B) (@fsetU K C D)) *) by move=> /(fsetSU B) /fsubset_trans sAC /(fsetUS C)/sAC. Qed. Lemma fset0U A : fset0 `|` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fset0 K) A) A *) by apply/fsetP => x; rewrite !inE orFb. Qed. Lemma fsetU0 A : A `|` fset0 = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fset0 K)) A *) by rewrite fsetUC fset0U. Qed. Lemma fsetIP x A B : reflect (x \in A /\ x \in B) (x \in A `&` B). Proof. (* Goal: Bool.reflect (and (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetI K A B))) *) by rewrite inE; apply: andP. Qed. Lemma fsetIS A B C : A `<=` B -> C `&` A `<=` C `&` B. Proof. (* Goal: forall _ : is_true (@fsubset K A B), is_true (@fsubset K (@fsetI K C A) (@fsetI K C B)) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))), is_true (andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))) *) by case: (x \in C) => //; exact: (fsubsetP sAB). Qed. Lemma fsetSI A B C : A `<=` B -> A `&` C `<=` B `&` C. Proof. (* Goal: forall _ : is_true (@fsubset K A B), is_true (@fsubset K (@fsetI K A C) (@fsetI K B C)) *) by move=> sAB; rewrite -!(fsetIC C) fsetIS. Qed. Lemma fsetISS A B C D : A `<=` C -> B `<=` D -> A `&` B `<=` C `&` D. Proof. (* Goal: forall (_ : is_true (@fsubset K A C)) (_ : is_true (@fsubset K B D)), is_true (@fsubset K (@fsetI K A B) (@fsetI K C D)) *) by move=> /(fsetSI B) /fsubset_trans sAC /(fsetIS C) /sAC. Qed. Lemma fsetDP A B x : reflect (x \in A /\ x \notin B) (x \in A `\` B). Proof. (* Goal: Bool.reflect (and (is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) (is_true (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A B))) *) by rewrite inE andbC; apply: andP. Qed. Lemma fsetSD C A B : A `<=` B -> A `\` C `<=` B `\` C. Proof. (* Goal: forall _ : is_true (@fsubset K A B), is_true (@fsubset K (@fsetD K A C) (@fsetD K B C)) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE. (* Goal: forall _ : is_true (andb (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))), is_true (andb (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))) *) by case: (x \in C) => //; exact: (fsubsetP sAB). Qed. Lemma fsetDS C A B : A `<=` B -> C `\` B `<=` C `\` A. Proof. (* Goal: forall _ : is_true (@fsubset K A B), is_true (@fsubset K (@fsetD K C B) (@fsetD K C A)) *) move=> sAB; apply/fsubsetP=> x; rewrite !inE ![_ && (_ \in _)]andbC. (* Goal: forall _ : is_true (andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)))), is_true (andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) by case: (x \in C) => //; apply: contra; exact: (fsubsetP sAB). Qed. Lemma fsetDSS A B C D : A `<=` C -> D `<=` B -> A `\` B `<=` C `\` D. Proof. (* Goal: forall (_ : is_true (@fsubset K A C)) (_ : is_true (@fsubset K D B)), is_true (@fsubset K (@fsetD K A B) (@fsetD K C D)) *) by move=> /(fsetSD B) /fsubset_trans sAC /(fsetDS C) /sAC. Qed. Lemma fsetD0 A : A `\` fset0 = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A (@fset0 K)) A *) by apply/fsetP=> x; rewrite !inE. Qed. Lemma fset0D A : fset0 `\` A = fset0. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K (@fset0 K) A) (@fset0 K) *) by apply/fsetP=> x; rewrite !inE andbF. Qed. Lemma fsetDv A : A `\` A = fset0. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A A) (@fset0 K) *) by apply/fsetP=> x; rewrite !inE andNb. Qed. Lemma fsetID B A : A `&` B `|` A `\` B = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetI K A B) (@fsetD K A B)) A *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDUl A B C : (A `|` B) `\` C = (A `\` C) `|` (B `\` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K (@fsetU K A B) C) (@fsetU K (@fsetD K A C) (@fsetD K B C)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDUr A B C : A `\` (B `|` C) = (A `\` B) `&` (A `\` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A (@fsetU K B C)) (@fsetI K (@fsetD K A B) (@fsetD K A C)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDIl A B C : (A `&` B) `\` C = (A `\` C) `&` (B `\` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K (@fsetI K A B) C) (@fsetI K (@fsetD K A C) (@fsetD K B C)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetIDA A B C : A `&` (B `\` C) = (A `&` B) `\` C. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fsetD K B C)) (@fsetD K (@fsetI K A B) C) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetIDAC A B C : (A `\` B) `&` C = (A `&` C) `\` B. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K (@fsetD K A B) C) (@fsetD K (@fsetI K A C) B) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDIr A B C : A `\` (B `&` C) = (A `\` B) `|` (A `\` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A (@fsetI K B C)) (@fsetU K (@fsetD K A B) (@fsetD K A C)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDDl A B C : (A `\` B) `\` C = A `\` (B `|` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K (@fsetD K A B) C) (@fsetD K A (@fsetU K B C)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDDr A B C : A `\` (B `\` C) = (A `\` B) `|` (A `&` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A (@fsetD K B C)) (@fsetU K (@fsetD K A B) (@fsetI K A C)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetDK A B : B `<=` A -> A `\` (A `\` B) = B. Proof. (* Goal: forall _ : is_true (@fsubset K B A), @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A (@fsetD K A B)) B *) by rewrite fsetDDr => /fsetIidPr->; rewrite fsetDv fset0U. Qed. Lemma fsetUDl (A B C : {fset K}) : A `|` (B `\` C) = (A `|` B) `\` (C `\` A). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K A (@fsetD K B C)) (@fsetD K (@fsetU K A B) (@fsetD K C A)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsetUDr (A B C : {fset K}) : (A `\` B) `|` C = (A `|` C) `\` (B `\` C). Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fsetD K A B) C) (@fsetD K (@fsetU K A C) (@fsetD K B C)) *) by apply/fsetP=> x; rewrite !inE; do ?case: (_ \in _). Qed. Lemma fsubsetIl A B : A `&` B `<=` A. Proof. (* Goal: is_true (@fsubset K (@fsetI K A B) A) *) by apply/fsubsetP=> x; rewrite inE => /andP []. Qed. Lemma fsubsetIr A B : A `&` B `<=` B. Proof. (* Goal: is_true (@fsubset K (@fsetI K A B) B) *) by apply/fsubsetP=> x; rewrite inE => /andP []. Qed. Lemma fsubsetDl A B : A `\` B `<=` A. Proof. (* Goal: is_true (@fsubset K (@fsetD K A B) A) *) by apply/fsubsetP=> x; rewrite inE => /andP []. Qed. Lemma fsubD1set A x : A `\ x `<=` A. Proof. (* Goal: is_true (@fsubset K (@fsetD K A (@fset1 K x)) A) *) by rewrite fsubsetDl. Qed. Lemma fsubsetD2l C A B : A `<=` C -> B `<=` C -> (C `\` B `<=` C `\` A) = (A `<=` B). Hint Resolve fsubsetIl fsubsetIr fsubsetDl fsubD1set. Lemma card_finset (T : finType) (P : pred T) : #|` [fset x in P] | = #|P|. Proof. (* Goal: @eq nat (@size (Choice.sort (Finite.choiceType T)) (@enum_fset (Finite.choiceType T) (@Imfset.imfset imfset_key (Finite.choiceType T) (Finite.choiceType T) (fun x : Choice.sort (Finite.choiceType T) => x : Choice.sort (Finite.choiceType T)) (@mem_fin (Choice.eqType (Finite.choiceType T)) (predPredType (Finite.sort T)) (@fin_finpred (Choice.eqType (Finite.choiceType T)) (pred_finpredType T) P)) (Phantom (mem_pred (Finite.sort T)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) P))))) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) P)) *) by rewrite card_imfset //= -cardE. Qed. Lemma card_fset (T : choiceType) (A : {fset T}) : #|` [fset x in A] | = #|` A|. Proof. (* Goal: @eq nat (@size (Choice.sort T) (@enum_fset T (@Imfset.imfset imfset_key T T (fun x : Choice.sort T => x : Choice.sort T) (@mem_fin (Choice.eqType T) (finSetPredType T) (@fin_finpred (Choice.eqType T) (fset_finpredType T) A)) (Phantom (mem_pred (Choice.sort T)) (@mem (Choice.sort T) (finSetPredType T) A))))) (@size (Choice.sort T) (@enum_fset T A)) *) by rewrite card_imfset. Qed. Lemma card_fseq (T : choiceType) (s : seq T) : #|` [fset x in s] | = size (undup s). Proof. (* Goal: @eq nat (@size (Choice.sort T) (@enum_fset T (@Imfset.imfset imfset_key T T (fun x : Choice.sort T => x : Choice.sort T) (@mem_fin (Choice.eqType T) (seq_predType (Choice.eqType T)) (@fin_finpred (Choice.eqType T) (seq_finpredType (Choice.eqType T)) s)) (Phantom (mem_pred (Equality.sort (Choice.eqType T))) (@mem (Equality.sort (Choice.eqType T)) (seq_predType (Choice.eqType T)) s))))) (@size (Equality.sort (Choice.eqType T)) (@undup (Choice.eqType T) s)) *) by rewrite card_imfset. Qed. Lemma cardfs0 : #|` @fset0 K| = 0. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fset0 K))) O *) by rewrite -(@card_fsub fset0) // fsub0 cards0. Qed. Lemma cardfT0 : #|{: @fset0 K}| = 0. Proof. (* Goal: @eq nat (@card (@fset_sub_finType K (@fset0 K)) (@mem (@fset_sub_type K (@fset0 K)) (predPredType (@fset_sub_type K (@fset0 K) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@fset0 K) : predArgType) (pred_of_argType (@fset_sub_type K (@fset0 K) : predArgType))))) O *) by rewrite -cardfE cardfs0. Qed. Lemma cardfs_eq0 A : (#|` A| == 0) = (A == fset0). Proof. (* Goal: @eq bool (@eq_op nat_eqType (@size (Choice.sort K) (@enum_fset K A)) O) (@eq_op (fset_eqType K) A (@fset0 K)) *) by rewrite -(@card_fsub A) // cards_eq0 fsub_eq0. Qed. Lemma cardfs0_eq A : #|` A| = 0 -> A = fset0. Proof. (* Goal: forall _ : @eq nat (@size (Choice.sort K) (@enum_fset K A)) O, @eq (@finset_of K (Phant (Choice.sort K))) A (@fset0 K) *) by move=> /eqP; rewrite cardfs_eq0 => /eqP. Qed. Lemma fset0Pn A : reflect (exists x, x \in A) (A != fset0). Lemma cardfs_gt0 A : (0 < #|` A|)%N = (A != fset0). Proof. (* Goal: @eq bool (leq (S O) (@size (Choice.sort K) (@enum_fset K A))) (negb (@eq_op (fset_eqType K) A (@fset0 K))) *) by rewrite lt0n cardfs_eq0. Qed. Lemma cardfs1 x : #|` [fset x]| = 1. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fset1 K x))) (S O) *) by rewrite card_imfset. Qed. Lemma cardfsUI A B : #|` A `|` B| + #|` A `&` B| = #|` A| + #|` B|. Proof. (* Goal: @eq nat (addn (@size (Choice.sort K) (@enum_fset K (@fsetU K A B))) (@size (Choice.sort K) (@enum_fset K (@fsetI K A B)))) (addn (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K B))) *) rewrite -!(@card_fsub (A `|` B)) ?(fsubset_trans (fsubsetIl _ _)) //. (* Goal: @eq nat (addn (@card (@fset_sub_finType K (@fsetU K A B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) (@fsetU K A B))))) (@card (@fset_sub_finType K (@fsetU K A B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) (@fsetI K A B)))))) (addn (@card (@fset_sub_finType K (@fsetU K A B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) A)))) (@card (@fset_sub_finType K (@fsetU K A B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K A B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K A B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K A B)) (fsub (@fsetU K A B) B))))) *) by rewrite fsubU fsubI cardsUI. Qed. Lemma cardfsU A B : #|` A `|` B| = (#|` A| + #|` B| - #|` A `&` B|)%N. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fsetU K A B))) (subn (addn (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K B))) (@size (Choice.sort K) (@enum_fset K (@fsetI K A B)))) *) by rewrite -cardfsUI addnK. Qed. Lemma cardfsI A B : #|` A `&` B| = (#|` A| + #|` B| - #|` A `|` B|)%N. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fsetI K A B))) (subn (addn (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K B))) (@size (Choice.sort K) (@enum_fset K (@fsetU K A B)))) *) by rewrite -cardfsUI addKn. Qed. Lemma cardfsID B A : #|` A `&` B| + #|` A `\` B| = #|` A|. Proof. (* Goal: @eq nat (addn (@size (Choice.sort K) (@enum_fset K (@fsetI K A B))) (@size (Choice.sort K) (@enum_fset K (@fsetD K A B)))) (@size (Choice.sort K) (@enum_fset K A)) *) by rewrite -!(@card_fsub A) // fsubI fsubD cardsID. Qed. Lemma cardfsD A B : #|` A `\` B| = (#|` A| - #|` A `&` B|)%N. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fsetD K A B))) (subn (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K (@fsetI K A B)))) *) by rewrite -(cardfsID B A) addKn. Qed. Lemma mem_fset1U a A : a \in A -> a |` A = A. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)), @eq (@finset_of K (Phant (Choice.sort K))) (@fsetU K (@fset1 K a) A) A *) move=> aA; apply/fsetP => x; rewrite !inE orbC. (* Goal: @eq bool (orb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@eq_op (Choice.eqType K) x a)) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) *) by have [//|/=] := boolP (_ \in A); apply: contraNF => /eqP ->. Qed. Lemma mem_fsetD1 a A : a \notin A -> A `\ a = A. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))), @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A (@fset1 K a)) A *) move=> aA; apply/fsetP => x; rewrite !inE andbC. (* Goal: @eq bool (andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (negb (@eq_op (Choice.eqType K) x a))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) *) by have [/= xA|//] := boolP (_ \in A); apply: contraNneq aA => <-. Qed. Lemma fsetI1 a A : A `&` [fset a] = if a \in A then [fset a] else fset0. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A (@fset1 K a)) (if @in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A) then @fset1 K a else @fset0 K) *) apply/fsetP => x; rewrite (fun_if (fun X => _ \in X)) !inE. (* Goal: @eq bool (andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@eq_op (Choice.eqType K) x a)) (if @in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A) then @eq_op (Choice.eqType K) x a else false) *) by have [[->|?] []] := (altP (x =P a), boolP (a \in A)); rewrite ?andbF. Qed. Lemma cardfsU1 a A : #|` a |` A| = (a \notin A) + #|` A|. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fsetU K (@fset1 K a) A))) (addn (nat_of_bool (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)))) (@size (Choice.sort K) (@enum_fset K A))) *) have [aA|aNA] := boolP (a \in A); first by rewrite mem_fset1U. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fsetU K (@fset1 K a) A))) (addn (nat_of_bool (negb false)) (@size (Choice.sort K) (@enum_fset K A))) *) rewrite cardfsU -addnBA ?fsubset_leq_card // fsetIC -cardfsD. (* Goal: @eq nat (addn (@size (Choice.sort K) (@enum_fset K (@fset1 K a))) (@size (Choice.sort K) (@enum_fset K (@fsetD K A (@fset1 K a))))) (addn (nat_of_bool (negb false)) (@size (Choice.sort K) (@enum_fset K A))) *) by rewrite mem_fsetD1 // cardfs1. Qed. Lemma cardfs2 a b : #|` [fset a; b]| = (a != b).+1. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K (@fsetU K (@fset1 K a) (@fset1 K b)))) (S (nat_of_bool (negb (@eq_op (Choice.eqType K) a b)))) *) by rewrite !cardfsU1 cardfs1 inE addn1. Qed. Lemma cardfsD1 a A : #|` A| = (a \in A) + #|` A `\ a|. Proof. (* Goal: @eq nat (@size (Choice.sort K) (@enum_fset K A)) (addn (nat_of_bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))) (@size (Choice.sort K) (@enum_fset K (@fsetD K A (@fset1 K a))))) *) rewrite -(cardfsID [fset a]) fsetI1 (fun_if (fun A => #|` A|)). (* Goal: @eq nat (addn (if @in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A) then @size (Choice.sort K) (@enum_fset K (@fset1 K a)) else @size (Choice.sort K) (@enum_fset K (@fset0 K))) (@size (Choice.sort K) (@enum_fset K (@fsetD K A (@fset1 K a))))) (addn (nat_of_bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))) (@size (Choice.sort K) (@enum_fset K (@fsetD K A (@fset1 K a))))) *) by rewrite cardfs0 cardfs1; case: (_ \in _). Qed. Lemma fsub1set A x : ([fset x] `<=` A) = (x \in A). Proof. (* Goal: @eq bool (@fsubset K (@fset1 K x) A) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) *) rewrite -(@subset_fsubE (x |` A)) // fsub1 ?fset1U1 // => xxA. (* Goal: @eq bool (@subset (@fset_sub_finType K (@fsetU K (@fset1 K x) A)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fset1 K x) A)) (@set1 (@fset_sub_finType K (@fsetU K (@fset1 K x) A)) (@FSetSub K (@fsetU K (@fset1 K x) A) x xxA)))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fset1 K x) A)) (fsub (@fsetU K (@fset1 K x) A) A)))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) *) by rewrite sub1set inE. Qed. Lemma cardfs1P A : reflect (exists x, A = [fset x]) (#|` A| == 1). Lemma fsubset1 A x : (A `<=` [fset x]) = (A == [fset x]) || (A == fset0). Proof. (* Goal: @eq bool (@fsubset K A (@fset1 K x)) (orb (@eq_op (fset_eqType K) A (@fset1 K x)) (@eq_op (fset_eqType K) A (@fset0 K))) *) rewrite eqEfcard cardfs1 -cardfs_eq0 orbC andbC. (* Goal: @eq bool (@fsubset K A (@fset1 K x)) (orb (@eq_op nat_eqType (@size (Choice.sort K) (@enum_fset K A)) O) (andb (leq (S O) (@size (Choice.sort K) (@enum_fset K A))) (@fsubset K A (@fset1 K x)))) *) by case: posnP => // A0; rewrite (cardfs0_eq A0) fsub0set. Qed. Arguments fsetIidPl {A B}. Lemma cardfsDS A B : B `<=` A -> #|` A `\` B| = (#|` A| - #|` B|)%N. Proof. (* Goal: forall _ : is_true (@fsubset K B A), @eq nat (@size (Choice.sort K) (@enum_fset K (@fsetD K A B))) (subn (@size (Choice.sort K) (@enum_fset K A)) (@size (Choice.sort K) (@enum_fset K B))) *) by rewrite cardfsD => /fsetIidPr->. Qed. Lemma fsubIset A B C : (B `<=` A) || (C `<=` A) -> (B `&` C `<=` A). Proof. (* Goal: forall _ : is_true (orb (@fsubset K B A) (@fsubset K C A)), is_true (@fsubset K (@fsetI K B C) A) *) by case/orP; apply: fsubset_trans; rewrite (fsubsetIl, fsubsetIr). Qed. Lemma fsubsetI A B C : (A `<=` B `&` C) = (A `<=` B) && (A `<=` C). Proof. (* Goal: @eq bool (@fsubset K A (@fsetI K B C)) (andb (@fsubset K A B) (@fsubset K A C)) *) rewrite !(sameP fsetIidPl eqP) fsetIA; have [-> //| ] := altP (A `&` B =P A). (* Goal: forall _ : is_true (negb (@eq_op (fset_eqType K) (@fsetI K A B) A)), @eq bool (@eq_op (fset_eqType K) (@fsetI K (@fsetI K A B) C) A) (andb false (@eq_op (fset_eqType K) (@fsetI K A C) A)) *) by apply: contraNF => /eqP <-; rewrite -fsetIA -fsetIIl fsetIAC. Qed. Lemma fsubsetIP A B C : reflect (A `<=` B /\ A `<=` C) (A `<=` B `&` C). Proof. (* Goal: Bool.reflect (and (is_true (@fsubset K A B)) (is_true (@fsubset K A C))) (@fsubset K A (@fsetI K B C)) *) by rewrite fsubsetI; exact: andP. Qed. Lemma fsubUset A B C : (B `|` C `<=` A) = (B `<=` A) && (C `<=` A). Proof. (* Goal: @eq bool (@fsubset K (@fsetU K B C) A) (andb (@fsubset K B A) (@fsubset K C A)) *) apply/idP/idP => [subA|/andP [AB CA]]; last by rewrite -[A]fsetUid fsetUSS. (* Goal: is_true (andb (@fsubset K B A) (@fsubset K C A)) *) by rewrite !(fsubset_trans _ subA). Qed. Lemma fsubUsetP A B C : reflect (A `<=` C /\ B `<=` C) (A `|` B `<=` C). Proof. (* Goal: Bool.reflect (and (is_true (@fsubset K A C)) (is_true (@fsubset K B C))) (@fsubset K (@fsetU K A B) C) *) by rewrite fsubUset; exact: andP. Qed. Lemma fsubDset A B C : (A `\` B `<=` C) = (A `<=` B `|` C). Proof. (* Goal: @eq bool (@fsubset K (@fsetD K A B) C) (@fsubset K A (@fsetU K B C)) *) apply/fsubsetP/fsubsetP=> sABC x; rewrite !inE. (* Goal: forall _ : is_true (andb (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))), is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) *) (* Goal: forall _ : is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)), is_true (orb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C))) *) by case Bx: (x \in B) => // Ax; rewrite sABC ?in_fsetD ?Bx. (* Goal: forall _ : is_true (andb (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))), is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) *) by case Bx: (x \in B) => //; move/sABC; rewrite inE Bx. Qed. Lemma fsetU_eq0 A B : (A `|` B == fset0) = (A == fset0) && (B == fset0). Proof. (* Goal: @eq bool (@eq_op (fset_eqType K) (@fsetU K A B) (@fset0 K)) (andb (@eq_op (fset_eqType K) A (@fset0 K)) (@eq_op (fset_eqType K) B (@fset0 K))) *) by rewrite -!fsubset0 fsubUset. Qed. Lemma fsubsetD1 A B x : (A `<=` B `\ x) = (A `<=` B) && (x \notin A). Proof. (* Goal: @eq bool (@fsubset K A (@fsetD K B (@fset1 K x))) (andb (@fsubset K A B) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) do !rewrite -(@subset_fsubE (x |` A `|` B)) ?fsubDset ?fsetUA // 1?fsetUAC //. (* Goal: @eq bool (@subset (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) A))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) (@fsetD K B (@fset1 K x)))))) (andb (@subset (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) A))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) B)))) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) rewrite fsubD1 => [|mem_x]; first by rewrite -fsetUA fset1U1. (* Goal: @eq bool (@subset (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) A))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (@setD (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) B) (@set1 (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (@FSetSub K (@fsetU K (@fsetU K (@fset1 K x) A) B) x mem_x)))))) (andb (@subset (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) A))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fsetU K (@fset1 K x) A) B)) (fsub (@fsetU K (@fsetU K (@fset1 K x) A) B) B)))) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))) *) by rewrite subsetD1 // inE. Qed. Lemma fsubsetD1P A B x : reflect (A `<=` B /\ x \notin A) (A `<=` B `\ x). Proof. (* Goal: Bool.reflect (and (is_true (@fsubset K A B)) (is_true (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))) (@fsubset K A (@fsetD K B (@fset1 K x))) *) by rewrite fsubsetD1; exact: andP. Qed. Lemma fsubsetPn A B : reflect (exists2 x, x \in A & x \notin B) (~~ (A `<=` B)). Proof. (* Goal: Bool.reflect (@ex2 (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) (fun x : Choice.sort K => is_true (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))))) (negb (@fsubset K A B)) *) rewrite -fsetD_eq0; apply: (iffP (fset0Pn _)) => [[x]|[x xA xNB]]. (* Goal: @ex (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A B)))) *) (* Goal: forall _ : is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A B))), @ex2 (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) (fun x : Choice.sort K => is_true (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)))) *) by rewrite inE => /andP[]; exists x. (* Goal: @ex (Choice.sort K) (fun x : Choice.sort K => is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A B)))) *) by exists x; rewrite inE xA xNB. Qed. Lemma fproperD1 A x : x \in A -> A `\ x `<` A. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)), is_true (@fproper K (@fsetD K A (@fset1 K x)) A) *) move=> Ax; rewrite fproperE fsubsetDl; apply/fsubsetPn; exists x=> //. (* Goal: is_true (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetD K A (@fset1 K x))))) *) by rewrite in_fsetD1 Ax eqxx. Qed. Lemma fproperIr A B : ~~ (B `<=` A) -> A `&` B `<` B. Proof. (* Goal: forall _ : is_true (negb (@fsubset K B A)), is_true (@fproper K (@fsetI K A B) B) *) by move=> nsAB; rewrite fproperE fsubsetIr fsubsetI negb_and nsAB. Qed. Lemma fproperIl A B : ~~ (A `<=` B) -> A `&` B `<` A. Proof. (* Goal: forall _ : is_true (negb (@fsubset K A B)), is_true (@fproper K (@fsetI K A B) A) *) by move=> nsBA; rewrite fproperE fsubsetIl fsubsetI negb_and nsBA orbT. Qed. Lemma fproperUr A B : ~~ (A `<=` B) -> B `<` A `|` B. Proof. (* Goal: forall _ : is_true (negb (@fsubset K A B)), is_true (@fproper K B (@fsetU K A B)) *) by rewrite fproperE fsubsetUr fsubUset fsubset_refl /= andbT. Qed. Lemma fproperUl A B : ~~ (B `<=` A) -> A `<` A `|` B. Proof. (* Goal: forall _ : is_true (negb (@fsubset K B A)), is_true (@fproper K A (@fsetU K A B)) *) by move=> not_sBA; rewrite fsetUC fproperUr. Qed. Lemma fproper1set A x : ([fset x] `<` A) -> (x \in A). Proof. (* Goal: forall _ : is_true (@fproper K (@fset1 K x) A), is_true (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) *) by move/fproper_sub; rewrite fsub1set. Qed. Lemma fproperIset A B C : (B `<` A) || (C `<` A) -> (B `&` C `<` A). Proof. (* Goal: forall _ : is_true (orb (@fproper K B A) (@fproper K C A)), is_true (@fproper K (@fsetI K B C) A) *) by case/orP; apply: fsub_proper_trans; rewrite (fsubsetIl, fsubsetIr). Qed. Lemma fproperI A B C : (A `<` B `&` C) -> (A `<` B) && (A `<` C). Lemma fproperU A B C : (B `|` C `<` A) -> (B `<` A) && (C `<` A). Lemma fsetDpS C A B : B `<=` C -> A `<` B -> C `\` B `<` C `\` A. Proof. (* Goal: forall (_ : is_true (@fsubset K B C)) (_ : is_true (@fproper K A B)), is_true (@fproper K (@fsetD K C B) (@fsetD K C A)) *) move=> subBC subAB; rewrite fproperEneq fsetDS 1?fproper_sub// andbT. (* Goal: is_true (negb (@eq_op (fset_eqType K) (@fsetD K C B) (@fsetD K C A))) *) apply/negP => /eqP /(congr1 (fsetD C)); rewrite !fsetDK // => [eqAB//|]. (* Goal: is_true (@fsubset K A C) *) (* Goal: False *) by rewrite eqAB (negPf (fproper_irrefl _)) in subAB. (* Goal: is_true (@fsubset K A C) *) by apply: fsubset_trans subBC; apply: fproper_sub. Qed. Lemma fproperD2l C A B : A `<=` C -> B `<=` C -> (C `\` B `<` C `\` A) = (A `<` B). Lemma fsetI_eq0 A B : (A `&` B == fset0) = [disjoint A & B]. Proof. (* Goal: @eq bool (@eq_op (fset_eqType K) (@fsetI K A B) (@fset0 K)) (@fdisjoint K A B) *) by []. Qed. Lemma fdisjoint_sub {A B} : [disjoint A & B]%fset -> forall C : {fset K}, [disjoint fsub C A & fsub C B]%bool. Proof. (* Goal: forall (_ : is_true (@fdisjoint K A B)) (C : @finset_of K (Phant (Choice.sort K))), is_true (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) *) move=> disjointAB C; apply/pred0P => a /=; rewrite !inE. (* Goal: @eq bool (andb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (@fset_sub_subType K C) a) (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) C)) (@fset_sub_subType K C) a) (@mem (Choice.sort K) (finSetPredType K) B))) false *) by have /eqP /fsetP /(_ (val a)) := disjointAB; rewrite !inE. Qed. Lemma disjoint_fsub C A B : A `|` B `<=` C -> [disjoint fsub C A & fsub C B]%bool = [disjoint A & B]. Proof. (* Goal: forall _ : is_true (@fsubset K (@fsetU K A B) C), @eq bool (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) (@fdisjoint K A B) *) move=> ABsubC. (* Goal: @eq bool (@disjoint (@fset_sub_finType K C) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C A))) (@mem (Finite.sort (@fset_sub_finType K C)) (predPredType (Finite.sort (@fset_sub_finType K C))) (@SetDef.pred_of_set (@fset_sub_finType K C) (fsub C B)))) (@fdisjoint K A B) *) apply/idP/idP=> [/pred0P DAB|/fdisjoint_sub->//]; apply/eqP/fsetP=> a. (* Goal: @eq bool (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetI K A B))) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fset0 K))) *) rewrite !inE; have [aC|] := boolP (a \in A `|` B); last first. (* Goal: @eq bool (andb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) false *) (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) (@fsetU K A B)))), @eq bool (andb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) false *) by rewrite !inE => /norP [/negPf-> /negPf->]. (* Goal: @eq bool (andb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) false *) by have /= := DAB [` fsubsetP ABsubC _ aC]; rewrite !inE. Qed. Lemma fdisjointP {A B} : reflect (forall a, a \in A -> a \notin B) [disjoint A & B]%fset. Proof. (* Goal: Bool.reflect (forall (a : Choice.sort K) (_ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))), is_true (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B)))) (@fdisjoint K A B) *) apply: (iffP eqP) => [AIB_eq0 a aA|neq_ab]. (* Goal: @eq (Equality.sort (fset_eqType K)) (@fsetI K A B) (@fset0 K) *) (* Goal: is_true (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) *) by have /fsetP /(_ a) := AIB_eq0; rewrite !inE aA /= => ->. (* Goal: @eq (Equality.sort (fset_eqType K)) (@fsetI K A B) (@fset0 K) *) apply/fsetP => a; rewrite !inE. (* Goal: @eq bool (andb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B))) false *) by case: (boolP (a \in A)) => // /neq_ab /negPf ->. Qed. Lemma fsetDidPl A B : reflect (A `\` B = A) [disjoint A & B]%fset. Proof. (* Goal: Bool.reflect (@eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A B) A) (@fdisjoint K A B) *) apply: (iffP fdisjointP)=> [NB|<- a]; last by rewrite inE => /andP[]. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@fsetD K A B) A *) apply/fsetP => a; rewrite !inE andbC. (* Goal: @eq bool (andb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B)))) (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)) *) by case: (boolP (a \in A)) => //= /NB ->. Qed. Lemma disjoint_fsetI0 A B : [disjoint A & B] -> A `&` B = fset0. Proof. (* Goal: forall _ : is_true (@fdisjoint K A B), @eq (@finset_of K (Phant (Choice.sort K))) (@fsetI K A B) (@fset0 K) *) by rewrite -fsetI_eq0; move/eqP. Qed. Lemma fsubsetD A B C : (A `<=` (B `\` C)) = (A `<=` B) && [disjoint A & C]%fset. Proof. (* Goal: @eq bool (@fsubset K A (@fsetD K B C)) (andb (@fsubset K A B) (@fdisjoint K A C)) *) pose D := A `|` B `|` C. (* Goal: @eq bool (@fsubset K A (@fsetD K B C)) (andb (@fsubset K A B) (@fdisjoint K A C)) *) have AD : A `<=` D by rewrite /D -fsetUA fsubsetUl. (* Goal: @eq bool (@fsubset K A (@fsetD K B C)) (andb (@fsubset K A B) (@fdisjoint K A C)) *) have BD : B `<=` D by rewrite /D fsetUAC fsubsetUr. (* Goal: @eq bool (@fsubset K A (@fsetD K B C)) (andb (@fsubset K A B) (@fdisjoint K A C)) *) rewrite -(@subset_fsubE D) //; last first. (* Goal: @eq bool (@subset (@fset_sub_finType K D) (@mem (Finite.sort (@fset_sub_finType K D)) (predPredType (Finite.sort (@fset_sub_finType K D))) (@SetDef.pred_of_set (@fset_sub_finType K D) (fsub D A))) (@mem (Finite.sort (@fset_sub_finType K D)) (predPredType (Finite.sort (@fset_sub_finType K D))) (@SetDef.pred_of_set (@fset_sub_finType K D) (fsub D (@fsetD K B C))))) (andb (@fsubset K A B) (@fdisjoint K A C)) *) (* Goal: is_true (@fsubset K (@fsetD K B C) D) *) by rewrite fsubDset (fsubset_trans BD) // fsubsetUr. (* Goal: @eq bool (@subset (@fset_sub_finType K D) (@mem (Finite.sort (@fset_sub_finType K D)) (predPredType (Finite.sort (@fset_sub_finType K D))) (@SetDef.pred_of_set (@fset_sub_finType K D) (fsub D A))) (@mem (Finite.sort (@fset_sub_finType K D)) (predPredType (Finite.sort (@fset_sub_finType K D))) (@SetDef.pred_of_set (@fset_sub_finType K D) (fsub D (@fsetD K B C))))) (andb (@fsubset K A B) (@fdisjoint K A C)) *) rewrite fsubD subsetD !subset_fsubE // disjoint_fsub //. (* Goal: is_true (@fsubset K (@fsetU K A C) D) *) by rewrite /D fsetUAC fsubsetUl. Qed. Lemma fsubsetDP A B C : reflect (A `<=` B /\ [disjoint A & C]%fset) (A `<=` (B `\` C)). Proof. (* Goal: Bool.reflect (and (is_true (@fsubset K A B)) (is_true (@fdisjoint K A C))) (@fsubset K A (@fsetD K B C)) *) by rewrite fsubsetD; apply: andP. Qed. Lemma fdisjoint_sym A B : [disjoint A & B] = [disjoint B & A]. Proof. (* Goal: @eq bool (@fdisjoint K A B) (@fdisjoint K B A) *) by rewrite -!fsetI_eq0 fsetIC. Qed. Lemma fdisjointP_sym {A B} : reflect (forall a, a \in A -> a \notin B) [disjoint B & A]%fset. Proof. (* Goal: Bool.reflect (forall (a : Choice.sort K) (_ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A))), is_true (negb (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B)))) (@fdisjoint K B A) *) by rewrite fdisjoint_sym; apply: fdisjointP. Qed. Lemma fdisjoint_trans A B C : A `<=` B -> [disjoint B & C] -> [disjoint A & C]. Proof. (* Goal: forall (_ : is_true (@fsubset K A B)) (_ : is_true (@fdisjoint K B C)), is_true (@fdisjoint K A C) *) move=> AsubB; rewrite -!(@disjoint_fsub (B `|` C)) ?fsetSU //. (* Goal: forall _ : is_true (@disjoint (@fset_sub_finType K (@fsetU K B C)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K B C))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K B C)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K B C)) (fsub (@fsetU K B C) B))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K B C))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K B C)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K B C)) (fsub (@fsetU K B C) C)))), is_true (@disjoint (@fset_sub_finType K (@fsetU K B C)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K B C))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K B C)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K B C)) (fsub (@fsetU K B C) A))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K B C))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K B C)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K B C)) (fsub (@fsetU K B C) C)))) *) by apply: disjoint_trans; rewrite subset_fsub. Qed. Lemma fdisjoint0X A : [disjoint fset0 & A]. Proof. (* Goal: is_true (@fdisjoint K (@fset0 K) A) *) by rewrite -fsetI_eq0 fset0I. Qed. Lemma fdisjointX0 A : [disjoint A & fset0]. Proof. (* Goal: is_true (@fdisjoint K A (@fset0 K)) *) by rewrite -fsetI_eq0 fsetI0. Qed. Lemma fdisjoint1X x A : [disjoint [fset x] & A] = (x \notin A). Proof. (* Goal: @eq bool (@fdisjoint K (@fset1 K x) A) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) *) rewrite -(@disjoint_fsub (x |` A)) //. (* Goal: @eq bool (@disjoint (@fset_sub_finType K (@fsetU K (@fset1 K x) A)) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fset1 K x) A)) (fsub (@fsetU K (@fset1 K x) A) (@fset1 K x)))) (@mem (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A))) (predPredType (Finite.sort (@fset_sub_finType K (@fsetU K (@fset1 K x) A)))) (@SetDef.pred_of_set (@fset_sub_finType K (@fsetU K (@fset1 K x) A)) (fsub (@fsetU K (@fset1 K x) A) A)))) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) *) by rewrite (@eq_disjoint1 _ [` fset1U1 _ _]) ?inE =>// ?; rewrite !inE. Qed. Lemma fdisjointX1 x A : [disjoint A & [fset x]] = (x \notin A). Proof. (* Goal: @eq bool (@fdisjoint K A (@fset1 K x)) (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))) *) by rewrite fdisjoint_sym fdisjoint1X. Qed. Lemma fdisjointUX A B C : [disjoint A `|` B & C] = [disjoint A & C]%fset && [disjoint B & C]%fset. Proof. (* Goal: @eq bool (@fdisjoint K (@fsetU K A B) C) (andb (@fdisjoint K A C) (@fdisjoint K B C)) *) by rewrite -!fsetI_eq0 fsetIUl fsetU_eq0. Qed. Lemma fdisjointXU A B C : [disjoint A & B `|` C] = [disjoint A & B]%fset && [disjoint A & C]%fset. Proof. (* Goal: @eq bool (@fdisjoint K A (@fsetU K B C)) (andb (@fdisjoint K A B) (@fdisjoint K A C)) *) by rewrite -!fsetI_eq0 fsetIUr fsetU_eq0. Qed. Lemma fdisjointU1X x A B : [disjoint x |` A & B]%fset = (x \notin B) && [disjoint A & B]%fset. Proof. (* Goal: @eq bool (@fdisjoint K (@fsetU K (@fset1 K x) A) B) (andb (negb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B))) (@fdisjoint K A B)) *) by rewrite fdisjointUX fdisjoint1X. Qed. Lemma fsubK A B : A `<=` B -> [fsetval k in fsub B A] = A. Proof. (* Goal: forall _ : is_true (@fsubset K A B), @eq (@finset_of K (Phant (Choice.sort K))) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) K (fun k : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) => @val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B)) k) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B)))) (predPredType (Finite.sort (@fset_sub_finType K B))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (Phantom (mem_pred (Finite.sort (@fset_sub_finType K B))) (@mem (Finite.sort (@fset_sub_finType K B)) (predPredType (Finite.sort (@fset_sub_finType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A))))) A *) move=> AsubB; apply/fsetP => k /=; symmetry. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B)) K (fun k : @fset_sub_type K B => @fsval K B k) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (predPredType (@fset_sub_type K B)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (Phantom (mem_pred (@fset_sub_type K B)) (@mem (@fset_sub_type K B) (predPredType (@fset_sub_type K B)) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A))))))) *) have [kB|kNB] := (boolP (k \in B)). (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B)) K (fun k : @fset_sub_type K B => @fsval K B k) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (predPredType (@fset_sub_type K B)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (Phantom (mem_pred (@fset_sub_type K B)) (@mem (@fset_sub_type K B) (predPredType (@fset_sub_type K B)) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A))))))) *) (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B)) K (fun k : @fset_sub_type K B => @fsval K B k) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (predPredType (@fset_sub_type K B)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (Phantom (mem_pred (@fset_sub_type K B)) (@mem (@fset_sub_type K B) (predPredType (@fset_sub_type K B)) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A))))))) *) by rewrite in_fset_valT /= inE. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B)) K (fun k : @fset_sub_type K B => @fsval K B k) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (predPredType (@fset_sub_type K B)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subType K B))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) B)) (@fset_sub_subfinType K B))) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A)))) (Phantom (mem_pred (@fset_sub_type K B)) (@mem (@fset_sub_type K B) (predPredType (@fset_sub_type K B)) (@SetDef.pred_of_set (@fset_sub_finType K B) (fsub B A))))))) *) by rewrite in_fset_valF //; apply: contraNF kNB; apply/fsubsetP. Qed. Lemma FSetK A (X : {set A}) : fsub A [fsetval k in X] = X. Proof. (* Goal: @eq (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (fsub A (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A))) K (fun k : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A))) => @val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A)) k) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A)))) (predPredType (Finite.sort (@fset_sub_finType K A))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A))) (@SetDef.pred_of_set (@fset_sub_finType K A) X))) (Phantom (mem_pred (Finite.sort (@fset_sub_finType K A))) (@mem (Finite.sort (@fset_sub_finType K A)) (predPredType (Finite.sort (@fset_sub_finType K A))) (@SetDef.pred_of_set (@fset_sub_finType K A) X))))) X *) by apply/setP => x; rewrite !inE. Qed. End Theory. Hint Resolve fsubset_refl. Hint Resolve fsubset_trans. Hint Resolve fproper_irrefl. Hint Resolve fsub0set. Module Import FSetInE. Definition inE := (inE, in_fsetE). End FSetInE. Section Card. End Card. Section Enum. Lemma enum_fset0 (T : choiceType) : enum [finType of fset0] = [::] :> seq (@fset0 T). Proof. (* Goal: @eq (list (@fset_sub_type T (@fset0 T))) (@enum_mem (@Finite.clone (@fset_sub_type T (@fset0 T)) (@fset_sub_finType T (@fset0 T)) (Finite.class (@fset_sub_finType T (@fset0 T))) (fun x : phantom (Finite.class_of (Finite.sort (@fset_sub_finType T (@fset0 T)))) (Finite.class (@fset_sub_finType T (@fset0 T))) => x)) (@mem (Equality.sort (Finite.eqType (@Finite.clone (@fset_sub_type T (@fset0 T)) (@fset_sub_finType T (@fset0 T)) (Finite.class (@fset_sub_finType T (@fset0 T))) (fun x : phantom (Finite.class_of (Finite.sort (@fset_sub_finType T (@fset0 T)))) (Finite.class (@fset_sub_finType T (@fset0 T))) => x)))) (predPredType (Equality.sort (Finite.eqType (@Finite.clone (@fset_sub_type T (@fset0 T)) (@fset_sub_finType T (@fset0 T)) (Finite.class (@fset_sub_finType T (@fset0 T))) (fun x : phantom (Finite.class_of (Finite.sort (@fset_sub_finType T (@fset0 T)))) (Finite.class (@fset_sub_finType T (@fset0 T))) => x))))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType (@Finite.clone (@fset_sub_type T (@fset0 T)) (@fset_sub_finType T (@fset0 T)) (Finite.class (@fset_sub_finType T (@fset0 T))) (fun x : phantom (Finite.class_of (Finite.sort (@fset_sub_finType T (@fset0 T)))) (Finite.class (@fset_sub_finType T (@fset0 T))) => x)))) (pred_of_argType (Equality.sort (Finite.eqType (@Finite.clone (@fset_sub_type T (@fset0 T)) (@fset_sub_finType T (@fset0 T)) (Finite.class (@fset_sub_finType T (@fset0 T))) (fun x : phantom (Finite.class_of (Finite.sort (@fset_sub_finType T (@fset0 T)))) (Finite.class (@fset_sub_finType T (@fset0 T))) => x)))))))) (@nil (@fset_sub_type T (@fset0 T))) *) by rewrite enumT unlock. Qed. Lemma enum_fset1 (T : choiceType) (x : T) : enum [finType of [fset x]] = [:: [`fset11 x]]. End Enum. Section ImfsetTh. Variables (key : unit) (K V : choiceType). Implicit Types (f : K -> V) (g : V -> K) (A V : {fset K}). Lemma imfset_id (A : {fset K}) : id @` A = A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (finSetPredType K) (@fin_finpred (Choice.eqType K) (fset_finpredType K) A)) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (finSetPredType K) A))) A *) by apply/fsetP=> a; rewrite in_fset. Qed. Lemma imfset_comp f g (p : finmempred _) : imfset key (g \o f) p = g @` (imfset key f p). Lemma subset_imfset f (p q : finmempred _) : {subset p <= q} -> imfset key f p `<=` imfset key f q. Proof. (* Goal: forall _ : @sub_mem (Equality.sort (Choice.eqType K)) (@mem (Equality.sort (Choice.eqType K)) (predPredType (Equality.sort (Choice.eqType K))) (@pred_of_mem (Equality.sort (Choice.eqType K)) (@pred_of_finmempred (Choice.eqType K) p))) (@mem (Equality.sort (Choice.eqType K)) (predPredType (Equality.sort (Choice.eqType K))) (@pred_of_mem (Equality.sort (Choice.eqType K)) (@pred_of_finmempred (Choice.eqType K) q))), is_true (@fsubset V (@Imfset.imfset key K V f p (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@pred_of_finmempred (Choice.eqType K) p))) (@Imfset.imfset key K V f q (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@pred_of_finmempred (Choice.eqType K) q)))) *) move=> subPQ; apply/fsubsetP=> x /imfsetP [y /= yA ->]. (* Goal: is_true (@in_mem (Choice.sort V) (f y) (@mem (Choice.sort V) (finSetPredType V) (@Imfset.imfset key K V f q (Phantom (mem_pred (Choice.sort K)) (@pred_of_finmempred (Choice.eqType K) q))))) *) by rewrite in_imfset //= [in_mem _ _]subPQ. Qed. Lemma eq_imfset (f f' : K -> V) (p q : finmempred _): f =1 f' -> (forall x, in_mem x p = in_mem x q) -> imfset key f p = imfset key f' q. Proof. (* Goal: forall (_ : @eqfun (Choice.sort V) (Choice.sort K) f f') (_ : forall x : Equality.sort (Choice.eqType K), @eq bool (@in_mem (Equality.sort (Choice.eqType K)) x (@pred_of_finmempred (Choice.eqType K) p)) (@in_mem (Equality.sort (Choice.eqType K)) x (@pred_of_finmempred (Choice.eqType K) q))), @eq (@finset_of V (Phant (Choice.sort V))) (@Imfset.imfset key K V f p (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@pred_of_finmempred (Choice.eqType K) p))) (@Imfset.imfset key K V f' q (Phantom (mem_pred (Equality.sort (Choice.eqType K))) (@pred_of_finmempred (Choice.eqType K) q))) *) move=> eq_f eqP; apply/fsetP => x; apply/imfsetP/imfsetP => /= [] [k Pk ->]; by exists k => //=; rewrite ?eq_f ?eqP in Pk *. Qed. Qed. Definition fpowerset (A : {fset K}) : {fset {fset K}} := [fset[fpowerset_key] [fsetval y in Y : {set A}] | Y in powerset [set: A]]. Lemma fpowersetE A B : (B \in fpowerset A) = (B `<=` A). Proof. (* Goal: @eq bool (@in_mem (Choice.sort (fset_choiceType K)) B (@mem (Choice.sort (fset_choiceType K)) (finSetPredType (fset_choiceType K)) (fpowerset A))) (@fsubset K B A) *) apply/imfsetP/fsubsetP => /= [[Z _ -> y /in_fset_valP [] //]|/fsubsetP subYX]. (* Goal: @ex2 (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (fun x : @set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A)) => is_true (@in_mem (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) x (@mem (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (predPredType (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A)))) (@SetDef.pred_of_set (set_of_finType (@fset_sub_finType K A)) (@powerset (@fset_sub_finType K A) (@setTfor (@fset_sub_finType K A) (Phant (@fset_sub_type K A)))))))) (fun x : @set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A)) => @eq (@finset_of K (Phant (Choice.sort K))) B (@Imfset.imfset imfset_key (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A)) K (fun y : @fset_sub_type K A => @fsval K A y) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))) (predPredType (@fset_sub_type K A)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subType K A))) (pred_finpredType (@subFinType_finType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A))) (@SetDef.pred_of_set (@fset_sub_finType K A) x))) (Phantom (mem_pred (@fset_sub_type K A)) (@mem (@fset_sub_type K A) (predPredType (@fset_sub_type K A)) (@SetDef.pred_of_set (@fset_sub_finType K A) x))))) *) exists (fsub _ B); last by rewrite fsubK. (* Goal: is_true (@in_mem (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (@fsub K A B) (@mem (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A))) (predPredType (@set_of (@fset_sub_finType K A) (Phant (@fset_sub_type K A)))) (@SetDef.pred_of_set (set_of_finType (@fset_sub_finType K A)) (@powerset (@fset_sub_finType K A) (@setTfor (@fset_sub_finType K A) (Phant (@fset_sub_type K A))))))) *) by rewrite powersetE /= -fsubT subset_fsub ?fsubset_refl. Qed. Lemma fpowersetCE (X A B : {fset K}) : (A \in fpowerset (X `\` B)) = (A `<=` X) && [disjoint A & B]%fset. Proof. (* Goal: @eq bool (@in_mem (@finset_of K (Phant (Choice.sort K))) A (@mem (Choice.sort (fset_choiceType K)) (finSetPredType (fset_choiceType K)) (fpowerset (@fsetD K X B)))) (andb (@fsubset K A X) (@fdisjoint K A B)) *) by rewrite fpowersetE fsubsetD. Qed. Lemma fpowersetS A B : (fpowerset A `<=` fpowerset B) = (A `<=` B). Proof. (* Goal: @eq bool (@fsubset (fset_choiceType K) (fpowerset A) (fpowerset B)) (@fsubset K A B) *) apply/fsubsetP/fsubsetP => [sub_pA_pB a|subAB X]. (* Goal: forall _ : is_true (@in_mem (Choice.sort (fset_choiceType K)) X (@mem (Choice.sort (fset_choiceType K)) (finSetPredType (fset_choiceType K)) (fpowerset A))), is_true (@in_mem (Choice.sort (fset_choiceType K)) X (@mem (Choice.sort (fset_choiceType K)) (finSetPredType (fset_choiceType K)) (fpowerset B))) *) (* Goal: forall _ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) A)), is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) B)) *) by have := sub_pA_pB [fset a]; rewrite !fpowersetE !fsub1set. (* Goal: forall _ : is_true (@in_mem (Choice.sort (fset_choiceType K)) X (@mem (Choice.sort (fset_choiceType K)) (finSetPredType (fset_choiceType K)) (fpowerset A))), is_true (@in_mem (Choice.sort (fset_choiceType K)) X (@mem (Choice.sort (fset_choiceType K)) (finSetPredType (fset_choiceType K)) (fpowerset B))) *) by rewrite !fpowersetE => /fsubsetP XA; apply/fsubsetP => x /XA /subAB. Qed. Lemma fpowerset0 : fpowerset fset0 = [fset fset0]. Proof. (* Goal: @eq (@finset_of (fset_choiceType K) (Phant (@finset_of K (Phant (Choice.sort K))))) (fpowerset (@fset0 K)) (@fset1 (fset_choiceType K) (@fset0 K)) *) by apply/fsetP=> X; rewrite inE fpowersetE fsubset0. Qed. Lemma fpowerset1 (x : K) : fpowerset [fset x] = [fset fset0; [fset x]]. Proof. (* Goal: @eq (@finset_of (fset_choiceType K) (Phant (@finset_of K (Phant (Choice.sort K))))) (fpowerset (@fset1 K x)) (@fsetU (fset_choiceType K) (@fset1 (fset_choiceType K) (@fset0 K)) (@fset1 (fset_choiceType K) (@fset1 K x))) *) by apply/fsetP => X; rewrite !inE fpowersetE fsubset1 orbC. Qed. Lemma fpowersetI A B : fpowerset (A `&` B) = fpowerset A `&` fpowerset B. Proof. (* Goal: @eq (@finset_of (fset_choiceType K) (Phant (@finset_of K (Phant (Choice.sort K))))) (fpowerset (@fsetI K A B)) (@fsetI (fset_choiceType K) (fpowerset A) (fpowerset B)) *) by apply/fsetP=> X; rewrite inE !fpowersetE fsubsetI. Qed. Lemma card_fpowerset (A : {fset K}) : #|` fpowerset A| = 2 ^ #|` A|. Proof. (* Goal: @eq nat (@size (Choice.sort (fset_choiceType K)) (@enum_fset (fset_choiceType K) (fpowerset A))) (expn (S (S O)) (@size (Choice.sort K) (@enum_fset K A))) *) rewrite !card_imfset; first by rewrite -cardE card_powerset cardsE cardfE. (* Goal: @injective (Choice.sort (fset_choiceType K)) (Choice.sort (set_of_choiceType (@fset_sub_finType K A))) (fun Y : Choice.sort (set_of_choiceType (@fset_sub_finType K A)) => @Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A))) K (fun y : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A))) => @val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A)) y) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A)))) (predPredType (Finite.sort (@fset_sub_finType K A))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@subFin_sort K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)) (@fset_sub_subfinType K A))) (@SetDef.pred_of_set (@fset_sub_finType K A) Y))) (Phantom (mem_pred (Finite.sort (@fset_sub_finType K A))) (@mem (Finite.sort (@fset_sub_finType K A)) (predPredType (Finite.sort (@fset_sub_finType K A))) (@SetDef.pred_of_set (@fset_sub_finType K A) Y)))) *) by move=> X Y /fsetP eqXY; apply/setP => x; have := eqXY (val x); rewrite !inE. Qed. End PowerSetTheory. Section BigFSet. Variable (R : Type) (idx : R) (op : Monoid.law idx). Variable (I : choiceType). Lemma big_seq_fsetE (X : {fset I}) (P : pred I) (F : I -> R) : \big[op/idx]_(i <- X | P i) F i = \big[op/idx]_(x : X | P (val x)) F (val x). Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I X) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx op) (P i) (F i))) (@BigOp.bigop R (Finite.sort (@fset_sub_finType I X)) idx (index_enum (@fset_sub_finType I X)) (fun x : @fset_sub_type I X => @BigBody R (@fset_sub_type I X) x (@Monoid.operator R idx op) (P (@val (Choice.sort I) (fun x0 : Choice.sort I => @in_mem (Choice.sort I) x0 (@mem (Choice.sort I) (finSetPredType I) X)) (@fset_sub_subType I X) x)) (F (@val (Choice.sort I) (fun x0 : Choice.sort I => @in_mem (Choice.sort I) x0 (@mem (Choice.sort I) (finSetPredType I) X)) (@fset_sub_subType I X) x)))) *) by rewrite enum_fsetE big_map enumT. Qed. Lemma big1_fset (X : {fset I}) (P : pred I) (F : I -> R) : (forall i, i \in X -> P i -> F i = idx) -> \big[op/idx]_(i <- X | P i) F i = idx. Proof. (* Goal: forall _ : forall (i : Choice.sort I) (_ : is_true (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) X))) (_ : is_true (P i)), @eq R (F i) idx, @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I X) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx op) (P i) (F i))) idx *) by move=> Fid; rewrite big_seq_fsetE big1//= => -[]. Qed. Lemma big_fset0 (P : pred fset0) (F : @fset0 I -> R) : \big[op/idx]_(i : fset0 | P i) F i = idx. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (@fset_sub_finType I (@fset0 I))) idx (index_enum (@fset_sub_finType I (@fset0 I))) (fun i : @fset_sub_type I (@fset0 I) => @BigBody R (@fset_sub_type I (@fset0 I)) i (@Monoid.operator R idx op) (P i) (F i))) idx *) by rewrite /index_enum -enumT /= enum_fset0 big_nil. Qed. Lemma big_seq_fset0 (F : I -> R): \big[op/idx]_(i <- fset0) F i = idx. Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@fset0 I)) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx op) true (F i))) idx *) by rewrite big_seq_fsetE big_fset0. Qed. Lemma big_fset1 (a : I) (F : [fset a] -> R) : \big[op/idx]_(i : [fset a]) F i = F [` fset11 a]. Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (@fset_sub_finType I (@fset1 I a))) idx (index_enum (@fset_sub_finType I (@fset1 I a))) (fun i : @fset_sub_type I (@fset1 I a) => @BigBody R (@fset_sub_type I (@fset1 I a)) i (@Monoid.operator R idx op) true (F i))) (F (@FSetSub I (@fset1 I a) a (@fset11 I a))) *) by rewrite /index_enum -enumT enum_fset1 big_seq1. Qed. Lemma big_seq_fset1 (a : I) (F : I -> R) : \big[op/idx]_(i <- [fset a]) F i = F a. Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@fset1 I a)) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx op) true (F i))) (F a) *) by rewrite big_seq_fsetE big_fset1. Qed. End BigFSet. Notation eq_big_imfset := (eq_big_perm _ (enum_imfset _ _)). Section BigComFSet. Variable (R : Type) (idx : R) (op : Monoid.com_law idx). Variable (I J : choiceType). Lemma big_fset (X : finmempred _) (P : pred I) (F : I -> R) : \big[op/idx]_(i <- [fset i in X | P i]) F i = \big[op/idx]_(i <- enum_finmem X | P i) F i. Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun i : Choice.sort I => i : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Equality.sort (Choice.eqType I))) (@subfinset_finpred I X P)) (Phantom (mem_pred (Equality.sort (Choice.eqType I))) (@mem (Equality.sort (Choice.eqType I)) (simplPredType (Equality.sort (Choice.eqType I))) (@SimplPred (Equality.sort (Choice.eqType I)) (fun i : Equality.sort (Choice.eqType I) => andb (@in_mem (Equality.sort (Choice.eqType I)) i (@mem (Equality.sort (Choice.eqType I)) (predPredType (Equality.sort (Choice.eqType I))) (@pred_of_mem (Equality.sort (Choice.eqType I)) (@pred_of_finmempred (Choice.eqType I) X)))) (P i))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Equality.sort (Choice.eqType I)) idx (@enum_finmem (Choice.eqType I) X) (fun i : Equality.sort (Choice.eqType I) => @BigBody R (Equality.sort (Choice.eqType I)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) *) by rewrite !eq_big_imfset//= !big_map !big_filter_cond big_andbC. Qed. Lemma big_fset_condE (X : {fset I}) (P : pred I) (F : I -> R) : \big[op/idx]_(i <- X | P i) F i = \big[op/idx]_(i <- [fset i in X | P i]) F i. Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I X) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun i : Choice.sort I => i : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I X)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun i : Choice.sort I => andb (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) X)) (P i))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) *) by rewrite big_fset. Qed. Lemma eq_fbig_cond (A B : {fset I}) (P Q : pred I) (F G : I -> R) : [fset x in A | P x] =i [fset x in B | Q x] -> (forall x, x \in A -> P x -> F x = G x) -> \big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- B | Q i) G i. Proof. (* Goal: forall (_ : @eq_mem (Choice.sort I) (@mem (Choice.sort I) (finSetPredType I) (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)) (P x))))))) (@mem (Choice.sort I) (finSetPredType I) (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I B)) Q)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B)) (Q x)))))))) (_ : forall (x : Choice.sort I) (_ : is_true (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A))) (_ : is_true (P x)), @eq R (F x) (G x)), @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I B) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i) (G i))) *) move=> /fsetP eqABPQ FG; rewrite big_fset_condE [in RHS]big_fset_condE -eqABPQ. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun i : Choice.sort I => i) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun i : Choice.sort I => andb (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) A)) (P i))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)) (P x))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (G i))) *) rewrite big_seq_cond [in RHS]big_seq_cond; apply: eq_bigr => i. (* Goal: forall _ : is_true (andb (@in_mem (Equality.sort (Choice.eqType I)) i (@mem (Equality.sort (Choice.eqType I)) (seq_predType (Choice.eqType I)) (@enum_fset I (@Imfset.imfset imfset_key I I (fun i : Choice.sort I => i) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun i : Choice.sort I => andb (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) A)) (P i))))))))) true), @eq R (F i) (G i) *) by rewrite in_fset !inE => /andP[/andP[??] _]; apply: FG. Qed. Lemma eq_fbig (A B : {fset I}) (F G : I -> R) : A =i B -> (forall x, x \in A -> F x = G x) -> \big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) G i. Proof. (* Goal: forall (_ : @eq_mem (Choice.sort I) (@mem (Choice.sort I) (finSetPredType I) A) (@mem (Choice.sort I) (finSetPredType I) B)) (_ : forall (x : Choice.sort I) (_ : is_true (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A))), @eq R (F x) (G x)), @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I B) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (G i))) *) by move=> AB FG; apply: eq_fbig_cond => x; rewrite ?inE/= -?AB// => /FG. Qed. Lemma eq_fbigl_cond (A B : {fset I}) (P Q : pred I) (F : I -> R) : [fset x in A | P x] =i [fset x in B | Q x] -> \big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- B | Q i) F i. Proof. (* Goal: forall _ : @eq_mem (Choice.sort I) (@mem (Choice.sort I) (finSetPredType I) (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)) (P x))))))) (@mem (Choice.sort I) (finSetPredType I) (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I B)) Q)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B)) (Q x))))))), @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I B) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i) (F i))) *) by move=> AB; apply: eq_fbig_cond. Qed. Lemma eq_fbigl (A B : {fset I}) (F : I -> R) : A =i B -> \big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) F i. Proof. (* Goal: forall _ : @eq_mem (Choice.sort I) (@mem (Choice.sort I) (finSetPredType I) A) (@mem (Choice.sort I) (finSetPredType I) B), @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I B) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) *) by move=> AB; apply: eq_fbig. Qed. Lemma eq_fbigr (A : {fset I}) (P : pred I) (F G : I -> R) : (forall x, x \in A -> P x -> F x = G x) -> \big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- A | P i) G i. Proof. (* Goal: forall _ : forall (x : Choice.sort I) (_ : is_true (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A))) (_ : is_true (P x)), @eq R (F x) (G x), @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (G i))) *) by apply: eq_fbig_cond. Qed. Lemma big_fsetID (B : pred I) (A : {fset I}) (F : I -> R) : \big[op/idx]_(i <- A) F i = op (\big[op/idx]_(i <- [fset x in A | B x]) F i) (\big[op/idx]_(i <- [fset x in A | ~~ B x]) F i). Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) B)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)) (B x))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) (fun x : Choice.sort I => negb (B x)))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)) (negb (B x)))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i)))) *) by rewrite !big_fset; apply: bigID. Qed. Lemma big_fsetIDcond (B : pred I) (A : {fset I}) (P : pred I) (F : I -> R) : \big[op/idx]_(i <- A | P i) F i = op (\big[op/idx]_(i <- [fset x in A | B x] | P i) F i) (\big[op/idx]_(i <- [fset x in A | ~~ B x] | P i) F i). Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) B)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)) (B x))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) (fun x : Choice.sort I => negb (B x)))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)) (negb (B x)))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (F i)))) *) by rewrite big_mkcond (big_fsetID B) // -!big_mkcond. Qed. Lemma big_fsetD1 (a : I) (A : {fset I}) (F : I -> R) : a \in A -> \big[op/idx]_(i <- A) F i = op (F a) (\big[op/idx]_(i <- A `\ a) F i). Lemma big_setU1 (a : I) (A : {fset I}) (F : I -> R) : a \notin A -> \big[op/idx]_(i <- (a |` A)) F i = op (F a) (\big[op/idx]_(i <- A) F i). Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort I) a (@mem (Choice.sort I) (finSetPredType I) A))), @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@fsetU I (@fset1 I a) A)) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (F a) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i)))) *) move=> aNA; rewrite eq_big_imfset//= big_map undup_id ?big_cat ?big_seq_fset1//. (* Goal: is_true (@uniq (Choice.eqType I) (@cat (Choice.sort I) (@enum_fset I (@fset1 I a)) (@enum_fset I A))) *) rewrite cat_uniq ?fset_uniq andbT//=; apply/hasPn=> /= x xA; rewrite !inE/=. (* Goal: is_true (negb (@eq_op (Choice.eqType I) x a)) *) by apply: contraNneq aNA => <-. Qed. Lemma big_fset_incl (A : {fset I}) B F : A `<=` B -> (forall x, x \in B -> x \notin A -> F x = idx) -> \big[op/idx]_(x <- A) F x = \big[op/idx]_(x <- B) F x. Proof. (* Goal: forall (_ : is_true (@fsubset I A B)) (_ : forall (x : Choice.sort I) (_ : is_true (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B))) (_ : is_true (negb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)))), @eq R (F x) idx), @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun x : Choice.sort I => @BigBody R (Choice.sort I) x (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F x))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I B) (fun x : Choice.sort I => @BigBody R (Choice.sort I) x (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F x))) *) move=> subAB Fid; rewrite [in RHS](big_fsetID (mem A)) /=. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun x : Choice.sort I => @BigBody R (Choice.sort I) x (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F x))) (@Monoid.operator R idx (@Monoid.com_operator R idx op) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I B)) (@pred_of_simpl (Choice.sort I) (@pred_of_mem_pred (Choice.sort I) (@mem (Choice.sort I) (finSetPredType I) A))))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B)) (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I B)) (fun x : Choice.sort I => negb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A))))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B)) (negb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A))))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i)))) *) rewrite [X in op _ X]big1_fset ?Monoid.mulm1; last first. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun x : Choice.sort I => @BigBody R (Choice.sort I) x (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F x))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I B)) (@pred_of_simpl (Choice.sort I) (@pred_of_mem_pred (Choice.sort I) (@mem (Choice.sort I) (finSetPredType I) A))))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B)) (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) *) (* Goal: forall (i : Choice.sort I) (_ : is_true (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I B)) (fun x : Choice.sort I => negb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A))))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B)) (negb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A))))))))))) (_ : is_true true), @eq R (F i) idx *) by move=> i; rewrite !inE /= => /andP[iB iNA _]; apply: Fid. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun x : Choice.sort I => @BigBody R (Choice.sort I) x (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F x))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun x : Choice.sort I => x) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I B)) (@pred_of_simpl (Choice.sort I) (@pred_of_mem_pred (Choice.sort I) (@mem (Choice.sort I) (finSetPredType I) A))))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun x : Choice.sort I => andb (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) B)) (@in_mem (Choice.sort I) x (@mem (Choice.sort I) (finSetPredType I) A)))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) *) by apply: eq_fbigl => i; rewrite !inE /= -(@in_fsetI _ B A) (fsetIidPr _). Qed. Lemma big_imfset key (h : I -> J) (A : finmempred _) (G : J -> R) : {in A &, injective h} -> \big[op/idx]_(j <- imfset key h A) G j = \big[op/idx]_(i <- enum_finmem A) G (h i). Proof. (* Goal: forall _ : @prop_in2 (Equality.sort (Choice.eqType I)) (@mem (Equality.sort (Choice.eqType I)) (predPredType (Equality.sort (Choice.eqType I))) (@pred_of_mem (Equality.sort (Choice.eqType I)) (@pred_of_finmempred (Choice.eqType I) A))) (fun x1 x2 : Choice.sort I => forall _ : @eq (Choice.sort J) (h x1) (h x2), @eq (Choice.sort I) x1 x2) (inPhantom (@injective (Choice.sort J) (Choice.sort I) h)), @eq R (@BigOp.bigop R (Choice.sort J) idx (@enum_fset J (@Imfset.imfset key I J h A (Phantom (mem_pred (Equality.sort (Choice.eqType I))) (@pred_of_finmempred (Choice.eqType I) A)))) (fun j : Choice.sort J => @BigBody R (Choice.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (G j))) (@BigOp.bigop R (Equality.sort (Choice.eqType I)) idx (@enum_finmem (Choice.eqType I) A) (fun i : Equality.sort (Choice.eqType I) => @BigBody R (Equality.sort (Choice.eqType I)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (G (h i)))) *) by move=> h_inj; rewrite eq_big_imfset// big_map. Qed. End BigComFSet. Arguments big_fsetD1 {R idx op I} a [A F]. Notation eq_big_imfset2 := (eq_big_perm _ (enum_imfset2 _ _)). Section BigComImfset2. Variables (R : Type) (idx : R) (op : Monoid.com_law idx) (I : choiceType) (J : I -> choiceType) (K : choiceType). Lemma big_imfset2 key (A : finmempred I) (B : forall i, finmempred (J i)) (h : forall i : I, J i -> K) (F : K -> R) : {in [pred t : sigT J | A (tag t) & B _ (tagged t)] &, injective (fun t => h (tag t) (tagged t))} -> \big[op/idx]_(k <- imfset2 key h A B) F k = \big[op/idx]_(i <- enum_finmem A) \big[op/idx]_(j <- enum_finmem (B i)) F (h i j). Proof. (* Goal: forall _ : @prop_in2 (@sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x))) (@mem (@sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x))) (simplPredType (@sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)))) (@SimplPred (@sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x))) (fun t : @sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) => andb (@pred_of_simpl (Equality.sort (Choice.eqType I)) (@pred_of_mem_pred (Equality.sort (Choice.eqType I)) (@pred_of_finmempred (Choice.eqType I) A)) (@tag (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) t)) (@pred_of_simpl (Equality.sort (Choice.eqType (J (@tag (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) t)))) (@pred_of_mem_pred (Equality.sort (Choice.eqType (J (@tag (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) t)))) (@pred_of_finmempred (Choice.eqType (J (@tag (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) t))) (B (@tag (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) t)))) (@tagged (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) t))))) (fun x1 x2 : @sigT (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) => forall _ : @eq (Choice.sort K) ((fun t : @sigT (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) => h (@tag (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) t) (@tagged (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) t)) x1) ((fun t : @sigT (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) => h (@tag (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) t) (@tagged (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) t)) x2), @eq (@sigT (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x)) x1 x2) (inPhantom (@injective (Choice.sort K) (@sigT (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x)) (fun t : @sigT (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) => h (@tag (Choice.sort I) (fun x : Choice.sort I => (fun x0 : Choice.sort I => Choice.sort (J x0)) x) t) (@tagged (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) t)))), @eq R (@BigOp.bigop R (Choice.sort K) idx (@enum_fset K (@Imfset.imfset2 key K I J h A B (Phantom (mem_pred (Equality.sort (Choice.eqType I))) (@pred_of_finmempred (Choice.eqType I) A)) (Phantom (forall x : Choice.sort I, mem_pred (Equality.sort (Choice.eqType (J x)))) (fun x : Choice.sort I => @pred_of_finmempred (Choice.eqType (J x)) (B x))))) (fun k : Choice.sort K => @BigBody R (Choice.sort K) k (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F k))) (@BigOp.bigop R (Equality.sort (Choice.eqType I)) idx (@enum_finmem (Choice.eqType I) A) (fun i : Equality.sort (Choice.eqType I) => @BigBody R (Equality.sort (Choice.eqType I)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (@BigOp.bigop R (Equality.sort (Choice.eqType (J i))) idx (@enum_finmem (Choice.eqType (J i)) (B i)) (fun j : Equality.sort (Choice.eqType (J i)) => @BigBody R (Equality.sort (Choice.eqType (J i))) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F (h i j)))))) *) move=> h_inj; rewrite eq_big_imfset2 //. (* Goal: @eq R (@BigOp.bigop R (Equality.sort (Choice.eqType K)) idx (@allsigs (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) (Choice.sort K) h (@enum_finmem (Choice.eqType I) A) (fun x : Choice.sort I => @enum_finmem (Choice.eqType (J x)) (B x))) (fun i : Equality.sort (Choice.eqType K) => @BigBody R (Equality.sort (Choice.eqType K)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Equality.sort (Choice.eqType I)) idx (@enum_finmem (Choice.eqType I) A) (fun i : Equality.sort (Choice.eqType I) => @BigBody R (Equality.sort (Choice.eqType I)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (@BigOp.bigop R (Equality.sort (Choice.eqType (J i))) idx (@enum_finmem (Choice.eqType (J i)) (B i)) (fun j : Equality.sort (Choice.eqType (J i)) => @BigBody R (Equality.sort (Choice.eqType (J i))) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F (h i j)))))) *) rewrite (allsigs_comp (fun _ j => Tagged _ j) (fun t => h (tag t) (tagged t))). (* Goal: @eq R (@BigOp.bigop R (Equality.sort (Choice.eqType K)) idx (@map (@sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x))) (Choice.sort K) (fun t : @sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) => h (@tag (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) t) (@tagged (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) t)) (@allsigs (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x)) (@sigT (Choice.sort I) (fun x : Choice.sort I => Choice.sort (J x))) (fun (x : Choice.sort I) (j : Choice.sort (J x)) => @Tagged (Choice.sort I) x (fun x0 : Choice.sort I => Choice.sort (J x0)) j) (@enum_finmem (Choice.eqType I) A) (fun x : Choice.sort I => @enum_finmem (Choice.eqType (J x)) (B x)))) (fun i : Equality.sort (Choice.eqType K) => @BigBody R (Equality.sort (Choice.eqType K)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i))) (@BigOp.bigop R (Equality.sort (Choice.eqType I)) idx (@enum_finmem (Choice.eqType I) A) (fun i : Equality.sort (Choice.eqType I) => @BigBody R (Equality.sort (Choice.eqType I)) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (@BigOp.bigop R (Equality.sort (Choice.eqType (J i))) idx (@enum_finmem (Choice.eqType (J i)) (B i)) (fun j : Equality.sort (Choice.eqType (J i)) => @BigBody R (Equality.sort (Choice.eqType (J i))) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F (h i j)))))) *) by rewrite big_map big_allsigs /=. Qed. End BigComImfset2. Section BigFsetDep. Variables (R : Type) (idx : R) (op : Monoid.com_law idx) (I : choiceType) (J : choiceType) (K : choiceType). Lemma pair_big_dep_cond (A : {fset I}) (B : I -> {fset J}) (P : pred I) (Q : I -> pred J) (F : I -> J -> R) : \big[op/idx]_(i <- A | P i) \big[op/idx]_(j <- B i | Q i j) F i j = \big[op/idx]_(p <- [fset ((i, j) : I * J) | i in [fset i in A | P i], j in [fset j in B i | Q i j]]) F p.1 p.2. Proof. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R (Choice.sort J) idx (@enum_fset J (B i)) (fun j : Choice.sort J => @BigBody R (Choice.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R (Choice.sort (prod_choiceType I J)) idx (@enum_fset (prod_choiceType I J) (@Imfset.imfset2 imfset_key (prod_choiceType I J) I (fun _ : Choice.sort I => J) (fun (i : Choice.sort I) (j : Choice.sort ((fun _ : Choice.sort I => J) i)) => @pair (Choice.sort I) (Choice.sort ((fun _ : Choice.sort I => J) i)) i j : prod (Choice.sort I) (Choice.sort J)) (@mem_fin (Choice.eqType I) (finSetPredType I) (@fin_finpred (Choice.eqType I) (fset_finpredType I) (@Imfset.imfset imfset_key I I (fun i : Choice.sort I => i : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun i : Choice.sort I => andb (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) A)) (P i)))))))) (fun x0 : Choice.sort I => @mem_fin (Choice.eqType ((fun _ : Choice.sort I => J) x0)) (finSetPredType J) (@fin_finpred (Choice.eqType ((fun _ : Choice.sort I => J) x0)) (fset_finpredType J) ((fun i : Choice.sort I => @Imfset.imfset imfset_key J J (fun j : Choice.sort J => j : Choice.sort J) (@mem_fin (Choice.eqType J) (simplPredType (Choice.sort J)) (@subfinset_finpred J (@mem_fin (Choice.eqType J) (seq_predType (Choice.eqType J)) (@fset_finpred J (B i))) (Q i))) (Phantom (mem_pred (Choice.sort J)) (@mem (Choice.sort J) (simplPredType (Choice.sort J)) (@SimplPred (Choice.sort J) (fun j : Choice.sort J => andb (@in_mem (Choice.sort J) j (@mem (Choice.sort J) (finSetPredType J) (B i))) (Q i j)))))) x0))) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (finSetPredType I) (@Imfset.imfset imfset_key I I (fun i : Choice.sort I => i : Choice.sort I) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun i : Choice.sort I => andb (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) A)) (P i)))))))) (Phantom (forall _ : Choice.sort I, mem_pred (Choice.sort J)) (fun x0 : Choice.sort I => @mem (Choice.sort J) (finSetPredType J) ((fun i : Choice.sort I => @Imfset.imfset imfset_key J J (fun j : Choice.sort J => j : Choice.sort J) (@mem_fin (Choice.eqType J) (simplPredType (Choice.sort J)) (@subfinset_finpred J (@mem_fin (Choice.eqType J) (seq_predType (Choice.eqType J)) (@fset_finpred J (B i))) (Q i))) (Phantom (mem_pred (Choice.sort J)) (@mem (Choice.sort J) (simplPredType (Choice.sort J)) (@SimplPred (Choice.sort J) (fun j : Choice.sort J => andb (@in_mem (Choice.sort J) j (@mem (Choice.sort J) (finSetPredType J) (B i))) (Q i j)))))) x0))))) (fun p : Choice.sort (prod_choiceType I J) => @BigBody R (Choice.sort (prod_choiceType I J)) p (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F (@fst (Choice.sort I) (Choice.sort J) p) (@snd (Choice.sort I) (Choice.sort J) p)))) *) rewrite big_imfset2 //=; last by move=> [??] [??] _ _ /= [-> ->]. (* Goal: @eq R (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I A) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (P i) (@BigOp.bigop R (Choice.sort J) idx (@enum_fset J (B i)) (fun j : Choice.sort J => @BigBody R (Choice.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (Q i j) (F i j))))) (@BigOp.bigop R (Choice.sort I) idx (@enum_fset I (@Imfset.imfset imfset_key I I (fun i : Choice.sort I => i) (@mem_fin (Choice.eqType I) (simplPredType (Choice.sort I)) (@subfinset_finpred I (@mem_fin (Choice.eqType I) (seq_predType (Choice.eqType I)) (@fset_finpred I A)) P)) (Phantom (mem_pred (Choice.sort I)) (@mem (Choice.sort I) (simplPredType (Choice.sort I)) (@SimplPred (Choice.sort I) (fun i : Choice.sort I => andb (@in_mem (Choice.sort I) i (@mem (Choice.sort I) (finSetPredType I) A)) (P i))))))) (fun i : Choice.sort I => @BigBody R (Choice.sort I) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (@BigOp.bigop R (Choice.sort J) idx (@enum_fset J (@Imfset.imfset imfset_key J J (fun j : Choice.sort J => j) (@mem_fin (Choice.eqType J) (simplPredType (Choice.sort J)) (@subfinset_finpred J (@mem_fin (Choice.eqType J) (seq_predType (Choice.eqType J)) (@fset_finpred J (B i))) (Q i))) (Phantom (mem_pred (Choice.sort J)) (@mem (Choice.sort J) (simplPredType (Choice.sort J)) (@SimplPred (Choice.sort J) (fun j : Choice.sort J => andb (@in_mem (Choice.sort J) j (@mem (Choice.sort J) (finSetPredType J) (B i))) (Q i j))))))) (fun j : Choice.sort J => @BigBody R (Choice.sort J) j (@Monoid.operator R idx (@Monoid.com_operator R idx op)) true (F i j))))) *) by rewrite big_fset /=; apply: eq_bigr => i _; rewrite big_fset. Qed. End BigFsetDep. Section BigComImfset. Variables (R : Type) (idx : R) (op : Monoid.com_law idx) (I : choiceType) (J : choiceType) (K : choiceType). Lemma partition_big_imfset (h : I -> J) (A : {fset I}) (F : I -> R) : \big[op/idx]_(i <- A) F i = \big[op/idx]_(j <- [fset h x | x in A]) \big[op/idx]_(i <- A | h i == j) F i. End BigComImfset. Notation "\bigcup_ ( i <- r | P ) F" := (\big[@fsetU _/fset0]_(i <- r | P%fset) F%fset) : fset_scope. Notation "\bigcup_ ( i <- r ) F" := (\big[@fsetU _/fset0]_(i <- r) F%fset) : fset_scope. Notation "\bigcup_ ( i | P ) F" := (\big[@fsetU _/fset0]_(i | P) F%fset) : fset_scope. Notation "\bigcup_ ( i 'in' A | P ) F" := (\big[@fsetU _/fset0]_(i in A | P) F%fset) : fset_scope. Notation "\bigcup_ ( i 'in' A ) F" := (\big[@fsetU _/fset0]_(i in A) F%fset) : fset_scope. Section FSetMonoids. Import Monoid. Variable (T : choiceType). Canonical fsetU_monoid := Law (@fsetUA T) (@fset0U T) (@fsetU0 T). Canonical fsetU_comoid := ComLaw (@fsetUC T). End FSetMonoids. Section BigFOpsSeq. Variables (T : choiceType) (I : eqType) (r : seq I). Implicit Types (P : pred I) (F : I -> {fset T}). Lemma bigfcup_undup P F : \bigcup_(i <- undup r | P i) F i = \bigcup_(i <- r | P i) F i. Proof. (* Goal: @eq (@finset_of T (Phant (Choice.sort T))) (@BigOp.bigop (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) (@fset0 T) (@undup I r) (fun i : Equality.sort I => @BigBody (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) i (@fsetU T) (P i) (F i))) (@BigOp.bigop (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) (@fset0 T) r (fun i : Equality.sort I => @BigBody (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) i (@fsetU T) (P i) (F i))) *) by rewrite big_undup => //= A; rewrite fsetUid. Qed. Lemma bigfcup_sup j P F : j \in r -> P j -> F j `<=` \bigcup_(i <- r | P i) F i. Proof. (* Goal: forall (_ : is_true (@in_mem (Equality.sort I) j (@mem (Equality.sort I) (seq_predType I) r))) (_ : is_true (P j)), is_true (@fsubset T (F j) (@BigOp.bigop (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) (@fset0 T) r (fun i : Equality.sort I => @BigBody (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) i (@fsetU T) (P i) (F i)))) *) move=> jr Pj; rewrite -bigfcup_undup big_mkcond. (* Goal: is_true (@fsubset T (F j) (@BigOp.bigop (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) (@fset0 T) (@undup I r) (fun i : Equality.sort I => @BigBody (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) i (@Monoid.operator (@finset_of T (Phant (Choice.sort T))) (@fset0 T) (fsetU_monoid T)) true (if P i then F i else @fset0 T)))) *) by rewrite (bigD1_seq j) ?mem_undup ?undup_uniq ?Pj //= fsubsetUl. Qed. Lemma bigfcupP x F P : reflect (exists2 i : I, (i \in r) && P i & x \in F i) (x \in \bigcup_(i <- r | P i) F i). Lemma bigfcupsP (U : {fset T}) P F : reflect (forall i : I, i \in r -> P i -> F i `<=` U) (\bigcup_(i <- r | P i) F i `<=` U). Proof. (* Goal: Bool.reflect (forall (i : Equality.sort I) (_ : is_true (@in_mem (Equality.sort I) i (@mem (Equality.sort I) (seq_predType I) r))) (_ : is_true (P i)), is_true (@fsubset T (F i) U)) (@fsubset T (@BigOp.bigop (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) (@fset0 T) r (fun i : Equality.sort I => @BigBody (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) i (@fsetU T) (P i) (F i))) U) *) apply: (iffP idP) => [sFU i ri Pi| sFU]. (* Goal: is_true (@fsubset T (@BigOp.bigop (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) (@fset0 T) r (fun i : Equality.sort I => @BigBody (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) i (@fsetU T) (P i) (F i))) U) *) (* Goal: is_true (@fsubset T (F i) U) *) by apply: fsubset_trans sFU; apply: bigfcup_sup. (* Goal: is_true (@fsubset T (@BigOp.bigop (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) (@fset0 T) r (fun i : Equality.sort I => @BigBody (@finset_of T (Phant (Choice.sort T))) (Equality.sort I) i (@fsetU T) (P i) (F i))) U) *) by apply/fsubsetP=> x /bigfcupP[i /andP[ri Pi]]; apply/fsubsetP/sFU. Qed. End BigFOpsSeq. Lemma finSet_rect (T : choiceType) (P : {fset T} -> Type) : P fset0 -> (forall X, (forall Y, Y `<` X -> P Y) -> P X) -> forall X, P X. Proof. (* Goal: forall (_ : P (@fset0 T)) (_ : forall (X : @finset_of T (Phant (Choice.sort T))) (_ : forall (Y : @finset_of T (Phant (Choice.sort T))) (_ : is_true (@fproper T Y X)), P Y), P X) (X : @finset_of T (Phant (Choice.sort T))), P X *) move=> P0 Psub X; move: (leqnn #|` X|); move: (X in Y in _ <= Y) => Y. (* Goal: forall _ : is_true (leq (@size (Choice.sort T) (@enum_fset T X)) (@size (Choice.sort T) (@enum_fset T Y))), P X *) elim: #|` _| X => [|n IHn] {Y} X; first by rewrite leqn0 cardfs_eq0 => /eqP->. (* Goal: forall _ : is_true (leq (@size (Choice.sort T) (@enum_fset T X)) (S n)), P X *) move=> Xleq; apply: Psub => Y XsubY; apply: IHn. (* Goal: is_true (leq (@size (Choice.sort T) (@enum_fset T Y)) n) *) by rewrite -ltnS (leq_trans _ Xleq) // fproper_ltn_card. Qed. Lemma fset_bounded_coind (T : choiceType) (P : {fset T} -> Type) (U : {fset T}): (forall X, (forall Y, Y `<=` U -> X `<` Y -> P Y) -> P X) -> forall X, X `<=` U -> P X. Proof. (* Goal: forall (_ : forall (X : @finset_of T (Phant (Choice.sort T))) (_ : forall (Y : @finset_of T (Phant (Choice.sort T))) (_ : is_true (@fsubset T Y U)) (_ : is_true (@fproper T X Y)), P Y), P X) (X : @finset_of T (Phant (Choice.sort T))) (_ : is_true (@fsubset T X U)), P X *) move=> Psuper X XsubU; rewrite -[X](fsetDK XsubU)//. (* Goal: P (@fsetD T U (@fsetD T U X)) *) have {XsubU}: (U `\` X) `<=` U by rewrite fsubsetDl. (* Goal: forall _ : is_true (@fsubset T (@fsetD T U X) U), P (@fsetD T U (@fsetD T U X)) *) elim: (_ `\` X) => {X} [|X IHX] XsubU. (* Goal: P (@fsetD T U X) *) (* Goal: P (@fsetD T U (@fset0 T)) *) rewrite fsetD0; apply: Psuper => Y /fsub_proper_trans UY/UY. (* Goal: P (@fsetD T U X) *) (* Goal: forall _ : is_true (@fproper T Y Y), P Y *) by rewrite fproperEneq eqxx. (* Goal: P (@fsetD T U X) *) apply: Psuper => Y /fsetDK<-; rewrite fproperD2l ?fsubsetDl //. (* Goal: forall _ : is_true (@fproper T (@fsetD T U Y) X), P (@fsetD T U (@fsetD T U Y)) *) by move=> /IHX; apply; rewrite fsubsetDl. Qed. Lemma iter_fix T (f : T -> T) x n : f x = x -> iter n f x = x. Proof. (* Goal: forall _ : @eq T (f x) x, @eq T (@iter T n f x) x *) by move=> fixf; elim: n => //= n ->. Qed. Section SetFixpoint. Section Least. Variables (T : finType) (F : {set T} -> {set T}). Hypothesis (F_mono : {homo F : X Y / X \subset Y}). Let n := #|T|. Notation iterF := (fun i => iter i F set0). Lemma set_iterF_sub i : iterF i \subset iterF i.+1. Proof. (* Goal: is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) i))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) (S i))))) *) by elim: i => [| i IHi]; rewrite /= ?sub0set ?F_mono. Qed. Lemma set_iterF_mono : {homo iterF : i j / i <= j >-> i \subset j}. Proof. (* Goal: @homomorphism_2 nat (@set_of T (Phant (Finite.sort T))) (fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) (fun i j : nat => is_true (leq i j)) (fun i j : @set_of T (Phant (Finite.sort T)) => is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T i)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T j)))) *) by apply: homo_leq => //[???|]; [apply: subset_trans|apply: set_iterF_sub]. Qed. Definition set_fix := iterF n. Lemma set_fixK : F set_fix = set_fix. Hint Resolve set_fixK. Lemma set_fixKn k : iter k F set_fix = set_fix. Proof. (* Goal: @eq (@set_of T (Phant (Finite.sort T))) (@iter (@set_of T (Phant (Finite.sort T))) k F set_fix) set_fix *) by rewrite iter_fix. Qed. Lemma iter_sub_fix k : iterF k \subset set_fix. Proof. (* Goal: is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) k))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix))) *) have [/set_iterF_mono//|/ltnW/subnK<-] := leqP k n; by rewrite iter_add set_fixKn. Qed. Lemma fix_order_proof x : x \in set_fix -> exists n, x \in iterF n. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix))), @ex nat (fun n : nat => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) n))))) *) by move=> x_fix; exists n. Qed. Definition fix_order (x : T) := if (x \in set_fix) =P true isn't ReflectT x_fix then 0 else (ex_minn (fix_order_proof x_fix)). Lemma fix_order_le_max (x : T) : fix_order x <= n. Proof. (* Goal: is_true (leq (fix_order x) n) *) rewrite /fix_order; case: eqP => //= x_in. (* Goal: is_true (leq (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in)) n) *) by case: ex_minnP => //= ??; apply. Qed. Lemma in_iter_fix_orderE (x : T) : (x \in iterF (fix_order x)) = (x \in set_fix). Proof. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) (fix_order x))))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix))) *) rewrite /fix_order; case: eqP; last by move=>/negP/negPf->; rewrite inE. (* Goal: forall p : @eq (Equality.sort bool_eqType) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix))) true, @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x p)) F (@set0 T))))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix))) *) by move=> x_in; case: ex_minnP => m ->; rewrite x_in. Qed. Lemma fix_order_gt0 (x : T) : (fix_order x > 0) = (x \in set_fix). Proof. (* Goal: @eq bool (leq (S O) (fix_order x)) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix))) *) rewrite /fix_order; case: eqP => [x_in|/negP/negPf->//]. (* Goal: @eq bool (leq (S O) (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix))) *) by rewrite x_in; case: ex_minnP => -[|m]; rewrite ?inE//= => _; apply. Qed. Lemma fix_order_eq0 (x : T) : (fix_order x == 0) = (x \notin set_fix). Proof. (* Goal: @eq bool (@eq_op nat_eqType (fix_order x) O) (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix)))) *) by rewrite -fix_order_gt0 -ltnNge ltnS leqn0. Qed. Lemma in_iter_fixE (x : T) k : (x \in iterF k) = (0 < fix_order x <= k). Proof. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) k)))) (andb (leq (S O) (fix_order x)) (leq (fix_order x) k)) *) rewrite /fix_order; case: eqP => //= [x_in|/negP xNin]; last first. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) k F (@set0 T))))) (andb (leq (S O) (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in))) (leq (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in)) k)) *) (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) k F (@set0 T))))) false *) by apply: contraNF xNin; apply/subsetP/iter_sub_fix. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) k F (@set0 T))))) (andb (leq (S O) (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in))) (leq (@ex_minn (fun n : nat => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) n F (@set0 T))))) (@fix_order_proof x x_in)) k)) *) case: ex_minnP => -[|m]; rewrite ?inE// => xm mP. (* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@iter (@set_of T (Phant (Finite.sort T))) k F (@set0 T))))) (andb (leq (S O) (S m)) (leq (S m) k)) *) by apply/idP/idP=> [/mP//|lt_mk]; apply: subsetP xm; apply: set_iterF_mono. Qed. Lemma in_iter (x : T) k : x \in set_fix -> fix_order x <= k -> x \in iterF k. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix)))) (_ : is_true (leq (fix_order x) k)), is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) k)))) *) by move=> x_in xk; rewrite in_iter_fixE fix_order_gt0 x_in xk. Qed. Lemma notin_iter (x : T) k : k < fix_order x -> x \notin iterF k. Proof. (* Goal: forall _ : is_true (leq (S k) (fix_order x)), is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) k))))) *) by move=> k_le; rewrite in_iter_fixE negb_and orbC -ltnNge k_le. Qed. Lemma fix_order_small x k : x \in iterF k -> fix_order x <= k. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) k)))), is_true (leq (fix_order x) k) *) by rewrite in_iter_fixE => /andP[]. Qed. Lemma fix_order_big x k : x \in set_fix -> x \notin iterF k -> fix_order x > k. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T set_fix)))) (_ : is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) k)))))), is_true (leq (S k) (fix_order x)) *) by move=> x_in; rewrite in_iter_fixE fix_order_gt0 x_in /= -ltnNge. Qed. Lemma le_fix_order (x y : T) : y \in iterF (fix_order x) -> fix_order y <= fix_order x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T ((fun i : nat => @iter (@set_of T (Phant (Finite.sort T))) i F (@set0 T)) (fix_order x))))), is_true (leq (fix_order y) (fix_order x)) *) exact: fix_order_small. Qed. End Least. Section Greatest. Variables (T : finType) (F : {set T} -> {set T}). Hypothesis (F_mono : {homo F : X Y / X \subset Y}). Notation n := #|T|. Definition funsetC X := ~: (F (~: X)). Notation G := funsetC. Lemma funsetC_mono : {homo G : X Y / X \subset Y}. Proof. (* Goal: @homomorphism_2 (@set_of T (Phant (Finite.sort T))) (@set_of T (Phant (Finite.sort T))) funsetC (fun X Y : @set_of T (Phant (Finite.sort T)) => is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T X)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T Y)))) (fun X Y : @set_of T (Phant (Finite.sort T)) => is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T X)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T Y)))) *) by move=> *; rewrite subCset setCK F_mono// subCset setCK. Qed. Hint Resolve funsetC_mono. Definition set_cofix := ~: set_fix G. Lemma set_cofixK : F set_cofix = set_cofix. Proof. (* Goal: @eq (@set_of T (Phant (Finite.sort T))) (F set_cofix) set_cofix *) by rewrite /set_cofix -[in RHS]set_fixK ?setCK. Qed. End Greatest. End SetFixpoint. Section Fixpoints. Variables (T : choiceType) (U : {fset T}). Definition sub_fun (F : {fset T} -> {fset T}) (X : {set U}) : {set U} := fsub U (F [fsetval x in X]). Lemma fset_fsub X : X `<=` U -> [fsetval x in fsub U X] = X. Variable (F : {fset T} -> {fset T}). Hypothesis (F_mono : {homo F : X Y / X `<=` Y}) (F_bound : {homo F : X / X `<=` U}). Notation Fsub := (sub_fun F). Notation iterF := (fun i => iter i F fset0). Lemma Fsub_mono : {homo Fsub : X Y / X \subset Y}. Hint Resolve Fsub_mono. Definition fset_fix := [fsetval x in set_fix Fsub]. Lemma fset_iterFE i : iterF i = [fsetval x in iter i Fsub set0]. Proof. (* Goal: @eq (@finset_of T (Phant (Choice.sort T))) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) i) (@Imfset.imfset imfset_key (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U))) T (fun x : Choice.sort (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U))) => @val (Choice.sort T) (fun x0 : Choice.sort T => @in_mem (Choice.sort T) x0 (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x0 : Choice.sort T => @in_mem (Choice.sort T) x0 (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U)) x) (@mem_fin (Choice.eqType (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U)))) (predPredType (Finite.sort (@fset_sub_finType T U))) (@fin_finpred (Choice.eqType (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U)))) (pred_finpredType (@subFinType_finType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U))) (@SetDef.pred_of_set (@fset_sub_finType T U) (@iter (@set_of (@fset_sub_finType T U) (Phant (@fset_sub_type T U))) i (sub_fun F) (@set0 (@fset_sub_finType T U)))))) (Phantom (mem_pred (Finite.sort (@fset_sub_finType T U))) (@mem (Finite.sort (@fset_sub_finType T U)) (predPredType (Finite.sort (@fset_sub_finType T U))) (@SetDef.pred_of_set (@fset_sub_finType T U) (@iter (@set_of (@fset_sub_finType T U) (Phant (@fset_sub_type T U))) i (sub_fun F) (@set0 (@fset_sub_finType T U))))))) *) elim: i => [|i /= -> /=]; last by rewrite fset_fsub // F_bound//= fset_sub_val. (* Goal: @eq (@finset_of T (Phant (Choice.sort T))) (@iter (@finset_of T (Phant (Choice.sort T))) O F (@fset0 T)) (@Imfset.imfset imfset_key (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U))) T (fun x : Choice.sort (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U))) => @val (Choice.sort T) (fun x0 : Choice.sort T => @in_mem (Choice.sort T) x0 (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x0 : Choice.sort T => @in_mem (Choice.sort T) x0 (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U)) x) (@mem_fin (Choice.eqType (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U)))) (predPredType (Finite.sort (@fset_sub_finType T U))) (@fin_finpred (Choice.eqType (@sub_choiceType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@subFin_sort T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U)))) (pred_finpredType (@subFinType_finType T (fun x : Choice.sort T => @in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) U)) (@fset_sub_subfinType T U))) (@SetDef.pred_of_set (@fset_sub_finType T U) (@iter (@set_of (@fset_sub_finType T U) (Phant (@fset_sub_type T U))) O (sub_fun F) (@set0 (@fset_sub_finType T U)))))) (Phantom (mem_pred (Finite.sort (@fset_sub_finType T U))) (@mem (Finite.sort (@fset_sub_finType T U)) (predPredType (Finite.sort (@fset_sub_finType T U))) (@SetDef.pred_of_set (@fset_sub_finType T U) (@iter (@set_of (@fset_sub_finType T U) (Phant (@fset_sub_type T U))) O (sub_fun F) (@set0 (@fset_sub_finType T U))))))) *) by apply/fsetP=> x; rewrite in_fset_val /=; case: insub=> //= ?; rewrite !inE. Qed. Lemma fset_iterF_sub i : iterF i `<=` U. Proof. (* Goal: is_true (@fsubset T ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) i) U) *) by rewrite /= fset_iterFE fset_sub_val. Qed. Lemma fset_fixK : F fset_fix = fset_fix. Proof. (* Goal: @eq (@finset_of T (Phant (Choice.sort T))) (F fset_fix) fset_fix *) by rewrite /fset_fix -[in RHS]set_fixK// fset_fsub// F_bound//= fset_sub_val. Qed. Hint Resolve fset_fixK. Lemma fset_fixKn k : iter k F fset_fix = fset_fix. Proof. (* Goal: @eq (@finset_of T (Phant (Choice.sort T))) (@iter (@finset_of T (Phant (Choice.sort T))) k F fset_fix) fset_fix *) by rewrite iter_fix. Qed. Lemma iter_sub_ffix k : iterF k `<=` fset_fix. Proof. (* Goal: is_true (@fsubset T ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) k) fset_fix) *) by rewrite /fset_fix !fset_iterFE; apply/subset_imfset/subsetP/iter_sub_fix. Qed. Definition ffix_order (x : T) := if x \in U =P true is ReflectT xU then fix_order Fsub [` xU] else 0. Lemma ffix_order_le_max (x : T) : ffix_order x <= #|` U|. Proof. (* Goal: is_true (leq (ffix_order x) (@size (Choice.sort T) (@enum_fset T U))) *) by rewrite /ffix_order; case: eqP => //= x_in; rewrite cardfE fix_order_le_max. Qed. Lemma in_iter_ffix_orderE (x : T) : (x \in iterF (ffix_order x)) = (x \in fset_fix). Proof. (* Goal: @eq bool (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) (ffix_order x)))) (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix)) *) rewrite /ffix_order; case: eqP => [xU|/negP xNU]; last first. (* Goal: @eq bool (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) (@iter (@finset_of T (Phant (Choice.sort T))) (@fix_order (@fset_sub_finType T U) (sub_fun F) (@FSetSub T U x xU)) F (@fset0 T)))) (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix)) *) (* Goal: @eq bool (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) (@iter (@finset_of T (Phant (Choice.sort T))) O F (@fset0 T)))) (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix)) *) by rewrite !inE /fset_fix in_fset_valF. (* Goal: @eq bool (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) (@iter (@finset_of T (Phant (Choice.sort T))) (@fix_order (@fset_sub_finType T U) (sub_fun F) (@FSetSub T U x xU)) F (@fset0 T)))) (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix)) *) by rewrite fset_iterFE !in_fset_valT /= in_iter_fix_orderE. Qed. Lemma ffix_order_gt0 (x : T) : (ffix_order x > 0) = (x \in fset_fix). Proof. (* Goal: @eq bool (leq (S O) (ffix_order x)) (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix)) *) rewrite /ffix_order; case: eqP => [xU|/negP xNU]; last by rewrite in_fset_valF. (* Goal: @eq bool (leq (S O) (@fix_order (@fset_sub_finType T U) (sub_fun F) (@FSetSub T U x xU))) (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix)) *) by rewrite fix_order_gt0 in_fset_valT. Qed. Lemma ffix_order_eq0 (x : T) : (ffix_order x == 0) = (x \notin fset_fix). Proof. (* Goal: @eq bool (@eq_op nat_eqType (ffix_order x) O) (negb (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix))) *) by rewrite -ffix_order_gt0 -ltnNge ltnS leqn0. Qed. Lemma in_iter_ffixE (x : T) k : (x \in iterF k) = (0 < ffix_order x <= k). Proof. (* Goal: @eq bool (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) k))) (andb (leq (S O) (ffix_order x)) (leq (ffix_order x) k)) *) rewrite /ffix_order fset_iterFE; case: eqP => [xU|/negP xNU]; by [rewrite in_fset_valF|rewrite in_fset_valT /= in_iter_fixE]. Qed. Lemma in_iter_ffix (x : T) k : x \in fset_fix -> ffix_order x <= k -> x \in iterF k. Proof. (* Goal: forall (_ : is_true (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix))) (_ : is_true (leq (ffix_order x) k)), is_true (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) k))) *) by move=> x_in xk; rewrite in_iter_ffixE ffix_order_gt0 x_in xk. Qed. Lemma notin_iter_ffix (x : T) k : k < ffix_order x -> x \notin iterF k. Proof. (* Goal: forall _ : is_true (leq (S k) (ffix_order x)), is_true (negb (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) k)))) *) by move=> k_le; rewrite in_iter_ffixE negb_and orbC -ltnNge k_le. Qed. Lemma ffix_order_small x k : x \in iterF k -> ffix_order x <= k. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) k))), is_true (leq (ffix_order x) k) *) by rewrite in_iter_ffixE => /andP[]. Qed. Lemma ffix_order_big x k : x \in fset_fix -> x \notin iterF k -> ffix_order x > k. Proof. (* Goal: forall (_ : is_true (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) fset_fix))) (_ : is_true (negb (@in_mem (Choice.sort T) x (@mem (Choice.sort T) (finSetPredType T) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) k))))), is_true (leq (S k) (ffix_order x)) *) by move=> x_in; rewrite in_iter_ffixE ffix_order_gt0 x_in -ltnNge. Qed. Lemma le_ffix_order (x y : T) : y \in iterF (ffix_order x) -> ffix_order y <= ffix_order x. Proof. (* Goal: forall _ : is_true (@in_mem (Choice.sort T) y (@mem (Choice.sort T) (finSetPredType T) ((fun i : nat => @iter (@finset_of T (Phant (Choice.sort T))) i F (@fset0 T)) (ffix_order x)))), is_true (leq (ffix_order y) (ffix_order x)) *) exact: ffix_order_small. Qed. End Fixpoints. Section DefMap. Variables (K : choiceType) (V : Type). Record finMap : Type := FinMap { domf : {fset K}; ffun_of_fmap :> {ffun domf -> V} }. Definition finmap_of (_ : phant (K -> V)) := finMap. Let T_ (domf : {fset K}) := {ffun domf -> V}. Local Notation finMap' := {domf : _ & T_ domf}. End DefMap. Notation "{fmap T }" := (@finmap_of _ _ (Phant T)) : type_scope. Definition pred_of_finmap (K : choiceType) (V : Type) (f : {fmap K -> V}) : pred K := mem (domf f). Canonical finMapPredType (K : choiceType) (V : Type) := Eval hnf in mkPredType (@pred_of_finmap K V). Delimit Scope fmap_scope with fmap. Local Open Scope fmap_scope. Notation "f .[ kf ]" := (f [` kf]) : fmap_scope. Arguments ffun_of_fmap : simpl never. Notation "[ 'fmap' x : aT => F ]" := (FinMap [ffun x : aT => F]) (at level 0, x ident, only parsing) : fun_scope. Notation "[ 'fmap' : aT => F ]" := (FinMap [ffun : aT => F]) (at level 0, only parsing) : fun_scope. Notation "[ 'fmap' x => F ]" := [fmap x : _ => F] (at level 0, x ident, format "[ 'fmap' x => F ]") : fun_scope. Notation "[ 'fmap' => F ]" := [fmap: _ => F] (at level 0, format "[ 'fmap' => F ]") : fun_scope. Canonical finmap_of_finfun (K : choiceType) V (A : {fset K}) (f : {ffun A -> V}) := FinMap f. Arguments finmap_of_finfun /. Arguments ffun_of_fmap : simpl nomatch. Section OpsMap. Variables (K : choiceType). Definition fmap0 V : {fmap K -> V} := FinMap (ffun0 _ (cardfT0 K)). Definition fnd V (A : {fset K}) (f : {ffun A -> V}) (k : K) := omap f (insub k). Inductive fnd_spec V (A : {fset K}) (f : {ffun A -> V}) k : bool -> option A -> option V -> Type := | FndIn (kf : k \in A) : fnd_spec f k true (some [` kf]) (some (f.[kf])) | FndOut (kNf : k \notin A) : fnd_spec f k false None None. Definition setf V (f : {fmap K -> V}) (k0 : K) (v0 : V) : {fmap K -> V} := [fmap k : k0 |` domf f => if val k == k0 then v0 else odflt v0 (fnd f (val k))]. End OpsMap. Prenex Implicits fnd setf. Arguments fmap0 {K V}. Arguments setf : simpl never. Arguments fnd : simpl never. Notation "[ 'fmap' 'of' T ]" := (fmap0 : {fmap T}) (only parsing) : fmap_scope. Notation "[fmap]" := fmap0 : fmap_scope. Notation "x .[ k <- v ]" := (setf x k v) : fmap_scope. Notation "f .[? k ]" := (fnd f k) : fmap_scope. Section FinMapCanonicals. Variable K : choiceType. Let finMap_on (V : Type) (d : {fset K}) := {ffun d -> V}. Local Notation finMap_ V := {d : _ & finMap_on V d}. Definition finMap_encode V (f : {fmap K -> V}) := Tagged (finMap_on V) (ffun_of_fmap f). Definition finMap_decode V (f : finMap_ V) := FinMap (tagged f). Lemma finMap_codeK V : cancel (@finMap_encode V) (@finMap_decode V). Proof. (* Goal: @cancel (@sigT (@finset_of K (Phant (Choice.sort K))) (fun x : @finset_of K (Phant (Choice.sort K)) => finMap_on V x)) (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@finMap_encode V) (@finMap_decode V) *) by case. Qed. Section FinMapEqType. Variable V : eqType. Definition finMap_eqMixin := CanEqMixin (@finMap_codeK V). Canonical finMap_eqType := EqType {fmap K -> V} finMap_eqMixin. End FinMapEqType. Section FinMapChoiceType. Variable V : choiceType. Definition finMap_choiceMixin := CanChoiceMixin (@finMap_codeK V). Canonical finMap_choiceType := ChoiceType {fmap K -> V} finMap_choiceMixin. End FinMapChoiceType. End FinMapCanonicals. Section FinMapTheory. Variables (K : choiceType). Lemma fndP V (f : {fmap K -> V}) k : fnd_spec f k (k \in domf f) (insub k) (f.[? k]). Proof. (* Goal: @fnd_spec K V (@domf K V f) (@ffun_of_fmap K V f) k (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f)) k) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) rewrite /fnd; case: insubP=> [[k' k'f] _ {k} <- /=|kNf]. (* Goal: @fnd_spec K V (@domf K V f) (@ffun_of_fmap K V f) k (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@None (@sub_sort (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f)))) (@Option.map (Finite.sort (@fset_sub_finType K (@domf K V f))) V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f)) (@None (@sub_sort (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f))))) *) (* Goal: @fnd_spec K V (@domf K V f) (@ffun_of_fmap K V f) k' (@in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@Some (@fset_sub_type K (@domf K V f)) (@FSetSub K (@domf K V f) k' k'f)) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k' k'f))) *) by rewrite k'f; constructor. (* Goal: @fnd_spec K V (@domf K V f) (@ffun_of_fmap K V f) k (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@None (@sub_sort (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f)))) (@Option.map (Finite.sort (@fset_sub_finType K (@domf K V f))) V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f)) (@None (@sub_sort (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f))))) *) by rewrite (negPf kNf); constructor. Qed. Lemma fndSome V (f : {fmap K -> V}) (k : K) : f.[? k] = (k \in f) :> bool. Proof. (* Goal: @eq bool (@isSome V (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)) *) by case: fndP. Qed. Lemma not_fnd V (f : {fmap K -> V}) (k : K) : k \notin f -> f.[? k] = None. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))), @eq (option V) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) (@None V) *) by case: fndP. Qed. Lemma getfE V (f : {fmap K -> V}) (k : domf f) (kf : val k \in domf f) : f.[kf] = f k :> V. Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f)) k) kf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) k) *) by congr (_ _); apply: val_inj. Qed. Lemma eq_getf V (f : {fmap K -> V}) k (kf kf' : k \in domf f) : f.[kf] = f.[kf'] :> V. Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kf')) *) by rewrite (@getfE _ _ [` kf']). Qed. Lemma Some_fnd V (f : {fmap K -> V}) (k : domf f) : Some (f k) = f.[? val k]. Proof. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) k)) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f)) k)) *) by case: fndP (valP k) => // ? _; rewrite getfE. Qed. Lemma in_fnd V (f : {fmap K -> V}) (k : K) (kf : k \in domf f) : f.[? k] = Some f.[kf]. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kf))) *) by rewrite Some_fnd. Qed. Lemma fnd_if V (cond : bool) (f g : {fmap K -> V}) (k : K) : ((if cond then f else g) : finMap _ _).[? k] = Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V ((if cond then f else g) : finMap K V)) (@ffun_of_fmap K V ((if cond then f else g) : finMap K V)) k) (if cond then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k) *) by case: cond. Qed. Lemma getfP V (f g : {fmap K -> V}) : domf f = domf g -> (forall k (kMf : k \in f) (kMg : k \in g), f.[kMf] = g.[kMg]) -> f = g. Proof. (* Goal: forall (_ : @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V f) (@domf K V g)) (_ : forall (k : Choice.sort K) (kMf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) (kMg : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kMf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V g)) V (@ffun_of_fmap K V g) (@FSetSub K (@domf K V g) k kMg))), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move: f g => [kf f] [kg g] /= eq_kfg; case: _ / eq_kfg in g * => {kg}. (* Goal: forall _ : forall (k : Choice.sort K) (kMf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (@FinMap K V kf f)))) (kMg : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (@FinMap K V kf g)))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K kf) V f (@FSetSub K kf k kMf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K kf) V g (@FSetSub K kf k kMg)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@FinMap K V kf f) (@FinMap K V kf g) *) move=> eq_fg; congr FinMap; apply/ffunP => /= x. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K kf) V f x) (@FunFinfun.fun_of_fin (@fset_sub_finType K kf) V g x) *) by do [rewrite -!getfE; do ?exact: valP] => *. Qed. Qed. Lemma fmapP V (f g : {fmap K -> V}) : (forall k, f.[? k] = g.[? k]) <-> f = g. Lemma fnd_fmap0 V k : ([fmap] : {fmap K -> V}).[? k] = None. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (@fmap0 K V : @finmap_of K V (Phant (forall _ : Choice.sort K, V)))) (@ffun_of_fmap K V (@fmap0 K V : @finmap_of K V (Phant (forall _ : Choice.sort K, V)))) k) (@None V) *) by rewrite not_fnd // in_fset0. Qed. Lemma mem_setf V (f : {fmap K -> V}) (k0 : K) (v0 : V) : f.[k0 <- v0] =i predU1 k0 (mem (domf f)). Proof. (* Goal: @eq_mem (Choice.sort K) (@mem (Choice.sort K) (finMapPredType K V) (@setf K V f k0 v0)) (@mem (Equality.sort (Choice.eqType K)) (simplPredType (Equality.sort (Choice.eqType K))) (@predU1 (Choice.eqType K) k0 (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) (@domf K V f)))))) *) by move=> k; rewrite !inE. Qed. Lemma dom_setf V (f : {fmap K -> V}) (k0 : K) (v0 : V) : domf (f.[k0 <- v0]) = k0 |` domf f. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V (@setf K V f k0 v0)) (@fsetU K (@fset1 K k0) (@domf K V f)) *) by apply/fsetP=> k; rewrite mem_setf. Qed. Lemma fnd_set_in V (f : {fmap K -> V}) k0 v0 (x : domf f.[k0 <- v0]) : Proof. (* Goal: forall _ : is_true (negb (@eq_op (Choice.eqType K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V (@setf K V f k0 v0)))) (@fset_sub_subType K (@domf K V (@setf K V f k0 v0))) x) k0)), is_true (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V (@setf K V f k0 v0)))) (@fset_sub_subType K (@domf K V (@setf K V f k0 v0))) x) (@mem (Choice.sort K) (finMapPredType K V) f)) *) by have := valP x; rewrite mem_setf inE; case: eqP. Qed. Lemma setfK V (f : {fmap K -> V}) k0 v0 (x : domf f.[k0 <- v0]): Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (@setf K V f k0 v0))) V (@ffun_of_fmap K V (@setf K V f k0 v0)) x) match @eqVneq (Choice.eqType K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V (@setf K V f k0 v0)))) (@fset_sub_subType K (@domf K V (@setf K V f k0 v0))) x) k0 with | left e => v0 | right xNk0 => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V (@setf K V f k0 v0)))) (@fset_sub_subType K (@domf K V (@setf K V f k0 v0))) x) (@fnd_set_in V f k0 v0 x xNk0)) end *) case: eqVneq => [|xNk0]; rewrite ?ffunE /=; first by move->; rewrite eqxx. (* Goal: @eq V (if @eq_op (Choice.eqType K) (@fsval K (@fsetU K (@fset1 K k0) (@domf K V f)) x) k0 then v0 else @Option.default V v0 (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) (@fsval K (@fsetU K (@fset1 K k0) (@domf K V f)) x))) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) (@fsval K (@fsetU K (@fset1 K k0) (@domf K V f)) x) (@fnd_set_in V f k0 v0 x xNk0))) *) by rewrite (negPf xNk0) in_fnd ?fnd_set_in //= => xf; apply: eq_getf. Qed. Lemma fnd_set V (f : {fmap K -> V}) k0 v0 k : f.[k0 <- v0].[? k] = if k == k0 then Some v0 else f.[? k]. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (@setf K V f k0 v0)) (@ffun_of_fmap K V (@setf K V f k0 v0)) k) (if @eq_op (Choice.eqType K) k k0 then @Some V v0 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) case: fndP => [ksf|]; last first. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (@setf K V f k0 v0))) V (@ffun_of_fmap K V (@setf K V f k0 v0)) (@FSetSub K (@domf K V (@setf K V f k0 v0)) k ksf))) (if @eq_op (Choice.eqType K) k k0 then @Some V v0 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V (@setf K V f k0 v0))))), @eq (option V) (@None V) (if @eq_op (Choice.eqType K) k k0 then @Some V v0 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by rewrite mem_setf inE negb_or => /andP [/negPf ->]; case: fndP. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (@setf K V f k0 v0))) V (@ffun_of_fmap K V (@setf K V f k0 v0)) (@FSetSub K (@domf K V (@setf K V f k0 v0)) k ksf))) (if @eq_op (Choice.eqType K) k k0 then @Some V v0 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) rewrite setfK; case: eqVneq => //= [->|kNk0]; first by rewrite eqxx. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k (@fnd_set_in V f k0 v0 (@FSetSub K (@fsetU K (@fset1 K k0) (@domf K V f)) k ksf) kNk0)))) (if @eq_op (Choice.eqType K) k k0 then @Some V v0 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by rewrite Some_fnd (negPf kNk0). Qed. Lemma fmap_nil V (f : {fmap K -> V}) : domf f = fset0 -> f = [fmap]. Proof. (* Goal: forall _ : @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V f) (@fset0 K), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f (@fmap0 K V) *) by move=> kf0; apply: getfP => //= k ? kMg; have := kMg; rewrite !inE. Qed. Lemma getf_set V (f : {fmap K -> V}) (k : K) (v : V) (kf' : k \in _) : f.[k <- v].[kf'] = v. Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (@setf K V f k v))) V (@ffun_of_fmap K V (@setf K V f k v)) (@FSetSub K (@domf K V (@setf K V f k v)) k kf')) v *) by apply: Some_inj; rewrite Some_fnd fnd_set eqxx. Qed. Lemma setf_get V (f : {fmap K -> V}) (k : domf f) : f.[val k <- f k] = f. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fset_sub_subType K (@domf K V f)) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) k)) f *) by apply/fmapP=> k'; rewrite fnd_set Some_fnd; case: eqP => [->|]. Qed. Lemma setfNK V (f : {fmap K -> V}) (k k' : K) (v : V) (k'f : k' \in _) (k'f' : k' \in _): f.[k <- v].[k'f'] = if k' == k then v else f.[k'f]. Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (@setf K V f k v))) V (@ffun_of_fmap K V (@setf K V f k v)) (@FSetSub K (@domf K V (@setf K V f k v)) k' k'f')) (if @eq_op (Choice.eqType K) k' k then v else @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k' k'f)) *) by apply: Some_inj; rewrite Some_fnd !fnd_set in_fnd; case: ifP. Qed. End FinMapTheory. Section ReduceOp. Variable (K : choiceType) (V : Type). Implicit Types (f : {fmap K -> option V}). Lemma reducef_subproof f (x : [fsetval x : domf f | f x]) : f (fincl (fset_sub_val _ _) x). Proof. (* Goal: is_true (@isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (Equality.sort (@Equality.clone (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqType K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f)) (fun x : Equality.sort (@fset_sub_eqType K (@domf K (option V) f)) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f))) => x)))) (@pred_of_finmempred (@Equality.clone (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqType K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f)) (fun x : Equality.sort (@fset_sub_eqType K (@domf K (option V) f)) => x) (fun x : phantom Equality.type (@Equality.Pack (@fset_sub_type K (@domf K (option V) f)) (@fset_sub_eqMixin K (@domf K (option V) f))) => x)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))) (@domf K (option V) f) (@fset_sub_val imfset_key K (@domf K (option V) f) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))) x))) *) set y := (y in f y); suff : val y \in [fsetval x : domf f | f x]. (* Goal: is_true (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) y) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) => @val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => andb (@in_mem (@fset_sub_type K (@domf K (option V) f)) x (@mem (@fset_sub_type K (@domf K (option V) f)) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (@isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))))) *) (* Goal: forall _ : is_true (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) y) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) => @val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => andb (@in_mem (@fset_sub_type K (@domf K (option V) f)) x (@mem (@fset_sub_type K (@domf K (option V) f)) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (@isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))))), is_true (@isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) y)) *) by rewrite val_in_fset. (* Goal: is_true (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) y) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) => @val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => andb (@in_mem (@fset_sub_type K (@domf K (option V) f)) x (@mem (@fset_sub_type K (@domf K (option V) f)) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (@isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))))) *) by suff -> : val y = val x by exact: valP. Qed. Definition reducef f : {fmap K -> V} := [fmap x => oextract (@reducef_subproof f x)]. Lemma domf_reduce f : domf (reducef f) = [fsetval x : domf f | f x]. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V (reducef f)) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : Choice.sort (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) => @val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => andb (@in_mem (@fset_sub_type K (@domf K (option V) f)) x (@mem (@fset_sub_type K (@domf K (option V) f)) (predPredType (@fset_sub_type K (@domf K (option V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (option V) f) : predArgType))))) (@isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))) *) by []. Qed. Lemma mem_reducef f k : k \in reducef f = ojoin f.[? k]. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (reducef f))) (@isSome V (@ojoin V (@fnd K (option V) (@domf K (option V) f) (@ffun_of_fmap K (option V) f) k))) *) rewrite inE; case: fndP => [kf|] /=; first by rewrite in_fset_valT. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f)))), @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : @fset_sub_type K (@domf K (option V) f) => @fsval K (@domf K (option V) f) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))))))) false *) by apply: contraNF; apply: (fsubsetP (fset_sub_val _ _)). Qed. Lemma fnd_reducef f k : (reducef f).[? k] = ojoin f.[? k]. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (reducef f)) (@ffun_of_fmap K V (reducef f)) k) (@ojoin V (@fnd K (option V) (@domf K (option V) f) (@ffun_of_fmap K (option V) f) k)) *) case: fndP => /= [kf|]; last by rewrite mem_reducef; case: ojoin. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : @fset_sub_type K (@domf K (option V) f) => @fsval K (@domf K (option V) f) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))) V (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : @fset_sub_type K (@domf K (option V) f) => @fsval K (@domf K (option V) f) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))))) V (fun x : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : @fset_sub_type K (@domf K (option V) f) => @fsval K (@domf K (option V) f) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))))) => @oextract V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (@fsval K (@domf K (option V) f)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x0 : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x0)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x0 : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x0)))))) (@domf K (option V) f) (@fset_sub_val imfset_key K (@domf K (option V) f) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x0 : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x0))))) x)) (@reducef_subproof f x))) (@FSetSub K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : @fset_sub_type K (@domf K (option V) f) => @fsval K (@domf K (option V) f) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))))) k kf))) (@ojoin V (@fnd K (option V) (@domf K (option V) f) (@ffun_of_fmap K (option V) f) k)) *) rewrite ffunE /= Some_oextract; apply: Some_inj; rewrite Some_fnd. (* Goal: @eq (option (option V)) (@fnd K (option V) (@domf K (option V) f) (@ffun_of_fmap K (option V) f) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)) (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (@fsval K (@domf K (option V) f)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))))) (@domf K (option V) f) (@fset_sub_val imfset_key K (@domf K (option V) f) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x))))) (@FSetSub K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) K (fun x : @fset_sub_type K (@domf K (option V) f) => @fsval K (@domf K (option V) f) x) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f))) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (predPredType (@fset_sub_type K (@domf K (option V) f))) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subType K (@domf K (option V) f)))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (option V) f))) (@fset_sub_subfinType K (@domf K (option V) f)))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (option V) f)) (pred_of_argType (@fset_sub_type K (@domf K (option V) f)))))) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (option V) f))) (@mem (@fset_sub_type K (@domf K (option V) f)) (simplPredType (@fset_sub_type K (@domf K (option V) f))) (@SimplPred (@fset_sub_type K (@domf K (option V) f)) (fun x : @fset_sub_type K (@domf K (option V) f) => @isSome V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) x)))))) k kf)))) (@Some (option V) (@ojoin V (@fnd K (option V) (@domf K (option V) f) (@ffun_of_fmap K (option V) f) k))) *) by rewrite Some_ojoin // ojoinT // -mem_reducef. Qed. Lemma get_reducef f k (krf : k \in reducef f) (kf : k \in f): Some (reducef f).[krf] = f.[kf]. Proof. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (reducef f))) V (@ffun_of_fmap K V (reducef f)) (@FSetSub K (@domf K V (reducef f)) k krf))) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (option V) f)) (option V) (@ffun_of_fmap K (option V) f) (@FSetSub K (@domf K (option V) f) k kf)) *) by rewrite Some_fnd fnd_reducef in_fnd. Qed. End ReduceOp. Arguments reducef : simpl never. Section RestrictionOps. Variable (K : choiceType) (V : Type). Implicit Types (f g : {fmap K -> V}). Definition filterf f (P : pred K) : {fmap K -> V} := [fmap x : [fset x in domf f | P x] => f (fincl (fset_sub _ _) x)]. Definition restrictf f (A : {fset K}) : {fmap K -> V} := filterf f (mem A). Notation "x .[& A ]" := (restrictf x A) : fmap_scope. Notation "x .[\ A ]" := (x.[& domf x `\` A]) : fmap_scope. Notation "x .[~ k ]" := (x.[\ [fset k]]) : fmap_scope. Lemma domf_filterf f (P : pred K) : domf (filterf f P) = [fset k in domf f | P k]. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V (filterf f P)) (@Imfset.imfset imfset_key K K (fun k : Choice.sort K => k : Choice.sort K) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K V f))) P)) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun k : Choice.sort K => andb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (P k)))))) *) by []. Qed. Lemma mem_filterf f (P : pred K) (k : K) : (k \in domf (filterf f P)) = (k \in f) && (P k) :> bool. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V (filterf f P)))) (andb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)) (P k)) *) by rewrite !inE. Qed. Lemma mem_restrictf f (A : {fset K}) (k : K) : k \in f.[& A] = (k \in A) && (k \in f) :> bool. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (restrictf f A))) (andb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) *) by rewrite mem_filterf andbC. Qed. Lemma mem_remf f (A : {fset K}) (k : K) : k \in f.[\ A] = (k \notin A) && (k \in f) :> bool. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (restrictf f (@fsetD K (@domf K V f) A)))) (andb (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A))) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) *) by rewrite mem_restrictf inE -andbA andbb. Qed. Lemma mem_remf1 f (k' k : K) : k \in f.[~ k'] = (k != k') && (k \in f) :> bool. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (restrictf f (@fsetD K (@domf K V f) (@fset1 K k'))))) (andb (negb (@eq_op (Choice.eqType K) k k')) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))) *) by rewrite mem_remf inE. Qed. Lemma domf_restrict f A : domf f.[& A] = A `&` domf f. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V (restrictf f A)) (@fsetI K A (@domf K V f)) *) by apply/fsetP=> k'; rewrite mem_restrictf !inE. Qed. Lemma domf_rem f A : domf f.[\ A] = domf f `\` A. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V (restrictf f (@fsetD K (@domf K V f) A))) (@fsetD K (@domf K V f) A) *) by rewrite domf_restrict fsetIDAC fsetIid. Qed. Lemma mem_remfF f (k : K) : k \in f.[~ k] = false. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) (restrictf f (@fsetD K (@domf K V f) (@fset1 K k))))) false *) by rewrite mem_remf1 eqxx. Qed. Lemma fnd_filterf f P k : (filterf f P).[? k] = if P k then f.[? k] else None. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (filterf f P)) (@ffun_of_fmap K V (filterf f P)) k) (if P k then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) *) case: fndP => [kff|]; last first. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (filterf f P))) V (@ffun_of_fmap K V (filterf f P)) (@FSetSub K (@domf K V (filterf f P)) k kff))) (if P k then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) *) (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V (filterf f P))))), @eq (option V) (@None V) (if P k then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) *) by rewrite in_fset => /nandP [/not_fnd->|/negPf-> //]; rewrite if_same. (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (filterf f P))) V (@ffun_of_fmap K V (filterf f P)) (@FSetSub K (@domf K V (filterf f P)) k kff))) (if P k then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) *) by have := kff; rewrite in_fset => /andP [kf ->]; rewrite ffunE Some_fnd. Qed. Lemma get_filterf f P k (kff : k \in filterf f P) (kf : k \in f) : (filterf f P).[kff] = f.[kf]. Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (filterf f P))) V (@ffun_of_fmap K V (filterf f P)) (@FSetSub K (@domf K V (filterf f P)) k kff)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kf)) *) apply: Some_inj; rewrite !Some_fnd /= fnd_filterf. (* Goal: @eq (option V) (if P k then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by move: kff; rewrite !(in_fset, inE) => /andP [? ->]. Qed. Lemma fnd_restrict f A (k : K) : f.[& A].[? k] = if k \in A then f.[? k] else None. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (restrictf f A)) (@ffun_of_fmap K V (restrictf f A)) k) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) *) by rewrite fnd_filterf. Qed. Lemma fnd_rem f A (k : K) : f.[\ A].[? k] = if k \in A then None else f.[? k]. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (restrictf f (@fsetD K (@domf K V f) A))) (@ffun_of_fmap K V (restrictf f (@fsetD K (@domf K V f) A))) k) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then @None V else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) rewrite fnd_restrict inE. (* Goal: @eq (option V) (if andb (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A))) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then @None V else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by case: fndP => ?; rewrite ?(andbT, andbF) //=; case: (_ \in _). Qed. Lemma restrictf_comp f A B : f.[& A].[& B] = f.[& A `&` B]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf (restrictf f A) B) (restrictf f (@fsetI K A B)) *) by apply/fmapP=> k; rewrite !fnd_restrict !inE; do !case: (_ \in _). Qed. Lemma remf_comp f A B : f.[\ A].[\ B] = f.[\ A `|` B]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf (restrictf f (@fsetD K (@domf K V f) A)) (@fsetD K (@domf K V (restrictf f (@fsetD K (@domf K V f) A))) B)) (restrictf f (@fsetD K (@domf K V f) (@fsetU K A B))) *) by apply/fmapP=> k; rewrite !fnd_rem inE; do !case: (_ \in _). Qed. Lemma restrictfT f : f.[& domf f] = f. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf f (@domf K V f)) f *) by apply/fmapP=> k; rewrite fnd_restrict; case: fndP. Qed. Lemma restrictf0 f : f.[& fset0] = [fmap]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf f (@fset0 K)) (@fmap0 K V) *) by apply/fmapP => k; rewrite fnd_restrict !(inE, not_fnd). Qed. Lemma fnd_rem1 f (k k' : K) : f.[~ k].[? k'] = if k' != k then f.[? k'] else None. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (restrictf f (@fsetD K (@domf K V f) (@fset1 K k)))) (@ffun_of_fmap K V (restrictf f (@fsetD K (@domf K V f) (@fset1 K k)))) k') (if negb (@eq_op (Choice.eqType K) k' k) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V) *) by rewrite fnd_rem inE; case: eqP. Qed. Lemma getf_restrict f A (k : K) (kf : k \in f) (kfA : k \in f.[& A]) : Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (restrictf f A))) V (@ffun_of_fmap K V (restrictf f A)) (@FSetSub K (@domf K V (restrictf f A)) k kfA)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kf)) *) by rewrite get_filterf. Qed. Lemma setf_restrict f A (k : K) (v : V) : f.[& A].[k <- v] = f.[k <- v].[& k |` A]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V (restrictf f A) k v) (restrictf (@setf K V f k v) (@fsetU K (@fset1 K k) A)) *) by apply/fmapP=> k'; rewrite !(fnd_set, fnd_restrict, inE); case: eqP. Qed. Lemma setf_rem f A (k : K) (v : V) : f.[\ A].[k <- v] = f.[k <- v].[\ (A `\ k)]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V (restrictf f (@fsetD K (@domf K V f) A)) k v) (restrictf (@setf K V f k v) (@fsetD K (@domf K V (@setf K V f k v)) (@fsetD K A (@fset1 K k)))) *) by rewrite setf_restrict fsetUDl. Qed. Lemma setf_rem1 f (k : K) (v : V) : f.[~ k].[k <- v] = f.[k <- v]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V (restrictf f (@fsetD K (@domf K V f) (@fset1 K k))) k v) (@setf K V f k v) *) by rewrite setf_rem fsetDv remf0. Qed. Lemma setfC f k1 k2 v1 v2 : f.[k1 <- v1].[k2 <- v2] = Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V (@setf K V f k1 v1) k2 v2) (if @eq_op (Choice.eqType K) k2 k1 then @setf K V f k2 v2 else @setf K V (@setf K V f k2 v2) k1 v1) *) apply/fmapP => k. (* Goal: @eq (option V) (@fnd K V (@domf K V (@setf K V (@setf K V f k1 v1) k2 v2)) (@ffun_of_fmap K V (@setf K V (@setf K V f k1 v1) k2 v2)) k) (@fnd K V (@domf K V (if @eq_op (Choice.eqType K) k2 k1 then @setf K V f k2 v2 else @setf K V (@setf K V f k2 v2) k1 v1)) (@ffun_of_fmap K V (if @eq_op (Choice.eqType K) k2 k1 then @setf K V f k2 v2 else @setf K V (@setf K V f k2 v2) k1 v1)) k) *) rewrite fnd_if !fnd_set. (* Goal: @eq (option V) (if @eq_op (Choice.eqType K) k k2 then @Some V v2 else if @eq_op (Choice.eqType K) k k1 then @Some V v1 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) (if @eq_op (Choice.eqType K) k2 k1 then if @eq_op (Choice.eqType K) k k2 then @Some V v2 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else if @eq_op (Choice.eqType K) k k1 then @Some V v1 else if @eq_op (Choice.eqType K) k k2 then @Some V v2 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) have [[->|kNk2] [// <-|k2Nk1]] // := (altP (k =P k2), altP (k2 =P k1)). (* Goal: @eq (option V) (if @eq_op (Choice.eqType K) k k2 then @Some V v1 else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by rewrite (negPf kNk2). Qed. Lemma restrictf_mkdom f A : f.[& A] = f.[& domf f `&` A]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf f A) (restrictf f (@fsetI K (@domf K V f) A)) *) apply/fmapP=> k; rewrite !fnd_restrict inE. (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) (if andb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A)) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) *) by case: fndP => ?; rewrite ?(andbT, andbF) //=; case: (_ \in _). Qed. Lemma restrictf_id f A : [disjoint domf f & A] -> f.[& A] = [fmap]. Proof. (* Goal: forall _ : is_true (@fdisjoint K (@domf K V f) A), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf f A) (@fmap0 K V) *) by move=> dAf; rewrite restrictf_mkdom (eqP dAf) restrictf0. Qed. Lemma remf_id f A : [disjoint domf f & A] -> f.[\ A] = f. Proof. (* Goal: forall _ : is_true (@fdisjoint K (@domf K V f) A), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf f (@fsetD K (@domf K V f) A)) f *) by move=> /fsetDidPl ->; rewrite restrictfT. Qed. Lemma remf1_id f k : k \notin f -> f.[~ k] = f. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f))), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf f (@fsetD K (@domf K V f) (@fset1 K k))) f *) by move=> kNf; rewrite remf_id //= fdisjointX1. Qed. Lemma restrictf_set f A (k : K) (v : V) : f.[k <- v].[& A] = if k \in A then f.[& A].[k <- v] else f.[& A]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf (@setf K V f k v) A) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then @setf K V (restrictf f A) k v else restrictf f A) *) apply/fmapP => k' /=; rewrite !(fnd_if, fnd_set, fnd_restrict). (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then if @eq_op (Choice.eqType K) k' k then @Some V v else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then if @eq_op (Choice.eqType K) k' k then @Some V v else if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V else if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V) *) by case: eqP => [->|]; do !case: ifP. Qed. Lemma remf_set f A (k : K) (v : V) : f.[k <- v].[\ A] = if k \in A then f.[\ A] else f.[\ A].[k <- v]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf (@setf K V f k v) (@fsetD K (@domf K V (@setf K V f k v)) A)) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then restrictf f (@fsetD K (@domf K V f) A) else @setf K V (restrictf f (@fsetD K (@domf K V f) A)) k v) *) apply/fmapP => k' /=; rewrite !(fnd_if, fnd_rem, fnd_set, inE). (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then @None V else if @eq_op (Choice.eqType K) k' k then @Some V v else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then @None V else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else if @eq_op (Choice.eqType K) k' k then @Some V v else if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then @None V else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') *) by case: eqP => [->|]; do !case: (_ \in _). Qed. Lemma remf1_set f (k k' : K) (v : V) : f.[k' <- v].[~ k] = if k == k' then f.[~ k] else f.[~ k].[k' <- v]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (restrictf (@setf K V f k' v) (@fsetD K (@domf K V (@setf K V f k' v)) (@fset1 K k))) (if @eq_op (Choice.eqType K) k k' then restrictf f (@fsetD K (@domf K V f) (@fset1 K k)) else @setf K V (restrictf f (@fsetD K (@domf K V f) (@fset1 K k))) k' v) *) by rewrite remf_set inE eq_sym. Qed. Lemma setf_inj f f' k v : k \notin f -> k \notin f' -> f.[k <- v] = f'.[k <- v]-> f = f'. Proof. (* Goal: forall (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)))) (_ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f')))) (_ : @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V f k v) (@setf K V f' k v)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f f' *) move=> kf kf' eq_fkv; apply/fmapP => k'. (* Goal: @eq (option V) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') (@fnd K V (@domf K V f') (@ffun_of_fmap K V f') k') *) have := congr1 (fun g => g.[? k']) eq_fkv. (* Goal: forall _ : @eq (option V) (@fnd K V (@domf K V (@setf K V f k v)) (@ffun_of_fmap K V (@setf K V f k v)) k') (@fnd K V (@domf K V (@setf K V f' k v)) (@ffun_of_fmap K V (@setf K V f' k v)) k'), @eq (option V) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') (@fnd K V (@domf K V f') (@ffun_of_fmap K V f') k') *) by rewrite !fnd_set; case: eqP => // ->; rewrite !not_fnd. Qed. End RestrictionOps. Arguments filterf : simpl never. Arguments restrictf : simpl never. Notation "x .[& A ]" := (restrictf x A) : fmap_scope. Notation "x .[\ A ]" := (x.[& domf x `\` A]) : fmap_scope. Notation "x .[~ k ]" := (x.[\ [fset k]]) : fmap_scope. Section Cat. Variables (K : choiceType) (V : Type). Implicit Types (f g : {fmap K -> V}). Definition catf (f g : {fmap K -> V}) := [fmap k : (domf f `\` domf g) `|` domf g=> match fsetULVR (valP k) with | inl kfDg => f.[fsubsetP (fsubsetDl _ _) _ kfDg] | inr kg => g.[kg] end]. Local Notation "f + g" := (catf f g) : fset_scope. Lemma domf_cat f g : domf (f + g) = domf f `|` domf g. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@domf K V (catf f g)) (@fsetU K (@domf K V f) (@domf K V g)) *) by apply/fsetP=> x; rewrite !inE; case: (boolP (_ \in domf _)); rewrite ?orbT. Qed. Lemma mem_catf f g k : k \in domf (f + g) = (k \in f) || (k \in g). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V (catf f g)))) (orb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) f)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g))) *) by rewrite domf_cat inE. Qed. Lemma fnd_cat f g k : (f + g).[? k] = if k \in domf g then g.[? k] else f.[? k]. Proof. (* Goal: @eq (option V) (@fnd K V (@domf K V (catf f g)) (@ffun_of_fmap K V (catf f g)) k) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) case: fndP => //= [kfg|]; rewrite /catf /=. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g))))), @eq (option V) (@None V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g))) V (@FunFinfun.finfun (@fset_sub_finType K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g))) V (fun k : @fset_sub_type K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g)) => match @fsetULVR K (@fsval K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g)) k) (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g) (@valP (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g)))) (@fset_sub_subType K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g))) k) with | inl kfDg => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) (@fsval K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g)) k) (@elimT (@sub_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K V f) (@domf K V g))) (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fsubset K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V f)) (@fsubsetP K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V f)) (@fsubsetDl K (@domf K V f) (@domf K V g)) (@fsval K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g)) k) kfDg)) | inr kg => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V g)) V (@ffun_of_fmap K V g) (@FSetSub K (@domf K V g) (@fsval K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g)) k) kg) end)) (@FSetSub K (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g)) k kfg))) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) rewrite ffunE /=; case: fsetULVR => [kf|kg]; last by rewrite Some_fnd kg. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g))))), @eq (option V) (@None V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) (* Goal: @eq (option V) (@Some V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k (@elimT (@sub_mem (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K V f) (@domf K V g))) (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) (@fsubset K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V f)) (@fsubsetP K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V f)) (@fsubsetDl K (@domf K V f) (@domf K V g)) k kf)))) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by rewrite -in_fnd; move: kf; rewrite inE => /andP[/negPf ->]. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g))))), @eq (option V) (@None V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by rewrite mem_catf => /norP [kNf kNg]; rewrite !not_fnd // if_same. Qed. Lemma catfE f g : f + g = f.[\ domf g] + g. Proof. (* Goal: @eq (finMap K V) (catf f g) (catf (@restrictf K V f (@fsetD K (@domf K V f) (@domf K V g))) g) *) by apply/fmapP=> k; rewrite !(fnd_cat, fnd_rem); case: ifP. Qed. Lemma getf_catl f g k (kfg : k \in domf (f + g)) (kf : k \in domf f) : k \notin domf g -> (f + g).[kfg] = f.[kf]. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)))), @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (catf f g))) V (@ffun_of_fmap K V (catf f g)) (@FSetSub K (@domf K V (catf f g)) k kfg)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V f)) V (@ffun_of_fmap K V f) (@FSetSub K (@domf K V f) k kf)) *) by move=> kNg; apply: Some_inj; rewrite Some_fnd fnd_cat (negPf kNg) in_fnd. Qed. Lemma getf_catr f g k (kfg : k \in domf (f + g)) (kg : k \in domf g) : (f + g).[kfg] = g.[kg]. Proof. (* Goal: @eq V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V (catf f g))) V (@ffun_of_fmap K V (catf f g)) (@FSetSub K (@domf K V (catf f g)) k kfg)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K V g)) V (@ffun_of_fmap K V g) (@FSetSub K (@domf K V g) k kg)) *) by apply: Some_inj; rewrite Some_fnd fnd_cat kg in_fnd. Qed. Lemma catf0 f : f + [fmap] = f. Proof. (* Goal: @eq (finMap K V) (catf f (@fmap0 K V)) f *) by apply/fmapP => k; rewrite fnd_cat in_fset0. Qed. Lemma cat0f f : [fmap] + f = f. Proof. (* Goal: @eq (finMap K V) (catf (@fmap0 K V) f) f *) apply/fmapP => k; rewrite fnd_cat; case: ifPn => //= kf. (* Goal: @eq (option V) (@fnd K V (@fset0 K) (@ffun0 (@fset_sub_finType K (@fset0 K)) V (cardfT0 K)) k) (@fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) *) by rewrite !not_fnd ?inE. Qed. Lemma catf_setl f g k (v : V) : f.[k <- v] + g = if k \in g then f + g else (f + g).[k <- v]. Proof. (* Goal: @eq (finMap K V) (catf (@setf K V f k v) g) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g) then catf f g else @setf K V (catf f g) k v) *) apply/fmapP=> k'; rewrite !(fnd_if, fnd_cat, fnd_set). (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else if @eq_op (Choice.eqType K) k' k then @Some V v else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g) then if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else if @eq_op (Choice.eqType K) k' k then @Some V v else if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') *) by have [->|Nkk'] := altP eqP; do !case: (_ \in _). Qed. Lemma catf_setr f g k (v : V) : f + g.[k <- v] = (f + g).[k <- v]. Proof. (* Goal: @eq (finMap K V) (catf f (@setf K V g k v)) (@setf K V (catf f g) k v) *) apply/fmapP=> k'; rewrite !(fnd_cat, fnd_set, mem_setf, inE). (* Goal: @eq (option V) (if orb (@eq_op (Choice.eqType K) k' k) (@in_mem (Equality.sort (Choice.eqType K)) k' (@mem (Equality.sort (Choice.eqType K)) (seq_predType (Choice.eqType K)) (@enum_fset K (@domf K V g)))) then if @eq_op (Choice.eqType K) k' k then @Some V v else @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') (if @eq_op (Choice.eqType K) k' k then @Some V v else if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k') *) by have [->|Nkk'] := altP eqP; do !case: (_ \in _). Qed. Lemma restrictf_cat f g A : (f + g).[& A] = f.[& A] + g.[& A]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@restrictf K V (catf f g) A) (catf (@restrictf K V f A) (@restrictf K V g A)) *) apply/fmapP => k'; rewrite !(fnd_cat, fnd_restrict) mem_restrictf. (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V) (if andb (@in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finMapPredType K V) g)) then if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @None V else if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) A) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V) *) by case: (_ \in _). Qed. Lemma restrictf_cat_domr f g : (f + g).[& domf g] = g. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@restrictf K V (catf f g) (@domf K V g)) g *) rewrite catfE restrictf_cat restrictf_comp. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (catf (@restrictf K V f (@fsetI K (@fsetD K (@domf K V f) (@domf K V g)) (@domf K V g))) (@restrictf K V g (@domf K V g))) g *) by rewrite fsetIDAC fsetDIl fsetDv fsetI0 restrictf0 restrictfT cat0f. Qed. Lemma remf_cat f g A : (f + g).[\ A] = f.[\ A] + g.[\ A]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@restrictf K V (catf f g) (@fsetD K (@domf K V (catf f g)) A)) (catf (@restrictf K V f (@fsetD K (@domf K V f) A)) (@restrictf K V g (@fsetD K (@domf K V g) A))) *) by apply/fmapP => k'; rewrite !(fnd_cat, fnd_rem) mem_remf; case: (_ \in _). Qed. Lemma catf_restrictl A f g : f.[& A] + g = (f + g).[& A `|` domf g]. Proof. (* Goal: @eq (finMap K V) (catf (@restrictf K V f A) g) (@restrictf K V (catf f g) (@fsetU K A (@domf K V g))) *) apply/fmapP=> k; rewrite !(fnd_cat, fnd_restrict) !inE. (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) (if orb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) A)) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g))) then if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @None V) *) by do !case: (_ \in _). Qed. Lemma catf_reml A f g : f.[\ A] + g = (f + g).[\ A `\` domf g]. Proof. (* Goal: @eq (finMap K V) (catf (@restrictf K V f (@fsetD K (@domf K V f) A)) g) (@restrictf K V (catf f g) (@fsetD K (@domf K V (catf f g)) (@fsetD K A (@domf K V g)))) *) by apply/fmapP=> k; rewrite !(fnd_cat, fnd_rem) inE; case: (_ \in _). Qed. Lemma catf_rem1l k f g : f.[~ k] + g = if k \in g then f + g else (f + g).[~ k]. Proof. (* Goal: @eq (finMap K V) (catf (@restrictf K V f (@fsetD K (@domf K V f) (@fset1 K k))) g) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g) then catf f g else @restrictf K V (catf f g) (@fsetD K (@domf K V (catf f g)) (@fset1 K k))) *) apply/fmapP => k'; rewrite !(fnd_if, fnd_cat, fnd_rem1). (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else if negb (@eq_op (Choice.eqType K) k' k) then @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K V) g) then if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else if negb (@eq_op (Choice.eqType K) k' k) then if @in_mem (Choice.sort K) k' (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k' else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k' else @None V) *) by have [->|?] := altP eqP; do !case: (_ \in _). Qed. Lemma setf_catr f g k (v : V) : (f + g).[k <- v] = f + g.[k <- v]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V (catf f g) k v) (catf f (@setf K V g k v)) *) by rewrite catf_setr. Qed. Lemma setf_catl f g k (v : V) : (f + g).[k <- v] = f.[k <- v] + g.[~ k]. Proof. (* Goal: @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@setf K V (catf f g) k v) (catf (@setf K V f k v) (@restrictf K V g (@fsetD K (@domf K V g) (@fset1 K k)))) *) by rewrite catf_setl mem_remf1 eqxx /= !setf_catr setf_rem1. Qed. Lemma catfA f g h : f + (g + h) = f + g + h. Proof. (* Goal: @eq (finMap K V) (catf f (catf g h)) (catf (catf f g) h) *) by apply/fmapP => k; rewrite !fnd_cat !mem_catf; do !case: (_ \in _). Qed. Lemma catfC f g : f + g = g + f.[\ domf g]. Proof. (* Goal: @eq (finMap K V) (catf f g) (catf g (@restrictf K V f (@fsetD K (@domf K V f) (@domf K V g)))) *) apply/fmapP=> k; rewrite !fnd_cat fnd_rem domf_rem inE. (* Goal: @eq (option V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) (if andb (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)))) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V f))) then if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @None V else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k else @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k) *) by have [|kNg] //= := boolP (_ \in domf g); rewrite (not_fnd kNg); case: fndP. Qed. Lemma disjoint_catfC f g : [disjoint domf f & domf g] -> f + g = g + f. Proof. (* Goal: forall _ : is_true (@fdisjoint K (@domf K V f) (@domf K V g)), @eq (finMap K V) (catf f g) (catf g f) *) by move=> dfg; rewrite catfC remf_id. Qed. Lemma catfAC f g h : f + g + h = f + h + g.[\ domf h]. Proof. (* Goal: @eq (finMap K V) (catf (catf f g) h) (catf (catf f h) (@restrictf K V g (@fsetD K (@domf K V g) (@domf K V h)))) *) by rewrite -!catfA [X in _ + X]catfC. Qed. Lemma disjoint_catfAC f g h : [disjoint domf g & domf h]%fmap -> f + g + h = f + h + g. Proof. (* Goal: forall _ : is_true (@fdisjoint K (@domf K V g) (@domf K V h)), @eq (finMap K V) (catf (catf f g) h) (catf (catf f h) g) *) by move=> dgh; rewrite catfAC remf_id. Qed. Lemma catfCA f g h : f + (g + h) = g + (f.[\ domf g] + h). Proof. (* Goal: @eq (finMap K V) (catf f (catf g h)) (catf g (catf (@restrictf K V f (@fsetD K (@domf K V f) (@domf K V g))) h)) *) by rewrite !catfA [X in X + _]catfC. Qed. Lemma disjoint_catfCA f g h : [disjoint domf f & domf g]%fmap -> f + (g + h) = g + (f + h). Proof. (* Goal: forall _ : is_true (@fdisjoint K (@domf K V f) (@domf K V g)), @eq (finMap K V) (catf f (catf g h)) (catf g (catf f h)) *) by move=> dfg; rewrite catfCA remf_id. Qed. Lemma catfIs f g h : f + h = g + h -> f.[\ domf h] = g.[\ domf h]. Proof. (* Goal: forall _ : @eq (finMap K V) (catf f h) (catf g h), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@restrictf K V f (@fsetD K (@domf K V f) (@domf K V h))) (@restrictf K V g (@fsetD K (@domf K V g) (@domf K V h))) *) move=> /fmapP eq_fg_fh; apply/fmapP => k; have := eq_fg_fh k. (* Goal: forall _ : @eq (option V) (@fnd K V (@domf K V (catf f h)) (@ffun_of_fmap K V (catf f h)) k) (@fnd K V (@domf K V (catf g h)) (@ffun_of_fmap K V (catf g h)) k), @eq (option V) (@fnd K V (@domf K V (@restrictf K V f (@fsetD K (@domf K V f) (@domf K V h)))) (@ffun_of_fmap K V (@restrictf K V f (@fsetD K (@domf K V f) (@domf K V h)))) k) (@fnd K V (@domf K V (@restrictf K V g (@fsetD K (@domf K V g) (@domf K V h)))) (@ffun_of_fmap K V (@restrictf K V g (@fsetD K (@domf K V g) (@domf K V h)))) k) *) by rewrite !fnd_cat !fnd_rem; case: ifP. Qed. Lemma disjoint_catfIs h f g : [disjoint domf f & domf h] -> [disjoint domf g & domf h] -> f + h = g + h -> f = g. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf f h) (catf g h)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) by move=> dfg dgh /catfIs; rewrite !remf_id. Qed. Lemma restrict_catfsI f g h : f + g = f + h -> g.[& domf h] = h.[& domf g]. Proof. (* Goal: forall _ : @eq (finMap K V) (catf f g) (catf f h), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) (@restrictf K V g (@domf K V h)) (@restrictf K V h (@domf K V g)) *) move=> /fmapP eq_fg_fh; apply/fmapP => k; have := eq_fg_fh k. (* Goal: forall _ : @eq (option V) (@fnd K V (@domf K V (catf f g)) (@ffun_of_fmap K V (catf f g)) k) (@fnd K V (@domf K V (catf f h)) (@ffun_of_fmap K V (catf f h)) k), @eq (option V) (@fnd K V (@domf K V (@restrictf K V g (@domf K V h))) (@ffun_of_fmap K V (@restrictf K V g (@domf K V h))) k) (@fnd K V (@domf K V (@restrictf K V h (@domf K V g))) (@ffun_of_fmap K V (@restrictf K V h (@domf K V g))) k) *) rewrite !fnd_cat !fnd_restrict. (* Goal: forall _ : @eq (option V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V h)) then @fnd K V (@domf K V h) (@ffun_of_fmap K V h) k else @fnd K V (@domf K V f) (@ffun_of_fmap K V f) k), @eq (option V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V h)) then @fnd K V (@domf K V g) (@ffun_of_fmap K V g) k else @None V) (if @in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K V g)) then @fnd K V (@domf K V h) (@ffun_of_fmap K V h) k else @None V) *) by do ![case: (boolP (_ \in domf _)) => ? //=] => _; rewrite not_fnd. Qed. Lemma disjoint_catfsI h f g : [disjoint domf f & domf h] -> [disjoint domf g & domf h] -> h + f = h + g -> f = g. Proof. (* Goal: forall (_ : is_true (@fdisjoint K (@domf K V f) (@domf K V h))) (_ : is_true (@fdisjoint K (@domf K V g) (@domf K V h))) (_ : @eq (finMap K V) (catf h f) (catf h g)), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) move=> dfg dgh; rewrite -disjoint_catfC // -[RHS]disjoint_catfC //. (* Goal: forall _ : @eq (finMap K V) (catf f h) (catf g h), @eq (@finmap_of K V (Phant (forall _ : Choice.sort K, V))) f g *) by apply: disjoint_catfIs. Qed. End Cat. Module Import FmapE. Definition fmapE := (fndSome, getfE, setfK, fnd_set, getf_set, setfNK, fnd_reducef, get_reducef, fnd_filterf, get_filterf, fnd_restrict, getf_restrict, fnd_rem, fnd_rem1, restrictfT, restrictf0, restrictf_id, remf_id, remf1_id, fnd_cat). End FmapE. Arguments catf : simpl never. Notation "f + g" := (catf f g) : fset_scope. Section FinMapKeyType. Variables (K V : choiceType). Implicit Types (f g : {fmap K -> V}). Definition codomf f : {fset V} := [fset f k | k : domf f]. Lemma mem_codomf f v : (v \in codomf f) = [exists x : domf f, f x == v]. Lemma codomfP f v : reflect (exists x, f.[? x] = Some v) (v \in codomf f). Proof. (* Goal: Bool.reflect (@ex (Choice.sort K) (fun x : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) apply: (iffP (imfsetP _ _ _ _)) => /= [[x _ ->]|[k]]. (* Goal: forall _ : @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) k) (@Some (Choice.sort V) v), @ex2 (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) x (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f)) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f))))))) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => @eq (Choice.sort V) v (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x)) *) (* Goal: @ex (Choice.sort K) (fun x0 : Choice.sort K => @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x0) (@Some (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x))) *) by exists (val x); rewrite Some_fnd. (* Goal: forall _ : @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) k) (@Some (Choice.sort V) v), @ex2 (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) x (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f)) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f))))))) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => @eq (Choice.sort V) v (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x)) *) by case: fndP => //= kf [<-]; exists [` kf]. Qed. Lemma codomfPn f v : reflect (forall x, f.[? x] != Some v) (v \notin codomf f). Proof. (* Goal: Bool.reflect (forall x : Choice.sort K, is_true (negb (@eq_op (option_eqType (Choice.eqType V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Equality.sort (Choice.eqType V)) v)))) (negb (@in_mem (Equality.sort (Choice.eqType V)) v (@mem (Choice.sort V) (finSetPredType V) (codomf f)))) *) rewrite mem_codomf negb_exists; apply: (iffP forallP) => f_eq_v x /=. (* Goal: is_true (negb (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) v)) *) (* Goal: is_true (negb (@eq_op (option_eqType (Choice.eqType V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) x) (@Some (Choice.sort V) v))) *) by case: fndP => //= kf; rewrite f_eq_v. (* Goal: is_true (negb (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) v)) *) by apply: contraNneq (f_eq_v (val x)) => <-; rewrite Some_fnd. Qed. Lemma codomf0 : codomf [fmap] = fset0. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@fmap0 K (Choice.sort V))) (@fset0 V) *) apply/fsetP=> k; rewrite inE; apply/negP => /codomfP [k']. (* Goal: forall _ : @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) (@fmap0 K (Choice.sort V))) (@ffun_of_fmap K (Choice.sort V) (@fmap0 K (Choice.sort V))) k') (@Some (Choice.sort V) k), False *) by rewrite not_fnd //= inE. Qed. Lemma in_codomf f (k : domf f) : f k \in codomf f. Proof. (* Goal: is_true (@in_mem (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem (Choice.sort V) (finSetPredType V) (codomf f))) *) by rewrite in_imfset. Qed. Lemma fndSomeP f (k : K) (v : V): (f.[? k] = Some v) <-> {kf : k \in f & f.[kf] = v}. Proof. (* Goal: iff (@eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) f) (@ffun_of_fmap K (Choice.sort V) f) k) (@Some (Choice.sort V) v)) (@sigT (is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K (Choice.sort V)) f))) (fun kf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K (Choice.sort V)) f)) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf)) v)) *) split => [fk|[kf fk]]; last by rewrite in_fnd fk. (* Goal: @sigT (is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K (Choice.sort V)) f))) (fun kf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K (Choice.sort V)) f)) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf)) v) *) have kf : k \in f by rewrite -fndSome fk. (* Goal: @sigT (is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K (Choice.sort V)) f))) (fun kf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K (Choice.sort V)) f)) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf)) v) *) by exists kf; apply: Some_inj; rewrite Some_fnd. Qed. Lemma codomf_restrict f (A : {fset K}) : codomf f.[& A] = [fset f k | k : domf f & val k \in A]. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f A)) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))))) *) apply/fsetP=> v; apply/imfsetP/imfsetP => /= [] [k kP ->]. (* Goal: @ex2 (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => is_true (@in_mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) x (@mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (predPredType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))) (@sort_of_simpl_pred (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (pred_of_argType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x0 : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x1 : Choice.sort K => x1) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x1 : Choice.sort K => andb (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x0))) x)) *) (* Goal: @ex2 (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) x (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x0 : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x0) (@mem (Choice.sort K) (finSetPredType K) A)))))) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x0 : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x1 : Choice.sort K => x1) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x1 : Choice.sort K => andb (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x0))) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x)) *) have := valP k; rewrite !inE => /andP [kf kA]; exists [` kf] => //. (* Goal: @ex2 (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => is_true (@in_mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) x (@mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (predPredType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))) (@sort_of_simpl_pred (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (pred_of_argType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x0 : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x1 : Choice.sort K => x1) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x1 : Choice.sort K => andb (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x0))) x)) *) (* Goal: @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x))) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))) (@fset_sub_subType K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) k) kf)) *) by rewrite ffunE /= -getfE. (* Goal: @ex2 (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => is_true (@in_mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) x (@mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (predPredType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))) (@sort_of_simpl_pred (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (pred_of_argType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x0 : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x1 : Choice.sort K => x1) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x1 : Choice.sort K => andb (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x0))) x)) *) have kA : val k \in [fset x | x in domf f & x \in A] by rewrite !inE (valP k). (* Goal: @ex2 (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A)))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => is_true (@in_mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) x (@mem (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (predPredType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))) (@sort_of_simpl_pred (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (pred_of_argType (@fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))))))))) (fun x : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x : Choice.sort K => x) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x : Choice.sort K => andb (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) A))))))) => @eq (Choice.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A)))))))) (Choice.sort V) (fun x0 : @fset_sub_type K (@Imfset.imfset imfset_key K K (fun x0 : Choice.sort K => x0) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x0 : Choice.sort K => andb (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) A))))))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@fincl K (@Imfset.imfset imfset_key K K (fun x1 : Choice.sort K => x1) (@mem_fin (Choice.eqType K) (simplPredType (Choice.sort K)) (@subfinset_finpred K (@mem_fin (Choice.eqType K) (seq_predType (Choice.eqType K)) (@fset_finpred K (@domf K (Choice.sort V) f))) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (Choice.sort K)) (@mem (Choice.sort K) (simplPredType (Choice.sort K)) (@SimplPred (Choice.sort K) (fun x1 : Choice.sort K => andb (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@in_mem (Choice.sort K) x1 (@mem (Choice.sort K) (finSetPredType K) A))))))) (@domf K (Choice.sort V) f) (@fset_sub K (@domf K (Choice.sort V) f) (@pred_of_simpl (Choice.sort K) (@pred_of_mem_pred (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) A)))) x0))) x)) *) by exists [` kA]; rewrite // ?ffunE !getfE. Qed. Lemma codomf_restrict_exists f (A : {fset K}) : codomf f.[& A] = [fset v in codomf f Lemma codomf_rem f (A : {fset K}) : codomf f.[\ A] = [fset f k | k : domf f & val k \notin A]. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) A))) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => negb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType)) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f) : predArgType))))) (negb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))))))) *) rewrite codomf_restrict. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f)) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f)))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A))))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f)) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f)))))) (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A)))))))) (@Imfset.imfset imfset_key (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) V (fun k : Choice.sort (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) => @FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@subfinset_finpred (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@mem_fin (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@fin_finpred (Choice.eqType (Finite.choiceType (@fset_sub_finType K (@domf K (Choice.sort V) f)))) (pred_finpredType (@fset_sub_finType K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f)) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f)))))) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => negb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))))) (Phantom (mem_pred (@fset_sub_type K (@domf K (Choice.sort V) f))) (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (simplPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@SimplPred (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => andb (@in_mem (@fset_sub_type K (@domf K (Choice.sort V) f)) k (@mem (@fset_sub_type K (@domf K (Choice.sort V) f)) (predPredType (@fset_sub_type K (@domf K (Choice.sort V) f))) (@sort_of_simpl_pred (@fset_sub_type K (@domf K (Choice.sort V) f)) (pred_of_argType (@fset_sub_type K (@domf K (Choice.sort V) f)))))) (negb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A)))))))) *) by apply: eq_imfset => //= x /=; rewrite -!topredE /= !inE (valP x) andbT. Qed. Lemma codomf_rem_exists f (A : {fset K}) : codomf f.[\ A] = [fset v in codomf f Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) A))) (@Imfset.imfset imfset_key V V (fun v : Choice.sort V => v : Choice.sort V) (@mem_fin (Choice.eqType V) (simplPredType (Choice.sort V)) (@subfinset_finpred V (@mem_fin (Choice.eqType V) (seq_predType (Choice.eqType V)) (@fset_finpred V (codomf f))) (fun v : Choice.sort V => negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) v))) k))))) (Phantom (mem_pred (Choice.sort V)) (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun v : Choice.sort V => andb (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) v))) k)))))))) *) rewrite codomf_restrict_exists; apply: eq_imfset => x //=. (* Goal: @eq bool (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (simplPredType (Choice.sort V)) (@SimplPred (Choice.sort V) (fun x : Choice.sort V => andb (@in_mem (Choice.sort V) x (@mem (Choice.sort V) (predPredType (Choice.sort V)) (fun x0 : Choice.sort V => @pred_of_eq_seq (Choice.eqType V) (@enum_fset V (codomf f)) x0))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))))))) *) rewrite !inE; case: (_ \in _) => //=. (* Goal: @eq bool (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) (@fsetD K (@domf K (Choice.sort V) f) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k) (@mem (Choice.sort K) (finSetPredType K) A))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k) x))) k))) *) apply/existsP/existsP => [] /= [k]; rewrite ?inE; by do 2?[move=>/andP []]; exists k; rewrite ?inE; do 2?[apply/andP; split]. Qed. Lemma in_codomf_rem1 f (k : K) (kf : k \in domf f) : codomf f.[~ k] = Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) (if negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k')) then codomf f else @fsetD V (codomf f) (@fset1 V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf)))) *) apply/fsetP => v; rewrite codomf_rem_exists (fun_if (fun x => v \in x)) !(in_fset, inE). (* Goal: @eq bool (andb (@in_mem (Equality.sort (Choice.eqType V)) v (@mem (Equality.sort (Choice.eqType V)) (predPredType (Equality.sort (Choice.eqType V))) (@pred_of_mem (Equality.sort (Choice.eqType V)) (@pred_of_finmempred (Choice.eqType V) (@mem_fin (Choice.eqType V) (seq_predType (Choice.eqType V)) (@fset_finpred V (codomf f))))))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k0 : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k0) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k0) v))) k0)))) (if negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@domf K (Choice.sort V) f))) (@fset_sub_subType K (@domf K (Choice.sort V) f)) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k')) then @in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f)) else andb (negb (@eq_op (Choice.eqType V) v (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf)))) (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf f)))) *) have [vf|vNf] := boolP (_ \in codomf f); rewrite /= ?(andbF,andbT) ?if_same //. (* Goal: @eq bool (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k0 : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) k0) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k0) v))) k0))) (if negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k')) then true else negb (@eq_op (Choice.eqType V) v (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf)))) *) rewrite -/(_ || _); apply/existsP/idP => /= [[k' /andP[xk /eqP <-]]|]. (* Goal: forall _ : is_true (orb (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k'))) (negb (@eq_op (Choice.eqType V) v (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))), @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) v))) *) (* Goal: is_true (orb (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k'))) (negb (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) *) rewrite orbC -implybE; apply/implyP => eq_fk. (* Goal: forall _ : is_true (orb (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k'))) (negb (@eq_op (Choice.eqType V) v (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))), @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) v))) *) (* Goal: is_true (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k'))) *) by rewrite inE /= in xk; apply/existsP; exists k'; rewrite // xk eq_fk. (* Goal: forall _ : is_true (orb (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k'))) (negb (@eq_op (Choice.eqType V) v (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))), @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) v))) *) have /imfsetP /= [[l lf] _ ->] := vf; rewrite orbC. (* Goal: forall _ : is_true (orb (negb (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) l lf)) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf)))) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k')))), @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) l lf))))) *) have [->|neq_f _] := altP (f.[lf] =P _). (* Goal: @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) l lf))))) *) (* Goal: forall _ : is_true (orb (negb true) (negb (@FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Choice.sort V) f)) (fun k' : @fset_sub_type K (@domf K (Choice.sort V) f) => @FiniteQuant.ex (@fset_sub_finType K (@domf K (Choice.sort V) f)) (FiniteQuant.Quantified (andb (negb (@eq_op (Choice.eqType K) (@fsval K (@domf K (Choice.sort V) f) k') k)) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) k') (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) k')))), @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) k kf))))) *) by move=> /existsP [m /andP[Nmk /eqP <-]]; exists m; rewrite eqxx inE Nmk. (* Goal: @ex (@fset_sub_type K (@domf K (Choice.sort V) f)) (fun x : @fset_sub_type K (@domf K (Choice.sort V) f) => is_true (andb (negb (@in_mem (Choice.sort K) (@fsval K (@domf K (Choice.sort V) f) x) (@mem (Choice.sort K) (finSetPredType K) (@fset1 K k)))) (@eq_op (Choice.eqType V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) x) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Choice.sort V) f)) (Choice.sort V) (@ffun_of_fmap K (Choice.sort V) f) (@FSetSub K (@domf K (Choice.sort V) f) l lf))))) *) exists [` lf]; rewrite eqxx andbT inE /=. (* Goal: is_true (negb (@eq_op (Choice.eqType K) l k)) *) apply: contra neq_f => /eqP eq_lk; rewrite eq_lk in lf *. by apply/eqP; congr f.[_]; apply: bool_irrelevance. Qed. Qed. Lemma codomf_set f (k : K) (v : V) (kf : k \in domf f) : codomf f.[k <- v] = v |` codomf f.[~ k]. Proof. (* Goal: @eq (@finset_of V (Phant (Choice.sort V))) (codomf (@setf K (Choice.sort V) f k v)) (@fsetU V (@fset1 V v) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))))) *) rewrite -setf_rem1; apply/fsetP=> v'; rewrite !inE. (* Goal: @eq bool (@in_mem (Choice.sort V) v' (@mem (Choice.sort V) (finSetPredType V) (codomf (@setf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))) k v)))) (orb (@eq_op (Choice.eqType V) v' v) (@in_mem (Choice.sort V) v' (@mem (Choice.sort V) (finSetPredType V) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))))))) *) have [->|neq_v'v] /= := altP eqP. (* Goal: @eq bool (@in_mem (Choice.sort V) v' (@mem (Choice.sort V) (finSetPredType V) (codomf (@setf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))) k v)))) (@in_mem (Choice.sort V) v' (@mem (Choice.sort V) (finSetPredType V) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))))) *) (* Goal: @eq bool (@in_mem (Choice.sort V) v (@mem (Choice.sort V) (finSetPredType V) (codomf (@setf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))) k v)))) true *) by apply/codomfP; exists k; rewrite fnd_set eqxx. (* Goal: @eq bool (@in_mem (Choice.sort V) v' (@mem (Choice.sort V) (finSetPredType V) (codomf (@setf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k))) k v)))) (@in_mem (Choice.sort V) v' (@mem (Choice.sort V) (finSetPredType V) (codomf (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))))) *) apply/codomfP/codomfP => [] [k' fk'_eq]; exists k'; move: fk'_eq; rewrite fnd_set. (* Goal: forall _ : @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) (@ffun_of_fmap K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) k') (@Some (Choice.sort V) v'), @eq (option (Choice.sort V)) (if @eq_op (Choice.eqType K) k' k then @Some (Choice.sort V) v else @fnd K (Choice.sort V) (@domf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) (@ffun_of_fmap K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) k') (@Some (Choice.sort V) v') *) (* Goal: forall _ : @eq (option (Choice.sort V)) (if @eq_op (Choice.eqType K) k' k then @Some (Choice.sort V) v else @fnd K (Choice.sort V) (@domf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) (@ffun_of_fmap K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) k') (@Some (Choice.sort V) v'), @eq (option (Choice.sort V)) (@fnd K (Choice.sort V) (@domf K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) (@ffun_of_fmap K (Choice.sort V) (@restrictf K (Choice.sort V) f (@fsetD K (@domf K (Choice.sort V) f) (@fset1 K k)))) k') (@Some (Choice.sort V) v') *) by have [_ [eq_vv']|//] := altP eqP; rewrite eq_vv' eqxx in neq_v'v *. by have [->|//] := altP eqP; rewrite fnd_rem inE eqxx. Qed. Qed. End FinMapKeyType. Module Import FinmapInE. Definition inE := (inE, mem_codomf, mem_catf, mem_remfF, mem_filterf, mem_reducef, mem_restrictf, mem_remf, mem_remf1, mem_setf). End FinmapInE. Section FsfunDef. Variables (K : choiceType) (V : eqType) (default : K -> V). Record fsfun := Fsfun { fmap_of_fsfun : {fmap K -> V}; _ : [forall k : domf fmap_of_fsfun, fmap_of_fsfun k != default (val k)] }. Canonical fsfun_subType := Eval hnf in [subType for fmap_of_fsfun]. Definition fsfun_eqMixin := [eqMixin of fsfun by <:]. Canonical fsfun_eqType := EqType fsfun fsfun_eqMixin. Fact fsfun_subproof (f : fsfun) : forall (k : K) (kf : k \in fmap_of_fsfun f), (fmap_of_fsfun f).[kf]%fmap != default k. Proof. (* Goal: forall (k : Choice.sort K) (kf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finMapPredType K (Equality.sort V)) (fmap_of_fsfun f)))), is_true (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (fmap_of_fsfun f))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (fmap_of_fsfun f)) (@FSetSub K (@domf K (Equality.sort V) (fmap_of_fsfun f)) k kf)) (default k))) *) case:f => f f_stable k kf /=. (* Goal: is_true (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) f)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) f) (@FSetSub K (@domf K (Equality.sort V) f) k kf)) (default k))) *) exact: (forallP f_stable [` kf]). Qed. Definition fun_of_fsfun (f : fsfun) (k : K) := odflt (default k) (fmap_of_fsfun f).[? k]%fmap. End FsfunDef. Coercion fun_of_fsfun : fsfun >-> Funclass. Module Type FinSuppSig. Axiom fs : forall (K : choiceType) (V : eqType) (default : K -> V), fsfun default -> {fset K}. Axiom E : fs = (fun K V d f => domf (@fmap_of_fsfun K V d f)). End FinSuppSig. Module FinSupp : FinSuppSig. Definition fs := (fun K V d f => domf (@fmap_of_fsfun K V d f)). Definition E := erefl fs. End FinSupp. Notation finsupp := FinSupp.fs. Canonical unlockable_finsupp := Unlockable FinSupp.E. Section FSfunBasics. Variables (K : choiceType) (V : eqType) (default : K -> V). Implicit Types (f : fsfun default) (k : K) (v : V). Lemma mem_finsupp f k : (k \in finsupp f) = (f k != default k). Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K V default f))) (negb (@eq_op V (@fun_of_fsfun K V default f k) (default k))) *) rewrite /fun_of_fsfun [finsupp]unlock; case: fndP; rewrite ?eqxx //=. (* Goal: forall kf : is_true (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f)))), @eq bool true (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f)) (@FSetSub K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f)) k kf)) (default k))) *) by move=> kf; rewrite fsfun_subproof. Qed. Lemma memNfinsupp f k : (k \notin finsupp f) = (f k == default k). Proof. (* Goal: @eq bool (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K V default f)))) (@eq_op V (@fun_of_fsfun K V default f k) (default k)) *) by rewrite mem_finsupp negbK. Qed. Lemma fsfun_dflt f k : k \notin finsupp f -> f k = default k. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K V default f)))), @eq (Equality.sort V) (@fun_of_fsfun K V default f k) (default k) *) by rewrite mem_finsupp negbK => /eqP. Qed. CoInductive fsfun_spec f k : V -> bool -> Type := | FsfunOut : k \notin finsupp f -> fsfun_spec f k (default k) false | FsfunIn (kf : k \in finsupp f) : fsfun_spec f k (f k) true. Lemma finsuppP f k : fsfun_spec f k (f k) (k \in finsupp f). Proof. (* Goal: fsfun_spec f k (@fun_of_fsfun K V default f k) (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K V default f))) *) have [kf|kNf] := boolP (_ \in _); first by constructor. (* Goal: fsfun_spec f k (@fun_of_fsfun K V default f k) false *) by rewrite fsfun_dflt // ; constructor. Qed. Lemma fsfunP f f' : f =1 f' <-> f = f'. Proof. (* Goal: iff (@eqfun (Equality.sort V) (Choice.sort K) (@fun_of_fsfun K V default f) (@fun_of_fsfun K V default f')) (@eq (@fsfun K V default) f f') *) split=> [eq_fg|->//]; apply/val_inj/fmapP => k. (* Goal: @eq (option (Equality.sort V)) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f)) k) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) (@ffun_of_fmap K (Equality.sort V) (@val (@finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V))) (fun x : @finmap_of K (Equality.sort V) (Phant (forall _ : Choice.sort K, Equality.sort V)) => @FiniteQuant.quant0b (@fset_sub_finType K (@domf K (Equality.sort V) x)) (fun k : @fset_sub_type K (@domf K (Equality.sort V) x) => @FiniteQuant.all (@fset_sub_finType K (@domf K (Equality.sort V) x)) (FiniteQuant.Quantified (negb (@eq_op V (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) x)) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) x) k) (default (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) (@domf K (Equality.sort V) x))) (@fset_sub_subType K (@domf K (Equality.sort V) x)) k))))) k)) (@fsfun_subType K V default) f')) k) *) have := eq_fg k; rewrite /(f _) /(f' _) /=. (* Goal: forall _ : @eq (Equality.sort V) (@Option.default (Equality.sort V) (default k) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f)) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f)) k)) (@Option.default (Equality.sort V) (default k) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f')) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f')) k)), @eq (option (Equality.sort V)) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f)) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f)) k) (@fnd K (Equality.sort V) (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f')) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f')) k) *) case: fndP; case: fndP => //= kf kf'; first by move->. (* Goal: forall _ : @eq (Equality.sort V) (default k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f'))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f')) (@FSetSub K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f')) k kf)), @eq (option (Equality.sort V)) (@None (Equality.sort V)) (@Some (Equality.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f'))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f')) (@FSetSub K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f')) k kf))) *) (* Goal: forall _ : @eq (Equality.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f)) (@FSetSub K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f)) k kf')) (default k), @eq (option (Equality.sort V)) (@Some (Equality.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f)) (@FSetSub K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f)) k kf'))) (@None (Equality.sort V)) *) by move/eqP/negPn; rewrite fsfun_subproof. (* Goal: forall _ : @eq (Equality.sort V) (default k) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f'))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f')) (@FSetSub K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f')) k kf)), @eq (option (Equality.sort V)) (@None (Equality.sort V)) (@Some (Equality.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f'))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap_of_fsfun K V default f')) (@FSetSub K (@domf K (Equality.sort V) (@fmap_of_fsfun K V default f')) k kf))) *) by move/eqP/negPn; rewrite eq_sym fsfun_subproof. Qed. Lemma fsfun_injective_inP f (T : {fset K}) : reflect {in T &, injective f} (injectiveb [ffun x : T => f (val x)]). Proof. (* Goal: Bool.reflect (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) T) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort V) (@fun_of_fsfun K V default f x1) (@fun_of_fsfun K V default f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort V) (Choice.sort K) (@fun_of_fsfun K V default f)))) (@injectiveb (@fset_sub_finType K T) V (@FunFinfun.fun_of_fin (@fset_sub_finType K T) (Equality.sort V) (@FunFinfun.finfun (@fset_sub_finType K T) (Equality.sort V) (fun x : @fset_sub_type K T => @fun_of_fsfun K V default f (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) T)) (@fset_sub_subType K T) x))))) *) apply: (iffP (@injectiveP _ _ _)) => f_inj a b; last first. (* Goal: forall (_ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) T))) (_ : is_true (@in_mem (Choice.sort K) b (@mem (Choice.sort K) (finSetPredType K) T))) (_ : @eq (Equality.sort V) (@fun_of_fsfun K V default f a) (@fun_of_fsfun K V default f b)), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Equality.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K T) (Equality.sort V) (@FunFinfun.finfun (@fset_sub_finType K T) (Equality.sort V) (fun x : @fset_sub_type K T => @fun_of_fsfun K V default f (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) T)) (@fset_sub_subType K T) x))) a) (@FunFinfun.fun_of_fin (@fset_sub_finType K T) (Equality.sort V) (@FunFinfun.finfun (@fset_sub_finType K T) (Equality.sort V) (fun x : @fset_sub_type K T => @fun_of_fsfun K V default f (@val (Choice.sort K) (fun x0 : Choice.sort K => @in_mem (Choice.sort K) x0 (@mem (Choice.sort K) (finSetPredType K) T)) (@fset_sub_subType K T) x))) b), @eq (Finite.sort (@fset_sub_finType K T)) a b *) by rewrite !ffunE => *; apply: val_inj; apply: f_inj => //; apply: valP. (* Goal: forall (_ : is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) T))) (_ : is_true (@in_mem (Choice.sort K) b (@mem (Choice.sort K) (finSetPredType K) T))) (_ : @eq (Equality.sort V) (@fun_of_fsfun K V default f a) (@fun_of_fsfun K V default f b)), @eq (Choice.sort K) a b *) move=> aT bT eq_ga_gb; have := f_inj.[aT].[bT]; rewrite !ffunE /=. (* Goal: forall _ : forall _ : @eq (Equality.sort V) (@fun_of_fsfun K V default f a) (@fun_of_fsfun K V default f b), @eq (@fset_sub_type K T) (@FSetSub K T a aT) (@FSetSub K T b bT), @eq (Choice.sort K) a b *) by move=> /(_ eq_ga_gb) /(congr1 val). Qed. Definition fsfun_of_can_ffun (T : {fset K}) (g : {ffun T -> V}) (can_g : forall k : T, g k != default (val k)) := @Fsfun K V default (FinMap g) (appP forallP idP can_g). Lemma fsfun_of_can_ffunE (T : {fset K}) (g : {ffun T -> V}) (can_g : forall k : T , g k != default (val k)) k (kg : k \in T) : (fsfun_of_can_ffun can_g) k = g.[kg]. Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (@fsfun_of_can_ffun T g can_g) k) (@FunFinfun.fun_of_fin (@fset_sub_finType K T) (Equality.sort V) g (@FSetSub K T k kg)) *) by rewrite/fun_of_fsfun in_fnd. Qed. End FSfunBasics. Notation "{ 'fsfun' ty 'for' dflt }" := (fsfun (dflt : ty)) (at level 0, format "{ 'fsfun' ty 'for' dflt }") : type_scope. Notation "{ 'fsfun' ty 'of' x => dflt }" := {fsfun ty for fun x => dflt} (at level 0, x at level 99, format "{ 'fsfun' ty 'of' x => dflt }") : type_scope. Notation "{ 'fsfun' ty 'with' dflt }" := {fsfun ty of _ => dflt} (at level 0, format "{ 'fsfun' ty 'with' dflt }") : type_scope. Notation "{ 'fsfun' ty }" := {fsfun ty of x => x} (at level 0, format "{ 'fsfun' ty }") : type_scope. Notation "{ 'fsfun' 'for' dflt }" := {fsfun _ for dflt} (at level 0, only parsing) : type_scope. Notation "{ 'fsfun' 'of' x : T => dflt }" := {fsfun T -> _ of x => dflt} (at level 0, x at level 99, only parsing) : type_scope. Notation "{ 'fsfun' 'of' x => dflt }" := {fsfun of x : _ => dflt} (at level 0, x at level 99, only parsing) : type_scope. Notation "{ 'fsfun' 'with' dflt }" := {fsfun of _ => dflt} (at level 0, only parsing) : type_scope. Module Type FsfunSig. Section FsfunSig. Variables (K : choiceType) (V : eqType) (default : K -> V). Parameter of_ffun : forall (S : {fset K}), (S -> V) -> unit -> fsfun default. Variables (S : {fset K}) (h : S -> V). Axiom of_ffunE :forall key x, of_ffun h key x = odflt (default x) (omap h (insub x)). End FsfunSig. End FsfunSig. Module Fsfun : FsfunSig. Section FsfunOfFinfun. Variables (K : choiceType) (V : eqType) (default : K -> V) (S : {fset K}) (h : S -> V). Let fmap := [fmap a : [fsetval a in {: S} | h a != default (val a)] => h (fincl (fset_sub_val _ _) a)]. Fact fmapP a : fmap a != default (val a). Definition of_ffun (k : unit) := fsfun_of_can_ffun fmapP. Lemma of_ffunE key x : of_ffun key x = odflt (default x) (omap h (insub x)). Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V default (of_ffun key) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) rewrite /fun_of_fsfun /=. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default x) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) x)) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) case: insubP => /= [u _ <-|xNS]; last first. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default x) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) x)) (default x) *) case: fndP => //= kf; rewrite !ffunE /=. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) (* Goal: @eq (Equality.sort V) (h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))) (@FSetSub K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) x kf))) (default x) *) by set y := (X in h X); rewrite (valP y) in xNS. (* Goal: @eq (Equality.sort V) (@Option.default (Equality.sort V) (default (@fsval K S u)) (@fnd K (Equality.sort V) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@fsval K S u))) (h u) *) case: fndP => /= [kf|]. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) (@fsval K S u) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))))), @eq (Equality.sort V) (default (@fsval K S u)) (h u) *) (* Goal: @eq (Equality.sort V) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (@FunFinfun.finfun (@fset_sub_finType K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))) (Equality.sort V) (fun a : @fset_sub_type K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) => h (@fincl K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (@fsval K S) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun x : @fset_sub_type K S => negb (@eq_op V (h x) (default (@fsval K S x)))))))) S (@fset_sub_val imfset_key K S (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a0 : @fset_sub_type K S => negb (@eq_op V (h a0) (default (@fsval K S a0))))))) a))) (@FSetSub K (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))))) (@fsval K S u) kf)) (h u) *) by rewrite ffunE; congr (h _); apply/val_inj => //. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) (@fsval K S u) (@mem (Choice.sort K) (finSetPredType K) (@Imfset.imfset imfset_key (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) K (fun a : @fset_sub_type K S => @fsval K S a) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (simplPredType (@fset_sub_type K S)) (@subfinset_finpred (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S)) (@mem_fin (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (predPredType (@fset_sub_type K S)) (@fin_finpred (Choice.eqType (@sub_choiceType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S))) (pred_finpredType (@subFinType_finType K (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subfinType K S))) (@sort_of_simpl_pred (@fset_sub_type K S) (pred_of_argType (@fset_sub_type K S))))) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a)))))) (Phantom (mem_pred (@fset_sub_type K S)) (@mem (@fset_sub_type K S) (simplPredType (@fset_sub_type K S)) (@SimplPred (@fset_sub_type K S) (fun a : @fset_sub_type K S => negb (@eq_op V (h a) (default (@fsval K S a))))))))))), @eq (Equality.sort V) (default (@fsval K S u)) (h u) *) by rewrite inE /= -topredE /= negbK => /eqP ->. Qed. Definition fsfun_of_ffun key (K : choiceType) (V : eqType) (S : {fset K}) (h : S -> V) (default : K -> V) := (Fsfun.of_ffun default h key). Definition fsfun_choiceMixin (K V : choiceType) (d : K -> V) := [choiceMixin of fsfun d by <:]. Canonical fsfun_choiceType (K V : choiceType) (d : K -> V) := ChoiceType (fsfun d) (fsfun_choiceMixin d). Delimit Scope fsfun_scope with fsfun. Notation "[ 'fsfun[' key ] x : aT => F | default ]" := (fsfun_of_ffun key (fun x : aT => F) (fun x => default)) (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x : aT => F | default ]" := [fsfun[fsfun_key] x : aT => F | default] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] x : aT => F ]" := [fsfun[key] x : aT => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x : aT => F ]" := [fsfun x : aT => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] x => F | default ]" := [fsfun[key] x : _ => F | default ] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x => F | default ]" := [fsfun x : _ => F | default] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ] x => F ]" := [fsfun[key] x => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' x => F ]" := [fsfun x => F | _] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun[' key ]=> F | default ]" := [fsfun[key] _ => F | default ] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun=>' F | default ]" := [fsfun _ => F | default] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun[' key ]=> F ]" := [fsfun[key]=> F | _] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun=>' F ]" := [fsfun=> F | _] (at level 0, only parsing) : fun_scope. Definition fsfun_of_fun key (K : choiceType) (V : eqType) (S : {fset K}) (h : K -> V) default := [fsfun[key] x : S => h (val x) | default x]. Notation "[ 'fsfun' 'for' default ]" := (fsfun_of_ffun fsfun0_key [fmap] default) (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun' 'of' x => default ]" := [fsfun for fun x => default] (at level 0, x at level 99, only parsing) : fun_scope. Notation "[ 'fsfun' 'with' default ]" := [fsfun of _ => default] (at level 0, only parsing) : fun_scope. Notation "[ 'fsfun' ]" := [fsfun for _] (at level 0, format "[ 'fsfun' ]") : fun_scope. Section FsfunTheory. Variables (key : unit) (K : choiceType) (V : eqType) (default : K -> V). Lemma fsfun_ffun (S : {fset K}) (h : S -> V) (x : K) : [fsfun[key] a : S => h a | default a] x = odflt (default x) (omap h (insub x)). Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a)) x) (@Option.default (Equality.sort V) (default x) (@Option.map (@fset_sub_type K S) (Equality.sort V) h (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) x))) *) by rewrite unlock. Qed. Lemma fsfun_fun (S : {fset K}) (h : K -> V) (x : K) : [fsfun[key] a in S => h a | default a] x = if x \in S then h x else (default x). Proof. (* Goal: @eq (Equality.sort V) (@fun_of_fsfun K V (fun x : Choice.sort K => (fun a : Choice.sort K => default a) x) (@fsfun_of_fun key K V S (fun a : Choice.sort K => h a) (fun a : Choice.sort K => default a)) x) (if @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S) then h x else default x) *) by rewrite fsfun_ffun; case: insubP => //= [u -> ->|/negPf ->]. Qed. Lemma fsfun0E : [fsfun for default] =1 default. Proof. (* Goal: @eqfun (Equality.sort V) (Choice.sort K) (@fun_of_fsfun K V default (@fsfun_of_ffun fsfun0_key K V (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V))) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V)))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap0 K (Equality.sort V)))) default)) default *) by move=> x; rewrite unlock insubF ?inE. Qed. Definition fsfunE := (fsfun_fun, fsfun0E). Lemma finsupp_sub (S : {fset K}) (h : S -> V) : finsupp [fsfun[key] a : S => h a | default a] `<=` S. Proof. (* Goal: is_true (@fsubset K (@FinSupp.fs K V (fun a : Choice.sort K => default a) (@fsfun_of_ffun key K V S (fun a : @fset_sub_type K S => h a) (fun a : Choice.sort K => default a))) S) *) apply/fsubsetP => a; rewrite mem_finsupp unlock /=. (* Goal: forall _ : is_true (negb (@eq_op V (@Option.default (Equality.sort V) (default a) (@Option.map (@fset_sub_type K S) (Equality.sort V) (fun a : @fset_sub_type K S => h a) (@insub (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a))) (default a))), is_true (@in_mem (Choice.sort K) a (@mem (Choice.sort K) (finSetPredType K) S)) *) by case: insubP => //=; rewrite eqxx. Qed. Lemma finsupp0 : finsupp [fsfun for default] = fset0. Proof. (* Goal: @eq (@finset_of K (Phant (Choice.sort K))) (@FinSupp.fs K V default (@fsfun_of_ffun fsfun0_key K V (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V))) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V)))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap0 K (Equality.sort V)))) default)) (@fset0 K) *) by apply/fsetP => x; rewrite !inE mem_finsupp fsfunE eqxx. Qed. Lemma fsfun0_inj : injective default -> injective [fsfun for default]. Proof. (* Goal: forall _ : @injective (Equality.sort V) (Choice.sort K) default, @injective (Equality.sort V) (Choice.sort K) (@fun_of_fsfun K V default (@fsfun_of_ffun fsfun0_key K V (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V))) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V)))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap0 K (Equality.sort V)))) default)) *) by move=> def_inj x y; rewrite !fsfunE => /def_inj. Qed. Lemma in_finsupp0 x : x \in finsupp [fsfun for default] = false. Proof. (* Goal: @eq bool (@in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K V default (@fsfun_of_ffun fsfun0_key K V (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V))) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort V) (@fmap0 K (Equality.sort V)))) (Equality.sort V) (@ffun_of_fmap K (Equality.sort V) (@fmap0 K (Equality.sort V)))) default)))) false *) by rewrite finsupp0 inE. Qed. End FsfunTheory. Module Import FsfunInE2. Definition inE := (inE, in_finsupp0). Definition fsfun_comp g f : {fsfun _} := [fsfun[fsfun_comp_key] k in finsupp f `|` finsupp g => g (f k)]. Notation "g \o f" := (fsfun_comp g f) : fsfun_scope. Lemma fscompE g f : (g \o f)%fsfun =1 g \o f. Proof. (* Goal: @eqfun (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) (fsfun_comp g f)) (@funcomp (Equality.sort (Choice.eqType K)) (Choice.sort K) (Choice.sort K) tt (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) g) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)) *) move=> k; rewrite fsfun_ffun; case: insubP => //= [u _ <- //|]. (* Goal: forall _ : is_true (negb (@in_mem (Choice.sort K) k (@mem (Choice.sort K) (finSetPredType K) (@fsetU K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) g))))), @eq (Choice.sort K) k (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) g (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f k)) *) by rewrite inE => /norP [kNf kNg]; rewrite !fsfun_dflt. Qed. Lemma fscomp0f : left_id [fsfun] fsfun_comp. Proof. (* Goal: @left_id (@fsfun K (Choice.eqType K) (fun x : Choice.sort K => x)) (@fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K)) (@fsfun_of_ffun fsfun0_key K (Choice.eqType K) (@domf K (Equality.sort (Choice.eqType K)) (@fmap0 K (Equality.sort (Choice.eqType K)))) (@FunFinfun.fun_of_fin (@fset_sub_finType K (@domf K (Equality.sort (Choice.eqType K)) (@fmap0 K (Equality.sort (Choice.eqType K))))) (Equality.sort (Choice.eqType K)) (@ffun_of_fmap K (Equality.sort (Choice.eqType K)) (@fmap0 K (Equality.sort (Choice.eqType K))))) (fun x : Choice.sort K => x)) fsfun_comp *) by move=> f; apply/fsfunP=> k; rewrite fscompE /= fsfun0E. Qed. Lemma fscompA : associative fsfun_comp. Proof. (* Goal: @associative (@fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K)) fsfun_comp *) by move=> f g h; apply/fsfunP => k; rewrite !fscompE /= !fscompE. Qed. Lemma fscomp_inj g f : injective f -> injective g -> injective (g \o f)%fsfun. Proof. (* Goal: forall (_ : @injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)) (_ : @injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) g)), @injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) (fsfun_comp g f)) *) by move=> f_inj g_inj k k'; rewrite !fscompE => /= /g_inj /f_inj. Qed. Definition fsinjectiveb : pred {fsfun K -> K} := [pred f | (injectiveb [ffun a : finsupp f => f (val a)]) && [forall a : finsupp f, f (val a) \in finsupp f]]. Let equivalent (Ps : seq Prop) := if Ps is P0 :: Ps then let fix aux (P : Prop) (Qs : seq Prop) := if Qs is Q :: Qs then (P -> Q) /\ (aux Q Qs) else P -> P0 in aux P0 Ps else True. Lemma fsinjective_subproof f : equivalent [:: injective f ; let S := finsupp f in {in S &, injective f} /\ forall a : S, f (val a) \in S ; exists2 S : {fset K}, (finsupp f `<=` S) & {in S &, injective f} /\ forall a : S, f (val a) \in S]. Proof. (* Goal: equivalent (@cons Prop (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)) (@cons Prop (let S := @FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f in and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S)))) (@cons Prop (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (@nil Prop)))) *) split => /= [f_inj|]; last split=> [[f_inj f_st]|[S fS [f_inj f_st]] a b]. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f)) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f), is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) *) - (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f)) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f), is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) *) split=> [a b ? ?|a]; first exact: f_inj. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) (* Goal: is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) a)) (@mem (Choice.sort K) (finSetPredType K) (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f))) *) rewrite mem_finsupp (inj_eq f_inj) -mem_finsupp; apply/valP. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) - (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: @ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Choice.sort K) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@fsval K S a)) (@mem (Choice.sort K) (finSetPredType K) S)))) *) by exists (finsupp f)=> //; apply: fsubset_refl. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have Nfinsupp := contra (fsubsetP fS _). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) wlog /andP [aS bNS] : a b / (a \in S) && (b \notin S) => [hwlog|]; last first. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) rewrite (fsfun_dflt (Nfinsupp _ bNS)) => fb_eq_a. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: @eq (Choice.sort K) a b *) by move: bNS; rewrite -fb_eq_a (f_st.[aS]). (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) have [[aS|aNS] [bS|bNS]] := (boolP (a \in S), boolP (b \in S)); first 3 last. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) by rewrite !fsfun_dflt // ?Nfinsupp. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) exact: f_inj. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) - (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) by apply: hwlog; rewrite aS. (* Goal: forall _ : @eq (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f a) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f b), @eq (Choice.sort K) a b *) by move=> fab; symmetry; apply: hwlog; rewrite // bS. Qed. Lemma fsinjectiveP f : reflect (injective f) (fsinjectiveb f). Lemma fsinjectivebP f : reflect (exists2 S : {fset K}, (finsupp f `<=` S) & {in S &, injective f} /\ forall a : S, f (val a) \in S) (fsinjectiveb f). Proof. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x1) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) ((fun x : Choice.sort K => x) : forall _ : Choice.sort K, Choice.sort K) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) have [H1 [H2 H3]]:= fsinjective_subproof f. (* Goal: Bool.reflect (@ex2 (@finset_of K (Phant (Choice.sort K))) (fun S : @finset_of K (Phant (Choice.sort K)) => is_true (@fsubset K (@FinSupp.fs K (Choice.eqType K) (fun x : Choice.sort K => x) f) S)) (fun S : @finset_of K (Phant (Choice.sort K)) => and (@prop_in2 (Choice.sort K) (@mem (Choice.sort K) (finSetPredType K) S) (fun x1 x2 : Choice.sort K => forall _ : @eq (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x1) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f x2), @eq (Choice.sort K) x1 x2) (inPhantom (@injective (Equality.sort (Choice.eqType K)) (Choice.sort K) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f)))) (forall a : @fset_sub_type K S, is_true (@in_mem (Equality.sort (Choice.eqType K)) (@fun_of_fsfun K (Choice.eqType K) (fun x : Choice.sort K => x) f (@val (Choice.sort K) (fun x : Choice.sort K => @in_mem (Choice.sort K) x (@mem (Choice.sort K) (finSetPredType K) S)) (@fset_sub_subType K S) a)) (@mem (Choice.sort K) (finSetPredType K) S))))) (fsinjectiveb f) *) by apply: (iffP (fsinjectiveP _)) => //; by move=> /H1 /H2. Qed. End FsfunIdTheory. Definition inE := inE. Export BigEnough. Module BigEnoughFSet. Definition big_rel_fsubset_class K : big_rel_class_of (@fsubset K). Proof. (* Goal: @big_rel_class_of (@finset_of K (Phant (Choice.sort K))) (@fsubset K) *) exists fsubset (fun G => \bigcup_(g <- G) g) => [|g s|g1 g2 j] //. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) (* Goal: is_true (@fsubset K g (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g s) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite big_cons fsubsetUl. (* Goal: forall _ : is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) j (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))), is_true (@fsubset K g1 (@BigOp.bigop (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) (@fset0 K) (@cons (@finset_of K (Phant (Choice.sort K))) g2 j) (fun g : @finset_of K (Phant (Choice.sort K)) => @BigBody (@finset_of K (Phant (Choice.sort K))) (@finset_of K (Phant (Choice.sort K))) g (@fsetU K) true g))) *) by rewrite big_cons => h; rewrite fsubsetU // h orbT. Qed. Canonical big_enough_fset K := BigRelOf (big_rel_fsubset_class K). Ltac fset_big_enough_trans := match goal with | [leq : is_true (?A `<=` ?B) |- is_true (?X `<=` ?B)] => apply: fsubset_trans leq; big_enough; olddone end. Ltac done := do [fset_big_enough_trans|BigEnough.done]. Ltac pose_big_fset K i := evar (i : {fset K}); suff : closed i; first do [move=> _; instantiate (1 := bigger_than (@fsubset K) _) in (Value of i)]. End BigEnoughFSet.
Set Implicit Arguments. Unset Strict Implicit. Require Export Field_cat. Require Export Ring_facts. Section Lemmas1. Variable K : FIELD. Definition field_inverse (x : K) : K := Ap (field_inverse_map K) x. Definition field_div (x y : K) : K := ring_mult x (field_inverse y). Lemma FIELD_inverse_r : forall x : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult x (field_inverse x)) (ring_unit K). Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (ring_unit (field_ring K)) *) exact (field_inverse_r_prf K). Qed. Lemma FIELD_inverse_l : forall x : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult (field_inverse x) x) (ring_unit K). Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) x) (ring_unit (field_ring K)) *) exact (field_inverse_l_prf K). Qed. Lemma FIELD_unit_non_zero : ~ Equal (ring_unit K) (monoid_unit K). Proof. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (ring_unit (field_ring K)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) exact (field_unit_non_zero K). Qed. Lemma FIELD_comp : forall x x' : K, Equal x x' -> Equal (field_inverse x) (field_inverse x'). Proof. (* Goal: forall (x x' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x x'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse x) (field_inverse x') *) unfold field_inverse in |- *. (* Goal: forall (x x' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x x'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@field_inverse_map (field_ring K) (field_on_def K)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@field_inverse_map (field_ring K) (field_on_def K)) x') *) auto with algebra. Qed. Hint Resolve FIELD_comp FIELD_inverse_r FIELD_inverse_l FIELD_unit_non_zero: algebra. Lemma FIELD_unit_inverse : Equal (field_inverse (ring_unit K)) (ring_unit K). Proof. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (ring_unit (field_ring K))) (ring_unit (field_ring K)) *) apply Trans with (ring_mult (field_inverse (ring_unit K)) (ring_unit K)); auto with algebra. Qed. Hint Resolve FIELD_unit_inverse: algebra. Lemma FIELD_reg_left : forall x y z : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult x y) (ring_mult x z) -> Equal y z. Proof. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@ring_mult (field_ring K) x z)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y z *) intros x y z H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y z *) apply Trans with (ring_mult (ring_unit K) y). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) y) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@ring_mult (field_ring K) (ring_unit (field_ring K)) y) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) y) z *) apply Trans with (ring_mult (ring_mult (field_inverse x) x) y). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) y) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) y) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) y) *) apply Sym; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) y) z *) apply Trans with (ring_mult (field_inverse x) (ring_mult x y)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x y)) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) y) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x y)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x y)) z *) apply Trans with (ring_mult (field_inverse x) (ring_mult x z)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x z)) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x y)) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x z)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x z)) z *) apply Trans with (ring_mult (ring_mult (field_inverse x) x) z). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) z) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) (@ring_mult (field_ring K) x z)) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) z) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (field_inverse x) x) z) z *) apply Trans with (ring_mult (ring_unit K) z); auto with algebra. Qed. Lemma FIELD_reg_right : forall x y z : K, ~ Equal x (monoid_unit K) -> Equal (ring_mult y x) (ring_mult z x) -> Equal y z. Proof. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y x) (@ring_mult (field_ring K) z x)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y z *) intros x y z H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y z *) apply Trans with (ring_mult y (ring_unit K)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (ring_unit (field_ring K))) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@ring_mult (field_ring K) y (ring_unit (field_ring K))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (ring_unit (field_ring K))) z *) apply Trans with (ring_mult y (ring_mult x (field_inverse x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (@ring_mult (field_ring K) x (field_inverse x))) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (ring_unit (field_ring K))) (@ring_mult (field_ring K) y (@ring_mult (field_ring K) x (field_inverse x))) *) apply Sym; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (@ring_mult (field_ring K) x (field_inverse x))) z *) apply Trans with (ring_mult (ring_mult y x) (field_inverse x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) y x) (field_inverse x)) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) y (@ring_mult (field_ring K) x (field_inverse x))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) y x) (field_inverse x)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) y x) (field_inverse x)) z *) apply Trans with (ring_mult (ring_mult z x) (field_inverse x)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) z x) (field_inverse x)) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) y x) (field_inverse x)) (@ring_mult (field_ring K) (@ring_mult (field_ring K) z x) (field_inverse x)) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) z x) (field_inverse x)) z *) apply Trans with (ring_mult z (ring_mult x (field_inverse x))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) z (@ring_mult (field_ring K) x (field_inverse x))) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) z x) (field_inverse x)) (@ring_mult (field_ring K) z (@ring_mult (field_ring K) x (field_inverse x))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) z (@ring_mult (field_ring K) x (field_inverse x))) z *) apply Trans with (ring_mult z (ring_unit K)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) z (ring_unit (field_ring K))) z *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) z (@ring_mult (field_ring K) x (field_inverse x))) (@ring_mult (field_ring K) z (ring_unit (field_ring K))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) z (ring_unit (field_ring K))) z *) auto with algebra. Qed. Lemma FIELD_inverse_non_zero : forall x : K, ~ Equal x (monoid_unit K) -> ~ Equal (field_inverse x) (monoid_unit K). Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) intuition. (* Goal: False *) apply FIELD_unit_non_zero. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (ring_unit (field_ring K)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) apply Trans with (ring_mult (field_inverse x) x:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (ring_unit (field_ring K)) (@ring_mult (field_ring K) (field_inverse x) x) *) apply Sym; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse x) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) apply Trans with (ring_mult (monoid_unit K) x:K); auto with algebra. Qed. Hint Resolve FIELD_inverse_non_zero: algebra. Lemma FIELD_inverse_inverse : forall x : K, ~ Equal x (monoid_unit K) -> Equal (field_inverse (field_inverse x)) x. Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_inverse x)) x *) intros x H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_inverse x)) x *) apply FIELD_reg_right with (field_inverse x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_inverse (field_inverse x)) (field_inverse x)) (@ring_mult (field_ring K) x (field_inverse x)) *) apply Trans with (ring_unit K:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (ring_unit (field_ring K)) (@ring_mult (field_ring K) x (field_inverse x)) *) apply Sym; auto with algebra. Qed. Hint Resolve FIELD_inverse_inverse: algebra. Lemma FIELD_integral_domain_l : forall x y : K, ~ Equal (ring_mult x y) (monoid_unit K) -> ~ Equal x (monoid_unit K). Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) unfold not in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))), False) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))), False *) intros x y H' H'0; try assumption. (* Goal: False *) absurd (Equal (ring_mult x y) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) apply Trans with (ring_mult (monoid_unit K) y:K); auto with algebra. Qed. Lemma FIELD_integral_domain_r : forall x y : K, ~ Equal (ring_mult x y) (monoid_unit K) -> ~ Equal y (monoid_unit K). Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) unfold not in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))), False) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))), False *) intros x y H' H'0; try assumption. (* Goal: False *) absurd (Equal (ring_mult x y) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) apply Trans with (ring_mult x (monoid_unit K):K); auto with algebra. Qed. Lemma FIELD_law_inverse : forall x y : K, Equal (ring_mult x y) (ring_unit K) -> Equal (field_inverse x) y. Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (ring_unit (field_ring K))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse x) y *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse x) y *) apply FIELD_reg_left with x. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (@ring_mult (field_ring K) x y) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) apply FIELD_integral_domain_l with y; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (@ring_mult (field_ring K) x y) *) (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) intuition. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (@ring_mult (field_ring K) x y) *) (* Goal: False *) absurd (Equal (ring_unit K) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (@ring_mult (field_ring K) x y) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (ring_unit (field_ring K)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) apply Trans with (ring_mult x y:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (@ring_mult (field_ring K) x y) *) apply Trans with (ring_unit K:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse x)) (ring_unit (field_ring K)) *) apply FIELD_inverse_r. (* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K))))))) *) intuition. (* Goal: False *) absurd (Equal (ring_unit K) (monoid_unit K)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (ring_unit (field_ring K)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) apply Trans with (ring_mult x y:K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))) *) apply Trans with (ring_mult (monoid_unit K) y:K); auto with algebra. Qed. Lemma FIELD_inverse_law : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_inverse (ring_mult x y)) (ring_mult (field_inverse y) (field_inverse x)). Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x y)) (@ring_mult (field_ring K) (field_inverse y) (field_inverse x)) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x y)) (@ring_mult (field_ring K) (field_inverse y) (field_inverse x)) *) apply FIELD_law_inverse. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (@ring_mult (field_ring K) (field_inverse y) (field_inverse x))) (ring_unit (field_ring K)) *) apply Trans with (ring_mult x (ring_mult y (ring_mult (field_inverse y) (field_inverse x))) :K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (@ring_mult (field_ring K) (field_inverse y) (field_inverse x)))) (ring_unit (field_ring K)) *) apply Trans with (ring_mult x (ring_mult (ring_mult y (field_inverse y)) (field_inverse x)) :K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) (@ring_mult (field_ring K) y (field_inverse y)) (field_inverse x))) (ring_unit (field_ring K)) *) apply Trans with (ring_mult x (ring_mult (ring_unit K) (field_inverse x)):K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse x))) (ring_unit (field_ring K)) *) apply Trans with (ring_mult x (field_inverse x):K); auto with algebra. Qed. Hint Resolve FIELD_inverse_law: algebra. Lemma FIELD_x_div_x : forall x : K, ~ Equal x (monoid_unit K) -> Equal (field_div x x) (ring_unit K). Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_div x x) (ring_unit (field_ring K)) *) unfold field_div in |- *; auto with algebra. Qed. Hint Resolve FIELD_x_div_x: algebra. Lemma FIELD_simpl_r : forall x y : K, ~ Equal y (monoid_unit K) -> Equal (ring_mult (field_div x y) y) x. Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (field_div x y) y) x *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) y) x *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) y) x *) apply Trans with (ring_mult x (ring_mult (field_inverse y) y):K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) (field_inverse y) y)) x *) apply Trans with (ring_mult x (ring_unit K):K); auto with algebra. Qed. Hint Resolve FIELD_simpl_r: algebra. Lemma FIELD_one_div_x : forall x : K, ~ Equal x (monoid_unit K) -> Equal (field_div (ring_unit K) x) (field_inverse x). Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_div (ring_unit (field_ring K)) x) (field_inverse x) *) unfold field_div in |- *; auto with algebra. Qed. Hint Resolve FIELD_one_div_x: algebra. Lemma FIELD_one_div_xy : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_div (ring_unit K) (ring_mult x y)) (ring_mult (field_div (ring_unit K) y) (field_div (ring_unit K) x)). Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_div (ring_unit (field_ring K)) (@ring_mult (field_ring K) x y)) (@ring_mult (field_ring K) (field_div (ring_unit (field_ring K)) y) (field_div (ring_unit (field_ring K)) x)) *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse (@ring_mult (field_ring K) x y))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse y)) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse x))) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse (@ring_mult (field_ring K) x y))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse y)) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse x))) *) apply Trans with (field_inverse (ring_mult x y):K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x y)) (@ring_mult (field_ring K) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse y)) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse x))) *) apply Trans with (ring_mult (field_inverse y) (field_inverse x):K); auto with algebra. Qed. Hint Resolve FIELD_one_div_xy: algebra. Lemma FIELD_one_div_div : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_div (ring_unit K) (field_div x y)) (field_div y x). Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_div (ring_unit (field_ring K)) (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse (@ring_mult (field_ring K) x (field_inverse y)))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (ring_unit (field_ring K)) (field_inverse (@ring_mult (field_ring K) x (field_inverse y)))) (@ring_mult (field_ring K) y (field_inverse x)) *) apply Trans with (field_inverse (ring_mult x (field_inverse y)):K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) apply Trans with (ring_mult (field_inverse (field_inverse y)) (field_inverse x):K); auto with algebra. Qed. Hint Resolve FIELD_one_div_div: algebra. Lemma FIELD_div_div : forall x y z : K, ~ Equal y (monoid_unit K) -> ~ Equal z (monoid_unit K) -> Equal (field_div x (field_div y z)) (field_div (ring_mult x z) y). Proof. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_div x (field_div y z)) (field_div (@ring_mult (field_ring K) x z) y) *) unfold field_div in |- *. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) y (field_inverse z)))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x z) (field_inverse y)) *) intros x y z H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) y (field_inverse z)))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x z) (field_inverse y)) *) apply Trans with (ring_mult x (ring_mult (field_inverse (field_inverse z)) (field_inverse y)) :K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) (field_inverse (field_inverse z)) (field_inverse y))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x z) (field_inverse y)) *) apply Trans with (ring_mult x (ring_mult z (field_inverse y)):K); auto with algebra. Qed. Hint Resolve FIELD_div_div: algebra. Comments "Normalisation.". Lemma FIELD_mult_div_l : forall x y z : K, Equal (ring_mult x (field_div y z)) (field_div (ring_mult x y) z). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_div y z)) (field_div (@ring_mult (field_ring K) x y) z) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (field_div y z)) (field_div (@ring_mult (field_ring K) x y) z) *) unfold field_div in |- *. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) y (field_inverse z))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x y) (field_inverse z)) *) auto with algebra. Qed. Hint Resolve FIELD_mult_div_l: algebra. Lemma FIELD_div_div2 : forall x y z : K, ~ Equal y (monoid_unit K) -> ~ Equal z (monoid_unit K) -> Equal (field_div (field_div x y) z) (field_div x (ring_mult z y)). Proof. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_div (field_div x y) z) (field_div x (@ring_mult (field_ring K) z y)) *) unfold field_div in |- *. (* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) z (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) (field_inverse z)) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) z y))) *) intros x y z H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) (@ring_mult (field_ring K) x (field_inverse y)) (field_inverse z)) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) z y))) *) apply Trans with (ring_mult x (ring_mult (field_inverse y) (field_inverse z)):K); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (@ring_mult (field_ring K) x (@ring_mult (field_ring K) (field_inverse y) (field_inverse z))) (@ring_mult (field_ring K) x (field_inverse (@ring_mult (field_ring K) z y))) *) apply Sym; auto with algebra. Qed. Lemma FIELD_inv_div : forall x y : K, ~ Equal x (monoid_unit K) -> ~ Equal y (monoid_unit K) -> Equal (field_inverse (field_div x y)) (field_div y x). Proof. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (field_div x y)) (field_div y x) *) unfold field_div in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (field_ring K)))))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (field_ring K)))))) (field_inverse (@ring_mult (field_ring K) x (field_inverse y))) (@ring_mult (field_ring K) y (field_inverse x)) *) apply Trans with (ring_mult (field_inverse (field_inverse y)) (field_inverse x):K); auto with algebra. Qed. End Lemmas1. Hint Resolve FIELD_inverse_r FIELD_inverse_l FIELD_unit_non_zero FIELD_comp FIELD_unit_inverse FIELD_reg_left FIELD_reg_right FIELD_inverse_non_zero FIELD_inverse_inverse FIELD_integral_domain_l FIELD_integral_domain_r FIELD_law_inverse FIELD_inverse_law FIELD_x_div_x FIELD_simpl_r FIELD_one_div_x FIELD_one_div_xy FIELD_one_div_div FIELD_div_div FIELD_mult_div_l FIELD_div_div2 FIELD_inv_div: algebra.
Require Export bbv.BinNotation. Require Export bbv.ReservedNotations. Require Import Coq.ZArith.BinInt. Notation "'Ob' a" := (Z.of_N (bin a)). Goal Ob"01000001" = 65%Z.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq path choice fintype. From mathcomp Require Import bigop finset fingroup morphism automorphism quotient action. From mathcomp Require Import gseries. Import GroupScope. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Inductive section (gT : finGroupType) := GSection of {group gT} * {group gT}. Delimit Scope section_scope with sec. Bind Scope section_scope with section. Definition mkSec (gT : finGroupType) (G1 G2 : {group gT}) := GSection (G1, G2). Infix "/" := mkSec : section_scope. Coercion pair_of_section gT (s : section gT) := let: GSection u := s in u. Coercion quotient_of_section gT (s : section gT) : GroupSet.sort _ := s.1 / s.2. Coercion section_group gT (s : section gT) : {group (coset_of s.2)} := Eval hnf in [group of s]. Section Sections. Variables (gT : finGroupType). Implicit Types (G : {group gT}) (s : section gT). Canonical section_subType := Eval hnf in [newType for @pair_of_section gT]. Definition section_eqMixin := Eval hnf in [eqMixin of section gT by <:]. Canonical section_eqType := Eval hnf in EqType (section gT) section_eqMixin. Definition section_choiceMixin := [choiceMixin of section gT by <:]. Canonical section_choiceType := Eval hnf in ChoiceType (section gT) section_choiceMixin. Definition section_countMixin := [countMixin of section gT by <:]. Canonical section_countType := Eval hnf in CountType (section gT) section_countMixin. Canonical section_subCountType := Eval hnf in [subCountType of section gT]. Definition section_finMixin := [finMixin of section gT by <:]. Canonical section_finType := Eval hnf in FinType (section gT) section_finMixin. Canonical section_subFinType := Eval hnf in [subFinType of section gT]. Canonical section_group. Definition section_isog := [rel x y : section gT | x \isog y]. Definition section_repr s := odflt (1 / 1)%sec (pick (section_isog ^~ s)). Definition mksrepr G1 G2 := section_repr (mkSec G1 G2). Lemma section_reprP s : section_repr s \isog s. Proof. (* Goal: is_true (@isog (@coset_groupType gT (@gval gT (@snd (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@pair_of_section gT (section_repr s))))) (@coset_groupType gT (@gval gT (@snd (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@pair_of_section gT s)))) (@quotient_of_section gT (section_repr s)) (@quotient_of_section gT s)) *) by rewrite /section_repr; case: pickP => //= /(_ s); rewrite isog_refl. Qed. Lemma section_repr_isog s1 s2 : s1 \isog s2 -> section_repr s1 = section_repr s2. Proof. (* Goal: forall _ : is_true (@isog (@coset_groupType gT (@gval gT (@snd (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@pair_of_section gT s1)))) (@coset_groupType gT (@gval gT (@snd (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@pair_of_section gT s2)))) (@quotient_of_section gT s1) (@quotient_of_section gT s2)), @eq (section gT) (section_repr s1) (section_repr s2) *) by move=> iso12; congr (odflt _ _); apply: eq_pick => s; apply: isog_transr. Qed. Definition mkfactors (G : {group gT}) (s : seq {group gT}) := map section_repr (pairmap (@mkSec _) G s). End Sections. Section CompositionSeries. Variable gT : finGroupType. Local Notation gTg := {group gT}. Implicit Types (G : gTg) (s : seq gTg). Local Notation compo := [rel x y : {set gT} | maxnormal y x x]. Definition comps G s := ((last G s) == 1%G) && compo.-series G s. Lemma compsP G s : reflect (last G s = 1%G /\ path [rel x y : gTg | maxnormal y x x] G s) (comps G s). Proof. (* Goal: Bool.reflect (and (@eq (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@last (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) G s) (one_group gT)) (is_true (@path (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@rel_of_simpl_rel (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@SimplRel (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun x y : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @maxnormal gT (@gval gT y) (@gval gT x) (@gval gT x)))) G s))) (comps G s) *) by apply: (iffP andP) => [] [/eqP]. Qed. Lemma trivg_comps G s : comps G s -> (G :==: 1) = (s == [::]). Proof. (* Goal: forall _ : is_true (comps G s), @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@eq_op (seq_eqType (group_of_eqType gT)) s (@nil (Equality.sort (group_of_eqType gT)))) *) case/andP=> ls cs; apply/eqP/eqP=> [G1 | s1]; last first. (* Goal: @eq (Equality.sort (seq_eqType (group_of_eqType gT))) s (@nil (Equality.sort (group_of_eqType gT))) *) (* Goal: @eq (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT)))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by rewrite s1 /= in ls; apply/eqP. (* Goal: @eq (Equality.sort (seq_eqType (group_of_eqType gT))) s (@nil (Equality.sort (group_of_eqType gT))) *) by case: s {ls} cs => //= H s /andP[/maxgroupp]; rewrite G1 /proper sub1G andbF. Qed. Lemma comps_cons G H s : comps G (H :: s) -> comps H s. Proof. (* Goal: forall _ : is_true (comps G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H s)), is_true (comps H s) *) by case/andP => /= ls /andP[_]; rewrite /comps ls. Qed. Lemma simple_compsP G s : comps G s -> reflect (s = [:: 1%G]) (simple G). Lemma exists_comps (G : gTg) : exists s, comps G s. Proof. (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) elim: {G} #|G| {1 3}G (leqnn #|G|) => [G | n IHn G cG]. (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) (* Goal: forall _ : is_true (leq (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) O), @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) by rewrite leqNgt cardG_gt0. (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) have [sG | nsG] := boolP (simple G). (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) by exists [:: 1%G]; rewrite /comps eqxx /= -simple_maxnormal andbT. (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) have [-> | ntG] := eqVneq G 1%G; first by exists [::]; rewrite /comps eqxx. (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) have [N maxN] := ex_maxnormal_ntrivg ntG. (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) have [|s /andP[ls cs]] := IHn N. (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) (* Goal: is_true (leq (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N)))) n) *) by rewrite -ltnS (leq_trans _ cG) // proper_card // (maxnormal_proper maxN). (* Goal: @ex (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun s : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (comps G s)) *) by exists (N :: s); apply/and3P. Qed. Lemma JordanHolderUniqueness (G : gTg) (s1 s2 : seq gTg) : comps G s1 -> comps G s2 -> perm_eq (mkfactors G s1) (mkfactors G s2). Proof. (* Goal: forall (_ : is_true (comps G s1)) (_ : is_true (comps G s2)), is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) elim: {G}#|G| {-2}G (leqnn #|G|) => [|n Hi] G cG in s1 s2 * => cs1 cs2. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) by rewrite leqNgt cardG_gt0 in cG. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) have [G1 | ntG] := boolP (G :==: 1). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) have -> : s1 = [::] by apply/eqP; rewrite -(trivg_comps cs1). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@nil (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (@mkfactors gT G s2)) *) have -> : s2 = [::] by apply/eqP; rewrite -(trivg_comps cs2). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@nil (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (@mkfactors gT G (@nil (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))))) *) by rewrite /= perm_eq_refl. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) have [sG | nsG] := boolP (simple G). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) by rewrite (simple_compsP cs1 sG) (simple_compsP cs2 sG) perm_eq_refl. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G s1) (@mkfactors gT G s2)) *) case es1: s1 cs1 => [|N1 st1] cs1. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G s2)) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@nil (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (@mkfactors gT G s2)) *) by move: (trivg_comps cs1); rewrite eqxx; move/negP:ntG. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G s2)) *) case es2: s2 cs2 => [|N2 st2] cs2 {s1 es1}. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@nil (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))))) *) by move: (trivg_comps cs2); rewrite eqxx; move/negP:ntG. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) case/andP: cs1 => /= lst1; case/andP=> maxN_1 pst1. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) case/andP: cs2 => /= lst2; case/andP=> maxN_2 pst2. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have cN1 : #|N1| <= n. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (leq (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N1)))) n) *) by rewrite -ltnS (leq_trans _ cG) ?proper_card ?(maxnormal_proper maxN_1). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have cN2 : #|N2| <= n. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (leq (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N2)))) n) *) by rewrite -ltnS (leq_trans _ cG) ?proper_card ?(maxnormal_proper maxN_2). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) case: (N1 =P N2) {s2 es2} => [eN12 |]. (* Goal: forall _ : not (@eq (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 N2), is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) by rewrite eN12 /= perm_cons Hi // /comps ?lst2 //= -eN12 lst1. (* Goal: forall _ : not (@eq (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 N2), is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) move/eqP; rewrite -val_eqE /=; move/eqP=> neN12. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have nN1G : N1 <| G by apply: maxnormal_normal. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have nN2G : N2 <| G by apply: maxnormal_normal. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) pose N := (N1 :&: N2)%G. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have nNG : N <| G. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@normal gT (@gval gT N) (@gval gT G)) *) by rewrite /normal subIset ?(normal_sub nN1G) //= normsI ?normal_norm. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have iso1 : (G / N1)%G \isog (N2 / N)%G. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@isog (@coset_groupType gT (@gval gT N1)) (@coset_groupType gT (@gval gT N)) (@gval (@coset_groupType gT (@gval gT N1)) (@quotient_group gT G (@gval gT N1))) (@gval (@coset_groupType gT (@gval gT N)) (@quotient_group gT N2 (@gval gT N)))) *) rewrite isog_sym /= -(maxnormalM maxN_1 maxN_2) //. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@isog (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2))) (@coset_groupType gT (@gval gT N1)) (@quotient gT (@gval gT N2) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2)) (@gval gT N1))) *) rewrite (@normC _ N1 N2) ?(subset_trans (normal_sub nN1G)) ?normal_norm //. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@isog (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2))) (@coset_groupType gT (@gval gT N1)) (@quotient gT (@gval gT N2) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT N2) (@gval gT N1)) (@gval gT N1))) *) by rewrite weak_second_isog ?(subset_trans (normal_sub nN2G)) ?normal_norm. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have iso2 : (G / N2)%G \isog (N1 / N)%G. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@isog (@coset_groupType gT (@gval gT N2)) (@coset_groupType gT (@gval gT N)) (@gval (@coset_groupType gT (@gval gT N2)) (@quotient_group gT G (@gval gT N2))) (@gval (@coset_groupType gT (@gval gT N)) (@quotient_group gT N1 (@gval gT N)))) *) rewrite isog_sym /= -(maxnormalM maxN_1 maxN_2) // setIC. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@isog (@coset_groupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N2) (@gval gT N1))) (@coset_groupType gT (@gval gT N2)) (@quotient gT (@gval gT N1) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N2) (@gval gT N1))) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2)) (@gval gT N2))) *) by rewrite weak_second_isog ?(subset_trans (normal_sub nN1G)) ?normal_norm. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have [sN /andP[lsN csN]] := exists_comps N. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have i1 : perm_eq (mksrepr G N1 :: mkfactors N1 st1) [:: mksrepr G N1, mksrepr N1 N & mkfactors N sN]. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@cons (section gT) (@mksrepr gT G N1) (@mkfactors gT N1 st1)) (@cons (section gT) (@mksrepr gT G N1) (@cons (section gT) (@mksrepr gT N1 N) (@mkfactors gT N sN)))) *) rewrite perm_cons -[mksrepr _ _ :: _]/(mkfactors N1 [:: N & sN]). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT N1 st1) (@mkfactors gT N1 (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N sN))) *) apply: Hi=> //; rewrite /comps ?lst1 //= lsN csN andbT /=. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@maxnormal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2)) (@gval gT N1) (@gval gT N1)) *) rewrite -quotient_simple. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@normal gT (@gval gT (@setI_group gT N1 N2)) (@gval gT N1)) *) (* Goal: is_true (@simple (@coset_groupType gT (@gval gT (@setI_group gT N1 N2))) (@quotient gT (@gval gT N1) (@gval gT (@setI_group gT N1 N2)))) *) by rewrite -(isog_simple iso2) quotient_simple. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@normal gT (@gval gT (@setI_group gT N1 N2)) (@gval gT N1)) *) by rewrite (normalS (subsetIl N1 N2) (normal_sub nN1G)). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have i2 : perm_eq (mksrepr G N2 :: mkfactors N2 st2) [:: mksrepr G N2, mksrepr N2 N & mkfactors N sN]. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@cons (section gT) (@mksrepr gT G N2) (@mkfactors gT N2 st2)) (@cons (section gT) (@mksrepr gT G N2) (@cons (section gT) (@mksrepr gT N2 N) (@mkfactors gT N sN)))) *) rewrite perm_cons -[mksrepr _ _ :: _]/(mkfactors N2 [:: N & sN]). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT N2 st2) (@mkfactors gT N2 (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N sN))) *) apply: Hi=> //; rewrite /comps ?lst2 //= lsN csN andbT /=. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@maxnormal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT N1) (@gval gT N2)) (@gval gT N2) (@gval gT N2)) *) rewrite -quotient_simple. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@normal gT (@gval gT (@setI_group gT N1 N2)) (@gval gT N2)) *) (* Goal: is_true (@simple (@coset_groupType gT (@gval gT (@setI_group gT N1 N2))) (@quotient gT (@gval gT N2) (@gval gT (@setI_group gT N1 N2)))) *) by rewrite -(isog_simple iso1) quotient_simple. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@normal gT (@gval gT (@setI_group gT N1 N2)) (@gval gT N2)) *) by rewrite (normalS (subsetIr N1 N2) (normal_sub nN2G)). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) pose fG1 := [:: mksrepr G N1, mksrepr N1 N & mkfactors N sN]. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) pose fG2 := [:: mksrepr G N2, mksrepr N2 N & mkfactors N sN]. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) have i3 : perm_eq fG1 fG2. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) fG1 fG2) *) rewrite (@perm_catCA _ [::_] [::_]) /mksrepr. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@cat (Equality.sort (section_eqType gT)) (@cons (Equality.sort (section_eqType gT)) (@section_repr gT (@mkSec gT N1 N)) (@nil (Equality.sort (section_eqType gT)))) (@cat (Equality.sort (section_eqType gT)) (@cons (Equality.sort (section_eqType gT)) (@section_repr gT (@mkSec gT G N1)) (@nil (Equality.sort (section_eqType gT)))) (@mkfactors gT N sN))) fG2) *) rewrite (@section_repr_isog _ (mkSec _ _) (mkSec _ _) iso1). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@cat (Equality.sort (section_eqType gT)) (@cons (Equality.sort (section_eqType gT)) (@section_repr gT (@mkSec gT N1 N)) (@nil (Equality.sort (section_eqType gT)))) (@cat (Equality.sort (section_eqType gT)) (@cons (Equality.sort (section_eqType gT)) (@section_repr gT (@mkSec gT N2 N)) (@nil (Equality.sort (section_eqType gT)))) (@mkfactors gT N sN))) fG2) *) rewrite -(@section_repr_isog _ (mkSec _ _) (mkSec _ _) iso2). (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) (* Goal: is_true (@perm_eq (section_eqType gT) (@cat (Equality.sort (section_eqType gT)) (@cons (Equality.sort (section_eqType gT)) (@section_repr gT (@mkSec gT G N2)) (@nil (Equality.sort (section_eqType gT)))) (@cat (Equality.sort (section_eqType gT)) (@cons (Equality.sort (section_eqType gT)) (@section_repr gT (@mkSec gT N2 N)) (@nil (Equality.sort (section_eqType gT)))) (@mkfactors gT N sN))) fG2) *) exact: perm_eq_refl. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N1 st1)) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2))) *) apply: (perm_eq_trans i1); apply: (perm_eq_trans i3); rewrite perm_eq_sym. (* Goal: is_true (@perm_eq (section_eqType gT) (@mkfactors gT G (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) N2 st2)) fG2) *) by apply: perm_eq_trans i2; apply: perm_eq_refl. Qed. End CompositionSeries. Section MoreGroupAction. Variables (aT rT : finGroupType). Variables (A : {group aT}) (D : {group rT}). Variable to : groupAction A D. Lemma gactsP (G : {set rT}) : reflect {acts A, on G | to} [acts A, on G | to]. Proof. (* Goal: Bool.reflect (@acts_on aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT A) G (@gact aT rT (@gval aT A) (@gval rT D) to)) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) G (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) apply: (iffP idP) => [nGA x|nGA]; first exact: acts_act. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) G (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) apply/subsetP=> a Aa; rewrite !inE; rewrite Aa. (* Goal: is_true (andb true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) G)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@preimset (FinGroup.arg_finType (FinGroup.base rT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) x a) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) G))))))) *) by apply/subsetP=> x; rewrite inE nGA. Qed. Lemma gactsM (N1 N2 : {set rT}) : N1 \subset D -> N2 \subset D -> [acts A, on N1 | to] -> [acts A, on N2 | to] -> [acts A, on N1 * N2 | to]. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) N1)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) N2)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N1 (@gact aT rT (@gval aT A) (@gval rT D) to)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N2 (@gact aT rT (@gval aT A) (@gval rT D) to)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2) (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) move=> sN1D sN2D aAN1 aAN2; apply/gactsP=> x Ax y. (* Goal: @eq bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) y x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) apply/idP/idP; case/mulsgP=> y1 y2 N1y1 N2y2 e. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) y x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) move: (actKin to Ax y); rewrite e; move<-. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) y x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) (@mulg (FinGroup.base rT) y1 y2) (@invg (FinGroup.base aT) x)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) rewrite gactM ?groupV ?(subsetP sN1D y1) ?(subsetP sN2D) //. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) y x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@mulg (FinGroup.base rT) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) y1 (@invg (FinGroup.base aT) x)) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) y2 (@invg (FinGroup.base aT) x))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) by apply: mem_mulg; rewrite ?(gactsP _ aAN1) ?(gactsP _ aAN2) // groupV. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) y x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) rewrite e gactM // ?(subsetP sN1D y1) ?(subsetP sN2D) //. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@mulg (FinGroup.base rT) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) y1 x) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) y2 x)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) N1 N2)))) *) by apply: mem_mulg; rewrite ?(gactsP _ aAN1) // ?(gactsP _ aAN2). Qed. Lemma gactsI (N1 N2 : {set rT}) : [acts A, on N1 | to] -> [acts A, on N2 | to] -> [acts A, on N1 :&: N2 | to]. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N1 (@gact aT rT (@gval aT A) (@gval rT D) to)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N2 (@gact aT rT (@gval aT A) (@gval rT D) to)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) N1 N2) (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) move=> aAN1 aAN2. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) N1 N2) (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) apply/subsetP=> x Ax; rewrite !inE Ax /=; apply/subsetP=> y Ny; rewrite inE. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) y x) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) N1 N2)))) *) case/setIP: Ny=> N1y N2y; rewrite inE ?astabs_act ?N1y ?N2y //. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N1 (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N2 (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) - (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N1 (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N2 (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) by move/subsetP: aAN2; move/(_ x Ax). (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N1 (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) - (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) N1 (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) by move/subsetP: aAN1; move/(_ x Ax). Qed. Lemma gastabsP (S : {set rT}) (a : aT) : a \in A -> reflect (forall x, (to x a \in S) = (x \in S)) (a \in 'N(S | to)). Proof. (* Goal: forall _ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A)))), Bool.reflect (forall x : FinGroup.arg_sort (FinGroup.base rT), @eq bool (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) x a) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) S))) (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) S)))) (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) S (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) move=> Aa; apply: (iffP idP) => [nSa x|nSa]; first exact: astabs_act. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) S (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) by rewrite !inE Aa; apply/subsetP=> x; rewrite inE nSa. Qed. End MoreGroupAction. Section MoreQuotientAction. Variables (aT rT : finGroupType). Variables (A : {group aT})(D : {group rT}). Variable to : groupAction A D. Lemma qact_dom_doms (H : {group rT}) : H \subset D -> qact_dom to H \subset A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D)))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A)))) *) by move=> sHD; apply/subsetP=> x; rewrite qact_domE // inE; case/andP. Qed. Lemma acts_qact_doms (H : {group rT}) : H \subset D -> [acts A, on H | to] -> qact_dom to H :=: A. Lemma qacts_cosetpre (H : {group rT}) (K' : {group coset_of H}) : H \subset D -> [acts A, on H | to] -> [acts qact_dom to H, on K' | to / H] -> [acts A, on coset H @*^-1 K' | to]. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H) (@gact aT rT (@gval aT A) (@gval rT D) to)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient_action aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@morphpre rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval (@coset_groupType rT (@gval rT H)) K')) (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) move=> sHD aH aK'; apply/subsetP=> x Ax; move: (Ax) (subsetP aK'). (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))))) (_ : @sub_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient_action aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@morphpre rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval (@coset_groupType rT (@gval rT H)) K')) (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) rewrite -{1}(acts_qact_doms sHD aH) => qdx; move/(_ x qdx) => nx. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@morphpre rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval (@coset_groupType rT (@gval rT H)) K')) (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) rewrite !inE Ax; apply/subsetP=> y; case/morphpreP=> Ny /= K'Hy; rewrite inE. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) y x) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphpre rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval (@coset_groupType rT (@gval rT H)) K'))))) *) apply/morphpreP; split; first by rewrite acts_qact_dom_norm. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@mfun rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) y x)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) K')))) *) by move/gastabsP: nx; move/(_ qdx (coset H y)); rewrite K'Hy qactE. Qed. Lemma qacts_coset (H K : {group rT}) : H \subset D -> [acts A, on K | to] -> [acts qact_dom to H, on (coset H) @* K | to / H]. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K) (@gact aT rT (@gval aT A) (@gval rT D) to)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@morphim rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval rT K)) (@quotient_action aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))))) *) move=> sHD aK. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@morphim rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval rT K)) (@quotient_action aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))))) *) apply/subsetP=> x qdx; rewrite inE qdx inE; apply/subsetP=> y. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) y (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@morphim rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval rT K))))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) y (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@preimset (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (fun x0 : Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) => @act aT (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (@quotient_action aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) x0 x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@morphim rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval rT K)))))))) *) case/morphimP=> z Nz Kz /= e; rewrite e inE qactE // mem_imset // inE. (* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@gval rT H))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K))))) *) move/gactsP: aK; move/(_ x (subsetP (qact_dom_doms sHD) _ qdx) z); rewrite Kz. (* Goal: forall _ : @eq bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K)))) true, is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@gval rT H))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K))))) *) move->; move/acts_act: (acts_qact_dom to H); move/(_ x qdx z). (* Goal: forall _ : @eq bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@gval rT H))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@gval rT H))))), is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@gval rT H))))) true) *) by rewrite Nz andbT. Qed. End MoreQuotientAction. Section StableCompositionSeries. Variables (aT rT : finGroupType). Variables (D : {group rT})(A : {group aT}). Variable to : groupAction A D. Definition maxainv (B C : {set rT}) := [max C of H | [&& (H <| B), ~~ (B \subset H) & [acts A, on H | to]]]. Section MaxAinvProps. Variables K N : {group rT}. Lemma maxainv_norm : maxainv K N -> N <| K. Proof. (* Goal: forall _ : is_true (maxainv (@gval rT K) (@gval rT N)), is_true (@normal rT (@gval rT N) (@gval rT K)) *) by move/maxgroupp; case/andP. Qed. Lemma maxainv_proper : maxainv K N -> N \proper K. Proof. (* Goal: forall _ : is_true (maxainv (@gval rT K) (@gval rT N)), is_true (@proper (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT N))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K)))) *) by move/maxgroupp; case/andP; rewrite properE; move/normal_sub->; case/andP. Qed. Lemma maxainv_sub : maxainv K N -> N \subset K. Proof. (* Goal: forall _ : is_true (maxainv (@gval rT K) (@gval rT N)), is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT N))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K)))) *) by move=> h; apply: proper_sub; apply: maxainv_proper. Qed. Lemma maxainv_ainvar : maxainv K N -> A \subset 'N(N | to). Proof. (* Goal: forall _ : is_true (maxainv (@gval rT K) (@gval rT N)), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT N) (@gact aT rT (@gval aT A) (@gval rT D) to))))) *) by move/maxgroupp; case/and3P. Qed. Lemma maxainvS : maxainv K N -> N \subset K. Proof. (* Goal: forall _ : is_true (maxainv (@gval rT K) (@gval rT N)), is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT N))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K)))) *) by move=> pNN; rewrite proper_sub // maxainv_proper. Qed. Lemma maxainv_exists : K :!=: 1 -> {N : {group rT} | maxainv K N}. End MaxAinvProps. Lemma maxainvM (G H K : {group rT}) : H \subset D -> K \subset D -> maxainv G H -> maxainv G K -> H :<>: K -> H * K = G. Definition asimple (K : {set rT}) := maxainv K 1. Implicit Types (H K : {group rT}) (s : seq {group rT}). Lemma asimpleP K : reflect [/\ K :!=: 1 & forall H, H <| K -> [acts A, on H | to] -> H :=: 1 \/ H :=: K] (asimple K). Definition acomps K s := ((last K s) == 1%G) && path [rel x y : {group rT} | maxainv x y] K s. Lemma acompsP K s : reflect (last K s = 1%G /\ path [rel x y : {group rT} | maxainv x y] K s) (acomps K s). Proof. (* Goal: Bool.reflect (and (@eq (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@last (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) K s) (one_group rT)) (is_true (@path (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@rel_of_simpl_rel (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@SimplRel (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun x y : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => maxainv (@gval rT x) (@gval rT y)))) K s))) (acomps K s) *) by apply: (iffP andP); case; move/eqP. Qed. Lemma trivg_acomps K s : acomps K s -> (K :==: 1) = (s == [::]). Lemma acomps_cons K H s : acomps K (H :: s) -> acomps H s. Proof. (* Goal: forall _ : is_true (acomps K (@cons (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) H s)), is_true (acomps H s) *) by case/andP => /= ls; case/andP=> _ p; rewrite /acomps ls. Qed. Lemma asimple_acompsP K s : acomps K s -> reflect (s = [:: 1%G]) (asimple K). Lemma exists_acomps K : exists s, acomps K s. Proof. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) elim: {K} #|K| {1 3}K (leqnn #|K|) => [K | n Hi K cK]. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) (* Goal: forall _ : is_true (leq (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K)))) O), @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) by rewrite leqNgt cardG_gt0. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) case/orP: (orbN (asimple K)) => [sK | nsK]. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) by exists [:: (1%G : {group rT})]; rewrite /acomps eqxx /= andbT. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) case/orP: (orbN (K :==: 1))=> [tK | ntK]. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) by exists (Nil _); rewrite /acomps /= andbT. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) case: (maxainv_exists ntK)=> N pmN. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) have cN: #|N| <= n. (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) (* Goal: is_true (leq (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT N)))) n) *) by rewrite -ltnS (leq_trans _ cK) // proper_card // (maxainv_proper pmN). (* Goal: @ex (list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (fun s : list (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) => is_true (acomps K s)) *) case: (Hi _ cN)=> s; case/andP=> lasts ps; exists [:: N & s]; rewrite /acomps. (* Goal: is_true (andb (@eq_op (group_of_eqType rT) (@last (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) K (@cons (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) N s)) (one_group rT)) (@path (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@rel_of_simpl_rel (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@SimplRel (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun x y : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => maxainv (@gval rT x) (@gval rT y)))) K (@cons (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) N s))) *) by rewrite last_cons lasts /= pmN. Qed. End StableCompositionSeries. Arguments maxainv {aT rT D%G A%G} to%gact B%g C%g. Arguments asimple {aT rT D%G A%G} to%gact K%g. Section StrongJordanHolder. Section AuxiliaryLemmas. Variables aT rT : finGroupType. Variables (A : {group aT}) (D : {group rT}) (to : groupAction A D). Lemma maxainv_asimple_quo (G H : {group rT}) : H \subset D -> maxainv to G H -> asimple (to / H) (G / H). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D))))) (_ : is_true (@maxainv aT rT D A to (@gval rT G) (@gval rT H))), is_true (@asimple aT (@coset_groupType rT (@gval rT H)) (@quotient_group rT D (@gval rT H)) (@qact_dom_group aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (@quotient_groupAction aT rT A D to H) (@quotient rT (@gval rT G) (@gval rT H))) *) move=> sHD /maxgroupP[/and3P[nHG pHG aH] Hmax]. (* Goal: is_true (@asimple aT (@coset_groupType rT (@gval rT H)) (@quotient_group rT D (@gval rT H)) (@qact_dom_group aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (@quotient_groupAction aT rT A D to H) (@quotient rT (@gval rT G) (@gval rT H))) *) apply/asimpleP; split; first by rewrite -subG1 quotient_sub1 ?normal_norm. (* Goal: forall (H0 : @group_of (@coset_groupType rT (@gval rT H)) (Phant (FinGroup.arg_sort (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (_ : is_true (@normal (@coset_groupType rT (@gval rT H)) (@gval (@coset_groupType rT (@gval rT H)) H0) (@gval (@coset_groupType rT (@gval rT H)) (@quotient_group rT G (@gval rT H))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT (@qact_dom_group aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT (@qact_dom_group aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H)) (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) H0) (@gact aT (@coset_groupType rT (@gval rT H)) (@gval aT (@qact_dom_group aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H)) (@gval (@coset_groupType rT (@gval rT H)) (@quotient_group rT D (@gval rT H))) (@quotient_groupAction aT rT A D to H))))))), or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) H0) (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) H0) (@gval (@coset_groupType rT (@gval rT H)) (@quotient_group rT G (@gval rT H)))) *) move=> K' nK'Q aK'. (* Goal: or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (@quotient_group rT G (@gval rT H)))) *) have: (K' \proper (G / H)) || (G / H == K'). (* Goal: forall _ : is_true (orb (@proper (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) K'))) (@mem (Finite.sort (@coset_finType rT (@gval rT H))) (predPredType (Finite.sort (@coset_finType rT (@gval rT H)))) (@SetDef.pred_of_set (@coset_finType rT (@gval rT H)) (@quotient rT (@gval rT G) (@gval rT H))))) (@eq_op (set_of_eqType (@coset_finType rT (@gval rT H))) (@quotient rT (@gval rT G) (@gval rT H)) (@gval (@coset_groupType rT (@gval rT H)) K'))), or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (@quotient_group rT G (@gval rT H)))) *) (* Goal: is_true (orb (@proper (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) K'))) (@mem (Finite.sort (@coset_finType rT (@gval rT H))) (predPredType (Finite.sort (@coset_finType rT (@gval rT H)))) (@SetDef.pred_of_set (@coset_finType rT (@gval rT H)) (@quotient rT (@gval rT G) (@gval rT H))))) (@eq_op (set_of_eqType (@coset_finType rT (@gval rT H))) (@quotient rT (@gval rT G) (@gval rT H)) (@gval (@coset_groupType rT (@gval rT H)) K'))) *) by rewrite properE eqEsubset andbC (normal_sub nK'Q) !andbT orbC orbN. (* Goal: forall _ : is_true (orb (@proper (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) K'))) (@mem (Finite.sort (@coset_finType rT (@gval rT H))) (predPredType (Finite.sort (@coset_finType rT (@gval rT H)))) (@SetDef.pred_of_set (@coset_finType rT (@gval rT H)) (@quotient rT (@gval rT G) (@gval rT H))))) (@eq_op (set_of_eqType (@coset_finType rT (@gval rT H))) (@quotient rT (@gval rT G) (@gval rT H)) (@gval (@coset_groupType rT (@gval rT H)) K'))), or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (@quotient_group rT G (@gval rT H)))) *) case/orP=> [ pHQ | eQH]; last by right; apply sym_eq; apply/eqP. (* Goal: or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (@quotient_group rT G (@gval rT H)))) *) left; pose K := ((coset H) @*^-1 K')%G. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H))))) *) have eK'I : K' \subset (coset H) @* 'N(H). (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H))))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@gval (@coset_groupType rT (@gval rT H)) K'))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (@morphim rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@normaliser rT (@gval rT H)))))) *) by rewrite (subset_trans (normal_sub nK'Q)) ?morphimS ?normal_norm. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H))))) *) have eKK' : K' :=: K / H by rewrite /(K / H) morphpreK //=. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType rT (@gval rT H))))) *) suff eKH : K :=: H by rewrite -trivg_quotient eKK' eKH. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) have sHK : H \subset K by rewrite -ker_coset kerE morphpreS // sub1set group1. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) apply: Hmax => //; apply/and3P; split; last exact: qacts_cosetpre. (* Goal: is_true (negb (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K))))) *) (* Goal: is_true (@normal rT (@gval rT K) (@gval rT G)) *) by rewrite -(quotientGK nHG) cosetpre_normal. (* Goal: is_true (negb (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K))))) *) by move: (proper_subn pHQ); rewrite sub_morphim_pre ?normal_norm. Qed. Lemma asimple_quo_maxainv (G H : {group rT}) : H \subset D -> G \subset D -> [acts A, on G | to] -> [acts A, on H | to] -> H <| G -> asimple (to / H) (G / H) -> maxainv to G H. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G) (@gact aT rT (@gval aT A) (@gval rT D) to)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H) (@gact aT rT (@gval aT A) (@gval rT D) to)))))) (_ : is_true (@normal rT (@gval rT H) (@gval rT G))) (_ : is_true (@asimple aT (@coset_groupType rT (@gval rT H)) (@quotient_group rT D (@gval rT H)) (@qact_dom_group aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (@quotient_groupAction aT rT A D to H) (@quotient rT (@gval rT G) (@gval rT H)))), is_true (@maxainv aT rT D A to (@gval rT G) (@gval rT H)) *) move=> sHD sGD aG aH nHG /asimpleP[ntQ maxQ]; apply/maxgroupP; split. (* Goal: forall (H0 : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (_ : is_true (andb (@normal rT (@gval rT H0) (@gval rT G)) (andb (negb (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H0))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H0) (@gact aT rT (@gval aT A) (@gval rT D) to)))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H0))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT H0) (@gval rT H) *) (* Goal: is_true (andb (@normal rT (@gval rT H) (@gval rT G)) (andb (negb (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H) (@gact aT rT (@gval aT A) (@gval rT D) to))))))) *) by rewrite nHG -quotient_sub1 ?normal_norm // subG1 ntQ. (* Goal: forall (H0 : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (_ : is_true (andb (@normal rT (@gval rT H0) (@gval rT G)) (andb (negb (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H0))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT A) (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H0) (@gact aT rT (@gval aT A) (@gval rT D) to)))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H0))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT H0) (@gval rT H) *) move=> K /and3P[nKG nsGK aK] sHK. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) pose K' := (K / H)%G. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) have K'dQ : K' <| (G / H)%G by apply: morphim_normal. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) have nKH : H <| K by rewrite (normalS _ _ nHG) // normal_sub. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) have: K' :=: 1%G \/ K' :=: (G / H). (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))) *) apply: (maxQ K' K'dQ) => /=. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@quotient rT (@gval rT K) (@gval rT H)) (@quotient_action aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))))) *) apply/subsetP=> x Adx. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H) (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@quotient rT (@gval rT K) (@gval rT H)) (@quotient_action aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))))) *) rewrite inE Adx /= inE. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@mem (@coset_of rT (@gval rT H)) (predPredType (@coset_of rT (@gval rT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@quotient rT (@gval rT K) (@gval rT H)))) (@mem (@coset_of rT (@gval rT H)) (predPredType (@coset_of rT (@gval rT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@preimset (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@coset_of rT (@gval rT H)) (fun x0 : @coset_of rT (@gval rT H) => @qact aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H x0 x) (@mem (@coset_of rT (@gval rT H)) (predPredType (@coset_of rT (@gval rT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@quotient rT (@gval rT K) (@gval rT H)))))))) *) apply/subsetP=> y. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H)))) y (@mem (Finite.sort (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H)))) (predPredType (Finite.sort (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@quotient rT (@gval rT K) (@gval rT H))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H)))) y (@mem (Finite.sort (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H)))) (predPredType (Finite.sort (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@preimset (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@coset_of rT (@gval rT H)) (fun x0 : @coset_of rT (@gval rT H) => @qact aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H x0 x) (@mem (@coset_of rT (@gval rT H)) (predPredType (@coset_of rT (@gval rT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@quotient rT (@gval rT K) (@gval rT H)))))))) *) rewrite quotientE; case/morphimP=> z Nz Kz ->; rewrite /= !inE qactE //. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@in_mem (@coset_of rT (@gval rT H)) (@coset rT (@gval rT H) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x)) (@mem (@coset_of rT (@gval rT H)) (predPredType (@coset_of rT (@gval rT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@morphim rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval rT K))))) *) have ntoyx : to z x \in 'N(H) by rewrite (acts_qact_dom_norm Adx). (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@in_mem (@coset_of rT (@gval rT H)) (@coset rT (@gval rT H) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x)) (@mem (@coset_of rT (@gval rT H)) (predPredType (@coset_of rT (@gval rT H))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (@morphim rT (@coset_groupType rT (@gval rT H)) (@normaliser rT (@gval rT H)) (@coset_morphism rT (@gval rT H)) (@MorPhantom rT (@coset_groupType rT (@gval rT H)) (@coset rT (@gval rT H))) (@gval rT K))))) *) apply/morphimP; exists (to z x) => //. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K)))) *) suff h: qact_dom to H \subset A. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A)))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@act aT (@gval aT A) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT A) (@gval rT D) to) z x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K)))) *) by rewrite astabs_act // (subsetP aK) //; apply: (subsetP h). (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@qact_dom aT A rT (@gact aT rT (@gval aT A) (@gval rT D) to) H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT A)))) *) by apply/subsetP=> t; rewrite qact_domE // inE; case/andP. (* Goal: forall _ : or (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) case; last first. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@quotient rT (@gval rT G) (@gval rT H)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) move/quotient_injG; rewrite !inE /=; move/(_ nKH nHG)=> c; move: nsGK. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) (* Goal: forall _ : is_true (negb (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT K))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@gval rT K) (@gval rT H) *) by rewrite c subxx. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType rT (@gval rT H))))))) (@gval (@coset_groupType rT (@gval rT H)) K') (@gval (@coset_groupType rT (@gval rT H)) (one_group (@coset_groupType rT (@gval rT H)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@gval rT K) (@gval rT H) *) rewrite /= -trivg_quotient => tK'; apply: (congr1 (@gval _)); move: tK'. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType rT (@gval rT H))) (Phant (@coset_of rT (@gval rT H)))) (@quotient rT (@gval rT K) (@gval rT H)) (@quotient rT (@gval rT H) (@gval rT H)), @eq (group_type rT) K H *) by apply: (@quotient_injG _ H); rewrite ?inE /= ?normal_refl. Qed. Lemma asimpleI (N1 N2 : {group rT}) : N2 \subset 'N(N1) -> N1 \subset D -> [acts A, on N1 | to] -> [acts A, on N2 | to] -> asimple (to / N1) (N2 / N1) -> asimple (to / (N2 :&: N1)) (N2 / (N2 :&: N1)). End AuxiliaryLemmas. Variables (aT rT : finGroupType). Variables (A : {group aT}) (D : {group rT}) (to : groupAction A D). Lemma StrongJordanHolderUniqueness (G : {group rT}) (s1 s2 : seq {group rT}) : G \subset D -> acomps to G s1 -> acomps to G s2 -> perm_eq (mkfactors G s1) (mkfactors G s2). End StrongJordanHolder.
Require Import Ensf. Require Import Words. Require Import more_words. Require Import need. Require Import fonctions. Require Import Relations. Require Import gram. Require Import gram2. Section resultats_iso_image. Variable X V R : Ensf. Variable S : Elt. Variable f : Elt -> Elt. Let Gim := imageGram f X V R S. Let Xim := fst Gim. Let Gim2 := snd Gim. Let Vim := fst Gim2. Let Gim3 := snd Gim2. Let Rim := fst Gim3. Let Sim := snd Gim3. Let invf := inv (union X V) (union Xim Vim) f. Let Gim' := imageGram invf Xim Vim Rim Sim. Let Xim' := fst Gim'. Let Gim2' := snd Gim'. Let Vim' := fst Gim2'. Let Gim3' := snd Gim2'. Let Rim' := fst Gim3'. Let Sim' := snd Gim3'. Hypothesis Gram : isGram X V R S. Lemma Regles_X_V_R : Regles X V R. Proof isGram4 X V R S Gram. Hypothesis Mono : is_mono (union X V) f. Lemma inter_Xim_Vim_empty : inter Xim Vim empty. Proof. (* Goal: inter Xim Vim empty *) unfold Xim, Vim in |- *; simpl in |- *. (* Goal: inter (map f X) (map f V) empty *) red in |- *. (* Goal: and (inclus empty (map f X)) (and (inclus empty (map f V)) (forall (x : Elt) (_ : dans x (map f X)) (_ : dans x (map f V)), dans x empty)) *) split; [ idtac | split ]. (* Goal: forall (x : Elt) (_ : dans x (map f X)) (_ : dans x (map f V)), dans x empty *) (* Goal: inclus empty (map f V) *) (* Goal: inclus empty (map f X) *) auto. (* Goal: forall (x : Elt) (_ : dans x (map f X)) (_ : dans x (map f V)), dans x empty *) (* Goal: inclus empty (map f V) *) auto. (* Goal: forall (x : Elt) (_ : dans x (map f X)) (_ : dans x (map f V)), dans x empty *) intros x dans_x_map_f_X dans_x_map_f_V. (* Goal: dans x empty *) elimtype (exists y : Elt, dans y X /\ x = f y :>Elt). (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: forall (x0 : Elt) (_ : and (dans x0 X) (@eq Elt x (f x0))), dans x empty *) elimtype (exists y : Elt, dans y V /\ x = f y :>Elt). (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: forall (x0 : Elt) (_ : and (dans x0 V) (@eq Elt x (f x0))) (x1 : Elt) (_ : and (dans x1 X) (@eq Elt x (f x1))), dans x empty *) intros v temp; elim temp; clear temp. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: forall (_ : dans v V) (_ : @eq Elt x (f v)) (x0 : Elt) (_ : and (dans x0 X) (@eq Elt x (f x0))), dans x empty *) intros dans_v_V x_egal_f_v x_ant temp; elim temp; clear temp. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: forall (_ : dans x_ant X) (_ : @eq Elt x (f x_ant)), dans x empty *) intros dans_x_ant_X x_egal_f_x_ant. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: dans x empty *) elimtype (inter X V empty). (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: forall (_ : inclus empty X) (_ : and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)), dans x empty *) intros incl_empty_X temp; elim temp; clear temp. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: forall (_ : inclus empty V) (_ : forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty), dans x empty *) intros incl_empty_V imp. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans x empty *) apply dans_empty_imp_P with v. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v empty *) apply imp. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v V *) (* Goal: dans v X *) replace v with x_ant. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v V *) (* Goal: @eq Elt x_ant v *) (* Goal: dans x_ant X *) assumption. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v V *) (* Goal: @eq Elt x_ant v *) apply Mono. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v V *) (* Goal: @eq Elt (f x_ant) (f v) *) (* Goal: dans v (union X V) *) (* Goal: dans x_ant (union X V) *) auto. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v V *) (* Goal: @eq Elt (f x_ant) (f v) *) (* Goal: dans v (union X V) *) auto. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v V *) (* Goal: @eq Elt (f x_ant) (f v) *) rewrite <- x_egal_f_x_ant; assumption. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) (* Goal: dans v V *) assumption. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) (* Goal: and (inclus empty X) (and (inclus empty V) (forall (x : Elt) (_ : dans x X) (_ : dans x V), dans x empty)) *) exact (isGram2 X V R S Gram). (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y V) (@eq Elt x (f y))) *) auto. (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f y))) *) auto. Qed. Lemma union_Xim_Vim_map_f_union_X_V : union Xim Vim = map f (union X V) :>Ensf. Proof. (* Goal: @eq Ensf (union Xim Vim) (map f (union X V)) *) unfold Xim, Vim, Gim2, Gim, imageGram in |- *; simpl in |- *. (* Goal: @eq Ensf (union (map f X) (map f V)) (map f (union X V)) *) apply map_union. Qed. Lemma Iso : is_iso (union X V) (union Xim Vim) f. Proof. (* Goal: is_iso (union X V) (union Xim Vim) f *) rewrite union_Xim_Vim_map_f_union_X_V. (* Goal: is_iso (union X V) (map f (union X V)) f *) auto. Qed. Hint Resolve Iso. Let wef := Word_ext f. Let weinvf := Word_ext invf. Lemma invf_f : Id (union X V) (comp invf f). Proof. (* Goal: Id (union X V) (comp invf f) *) unfold invf in |- *. (* Goal: Id (union X V) (comp (inv (union X V) (union Xim Vim) f) f) *) auto. Qed. Lemma weinvf_wef : Id_words (union X V) (comp_word weinvf wef). Proof. (* Goal: Id_words (union X V) (comp_word weinvf wef) *) unfold Id_words in |- *. (* Goal: forall (x : Word) (_ : inmonoid (union X V) x), @eq Word (comp_word weinvf wef x) x *) unfold weinvf, wef in |- *. (* Goal: forall (x : Word) (_ : inmonoid (union X V) x), @eq Word (comp_word (Word_ext invf) (Word_ext f) x) x *) intro x. (* Goal: forall _ : inmonoid (union X V) x, @eq Word (comp_word (Word_ext invf) (Word_ext f) x) x *) rewrite <- (comp_Word_ext invf f x). (* Goal: forall _ : inmonoid (union X V) x, @eq Word (Word_ext (comp invf f) x) x *) generalize x. (* Goal: forall (x : Word) (_ : inmonoid (union X V) x), @eq Word (Word_ext (comp invf f) x) x *) apply (extension_Id (union X V) (comp invf f)). (* Goal: Id (union X V) (comp invf f) *) exact invf_f. Qed. Let Rf (g : Elt -> Elt) (P : Elt) := couple (g (first P)) (word (Word_ext g (word_inv (second P)))). Lemma comp_Rf : forall (g f : Elt -> Elt) (x : Elt), dans x R -> comp (Rf g) (Rf f) x = Rf (comp g f) x :>Elt. Proof. (* Goal: forall (g f : forall _ : Elt, Elt) (x : Elt) (_ : dans x R), @eq Elt (comp (Rf g) (Rf f) x) (Rf (comp g f) x) *) clear Mono. (* Goal: forall (g f : forall _ : Elt, Elt) (x : Elt) (_ : dans x R), @eq Elt (comp (Rf g) (Rf f) x) (Rf (comp g f) x) *) intros f' g x dans_x_R. (* Goal: @eq Elt (comp (Rf f') (Rf g) x) (Rf (comp f' g) x) *) elim (Regles_X_V_R x dans_x_R). (* Goal: forall (x0 : Elt) (_ : dans x0 V) (_ : @ex2 Word (fun B : Word => @eq Elt x (couple x0 (word B))) (fun B : Word => inmonoid (union X V) B)), @eq Elt (comp (Rf f') (Rf g) x) (Rf (comp f' g) x) *) intros A dans_A_V temp. (* Goal: @eq Elt (comp (Rf f') (Rf g) x) (Rf (comp f' g) x) *) elim temp; clear temp; intros B egal_x inmonoid_B. (* Goal: @eq Elt (comp (Rf f') (Rf g) x) (Rf (comp f' g) x) *) rewrite egal_x. (* Goal: @eq Elt (comp (Rf f') (Rf g) (couple A (word B))) (Rf (comp f' g) (couple A (word B))) *) unfold Rf in |- *. (* Goal: @eq Elt (comp (fun P : Elt => couple (f' (first P)) (word (Word_ext f' (word_inv (second P))))) (fun P : Elt => couple (g (first P)) (word (Word_ext g (word_inv (second P))))) (couple A (word B))) (couple (comp f' g (first (couple A (word B)))) (word (Word_ext (comp f' g) (word_inv (second (couple A (word B))))))) *) unfold comp at 1 in |- *. (* Goal: @eq Elt (couple (f' (first (couple (g (first (couple A (word B)))) (word (Word_ext g (word_inv (second (couple A (word B))))))))) (word (Word_ext f' (word_inv (second (couple (g (first (couple A (word B)))) (word (Word_ext g (word_inv (second (couple A (word B)))))))))))) (couple (comp f' g (first (couple A (word B)))) (word (Word_ext (comp f' g) (word_inv (second (couple A (word B))))))) *) apply couple_couple. (* Goal: @eq Elt (word (Word_ext f' (word_inv (second (couple (g (first (couple A (word B)))) (word (Word_ext g (word_inv (second (couple A (word B))))))))))) (word (Word_ext (comp f' g) (word_inv (second (couple A (word B)))))) *) (* Goal: @eq Elt (f' (first (couple (g (first (couple A (word B)))) (word (Word_ext g (word_inv (second (couple A (word B))))))))) (comp f' g (first (couple A (word B)))) *) apply refl_equal. (* Goal: @eq Elt (word (Word_ext f' (word_inv (second (couple (g (first (couple A (word B)))) (word (Word_ext g (word_inv (second (couple A (word B))))))))))) (word (Word_ext (comp f' g) (word_inv (second (couple A (word B)))))) *) simpl in |- *. (* Goal: @eq Elt (word (Word_ext f' (Word_ext g B))) (word (Word_ext (comp f' g) B)) *) rewrite (comp_Word_ext f' g B). (* Goal: @eq Elt (word (Word_ext f' (Word_ext g B))) (word (comp_word (Word_ext f') (Word_ext g) B)) *) apply refl_equal. Qed. Lemma egalGim'_image_comp : Gim' = imageGram (comp invf f) X V R S :>Ensf * (Ensf * (Ensf * Elt)). Proof. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) Gim' (imageGram (comp invf f) X V R S) *) unfold Gim' in |- *. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (imageGram invf Xim Vim Rim Sim) (imageGram (comp invf f) X V R S) *) unfold Sim, Rim, Gim3, Vim, Gim2, Xim, Gim, imageGram in |- *; simpl in |- *. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (@pair Ensf (prod Ensf (prod Ensf Elt)) (map invf (map f X)) (@pair Ensf (prod Ensf Elt) (map invf (map f V)) (@pair Ensf Elt (map (fun P : Elt => couple (invf (first P)) (word (Word_ext invf (word_inv (second P))))) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (invf (f S))))) (@pair Ensf (prod Ensf (prod Ensf Elt)) (map (comp invf f) X) (@pair Ensf (prod Ensf Elt) (map (comp invf f) V) (@pair Ensf Elt (map (fun P : Elt => couple (comp invf f (first P)) (word (Word_ext (comp invf f) (word_inv (second P))))) R) (comp invf f S)))) *) apply pair_equal. (* Goal: @eq (prod Ensf (prod Ensf Elt)) (@pair Ensf (prod Ensf Elt) (map invf (map f V)) (@pair Ensf Elt (map (fun P : Elt => couple (invf (first P)) (word (Word_ext invf (word_inv (second P))))) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (invf (f S)))) (@pair Ensf (prod Ensf Elt) (map (comp invf f) V) (@pair Ensf Elt (map (fun P : Elt => couple (comp invf f (first P)) (word (Word_ext (comp invf f) (word_inv (second P))))) R) (comp invf f S))) *) (* Goal: @eq Ensf (map invf (map f X)) (map (comp invf f) X) *) rewrite (map_map_eg_map_comp invf f X); auto. (* Goal: @eq (prod Ensf (prod Ensf Elt)) (@pair Ensf (prod Ensf Elt) (map invf (map f V)) (@pair Ensf Elt (map (fun P : Elt => couple (invf (first P)) (word (Word_ext invf (word_inv (second P))))) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (invf (f S)))) (@pair Ensf (prod Ensf Elt) (map (comp invf f) V) (@pair Ensf Elt (map (fun P : Elt => couple (comp invf f (first P)) (word (Word_ext (comp invf f) (word_inv (second P))))) R) (comp invf f S))) *) apply pair_equal. (* Goal: @eq (prod Ensf Elt) (@pair Ensf Elt (map (fun P : Elt => couple (invf (first P)) (word (Word_ext invf (word_inv (second P))))) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (invf (f S))) (@pair Ensf Elt (map (fun P : Elt => couple (comp invf f (first P)) (word (Word_ext (comp invf f) (word_inv (second P))))) R) (comp invf f S)) *) (* Goal: @eq Ensf (map invf (map f V)) (map (comp invf f) V) *) rewrite (map_map_eg_map_comp invf f V); auto. (* Goal: @eq (prod Ensf Elt) (@pair Ensf Elt (map (fun P : Elt => couple (invf (first P)) (word (Word_ext invf (word_inv (second P))))) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (invf (f S))) (@pair Ensf Elt (map (fun P : Elt => couple (comp invf f (first P)) (word (Word_ext (comp invf f) (word_inv (second P))))) R) (comp invf f S)) *) apply pair_equal. (* Goal: @eq Elt (invf (f S)) (comp invf f S) *) (* Goal: @eq Ensf (map (fun P : Elt => couple (invf (first P)) (word (Word_ext invf (word_inv (second P))))) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (map (fun P : Elt => couple (comp invf f (first P)) (word (Word_ext (comp invf f) (word_inv (second P))))) R) *) change (map (Rf invf) (map (Rf f) R) = map (Rf (comp invf f)) R :>Ensf) in |- *. (* Goal: @eq Elt (invf (f S)) (comp invf f S) *) (* Goal: @eq Ensf (map (Rf invf) (map (Rf f) R)) (map (Rf (comp invf f)) R) *) replace (map (Rf (comp invf f)) R) with (map (comp (Rf invf) (Rf f)) R). (* Goal: @eq Elt (invf (f S)) (comp invf f S) *) (* Goal: @eq Ensf (map (comp (Rf invf) (Rf f)) R) (map (Rf (comp invf f)) R) *) (* Goal: @eq Ensf (map (Rf invf) (map (Rf f) R)) (map (comp (Rf invf) (Rf f)) R) *) apply map_map_eg_map_comp. (* Goal: @eq Elt (invf (f S)) (comp invf f S) *) (* Goal: @eq Ensf (map (comp (Rf invf) (Rf f)) R) (map (Rf (comp invf f)) R) *) apply map_egal. (* Goal: @eq Elt (invf (f S)) (comp invf f S) *) (* Goal: forall (x : Elt) (_ : dans x R), @eq Elt (comp (Rf invf) (Rf f) x) (Rf (comp invf f) x) *) exact (comp_Rf invf f). (* Goal: @eq Elt (invf (f S)) (comp invf f S) *) apply refl_equal. Qed. Lemma egalG : Gim' = (X, (V, (R, S))). Proof. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) Gim' (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V (@pair Ensf Elt R S))) *) rewrite egalGim'_image_comp. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (imageGram (comp invf f) X V R S) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V (@pair Ensf Elt R S))) *) apply Id_image_G. (* Goal: isGram X V R S *) (* Goal: Id (union X V) (comp invf f) *) unfold invf in |- *. (* Goal: isGram X V R S *) (* Goal: Id (union X V) (comp (inv (union X V) (union Xim Vim) f) f) *) auto. (* Goal: isGram X V R S *) auto. Qed. Lemma egalS : Sim' = S :>Elt. Proof. (* Goal: @eq Elt Sim' S *) unfold Sim', Rim', Gim3', Vim', Gim2', Xim' in |- *. (* Goal: @eq Elt (@snd Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) Gim'))) S *) rewrite egalG. (* Goal: @eq Elt (@snd Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V (@pair Ensf Elt R S)))))) S *) apply refl_equal. Qed. Lemma egalR : Rim' = R :>Ensf. Proof. (* Goal: @eq Ensf Rim' R *) unfold Rim', Gim3', Vim', Gim2', Xim' in |- *. (* Goal: @eq Ensf (@fst Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) Gim'))) R *) rewrite egalG. (* Goal: @eq Ensf (@fst Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V (@pair Ensf Elt R S)))))) R *) apply refl_equal. Qed. Lemma egalX : Xim' = X :>Ensf. Proof. (* Goal: @eq Ensf Xim' X *) unfold Vim', Gim2', Xim' in |- *. (* Goal: @eq Ensf (@fst Ensf (prod Ensf (prod Ensf Elt)) Gim') X *) rewrite egalG. (* Goal: @eq Ensf (@fst Ensf (prod Ensf (prod Ensf Elt)) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V (@pair Ensf Elt R S)))) X *) apply refl_equal. Qed. Lemma egalV : Vim' = V :>Ensf. Proof. (* Goal: @eq Ensf Vim' V *) unfold Vim', Gim2', Xim' in |- *. (* Goal: @eq Ensf (@fst Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) Gim')) V *) rewrite egalG. (* Goal: @eq Ensf (@fst Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V (@pair Ensf Elt R S))))) V *) apply refl_equal. Qed. Lemma Reconnait_imageGram_iso : forall w : Word, inmonoid X w -> LG Xim Vim Rim Sim (wef w) -> LG X V R S w. Proof. (* Goal: forall (w : Word) (_ : inmonoid X w) (_ : LG Xim Vim Rim Sim (wef w)), LG X V R S w *) intros w inmonoid_X_w LG_wef_w. (* Goal: LG X V R S w *) rewrite <- egalR. (* Goal: LG X V Rim' S w *) rewrite <- egalS. (* Goal: LG X V Rim' Sim' w *) rewrite <- egalV. (* Goal: LG X Vim' Rim' Sim' w *) rewrite <- egalX. (* Goal: LG Xim' Vim' Rim' Sim' w *) replace w with (weinvf (wef w)). (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: LG Xim' Vim' Rim' Sim' (weinvf (wef w)) *) unfold Sim', Rim', Gim3', Vim', Gim2', Xim', Gim', weinvf in |- *. (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: LG (@fst Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim)) (@fst Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim))) (@fst Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim)))) (@snd Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim)))) (Word_ext invf (wef w)) *) auto. (* Goal: @eq Word (weinvf (wef w)) w *) change (comp_word weinvf wef w = w :>Word) in |- *. (* Goal: @eq Word (comp_word weinvf wef w) w *) apply Id_words_inv with X. (* Goal: Id_words X (comp_word weinvf wef) *) (* Goal: inmonoid X w *) assumption. (* Goal: Id_words X (comp_word weinvf wef) *) apply Id_words_inclus with (union X V). (* Goal: Id_words (union X V) (comp_word weinvf wef) *) (* Goal: inclus X (union X V) *) auto. (* Goal: Id_words (union X V) (comp_word weinvf wef) *) exact weinvf_wef. Qed. Lemma egal_Xim : Id X f -> Xim = X :>Ensf. Proof. (* Goal: forall _ : Id X f, @eq Ensf Xim X *) unfold Xim, Gim, imageGram in |- *; simpl in |- *. (* Goal: forall _ : Id X f, @eq Ensf (map f X) X *) intros. (* Goal: @eq Ensf (map f X) X *) apply map_Id; assumption. Qed. Lemma egal_LG : Id X f -> l_egal (LG X V R S) (LG Xim Vim Rim Sim). Proof. (* Goal: forall _ : Id X f, l_egal (LG X V R S) (LG Xim Vim Rim Sim) *) unfold l_egal in |- *. (* Goal: forall _ : Id X f, and (l_inclus (LG X V R S) (LG Xim Vim Rim Sim)) (l_inclus (LG Xim Vim Rim Sim) (LG X V R S)) *) intro Id_X. (* Goal: and (l_inclus (LG X V R S) (LG Xim Vim Rim Sim)) (l_inclus (LG Xim Vim Rim Sim) (LG X V R S)) *) unfold l_inclus in |- *. (* Goal: and (forall (w : Word) (_ : LG X V R S w), LG Xim Vim Rim Sim w) (forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w) *) split. (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) (* Goal: forall (w : Word) (_ : LG X V R S w), LG Xim Vim Rim Sim w *) intros w LG_X_w. (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) (* Goal: LG Xim Vim Rim Sim w *) replace w with (wef w). (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) (* Goal: @eq Word (wef w) w *) (* Goal: LG Xim Vim Rim Sim (wef w) *) unfold Sim, Rim, Gim3, Vim, Gim2, Xim, Gim, wef in |- *. (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) (* Goal: @eq Word (wef w) w *) (* Goal: LG (@fst Ensf (prod Ensf (prod Ensf Elt)) (imageGram f X V R S)) (@fst Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram f X V R S))) (@fst Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram f X V R S)))) (@snd Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram f X V R S)))) (Word_ext f w) *) auto. (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) (* Goal: @eq Word (wef w) w *) apply (Id_words_inv X). (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) (* Goal: Id_words X wef *) (* Goal: inmonoid X w *) prolog [ LG_inv ] 2. (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) (* Goal: Id_words X wef *) exact (extension_Id X f Id_X). (* Goal: forall (w : Word) (_ : LG Xim Vim Rim Sim w), LG X V R S w *) intros w LG_Xim_w. (* Goal: LG X V R S w *) replace X with Xim'. (* Goal: @eq Ensf Xim' X *) (* Goal: LG Xim' V R S w *) replace V with Vim'. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: LG Xim' Vim' R S w *) replace S with Sim'. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: LG Xim' Vim' R Sim' w *) replace R with Rim'. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: LG Xim' Vim' Rim' Sim' w *) replace w with (weinvf (wef w)). (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: LG Xim' Vim' Rim' Sim' (weinvf (wef w)) *) unfold Sim', Rim', Gim3', Vim', Gim2', Xim', Gim', weinvf in |- *. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: LG (@fst Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim)) (@fst Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim))) (@fst Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim)))) (@snd Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) (imageGram invf Xim Vim Rim Sim)))) (Word_ext invf (wef w)) *) apply Reconnait_imageGram. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: LG Xim Vim Rim Sim (wef w) *) replace (wef w) with w. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: @eq Word w (wef w) *) (* Goal: LG Xim Vim Rim Sim w *) assumption. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: @eq Word w (wef w) *) apply sym_equal. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: @eq Word (wef w) w *) apply (Id_words_inv X). (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: Id_words X wef *) (* Goal: inmonoid X w *) rewrite <- (egal_Xim Id_X). (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: Id_words X wef *) (* Goal: inmonoid Xim w *) prolog [ LG_inv ] 2. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) (* Goal: Id_words X wef *) exact (extension_Id X f Id_X). (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (weinvf (wef w)) w *) pattern w at 2 in |- *; replace w with (comp_word weinvf wef w). (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (comp_word weinvf wef w) w *) (* Goal: @eq Word (weinvf (wef w)) (comp_word weinvf wef w) *) apply refl_equal. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: @eq Word (comp_word weinvf wef w) w *) apply Id_words_inv with (union X V). (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: Id_words (union X V) (comp_word weinvf wef) *) (* Goal: inmonoid (union X V) w *) apply inmonoid_inclus with X. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: Id_words (union X V) (comp_word weinvf wef) *) (* Goal: inmonoid X w *) (* Goal: inclus X (union X V) *) auto. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: Id_words (union X V) (comp_word weinvf wef) *) (* Goal: inmonoid X w *) replace X with Xim. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: Id_words (union X V) (comp_word weinvf wef) *) (* Goal: @eq Ensf Xim X *) (* Goal: inmonoid Xim w *) prolog [ LG_inv ] 2. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: Id_words (union X V) (comp_word weinvf wef) *) (* Goal: @eq Ensf Xim X *) exact (egal_Xim Id_X). (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) (* Goal: Id_words (union X V) (comp_word weinvf wef) *) exact weinvf_wef. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) (* Goal: @eq Ensf Rim' R *) exact egalR. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) (* Goal: @eq Elt Sim' S *) exact egalS. (* Goal: @eq Ensf Xim' X *) (* Goal: @eq Ensf Vim' V *) exact egalV. (* Goal: @eq Ensf Xim' X *) exact egalX. Qed. End resultats_iso_image.
Require Export GeoCoq.Elements.OriginalProofs.lemma_extension. Require Export GeoCoq.Elements.OriginalProofs.lemma_betweennesspreserved. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_lessthancongruence : forall A B C D E F, Lt A B C D -> Cong C D E F -> Lt A B E F. Proof. (* Goal: forall (A B C D E F : @Point Ax) (_ : @Lt Ax A B C D) (_ : @Cong Ax C D E F), @Lt Ax A B E F *) intros. (* Goal: @Lt Ax A B E F *) let Tf:=fresh in assert (Tf:exists G, (BetS C G D /\ Cong C G A B)) by (conclude_def Lt );destruct Tf as [G];spliter. (* Goal: @Lt Ax A B E F *) assert (neq C D) by (forward_using lemma_betweennotequal). (* Goal: @Lt Ax A B E F *) assert (neq E F) by (conclude axiom_nocollapse). (* Goal: @Lt Ax A B E F *) assert (~ eq F E). (* Goal: @Lt Ax A B E F *) (* Goal: not (@eq Ax F E) *) { (* Goal: not (@eq Ax F E) *) intro. (* Goal: False *) assert (eq E F) by (conclude lemma_equalitysymmetric). (* Goal: False *) contradict. (* BG Goal: @Lt Ax A B E F *) } (* Goal: @Lt Ax A B E F *) let Tf:=fresh in assert (Tf:exists P, (BetS F E P /\ Cong E P F E)) by (conclude lemma_extension);destruct Tf as [P];spliter. (* Goal: @Lt Ax A B E F *) assert (BetS P E F) by (conclude axiom_betweennesssymmetry). (* Goal: @Lt Ax A B E F *) assert (neq P E) by (forward_using lemma_betweennotequal). (* Goal: @Lt Ax A B E F *) assert (neq C G) by (forward_using lemma_betweennotequal). (* Goal: @Lt Ax A B E F *) assert (neq A B) by (conclude axiom_nocollapse). (* Goal: @Lt Ax A B E F *) rename_H H;let Tf:=fresh in assert (Tf:exists H, (BetS P E H /\ Cong E H A B)) by (conclude lemma_extension);destruct Tf as [H];spliter. (* Goal: @Lt Ax A B E F *) assert (~ eq D C). (* Goal: @Lt Ax A B E F *) (* Goal: not (@eq Ax D C) *) { (* Goal: not (@eq Ax D C) *) intro. (* Goal: False *) assert (BetS C G C) by (conclude cn_equalitysub). (* Goal: False *) assert (~ BetS C G C) by (conclude axiom_betweennessidentity). (* Goal: False *) contradict. (* BG Goal: @Lt Ax A B E F *) } (* Goal: @Lt Ax A B E F *) assert (neq P E) by (forward_using lemma_betweennotequal). (* Goal: @Lt Ax A B E F *) assert (neq E P) by (conclude lemma_inequalitysymmetric). (* Goal: @Lt Ax A B E F *) let Tf:=fresh in assert (Tf:exists Q, (BetS D C Q /\ Cong C Q E P)) by (conclude lemma_extension);destruct Tf as [Q];spliter. (* Goal: @Lt Ax A B E F *) assert (BetS Q C D) by (conclude axiom_betweennesssymmetry). (* Goal: @Lt Ax A B E F *) assert (Cong Q C C Q) by (conclude cn_equalityreverse). (* Goal: @Lt Ax A B E F *) assert (Cong Q C E P) by (conclude lemma_congruencetransitive). (* Goal: @Lt Ax A B E F *) assert (Cong E P P E) by (conclude cn_equalityreverse). (* Goal: @Lt Ax A B E F *) assert (Cong Q C P E) by (conclude lemma_congruencetransitive). (* Goal: @Lt Ax A B E F *) assert (Cong Q D P F) by (conclude cn_sumofparts). (* Goal: @Lt Ax A B E F *) assert (Cong A B E H) by (conclude lemma_congruencesymmetric). (* Goal: @Lt Ax A B E F *) assert (Cong C G E H) by (conclude lemma_congruencetransitive). (* Goal: @Lt Ax A B E F *) assert (BetS Q C G) by (conclude axiom_innertransitivity). (* Goal: @Lt Ax A B E F *) assert (Cong D G F H) by (conclude axiom_5_line). (* Goal: @Lt Ax A B E F *) assert (Cong G D H F) by (forward_using lemma_doublereverse). (* Goal: @Lt Ax A B E F *) assert (BetS E H F) by (conclude lemma_betweennesspreserved). (* Goal: @Lt Ax A B E F *) assert (Lt A B E F) by (conclude_def Lt ). (* Goal: @Lt Ax A B E F *) close. Qed. End Euclid.
Require Import Ensf. Require Import Words. Require Import more_words. Require Import need. Require Import fonctions. Require Import Relations. Require Import gram. Hint Resolve extension_Id. Section resultats. Variable X V1 R1 : Ensf. Variable S1 : Elt. Variable V2 R2 : Ensf. Variable S2 : Elt. Let C := Gunion V1 R1 V2 R2. Let Vu := fst C. Let Ru := snd C. Lemma inter_X_Vu : isGram X V1 R1 S1 -> isGram X V2 R2 S2 -> inter X Vu empty. Proof. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2), inter X Vu empty *) intro G1. (* Goal: forall _ : isGram X V2 R2 S2, inter X Vu empty *) intro G2. (* Goal: inter X Vu empty *) unfold Vu in |- *. (* Goal: inter X (@fst Ensf Ensf C) empty *) unfold C in |- *. (* Goal: inter X (@fst Ensf Ensf (Gunion V1 R1 V2 R2)) empty *) unfold Gunion in |- *. (* Goal: inter X (@fst Ensf Ensf (@pair Ensf Ensf (union V1 V2) (union R1 R2))) empty *) simpl in |- *. (* Goal: inter X (union V1 V2) empty *) apply union_inter. (* Goal: inter X V2 empty *) (* Goal: inter X V1 empty *) apply isGram2 with R1 S1; assumption. (* Goal: inter X V2 empty *) apply isGram2 with R2 S2; assumption. Qed. Lemma Gunion_Regles : isGram X V1 R1 S1 -> isGram X V2 R2 S2 -> Regles X Vu Ru. Proof. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2), Regles X Vu Ru *) intros. (* Goal: Regles X Vu Ru *) unfold Ru in |- *; unfold C in |- *; unfold Gunion in |- *; simpl in |- *. (* Goal: Regles X Vu (union R1 R2) *) apply Regles_union; unfold Vu in |- *; unfold C in |- *; unfold Gunion in |- *; simpl in |- *. (* Goal: Regles X (union V1 V2) R2 *) (* Goal: Regles X (union V1 V2) R1 *) apply Regles_V with V1; [ auto | apply isGram4 with S1; auto ]. (* Goal: Regles X (union V1 V2) R2 *) apply Regles_V with V2; [ auto | apply isGram4 with S2; auto ]. Qed. Lemma inmon_Der_imp_Der : Regles X V1 R1 -> Regles X V2 R2 -> inter (union X V1) V2 empty -> forall u v : Word, Derive Ru u v -> inmonoid (union X V1) u -> Derive R1 u v. Proof. (* Goal: forall (_ : Regles X V1 R1) (_ : Regles X V2 R2) (_ : inter (union X V1) V2 empty) (u v : Word) (_ : Derive Ru u v) (_ : inmonoid (union X V1) u), Derive R1 u v *) intros Re_1 Re_2 inter_X_V1_V2_empty u v Der_Ru_u. (* Goal: forall _ : inmonoid (union X V1) u, Derive R1 u v *) elim Der_Ru_u. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) Ru) (_ : inmonoid (union X V1) (cons A v)), Derive R1 (cons A v) (Append u v) *) intros u0 v0 A dans_couple_Ru inmon_cons_A_v0. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: Derive R1 (cons A v0) (Append u0 v0) *) apply Derive1. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: dans (couple A (word u0)) R1 *) cut (dans (couple A (word u0)) R1 \/ dans (couple A (word u0)) R2). (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2), dans (couple A (word u0)) R1 *) intro temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R1 *) (* Goal: forall _ : dans (couple A (word u0)) R1, dans (couple A (word u0)) R1 *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R1 *) intro dans_R2. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: dans (couple A (word u0)) R1 *) absurd (inter (union X V1) V2 empty). (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: not (inter (union X V1) V2 empty) *) red in |- *. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: forall _ : inter (union X V1) V2 empty, False *) unfold inter in |- *. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: forall _ : and (inclus empty (union X V1)) (and (inclus empty V2) (forall (x : Elt) (_ : dans x (union X V1)) (_ : dans x V2), dans x empty)), False *) intro temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: forall (_ : inclus empty (union X V1)) (_ : and (inclus empty V2) (forall (x : Elt) (_ : dans x (union X V1)) (_ : dans x V2), dans x empty)), False *) intros incl_empty_X_V1 temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: forall (_ : inclus empty V2) (_ : forall (x : Elt) (_ : dans x (union X V1)) (_ : dans x V2), dans x empty), False *) intros incl_empty_V2 imp. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: False *) apply dans_empty_imp_P with A. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: dans A empty *) apply imp. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: dans A V2 *) (* Goal: dans A (union X V1) *) apply inmonoid_cons_inv2 with v0; assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) (* Goal: dans A V2 *) apply Regles_inv1 with X R2 (word u0); assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: inter (union X V1) V2 empty *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) apply dans_union; assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) u, Derive R1 u v) (_ : inmonoid (union X V1) (cons x u)), Derive R1 (cons x u) (cons x v) *) intros u0 v0 x Der_Ru imp inmon_cons_x_u0. (* Goal: Derive R1 (cons x u0) (cons x v0) *) apply Derive2. (* Goal: Derive R1 u0 v0 *) apply imp. (* Goal: inmonoid (union X V1) u0 *) apply inmonoid_cons_inv with x. (* Goal: inmonoid (union X V1) (cons x u0) *) assumption. Qed. Lemma inmon_Der_imp_inmon_R1 : forall u v : Word, Regles X V1 R1 -> Derive R1 u v -> inmonoid (union X V1) u -> inmonoid (union X V1) v. Proof. (* Goal: forall (u v : Word) (_ : Regles X V1 R1) (_ : Derive R1 u v) (_ : inmonoid (union X V1) u), inmonoid (union X V1) v *) intros. (* Goal: inmonoid (union X V1) v *) apply in_mon_X_Der_imp_inmon_X with R1 u; assumption. Qed. Lemma inmon_Der_imp_inmon : forall u v : Word, isGram X V1 R1 S1 -> isGram X V2 R2 S2 -> inter V1 V2 empty -> inmonoid (union X V1) u -> Derive Ru u v -> inmonoid (union X V1) v. Proof. (* Goal: forall (u v : Word) (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2) (_ : inter V1 V2 empty) (_ : inmonoid (union X V1) u) (_ : Derive Ru u v), inmonoid (union X V1) v *) intros u v G_R1 G_R2 inter_V1_V2_empty inmon_X_V1_u Der_Ru_u_v. (* Goal: inmonoid (union X V1) v *) apply inmon_Der_imp_inmon_R1 with u. (* Goal: inmonoid (union X V1) u *) (* Goal: Derive R1 u v *) (* Goal: Regles X V1 R1 *) apply isGram4 with S1; assumption. (* Goal: inmonoid (union X V1) u *) (* Goal: Derive R1 u v *) apply inmon_Der_imp_Der. (* Goal: inmonoid (union X V1) u *) (* Goal: inmonoid (union X V1) u *) (* Goal: Derive Ru u v *) (* Goal: inter (union X V1) V2 empty *) (* Goal: Regles X V2 R2 *) (* Goal: Regles X V1 R1 *) apply isGram4 with S1; assumption. (* Goal: inmonoid (union X V1) u *) (* Goal: inmonoid (union X V1) u *) (* Goal: Derive Ru u v *) (* Goal: inter (union X V1) V2 empty *) (* Goal: Regles X V2 R2 *) apply isGram4 with S2; assumption. (* Goal: inmonoid (union X V1) u *) (* Goal: inmonoid (union X V1) u *) (* Goal: Derive Ru u v *) (* Goal: inter (union X V1) V2 empty *) apply inter_union. (* Goal: inmonoid (union X V1) u *) (* Goal: inmonoid (union X V1) u *) (* Goal: Derive Ru u v *) (* Goal: inter V1 V2 empty *) (* Goal: inter X V2 empty *) apply isGram2 with R2 S2; assumption. (* Goal: inmonoid (union X V1) u *) (* Goal: inmonoid (union X V1) u *) (* Goal: Derive Ru u v *) (* Goal: inter V1 V2 empty *) assumption. (* Goal: inmonoid (union X V1) u *) (* Goal: inmonoid (union X V1) u *) (* Goal: Derive Ru u v *) assumption. (* Goal: inmonoid (union X V1) u *) (* Goal: inmonoid (union X V1) u *) assumption. (* Goal: inmonoid (union X V1) u *) assumption. Qed. Lemma Gunion_Derivestar : isGram X V1 R1 S1 -> isGram X V2 R2 S2 -> inter V1 V2 empty -> forall u v : Word, Derivestar Ru u v -> inmonoid (union X V1) u -> Derivestar R1 u v. Proof. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2) (_ : inter V1 V2 empty) (u v : Word) (_ : Derivestar Ru u v) (_ : inmonoid (union X V1) u), Derivestar R1 u v *) unfold Derivestar in |- *. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2) (_ : inter V1 V2 empty) (u v : Word) (_ : Rstar Word (Derive Ru) u v) (_ : inmonoid (union X V1) u), Rstar Word (Derive R1) u v *) intros G_1 G_2 inter_V1_V2_empty u v Derivestar_Ru. (* Goal: forall _ : inmonoid (union X V1) u, Rstar Word (Derive R1) u v *) pattern u, v in |- *. (* Goal: (fun w w0 : Word => forall _ : inmonoid (union X V1) w, Rstar Word (Derive R1) w w0) u v *) apply Derivestar_Ru. (* Goal: forall (u v w : Word) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) v, Rstar Word (Derive R1) v w) (_ : inmonoid (union X V1) u), Rstar Word (Derive R1) u w *) (* Goal: forall (u : Word) (_ : inmonoid (union X V1) u), Rstar Word (Derive R1) u u *) auto. (* Goal: forall (u v w : Word) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V1) v, Rstar Word (Derive R1) v w) (_ : inmonoid (union X V1) u), Rstar Word (Derive R1) u w *) intros u0 v0 w Der_Ru inmon_v0_imp_Rstar_R1_v0 inmon_u0. (* Goal: Rstar Word (Derive R1) u0 w *) apply Rstar_R with v0. (* Goal: Rstar Word (Derive R1) v0 w *) (* Goal: Derive R1 u0 v0 *) prolog [ inmon_Der_imp_Der isGram4 inter_union isGram2 ] 5. (* Goal: Rstar Word (Derive R1) v0 w *) prolog [ inmon_Der_imp_inmon ] 3. Qed. Lemma inmon_Der_imp_Der2 : Regles X V1 R1 -> Regles X V2 R2 -> inter (union X V2) V1 empty -> forall u v : Word, Derive Ru u v -> inmonoid (union X V2) u -> Derive R2 u v. Proof. (* Goal: forall (_ : Regles X V1 R1) (_ : Regles X V2 R2) (_ : inter (union X V2) V1 empty) (u v : Word) (_ : Derive Ru u v) (_ : inmonoid (union X V2) u), Derive R2 u v *) intros Re_1 Re_2 inter_X_V2_V1_empty u v Der_Ru_u. (* Goal: forall _ : inmonoid (union X V2) u, Derive R2 u v *) elim Der_Ru_u. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) Ru) (_ : inmonoid (union X V2) (cons A v)), Derive R2 (cons A v) (Append u v) *) intros u0 v0 A dans_couple_Ru inmon_cons_A_v0. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: Derive R2 (cons A v0) (Append u0 v0) *) apply Derive1. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: dans (couple A (word u0)) R2 *) cut (dans (couple A (word u0)) R1 \/ dans (couple A (word u0)) R2). (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2), dans (couple A (word u0)) R2 *) intro temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: forall _ : dans (couple A (word u0)) R1, dans (couple A (word u0)) R2 *) intro dans_R1. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: dans (couple A (word u0)) R2 *) absurd (inter (union X V2) V1 empty). (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: inter (union X V2) V1 empty *) (* Goal: not (inter (union X V2) V1 empty) *) red in |- *. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: inter (union X V2) V1 empty *) (* Goal: forall _ : inter (union X V2) V1 empty, False *) unfold inter in |- *. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: inter (union X V2) V1 empty *) (* Goal: forall _ : and (inclus empty (union X V2)) (and (inclus empty V1) (forall (x : Elt) (_ : dans x (union X V2)) (_ : dans x V1), dans x empty)), False *) intros (H1, (H2, H3)). (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: inter (union X V2) V1 empty *) (* Goal: False *) apply dans_empty_imp_P with A. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: inter (union X V2) V1 empty *) (* Goal: dans A empty *) prolog [ inmonoid_cons_inv2 Regles_inv1 ] 3. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) (* Goal: inter (union X V2) V1 empty *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) (* Goal: forall _ : dans (couple A (word u0)) R2, dans (couple A (word u0)) R2 *) trivial. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) (* Goal: or (dans (couple A (word u0)) R1) (dans (couple A (word u0)) R2) *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) u, Derive R2 u v) (_ : inmonoid (union X V2) (cons x u)), Derive R2 (cons x u) (cons x v) *) prolog [ Derive2 inmonoid_cons_inv ] 10. Qed. Lemma inmon_Der_imp_inmon_R2 : forall u v : Word, Regles X V2 R2 -> Derive R2 u v -> inmonoid (union X V2) u -> inmonoid (union X V2) v. Proof. (* Goal: forall (u v : Word) (_ : Regles X V2 R2) (_ : Derive R2 u v) (_ : inmonoid (union X V2) u), inmonoid (union X V2) v *) intros u v Regles_R2 Der_R2. (* Goal: forall _ : inmonoid (union X V2) u, inmonoid (union X V2) v *) elim Der_R2. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R2 u v) (_ : forall _ : inmonoid (union X V2) u, inmonoid (union X V2) v) (_ : inmonoid (union X V2) (cons x u)), inmonoid (union X V2) (cons x v) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) R2) (_ : inmonoid (union X V2) (cons A v)), inmonoid (union X V2) (Append u v) *) intros; prolog [ inmonoid_cons_inv Regles_inv2 inmonoid_Append ] 3. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R2 u v) (_ : forall _ : inmonoid (union X V2) u, inmonoid (union X V2) v) (_ : inmonoid (union X V2) (cons x u)), inmonoid (union X V2) (cons x v) *) intros; prolog [ inmonoid_cons_inv2 inmonoid_cons_inv inmonoid_cons ] 4. Qed. Lemma inmon_Der_imp_inmon_2 : forall u v : Word, isGram X V1 R1 S1 -> isGram X V2 R2 S2 -> inter V1 V2 empty -> inmonoid (union X V2) u -> Derive Ru u v -> inmonoid (union X V2) v. Proof. (* Goal: forall (u v : Word) (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2) (_ : inter V1 V2 empty) (_ : inmonoid (union X V2) u) (_ : Derive Ru u v), inmonoid (union X V2) v *) intros; prolog [ inmon_Der_imp_inmon_R2 sym_inter isGram2 inter_union isGram4 inmon_Der_imp_Der2 ] 5. Qed. Lemma Gunion_Derivestar2 : isGram X V1 R1 S1 -> isGram X V2 R2 S2 -> inter V1 V2 empty -> forall u v : Word, Derivestar Ru u v -> inmonoid (union X V2) u -> Derivestar R2 u v. Proof. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2) (_ : inter V1 V2 empty) (u v : Word) (_ : Derivestar Ru u v) (_ : inmonoid (union X V2) u), Derivestar R2 u v *) unfold Derivestar in |- *. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2) (_ : inter V1 V2 empty) (u v : Word) (_ : Rstar Word (Derive Ru) u v) (_ : inmonoid (union X V2) u), Rstar Word (Derive R2) u v *) intros G_1 G_2 inter_V1_V2_empty u v Derivestar_Ru. (* Goal: forall _ : inmonoid (union X V2) u, Rstar Word (Derive R2) u v *) pattern u, v in |- *. (* Goal: (fun w w0 : Word => forall _ : inmonoid (union X V2) w, Rstar Word (Derive R2) w w0) u v *) apply Derivestar_Ru. (* Goal: forall (u v w : Word) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) v, Rstar Word (Derive R2) v w) (_ : inmonoid (union X V2) u), Rstar Word (Derive R2) u w *) (* Goal: forall (u : Word) (_ : inmonoid (union X V2) u), Rstar Word (Derive R2) u u *) auto. (* Goal: forall (u v w : Word) (_ : Derive Ru u v) (_ : forall _ : inmonoid (union X V2) v, Rstar Word (Derive R2) v w) (_ : inmonoid (union X V2) u), Rstar Word (Derive R2) u w *) intros u0 v0 w Der_Ru inmon_v0_imp_Rstar_R2_v0 inmon_u0. (* Goal: Rstar Word (Derive R2) u0 w *) apply Rstar_R with v0. (* Goal: Rstar Word (Derive R2) v0 w *) (* Goal: Derive R2 u0 v0 *) prolog [ sym_inter isGram2 inter_union isGram4 inmon_Der_imp_Der2 ] 4. (* Goal: Rstar Word (Derive R2) v0 w *) prolog [ inmon_Der_imp_inmon_2 ] 3. Qed. Lemma Gunion_isGram : forall S : Elt, isGram X V1 R1 S1 -> isGram X V2 R2 S2 -> dans S Vu -> isGram X Vu Ru S. Proof. (* Goal: forall (S : Elt) (_ : isGram X V1 R1 S1) (_ : isGram X V2 R2 S2) (_ : dans S Vu), isGram X Vu Ru S *) prolog [ isGram5 isGram1 inter_X_Vu Gunion_Regles ] 7. Qed. Variable f : Elt -> Elt. Let wef := Word_ext f. Let fet (w : Elt) := word (wef (word_inv w)). Let fonc (P : Elt) := couple (f (first P)) (fet (second P)). Let Gim := imageGram f X V1 R1 S1. Let Xim := fst Gim. Let Gim2 := snd Gim. Let Vim := fst Gim2. Let Gim3 := snd Gim2. Let Rim := fst Gim3. Let Sim := snd Gim3. Lemma dans_Rim : forall (A : Elt) (u : Word), dans (couple A (word u)) R1 -> dans (couple (f A) (word (wef u))) Rim. Proof. (* Goal: forall (A : Elt) (u : Word) (_ : dans (couple A (word u)) R1), dans (couple (f A) (word (wef u))) Rim *) intros. (* Goal: dans (couple (f A) (word (wef u))) Rim *) unfold Rim, Gim3, Gim2, Gim, imageGram in |- *; simpl in |- *. (* Goal: dans (couple (f A) (word (wef u))) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R1) *) replace (couple (f A) (word (wef u))) with (fonc (couple A (word u))); auto. Qed. Hint Resolve dans_Rim. Lemma image_Regles : Regles X V1 R1 -> Regles Xim Vim Rim. Proof. (* Goal: forall _ : Regles X V1 R1, Regles Xim Vim Rim *) unfold Rim, Vim, Xim, Gim3, Gim2, Gim, imageGram, Regles in |- *; simpl in |- *. (* Goal: forall (_ : forall (x : Elt) (_ : dans x R1), @ex2 Elt (fun A : Elt => dans A V1) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union X V1) B))) (x : Elt) (_ : dans x (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R1)), @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) intros R_R1 x dans_x. (* Goal: @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) cut (exists x_ant : Elt, dans x_ant R1 /\ x = fonc x_ant :>Elt). (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: forall _ : @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))), @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) intro temp; elim temp; clear temp. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: forall (x0 : Elt) (_ : and (dans x0 R1) (@eq Elt x (fonc x0))), @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) intros x_ant temp; elim temp; clear temp; intros x_ant_in_R1 x_egal. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) elim (R_R1 x_ant x_ant_in_R1). (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: forall (x0 : Elt) (_ : dans x0 V1) (_ : @ex2 Word (fun B : Word => @eq Elt x_ant (couple x0 (word B))) (fun B : Word => inmonoid (union X V1) B)), @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) intros A_ant dans_A_ant_V1 temp; elim temp; clear temp. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: forall (x0 : Word) (_ : @eq Elt x_ant (couple A_ant (word x0))) (_ : inmonoid (union X V1) x0), @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) intros B_ant x_ant_egal inmonoid_x_ant. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: @ex2 Elt (fun A : Elt => dans A (map f V1)) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B)) *) exists (f A_ant). (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: @ex2 Word (fun B : Word => @eq Elt x (couple (f A_ant) (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B) *) (* Goal: dans (f A_ant) (map f V1) *) apply dans_map_inv; assumption. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: @ex2 Word (fun B : Word => @eq Elt x (couple (f A_ant) (word B))) (fun B : Word => inmonoid (union (map f X) (map f V1)) B) *) exists (Word_ext f B_ant). (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: inmonoid (union (map f X) (map f V1)) (Word_ext f B_ant) *) (* Goal: @eq Elt x (couple (f A_ant) (word (Word_ext f B_ant))) *) rewrite x_egal; unfold fonc in |- *; unfold fet in |- *. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: inmonoid (union (map f X) (map f V1)) (Word_ext f B_ant) *) (* Goal: @eq Elt (couple (f (first x_ant)) (word (wef (word_inv (second x_ant))))) (couple (f A_ant) (word (Word_ext f B_ant))) *) rewrite x_ant_egal; unfold first in |- *; unfold second in |- *; unfold word_inv in |- *; simpl in |- *. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: inmonoid (union (map f X) (map f V1)) (Word_ext f B_ant) *) (* Goal: @eq Elt (couple (f A_ant) (word (wef B_ant))) (couple (f A_ant) (word (Word_ext f B_ant))) *) trivial. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) (* Goal: inmonoid (union (map f X) (map f V1)) (Word_ext f B_ant) *) replace (union (map f X) (map f V1)) with (map f (union X V1)); auto. (* Goal: @ex Elt (fun x_ant : Elt => and (dans x_ant R1) (@eq Elt x (fonc x_ant))) *) apply dans_map; assumption. Qed. Lemma image_isGram : isGram X V1 R1 S1 -> Mots Xim -> inter Xim Vim empty -> isGram Xim Vim Rim Sim. Proof. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : Mots Xim) (_ : inter Xim Vim empty), isGram Xim Vim Rim Sim *) unfold Sim, Rim, Gim3, Vim, Gim2, Xim, Gim, imageGram in |- *; simpl in |- *. (* Goal: forall (_ : isGram X V1 R1 S1) (_ : Mots (map f X)) (_ : inter (map f X) (map f V1) empty), isGram (map f X) (map f V1) (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R1) (f S1) *) prolog [ isGram4 image_Regles isGram3 dans_map_inv isGram5 ] 7. Qed. Lemma Id_image_X : Id (union X V1) f -> Xim = X :>Ensf. Proof. (* Goal: forall _ : Id (union X V1) f, @eq Ensf Xim X *) unfold Xim, Gim, imageGram in |- *; simpl in |- *. (* Goal: forall _ : Id (union X V1) f, @eq Ensf (map f X) X *) elim X. (* Goal: forall (e : Elt) (e0 : Ensf) (_ : forall _ : Id (union e0 V1) f, @eq Ensf (map f e0) e0) (_ : Id (union (add e e0) V1) f), @eq Ensf (map f (add e e0)) (add e e0) *) (* Goal: forall _ : Id (union empty V1) f, @eq Ensf (map f empty) empty *) auto. (* Goal: forall (e : Elt) (e0 : Ensf) (_ : forall _ : Id (union e0 V1) f, @eq Ensf (map f e0) e0) (_ : Id (union (add e e0) V1) f), @eq Ensf (map f (add e e0)) (add e e0) *) intros a X' Hyp Id_a_X_V1_f. (* Goal: @eq Ensf (map f (add a X')) (add a X') *) unfold map in |- *. (* Goal: @eq Ensf (add (f a) ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f X')) (add a X') *) simpl in |- *. (* Goal: @eq Ensf (add (f a) ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f X')) (add a X') *) apply add_add. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f X') X' *) (* Goal: @eq Elt (f a) a *) auto. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f X') X' *) apply Hyp. (* Goal: Id (union X' V1) f *) apply Id_inclus with (union (add a X') V1). (* Goal: Id (union (add a X') V1) f *) (* Goal: inclus (union X' V1) (union (add a X') V1) *) red in |- *; intros x dans_x_union_X_V1. (* Goal: Id (union (add a X') V1) f *) (* Goal: dans x (union (add a X') V1) *) cut (dans x X' \/ dans x V1). (* Goal: Id (union (add a X') V1) f *) (* Goal: or (dans x X') (dans x V1) *) (* Goal: forall _ : or (dans x X') (dans x V1), dans x (union (add a X') V1) *) intros [HX| HV1]; auto. (* Goal: Id (union (add a X') V1) f *) (* Goal: or (dans x X') (dans x V1) *) auto. (* Goal: Id (union (add a X') V1) f *) assumption. Qed. Lemma Id_image_V : Id (union X V1) f -> Vim = V1 :>Ensf. Proof. (* Goal: forall _ : Id (union X V1) f, @eq Ensf Vim V1 *) unfold Vim, Gim2, Gim, imageGram; simpl in |- *. (* Goal: forall _ : Id (union X V1) f, @eq Ensf (map f V1) V1 *) generalize V1; clearbody C Gim; clear V1. (* Goal: forall (V1 : Ensf) (_ : Id (union X V1) f), @eq Ensf (map f V1) V1 *) simple induction V1; auto. (* Goal: forall (e : Elt) (e0 : Ensf) (_ : forall _ : Id (union X e0) f, @eq Ensf (map f e0) e0) (_ : Id (union X (add e e0)) f), @eq Ensf (map f (add e e0)) (add e e0) *) intros a V1' Hyp Id_X_a_V1_f. (* Goal: @eq Ensf (map f (add a V1')) (add a V1') *) unfold map in |- *. (* Goal: @eq Ensf (add (f a) ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f V1')) (add a V1') *) simpl in |- *. (* Goal: @eq Ensf (add (f a) ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f V1')) (add a V1') *) apply add_add. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f V1') V1' *) (* Goal: @eq Elt (f a) a *) auto. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) f V1') V1' *) apply Hyp. (* Goal: Id (union X V1') f *) apply Id_inclus with (union X (add a V1')). (* Goal: Id (union X (add a V1')) f *) (* Goal: inclus (union X V1') (union X (add a V1')) *) red in |- *; intros x dans_x_union_X_V1. (* Goal: Id (union X (add a V1')) f *) (* Goal: dans x (union X (add a V1')) *) cut (dans x X \/ dans x V1'). (* Goal: Id (union X (add a V1')) f *) (* Goal: or (dans x X) (dans x V1') *) (* Goal: forall _ : or (dans x X) (dans x V1'), dans x (union X (add a V1')) *) intros [HX| HV1]; auto. (* Goal: Id (union X (add a V1')) f *) (* Goal: or (dans x X) (dans x V1') *) auto. (* Goal: Id (union X (add a V1')) f *) assumption. Qed. Lemma Id_image_R : Id (union X V1) f -> isGram X V1 R1 S1 -> Rim = R1 :>Ensf. Proof. (* Goal: forall (_ : Id (union X V1) f) (_ : isGram X V1 R1 S1), @eq Ensf Rim R1 *) intros Id_X_V1_f. (* Goal: forall _ : isGram X V1 R1 S1, @eq Ensf Rim R1 *) unfold Rim, Gim3, Gim2, Gim, imageGram in |- *; simpl in |- *. (* Goal: forall _ : isGram X V1 R1 S1, @eq Ensf (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R1) R1 *) elim R1. (* Goal: forall (e : Elt) (e0 : Ensf) (_ : forall _ : isGram X V1 e0 S1, @eq Ensf (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) e0) e0) (_ : isGram X V1 (add e e0) S1), @eq Ensf (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) (add e e0)) (add e e0) *) (* Goal: forall _ : isGram X V1 empty S1, @eq Ensf (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) empty) empty *) auto. (* Goal: forall (e : Elt) (e0 : Ensf) (_ : forall _ : isGram X V1 e0 S1, @eq Ensf (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) e0) e0) (_ : isGram X V1 (add e e0) S1), @eq Ensf (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) (add e e0)) (add e e0) *) intros a R Hyp isGram_X_V1_R1_S1. (* Goal: @eq Ensf (map (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) (add a R)) (add a R) *) unfold map in |- *. (* Goal: @eq Ensf (add (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (add a R) *) simpl in |- *. (* Goal: @eq Ensf (add (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R)) (add a R) *) apply add_add. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: @eq Elt (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) a *) cut (Regles X V1 (add a R)). (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: forall _ : Regles X V1 (add a R), @eq Elt (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) a *) unfold Regles in |- *. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: forall _ : forall (x : Elt) (_ : dans x (add a R)), @ex2 Elt (fun A : Elt => dans A V1) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt x (couple A (word B))) (fun B : Word => inmonoid (union X V1) B)), @eq Elt (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) a *) intro R_a_R. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: @eq Elt (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) a *) elim (R_a_R a). (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) (* Goal: forall (x : Elt) (_ : dans x V1) (_ : @ex2 Word (fun B : Word => @eq Elt a (couple x (word B))) (fun B : Word => inmonoid (union X V1) B)), @eq Elt (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) a *) intros x dans_x_V1 temp; elim temp; clear temp. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) (* Goal: forall (x0 : Word) (_ : @eq Elt a (couple x (word x0))) (_ : inmonoid (union X V1) x0), @eq Elt (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) a *) intros B egal_a inmonoid_B. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) (* Goal: @eq Elt (couple (f (first a)) (word (Word_ext f (word_inv (second a))))) a *) rewrite egal_a. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) (* Goal: @eq Elt (couple (f (first (couple x (word B)))) (word (Word_ext f (word_inv (second (couple x (word B))))))) (couple x (word B)) *) apply couple_couple; unfold first, second, word_inv in |- *; simpl in |- *. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) (* Goal: @eq Elt (word (Word_ext f B)) (word B) *) (* Goal: @eq Elt (f x) x *) auto. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) (* Goal: @eq Elt (word (Word_ext f B)) (word B) *) apply word_word. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) (* Goal: @eq Word (Word_ext f B) B *) cut (Id_words (union X V1) (Word_ext f)); auto. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) (* Goal: dans a (add a R) *) trivial. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) (* Goal: Regles X V1 (add a R) *) apply isGram4 with S1; trivial. (* Goal: @eq Ensf ((fix map (f : forall _ : Elt, Elt) (e : Ensf) {struct e} : Ensf := match e with | empty => empty | add y e0 => add (f y) (map f e0) end) (fun P : Elt => couple (f (first P)) (word (Word_ext f (word_inv (second P))))) R) R *) prolog [ isGram_inclus3 ] 3. Qed. Lemma Id_image_S : Id (union X V1) f -> isGram X V1 R1 S1 -> Sim = S1 :>Elt. Proof. (* Goal: forall (_ : Id (union X V1) f) (_ : isGram X V1 R1 S1), @eq Elt Sim S1 *) unfold Sim, Gim3, Gim2, Gim, imageGram in |- *; simpl in |- *. (* Goal: forall (_ : Id (union X V1) f) (_ : isGram X V1 R1 S1), @eq Elt (f S1) S1 *) prolog [ isGram3 union_d ] 6. Qed. Lemma Gim_egal : Gim = (Xim, (Vim, (Rim, Sim))). Proof. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) Gim (@pair Ensf (prod Ensf (prod Ensf Elt)) Xim (@pair Ensf (prod Ensf Elt) Vim (@pair Ensf Elt Rim Sim))) *) unfold Sim, Rim, Gim3, Vim, Gim2, Xim in |- *. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) Gim (@pair Ensf (prod Ensf (prod Ensf Elt)) (@fst Ensf (prod Ensf (prod Ensf Elt)) Gim) (@pair Ensf (prod Ensf Elt) (@fst Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) Gim)) (@pair Ensf Elt (@fst Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) Gim))) (@snd Ensf Elt (@snd Ensf (prod Ensf Elt) (@snd Ensf (prod Ensf (prod Ensf Elt)) Gim)))))) *) apply refl_equal. Qed. Lemma Id_image_G : Id (union X V1) f -> isGram X V1 R1 S1 -> Gim = (X, (V1, (R1, S1))). Proof. (* Goal: forall (_ : Id (union X V1) f) (_ : isGram X V1 R1 S1), @eq (prod Ensf (prod Ensf (prod Ensf Elt))) Gim (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) *) intros Id_u_X_V1_f isG_X_V1_R1_S1. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) Gim (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) *) rewrite Gim_egal. (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (@pair Ensf (prod Ensf (prod Ensf Elt)) Xim (@pair Ensf (prod Ensf Elt) Vim (@pair Ensf Elt Rim Sim))) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) *) rewrite (Id_image_S Id_u_X_V1_f isG_X_V1_R1_S1). (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (@pair Ensf (prod Ensf (prod Ensf Elt)) Xim (@pair Ensf (prod Ensf Elt) Vim (@pair Ensf Elt Rim S1))) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) *) rewrite (Id_image_R Id_u_X_V1_f isG_X_V1_R1_S1). (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (@pair Ensf (prod Ensf (prod Ensf Elt)) Xim (@pair Ensf (prod Ensf Elt) Vim (@pair Ensf Elt R1 S1))) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) *) rewrite (Id_image_V Id_u_X_V1_f). (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (@pair Ensf (prod Ensf (prod Ensf Elt)) Xim (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) *) rewrite (Id_image_X Id_u_X_V1_f). (* Goal: @eq (prod Ensf (prod Ensf (prod Ensf Elt))) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) (@pair Ensf (prod Ensf (prod Ensf Elt)) X (@pair Ensf (prod Ensf Elt) V1 (@pair Ensf Elt R1 S1))) *) apply refl_equal. Qed. Lemma Derive_image : forall u v : Word, Derive R1 u v -> Derive Rim (wef u) (wef v). Proof. (* Goal: forall (u v : Word) (_ : Derive R1 u v), Derive Rim (wef u) (wef v) *) intros u v H. (* Goal: Derive Rim (wef u) (wef v) *) elim H; clear H u v. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R1 u v) (_ : Derive Rim (wef u) (wef v)), Derive Rim (wef (cons x u)) (wef (cons x v)) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) R1), Derive Rim (wef (cons A v)) (wef (Append u v)) *) intros u v A dans_A. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R1 u v) (_ : Derive Rim (wef u) (wef v)), Derive Rim (wef (cons x u)) (wef (cons x v)) *) (* Goal: Derive Rim (wef (cons A v)) (wef (Append u v)) *) replace (wef (cons A v)) with (cons (f A) (wef v)). (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R1 u v) (_ : Derive Rim (wef u) (wef v)), Derive Rim (wef (cons x u)) (wef (cons x v)) *) (* Goal: @eq Word (cons (f A) (wef v)) (wef (cons A v)) *) (* Goal: Derive Rim (cons (f A) (wef v)) (wef (Append u v)) *) replace (wef (Append u v)) with (Append (wef u) (wef v)). (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R1 u v) (_ : Derive Rim (wef u) (wef v)), Derive Rim (wef (cons x u)) (wef (cons x v)) *) (* Goal: @eq Word (cons (f A) (wef v)) (wef (cons A v)) *) (* Goal: @eq Word (Append (wef u) (wef v)) (wef (Append u v)) *) (* Goal: Derive Rim (cons (f A) (wef v)) (Append (wef u) (wef v)) *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R1 u v) (_ : Derive Rim (wef u) (wef v)), Derive Rim (wef (cons x u)) (wef (cons x v)) *) (* Goal: @eq Word (cons (f A) (wef v)) (wef (cons A v)) *) (* Goal: @eq Word (Append (wef u) (wef v)) (wef (Append u v)) *) apply sym_equal; unfold wef in |- *; apply wef_append; auto. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R1 u v) (_ : Derive Rim (wef u) (wef v)), Derive Rim (wef (cons x u)) (wef (cons x v)) *) (* Goal: @eq Word (cons (f A) (wef v)) (wef (cons A v)) *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : Derive R1 u v) (_ : Derive Rim (wef u) (wef v)), Derive Rim (wef (cons x u)) (wef (cons x v)) *) intros. (* Goal: Derive Rim (wef (cons x u)) (wef (cons x v)) *) replace (wef (cons x u)) with (cons (f x) (wef u)). (* Goal: @eq Word (cons (f x) (wef u)) (wef (cons x u)) *) (* Goal: Derive Rim (cons (f x) (wef u)) (wef (cons x v)) *) replace (wef (cons x v)) with (cons (f x) (wef v)); auto. (* Goal: @eq Word (cons (f x) (wef u)) (wef (cons x u)) *) auto. Qed. Hint Resolve Derive_image. Lemma Derivestar_image : forall u v : Word, Derivestar R1 u v -> Derivestar Rim (wef u) (wef v). Proof. (* Goal: forall (u v : Word) (_ : Derivestar R1 u v), Derivestar Rim (wef u) (wef v) *) unfold Derivestar in |- *. (* Goal: forall (u v : Word) (_ : Rstar Word (Derive R1) u v), Rstar Word (Derive Rim) (wef u) (wef v) *) intros u v Hyp. (* Goal: Rstar Word (Derive Rim) (wef u) (wef v) *) unfold Derivestar, Rstar in Hyp. (* Goal: Rstar Word (Derive Rim) (wef u) (wef v) *) pattern u, v in |- *. (* Goal: (fun w w0 : Word => Rstar Word (Derive Rim) (wef w) (wef w0)) u v *) apply Hyp. (* Goal: forall (u v w : Word) (_ : Derive R1 u v) (_ : Rstar Word (Derive Rim) (wef v) (wef w)), Rstar Word (Derive Rim) (wef u) (wef w) *) (* Goal: forall u : Word, Rstar Word (Derive Rim) (wef u) (wef u) *) auto. (* Goal: forall (u v w : Word) (_ : Derive R1 u v) (_ : Rstar Word (Derive Rim) (wef v) (wef w)), Rstar Word (Derive Rim) (wef u) (wef w) *) intros a b c DeriveR1 Rst. (* Goal: Rstar Word (Derive Rim) (wef a) (wef c) *) apply Rstar_R with (y := wef b); auto. Qed. Hint Resolve Derivestar_image. Lemma Reconnait_imageGram : forall w : Word, LG X V1 R1 S1 w -> LG Xim Vim Rim Sim (wef w). Proof. (* Goal: forall (w : Word) (_ : LG X V1 R1 S1 w), LG Xim Vim Rim Sim (wef w) *) intro w. (* Goal: forall _ : LG X V1 R1 S1 w, LG Xim Vim Rim Sim (wef w) *) unfold LG in |- *. (* Goal: forall _ : and (Derivestar R1 (cons S1 nil) w) (inmonoid X w), and (Derivestar Rim (cons Sim nil) (wef w)) (inmonoid Xim (wef w)) *) intro temp; split; elim temp; clear temp; intros Der inmo. (* Goal: inmonoid Xim (wef w) *) (* Goal: Derivestar Rim (cons Sim nil) (wef w) *) unfold Sim, Gim3, Gim2, Gim, imageGram in |- *; simpl in |- *. (* Goal: inmonoid Xim (wef w) *) (* Goal: Derivestar Rim (cons (f S1) nil) (wef w) *) replace (cons (f S1) nil) with (wef (cons S1 nil)); auto. (* Goal: inmonoid Xim (wef w) *) elim inmo. (* Goal: forall (w : Word) (e : Elt) (_ : inmonoid X w) (_ : inmonoid Xim (wef w)) (_ : dans e X), inmonoid Xim (wef (cons e w)) *) (* Goal: inmonoid Xim (wef nil) *) auto. (* Goal: forall (w : Word) (e : Elt) (_ : inmonoid X w) (_ : inmonoid Xim (wef w)) (_ : dans e X), inmonoid Xim (wef (cons e w)) *) intros wo el. (* Goal: forall (_ : inmonoid X wo) (_ : inmonoid Xim (wef wo)) (_ : dans el X), inmonoid Xim (wef (cons el wo)) *) unfold Xim, Gim, imageGram in |- *; simpl in |- *. (* Goal: forall (_ : inmonoid X wo) (_ : inmonoid (map f X) (wef wo)) (_ : dans el X), inmonoid (map f X) (wef (cons el wo)) *) replace (wef (cons el wo)) with (cons (f el) (wef wo)); auto. Qed. End resultats. Hint Resolve dans_Rim. Hint Resolve Derive_image. Hint Resolve Derivestar_image. Hint Resolve Reconnait_imageGram.
Arguments id {A} x. Fixpoint nat_cast (P : nat -> Type) {n m} : n = m -> P n -> P m. Proof. (* Goal: forall (_ : @eq nat n m) (_ : P n), P m *) refine match n, m return n = m -> P n -> P m with | O, O => fun _ => id | S n, S m => fun pf => @nat_cast (fun n => P (S n)) n m (f_equal pred pf) | _, _ => fun pf => match _ pf : False with end end; clear; abstract congruence. Qed. Lemma nat_cast_eq_rect: forall (P : nat -> Type), forall (n m : nat) (e: n = m) (pn: P n), nat_cast P e pn = eq_rect n P pn m e. Proof. (* Goal: forall (P : forall _ : nat, Type) (n m : nat) (e : @eq nat n m) (pn : P n), @eq (P m) (@nat_cast P n m e pn) (@eq_rect nat n P pn m e) *) destruct e. (* Goal: forall pn : P n, @eq (P n) (@nat_cast P n n (@eq_refl nat n) pn) (@eq_rect nat n P pn n (@eq_refl nat n)) *) revert dependent P; induction n; simpl; intros. (* Goal: @eq (P (S n)) (@nat_cast (fun n : nat => P (S n)) n n (@eq_refl nat n) pn) pn *) (* Goal: @eq (P O) (@id (P O) pn) pn *) - (* Goal: @eq (P O) (@id (P O) pn) pn *) reflexivity. (* BG Goal: @eq (P (S n)) (@nat_cast (fun n : nat => P (S n)) n n (@eq_refl nat n) pn) pn *) - (* Goal: @eq (P (S n)) (@nat_cast (fun n : nat => P (S n)) n n (@eq_refl nat n) pn) pn *) rewrite IHn. (* Goal: @eq (P (S n)) (@eq_rect nat n (fun n : nat => P (S n)) pn n (@eq_refl nat n)) pn *) reflexivity. Qed. Lemma nat_cast_proof_irrel: forall (P : nat -> Type), forall (n m : nat) (e1 e2: n = m) (pn: P n), nat_cast P e1 pn = nat_cast P e2 pn. Lemma nat_cast_same: forall (P: nat -> Type) (s: nat) (n: P s), nat_cast P eq_refl n = n. Proof. (* Goal: forall (P : forall _ : nat, Type) (s : nat) (n : P s), @eq (P s) (@nat_cast P s s (@eq_refl nat s) n) n *) intros. (* Goal: @eq (P s) (@nat_cast P s s (@eq_refl nat s) n) n *) rewrite nat_cast_eq_rect. (* Goal: @eq (P s) (@eq_rect nat s P n s (@eq_refl nat s)) n *) reflexivity. Qed. Lemma nat_cast_fuse: forall (P: nat -> Type) (n1 n2 n3: nat) (e12: n1 = n2) (e23: n2 = n3) (x: P n1), nat_cast P e23 (nat_cast P e12 x) = nat_cast P (eq_trans e12 e23) x. Proof. (* Goal: forall (P : forall _ : nat, Type) (n1 n2 n3 : nat) (e12 : @eq nat n1 n2) (e23 : @eq nat n2 n3) (x : P n1), @eq (P n3) (@nat_cast P n2 n3 e23 (@nat_cast P n1 n2 e12 x)) (@nat_cast P n1 n3 (@eq_trans nat n1 n2 n3 e12 e23) x) *) destruct e12. (* Goal: forall (e23 : @eq nat n1 n3) (x : P n1), @eq (P n3) (@nat_cast P n1 n3 e23 (@nat_cast P n1 n1 (@eq_refl nat n1) x)) (@nat_cast P n1 n3 (@eq_trans nat n1 n1 n3 (@eq_refl nat n1) e23) x) *) destruct e23. (* Goal: forall x : P n1, @eq (P n1) (@nat_cast P n1 n1 (@eq_refl nat n1) (@nat_cast P n1 n1 (@eq_refl nat n1) x)) (@nat_cast P n1 n1 (@eq_trans nat n1 n1 n1 (@eq_refl nat n1) (@eq_refl nat n1)) x) *) intros. (* Goal: @eq (P n1) (@nat_cast P n1 n1 (@eq_refl nat n1) (@nat_cast P n1 n1 (@eq_refl nat n1) x)) (@nat_cast P n1 n1 (@eq_trans nat n1 n1 n1 (@eq_refl nat n1) (@eq_refl nat n1)) x) *) rewrite nat_cast_same. (* Goal: @eq (P n1) (@nat_cast P n1 n1 (@eq_refl nat n1) x) (@nat_cast P n1 n1 (@eq_trans nat n1 n1 n1 (@eq_refl nat n1) (@eq_refl nat n1)) x) *) reflexivity. Qed. Lemma nat_cast_cast ni no (pf: ni = no) (P: nat -> Type) (x : P ni): nat_cast P pf x = match pf in _ = Y return P Y with | eq_refl => x end. Proof. (* Goal: @eq (P no) (@nat_cast P ni no pf x) match pf in (eq _ Y) return (P Y) with | eq_refl => x end *) destruct pf. (* Goal: @eq (P ni) (@nat_cast P ni ni (@eq_refl nat ni) x) x *) rewrite nat_cast_same. (* Goal: @eq (P ni) x x *) auto. Qed.
From Coq Require Import ssreflect ssrbool ssrfun Eqdep. From mathcomp Require Import ssrnat eqtype. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Definition inj_pair2 := @inj_pair2. Arguments inj_pair2 [U P p x y] _. Prenex Implicits inj_pair2. Notation prod_eta := surjective_pairing. Lemma prod_inj A B (x y : A * B) : x = y <-> (x.1, x.2) = (y.1, y.2). Proof. (* Goal: iff (@eq (prod A B) x y) (@eq (prod A B) (@pair A B (@fst A B x) (@snd A B x)) (@pair A B (@fst A B y) (@snd A B y))) *) by case: x y=>x1 x2 []. Qed. Prenex Implicits Some_inj. Lemma compA A B C D (h : A -> B) (g : B -> C) (f : C -> D) : (f \o g) \o h = f \o (g \o h). Proof. (* Goal: @eq (forall _ : A, D) (@funcomp D B A tt (@funcomp D C B tt f g) h) (@funcomp D C A tt f (@funcomp C B A tt g h)) *) by []. Qed. Definition fprod A1 A2 B1 B2 (f1 : A1 -> B1) (f2 : A2 -> B2) := fun (x : A1 * A2) => (f1 x.1, f2 x.2). Notation "f1 \* f2" := (fprod f1 f2) (at level 42, left associativity). Lemma ext A (B : A -> Type) (f1 f2 : forall x, B x) : f1 = f2 -> forall x, f1 x = f2 x. Proof. (* Goal: forall (_ : @eq (forall x : A, B x) f1 f2) (x : A), @eq (B x) (f1 x) (f2 x) *) by move=>->. Qed. Definition fsplice A B1 B2 (f1 : A -> B1) (f2 : A -> B2) := fun x : A => (f1 x, f2 x). Notation "[ 'fs' f1 , f2 ]" := (fsplice f1 f2) (at level 0, format "[ 'fs' f1 , f2 ]"). Definition relfuncomp A B (D : rel A) (f : B -> A) : rel B := fun x y => D (f x) (f y). Notation "D \\o f" := (@relfuncomp _ _ D f) (at level 42, left associativity). Reserved Notation "[ /\ P1 , P2 , P3 , P4 , P5 & P6 ]" (at level 0, format "'[hv' [ /\ '[' P1 , '/' P2 , '/' P3 , '/' P4 , '/' P5 ']' '/ ' & P6 ] ']'"). Reserved Notation "[ /\ P1 , P2 , P3 , P4 , P5 , P6 & P7 ]" (at level 0, format "'[hv' [ /\ '[' P1 , '/' P2 , '/' P3 , '/' P4 , '/' P5 , '/' P6 ']' '/ ' & P7 ] ']'"). Reserved Notation "[ \/ P1 , P2 , P3 , P4 | P5 ]" (at level 0, format "'[hv' [ \/ '[' P1 , '/' P2 , '/' P3 , '/' P4 ']' '/ ' | P5 ] ']'"). Reserved Notation "[ \/ P1 , P2 , P3 , P4 , P5 | P6 ]" (at level 0, format "'[hv' [ \/ '[' P1 , '/' P2 , '/' P3 , '/' P4 , '/' P5 ']' '/ ' | P6 ] ']'"). Reserved Notation "[ \/ P1 , P2 , P3 , P4 , P5 , P6 | P7 ]" (at level 0, format "'[hv' [ \/ '[' P1 , '/' P2 , '/' P3 , '/' P4 , '/' P5 , '/' P6 ']' '/ ' | P7 ] ']'"). Inductive and6 (P1 P2 P3 P4 P5 P6 : Prop) : Prop := And6 of P1 & P2 & P3 & P4 & P5 & P6. Inductive and7 (P1 P2 P3 P4 P5 P6 P7 : Prop) : Prop := And7 of P1 & P2 & P3 & P4 & P5 & P6 & P7. Inductive or5 (P1 P2 P3 P4 P5 : Prop) : Prop := Or51 of P1 | Or52 of P2 | Or53 of P3 | Or54 of P4 | Or55 of P5. Inductive or6 (P1 P2 P3 P4 P5 P6 : Prop) : Prop := Or61 of P1 | Or62 of P2 | Or63 of P3 | Or64 of P4 | Or65 of P5 | Or66 of P6. Inductive or7 (P1 P2 P3 P4 P5 P6 P7 : Prop) : Prop := Or71 of P1 | Or72 of P2 | Or73 of P3 | Or74 of P4 | Or75 of P5 | Or76 of P6 | Or77 of P7. Notation "[ /\ P1 , P2 , P3 , P4 , P5 & P6 ]" := (and6 P1 P2 P3 P4 P5 P6) : type_scope. Notation "[ /\ P1 , P2 , P3 , P4 , P5 , P6 & P7 ]" := (and7 P1 P2 P3 P4 P5 P6 P7) : type_scope. Notation "[ \/ P1 , P2 , P3 , P4 | P5 ]" := (or5 P1 P2 P3 P4 P5) : type_scope. Notation "[ \/ P1 , P2 , P3 , P4 , P5 | P6 ]" := (or6 P1 P2 P3 P4 P5 P6) : type_scope. Notation "[ \/ P1 , P2 , P3 , P4 , P5 , P6 | P7 ]" := (or7 P1 P2 P3 P4 P5 P6 P7) : type_scope. Section ReflectConnectives. Variable b1 b2 b3 b4 b5 b6 b7 : bool. Lemma and6P : reflect [/\ b1, b2, b3, b4, b5 & b6] [&& b1, b2, b3, b4, b5 & b6]. Proof. (* Goal: Bool.reflect (and6 (is_true b1) (is_true b2) (is_true b3) (is_true b4) (is_true b5) (is_true b6)) (andb b1 (andb b2 (andb b3 (andb b4 (andb b5 b6))))) *) by case b1; case b2; case b3; case b4; case b5; case b6; constructor; try by case. Qed. Lemma and7P : reflect [/\ b1, b2, b3, b4, b5, b6 & b7] [&& b1, b2, b3, b4, b5, b6 & b7]. Proof. (* Goal: Bool.reflect (and7 (is_true b1) (is_true b2) (is_true b3) (is_true b4) (is_true b5) (is_true b6) (is_true b7)) (andb b1 (andb b2 (andb b3 (andb b4 (andb b5 (andb b6 b7)))))) *) by case b1; case b2; case b3; case b4; case b5; case b6; case: b7; constructor; try by case. Qed. Lemma or5P : reflect [\/ b1, b2, b3, b4 | b5] [|| b1, b2, b3, b4 | b5]. Proof. (* Goal: Bool.reflect (or5 (is_true b1) (is_true b2) (is_true b3) (is_true b4) (is_true b5)) (orb b1 (orb b2 (orb b3 (orb b4 b5)))) *) case b1; first by constructor; constructor 1. (* Goal: Bool.reflect (or5 (is_true false) (is_true b2) (is_true b3) (is_true b4) (is_true b5)) (orb false (orb b2 (orb b3 (orb b4 b5)))) *) case b2; first by constructor; constructor 2. (* Goal: Bool.reflect (or5 (is_true false) (is_true false) (is_true b3) (is_true b4) (is_true b5)) (orb false (orb false (orb b3 (orb b4 b5)))) *) case b3; first by constructor; constructor 3. (* Goal: Bool.reflect (or5 (is_true false) (is_true false) (is_true false) (is_true b4) (is_true b5)) (orb false (orb false (orb false (orb b4 b5)))) *) case b4; first by constructor; constructor 4. (* Goal: Bool.reflect (or5 (is_true false) (is_true false) (is_true false) (is_true false) (is_true b5)) (orb false (orb false (orb false (orb false b5)))) *) case b5; first by constructor; constructor 5. (* Goal: Bool.reflect (or5 (is_true false) (is_true false) (is_true false) (is_true false) (is_true false)) (orb false (orb false (orb false (orb false false)))) *) by constructor; case. Qed. Lemma or6P : reflect [\/ b1, b2, b3, b4, b5 | b6] [|| b1, b2, b3, b4, b5 | b6]. Proof. (* Goal: Bool.reflect (or6 (is_true b1) (is_true b2) (is_true b3) (is_true b4) (is_true b5) (is_true b6)) (orb b1 (orb b2 (orb b3 (orb b4 (orb b5 b6))))) *) case b1; first by constructor; constructor 1. (* Goal: Bool.reflect (or6 (is_true false) (is_true b2) (is_true b3) (is_true b4) (is_true b5) (is_true b6)) (orb false (orb b2 (orb b3 (orb b4 (orb b5 b6))))) *) case b2; first by constructor; constructor 2. (* Goal: Bool.reflect (or6 (is_true false) (is_true false) (is_true b3) (is_true b4) (is_true b5) (is_true b6)) (orb false (orb false (orb b3 (orb b4 (orb b5 b6))))) *) case b3; first by constructor; constructor 3. (* Goal: Bool.reflect (or6 (is_true false) (is_true false) (is_true false) (is_true b4) (is_true b5) (is_true b6)) (orb false (orb false (orb false (orb b4 (orb b5 b6))))) *) case b4; first by constructor; constructor 4. (* Goal: Bool.reflect (or6 (is_true false) (is_true false) (is_true false) (is_true false) (is_true b5) (is_true b6)) (orb false (orb false (orb false (orb false (orb b5 b6))))) *) case b5; first by constructor; constructor 5. (* Goal: Bool.reflect (or6 (is_true false) (is_true false) (is_true false) (is_true false) (is_true false) (is_true b6)) (orb false (orb false (orb false (orb false (orb false b6))))) *) case b6; first by constructor; constructor 6. (* Goal: Bool.reflect (or6 (is_true false) (is_true false) (is_true false) (is_true false) (is_true false) (is_true false)) (orb false (orb false (orb false (orb false (orb false false))))) *) by constructor; case. Qed. Lemma or7P : reflect [\/ b1, b2, b3, b4, b5, b6 | b7] [|| b1, b2, b3, b4, b5, b6 | b7]. Proof. (* Goal: Bool.reflect (or7 (is_true b1) (is_true b2) (is_true b3) (is_true b4) (is_true b5) (is_true b6) (is_true b7)) (orb b1 (orb b2 (orb b3 (orb b4 (orb b5 (orb b6 b7)))))) *) case b1; first by constructor; constructor 1. (* Goal: Bool.reflect (or7 (is_true false) (is_true b2) (is_true b3) (is_true b4) (is_true b5) (is_true b6) (is_true b7)) (orb false (orb b2 (orb b3 (orb b4 (orb b5 (orb b6 b7)))))) *) case b2; first by constructor; constructor 2. (* Goal: Bool.reflect (or7 (is_true false) (is_true false) (is_true b3) (is_true b4) (is_true b5) (is_true b6) (is_true b7)) (orb false (orb false (orb b3 (orb b4 (orb b5 (orb b6 b7)))))) *) case b3; first by constructor; constructor 3. (* Goal: Bool.reflect (or7 (is_true false) (is_true false) (is_true false) (is_true b4) (is_true b5) (is_true b6) (is_true b7)) (orb false (orb false (orb false (orb b4 (orb b5 (orb b6 b7)))))) *) case b4; first by constructor; constructor 4. (* Goal: Bool.reflect (or7 (is_true false) (is_true false) (is_true false) (is_true false) (is_true b5) (is_true b6) (is_true b7)) (orb false (orb false (orb false (orb false (orb b5 (orb b6 b7)))))) *) case b5; first by constructor; constructor 5. (* Goal: Bool.reflect (or7 (is_true false) (is_true false) (is_true false) (is_true false) (is_true false) (is_true b6) (is_true b7)) (orb false (orb false (orb false (orb false (orb false (orb b6 b7)))))) *) case b6; first by constructor; constructor 6. (* Goal: Bool.reflect (or7 (is_true false) (is_true false) (is_true false) (is_true false) (is_true false) (is_true false) (is_true b7)) (orb false (orb false (orb false (orb false (orb false (orb false b7)))))) *) case b7; first by constructor; constructor 7. (* Goal: Bool.reflect (or7 (is_true false) (is_true false) (is_true false) (is_true false) (is_true false) (is_true false) (is_true false)) (orb false (orb false (orb false (orb false (orb false (orb false false)))))) *) by constructor; case. Qed. End ReflectConnectives. Arguments and6P [b1 b2 b3 b4 b5 b6]. Arguments and7P [b1 b2 b3 b4 b5 b6 b7]. Arguments or5P [b1 b2 b3 b4 b5]. Arguments or6P [b1 b2 b3 b4 b5 b6]. Arguments or7P [b1 b2 b3 b4 b5 b6 b7]. Prenex Implicits and6P and7P or5P or6P or7P. Lemma andX (a b : bool) : reflect (a * b) (a && b). Proof. (* Goal: Bool.reflect (prod (is_true a) (is_true b)) (andb a b) *) by case: a; case: b; constructor=>//; case. Qed. Arguments andX [a b]. Fixpoint iter' T (g : T -> T -> Prop) n s1 s2 := if n is n'.+1 then exists s, g s1 s /\ iter' g n' s s2 else s1 = s2. Definition iter T (g : T -> T -> Prop) s1 s2 := exists n, iter' g n s1 s2. Definition iterc A T (g : A -> T -> A -> T -> Prop) a1 s1 a2 s2 := iter (fun (a b : A * T) => g a.1 a.2 b.1 b.2) (a1, s1) (a2, s2). Section IteratedRels. Variable T : Type. Implicit Type g : T -> T -> Prop. Lemma iter_refl g s : iter g s s. Proof. (* Goal: @iter T g s s *) by exists 0. Qed. Lemma iter_trans g s1 s2 s3 : iter g s1 s2 -> iter g s2 s3 -> iter g s1 s3. Proof. (* Goal: forall (_ : @iter T g s1 s2) (_ : @iter T g s2 s3), @iter T g s1 s3 *) case=>n; elim: n s1 =>[|n IH] s1 /=; first by move=>->. (* Goal: forall (_ : @ex T (fun s : T => and (g s1 s) (@iter' T g n s s2))) (_ : @iter T g s2 s3), @iter T g s1 s3 *) by case=>s [H1 H2] /(IH _ H2) [m]; exists m.+1, s. Qed. Lemma iterS g n s1 s2 : iter' g n.+1 s1 s2 <-> exists s, iter' g n s1 s /\ g s s2. Proof. (* Goal: iff (@iter' T g (S n) s1 s2) (@ex T (fun s : T => and (@iter' T g n s1 s) (g s s2))) *) elim: n s1=>[|n IH] s1. (* Goal: iff (@iter' T g (S (S n)) s1 s2) (@ex T (fun s : T => and (@iter' T g (S n) s1 s) (g s s2))) *) (* Goal: iff (@iter' T g (S O) s1 s2) (@ex T (fun s : T => and (@iter' T g O s1 s) (g s s2))) *) - (* Goal: iff (@iter' T g (S (S n)) s1 s2) (@ex T (fun s : T => and (@iter' T g (S n) s1 s) (g s s2))) *) (* Goal: iff (@iter' T g (S O) s1 s2) (@ex T (fun s : T => and (@iter' T g O s1 s) (g s s2))) *) by split; [case=>s [H <-]; exists s1 | case=>s [<- H]; exists s2]. (* Goal: iff (@iter' T g (S (S n)) s1 s2) (@ex T (fun s : T => and (@iter' T g (S n) s1 s) (g s s2))) *) split; first by case=>s [H1] /IH [s'][H G]; exists s'; split=>//; exists s. (* Goal: forall _ : @ex T (fun s : T => and (@iter' T g (S n) s1 s) (g s s2)), @iter' T g (S (S n)) s1 s2 *) by case=>s [[s'][H1 H G]]; exists s'; split=>//; apply/IH; exists s. Qed. Lemma iter'_sub g g' n s1 s2 : (forall s1 s2, g s1 s2 -> g' s1 s2) -> iter' g n s1 s2 -> iter' g' n s1 s2. Proof. (* Goal: forall (_ : forall (s1 s2 : T) (_ : g s1 s2), g' s1 s2) (_ : @iter' T g n s1 s2), @iter' T g' n s1 s2 *) by move=>H; elim: n s1=>[|n IH] s1 //= [s][/H G] /IH; exists s. Qed. Lemma iter_sub g g' s1 s2 : (forall s1 s2, g s1 s2 -> g' s1 s2) -> iter g s1 s2 -> iter g' s1 s2. Proof. (* Goal: forall (_ : forall (s1 s2 : T) (_ : g s1 s2), g' s1 s2) (_ : @iter T g s1 s2), @iter T g' s1 s2 *) by move=>H [n]; exists n; apply: iter'_sub H _. Qed. Lemma iter1 g s1 s2 : g s1 s2 -> iter g s1 s2. Proof. (* Goal: forall _ : g s1 s2, @iter T g s1 s2 *) by exists 1, s2. Qed. End IteratedRels. Lemma iter2 A T (g : A -> T -> A -> T -> Prop) x1 s1 x2 s2 : g x1 s1 x2 s2 -> iterc g x1 s1 x2 s2. Proof. (* Goal: forall _ : g x1 s1 x2 s2, @iterc A T g x1 s1 x2 s2 *) by apply: iter1. Qed. Prenex Implicits iter1 iter2. Arguments iter_refl [T g s]. Hint Resolve iter_refl : core. Lemma emptyset_eqP : Equality.axiom (fun _ _ : Empty_set => true). Proof. (* Goal: @Equality.axiom Empty_set (fun _ _ : Empty_set => true) *) by case. Qed. Definition emptysetEqMix := EqMixin emptyset_eqP. Canonical emptysetEqType := Eval hnf in EqType Empty_set emptysetEqMix.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq path div choice. From mathcomp Require Import fintype tuple finfun bigop prime ssralg poly finset. From mathcomp Require Import fingroup finalg zmodp cyclic. From mathcomp Require Import ssrnum ssrint polydiv rat intdiv. From mathcomp Require Import mxpoly vector falgebra fieldext separable galois algC. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GRing.Theory Num.Theory. Local Open Scope ring_scope. Section CyclotomicPoly. Section Ring. Variable R : ringType. Definition cyclotomic (z : R) n := \prod_(k < n | coprime k n) ('X - (z ^+ k)%:P). Lemma cyclotomic_monic z n : cyclotomic z n \is monic. Proof. (* Goal: is_true (@in_mem (GRing.Ring.sort (poly_ringType R)) (cyclotomic z n) (@mem (@poly_of R (Phant (GRing.Ring.sort R))) (predPredType (@poly_of R (Phant (GRing.Ring.sort R)))) (@has_quality O (@poly_of R (Phant (GRing.Ring.sort R))) (@monic R)))) *) exact: monic_prod_XsubC. Qed. Lemma size_cyclotomic z n : size (cyclotomic z n) = (totient n).+1. End Ring. Lemma separable_Xn_sub_1 (R : idomainType) n : n%:R != 0 :> R -> @separable_poly R ('X^n - 1). Proof. (* Goal: forall _ : is_true (negb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.natmul (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)) (GRing.one (GRing.IntegralDomain.ringType R)) n : GRing.IntegralDomain.sort R) (GRing.zero (GRing.IntegralDomain.zmodType R) : GRing.IntegralDomain.sort R))), is_true (@separable_poly R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R)))))) *) case: n => [/eqP// | n nz_n]; rewrite /separable_poly linearB /=. (* Goal: is_true (coprimep R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (S n)) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))) (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType R)) (@deriv (GRing.IntegralDomain.ringType R) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (S n))) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType R)) (@deriv (GRing.IntegralDomain.ringType R) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))))) *) rewrite derivC subr0 derivXn -scaler_nat coprimep_scaler //= exprS -scaleN1r. (* Goal: is_true (coprimep R (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.IntegralDomain.ringType R))) (@GRing.mul (poly_ringType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) n)) (@GRing.scale (GRing.IntegralDomain.ringType R) (@GRing.Lalgebra.lmod_ringType (GRing.IntegralDomain.ringType R) (Phant (GRing.Ring.sort (GRing.IntegralDomain.ringType R))) (poly_lalgType (GRing.IntegralDomain.ringType R))) (@GRing.opp (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)) (GRing.one (GRing.IntegralDomain.ringType R))) (GRing.one (poly_ringType (GRing.IntegralDomain.ringType R))))) (@GRing.exp (poly_ringType (GRing.IntegralDomain.ringType R)) (polyX (GRing.IntegralDomain.ringType R)) n)) *) rewrite coprimep_sym coprimep_addl_mul coprimep_scaler ?coprimep1 //. (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))) (@GRing.opp (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R)) (GRing.one (GRing.IntegralDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType R))))) *) by rewrite (signr_eq0 _ 1). Qed. Section Field. Variables (F : fieldType) (n : nat) (z : F). Hypothesis prim_z : n.-primitive_root z. Let n_gt0 := prim_order_gt0 prim_z. Lemma root_cyclotomic x : root (cyclotomic z n) x = n.-primitive_root x. Proof. (* Goal: @eq bool (@root (GRing.Field.ringType F) (@cyclotomic (GRing.Field.ringType F) z n) x) (@primitive_root_of_unity (GRing.Field.ringType F) n x) *) rewrite /cyclotomic -big_filter filter_index_enum. (* Goal: @eq bool (@root (GRing.Field.ringType F) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Finite.sort (ordinal_finType n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (@enum_mem (ordinal_finType n) (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun i : Finite.sort (ordinal_finType n) => coprime (@nat_of_ord n i) n))) (fun i : Finite.sort (ordinal_finType n) => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Finite.sort (ordinal_finType n)) i (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n i))))))) x) (@primitive_root_of_unity (GRing.Field.ringType F) n x) *) rewrite -(big_map _ xpredT (fun y => 'X - y%:P)) root_prod_XsubC. (* Goal: @eq bool (@in_mem (GRing.IntegralDomain.sort (GRing.Field.idomainType F)) x (@mem (Equality.sort (GRing.Ring.eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (seq_predType (GRing.Ring.eqType (GRing.IntegralDomain.ringType (GRing.Field.idomainType F)))) (@map (Finite.sort (ordinal_finType n)) (GRing.Ring.sort (GRing.Field.ringType F)) (fun j : Finite.sort (ordinal_finType n) => @GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n j)) (@enum_mem (ordinal_finType n) (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun i : Finite.sort (ordinal_finType n) => coprime (@nat_of_ord n i) n)))))) (@primitive_root_of_unity (GRing.Field.ringType F) n x) *) apply/imageP/idP=> [[k co_k_n ->] | prim_x]. (* Goal: @ex2 (Finite.sort (ordinal_finType n)) (fun x : Finite.sort (ordinal_finType n) => is_true (@in_mem (Finite.sort (ordinal_finType n)) x (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun i : Finite.sort (ordinal_finType n) => coprime (@nat_of_ord n i) n)))) (fun x0 : Finite.sort (ordinal_finType n) => @eq (Equality.sort (GRing.IntegralDomain.eqType (GRing.Field.idomainType F))) x (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n x0))) *) (* Goal: is_true (@primitive_root_of_unity (GRing.Field.ringType F) n (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n k))) *) by rewrite prim_root_exp_coprime. (* Goal: @ex2 (Finite.sort (ordinal_finType n)) (fun x : Finite.sort (ordinal_finType n) => is_true (@in_mem (Finite.sort (ordinal_finType n)) x (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun i : Finite.sort (ordinal_finType n) => coprime (@nat_of_ord n i) n)))) (fun x0 : Finite.sort (ordinal_finType n) => @eq (Equality.sort (GRing.IntegralDomain.eqType (GRing.Field.idomainType F))) x (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n x0))) *) have [k Dx] := prim_rootP prim_z (prim_expr_order prim_x). (* Goal: @ex2 (Finite.sort (ordinal_finType n)) (fun x : Finite.sort (ordinal_finType n) => is_true (@in_mem (Finite.sort (ordinal_finType n)) x (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun i : Finite.sort (ordinal_finType n) => coprime (@nat_of_ord n i) n)))) (fun x0 : Finite.sort (ordinal_finType n) => @eq (Equality.sort (GRing.IntegralDomain.eqType (GRing.Field.idomainType F))) x (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n x0))) *) exists (Ordinal (ltn_pmod k n_gt0)) => /=. (* Goal: @eq (GRing.Field.sort F) x (@GRing.exp (GRing.Field.ringType F) z (modn (@nat_of_ord n k) n)) *) (* Goal: is_true (@in_mem (ordinal n) (@Ordinal n (modn (@nat_of_ord n k) n) (@ltn_pmod (@nat_of_ord n k) n n_gt0)) (@mem (ordinal n) (predPredType (ordinal n)) (fun i : ordinal n => coprime (@nat_of_ord n i) n))) *) by rewrite unfold_in /= coprime_modl -(prim_root_exp_coprime k prim_z) -Dx. (* Goal: @eq (GRing.Field.sort F) x (@GRing.exp (GRing.Field.ringType F) z (modn (@nat_of_ord n k) n)) *) by rewrite prim_expr_mod. Qed. Lemma prod_cyclotomic : 'X^n - 1 = \prod_(d <- divisors n) cyclotomic (z ^+ (n %/ d)) d. Proof. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) (GRing.one (poly_ringType (GRing.Field.ringType F))) (divisors n) (fun d : Equality.sort nat_eqType => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) d (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n d)) d))) *) have in_d d: (d %| n)%N -> val (@inord n d) = d by move/dvdn_leq/inordK=> /= ->. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) (GRing.one (poly_ringType (GRing.Field.ringType F))) (divisors n) (fun d : Equality.sort nat_eqType => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) d (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n d)) d))) *) have dv_n k: (n %/ gcdn k n %| n)%N. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) (GRing.one (poly_ringType (GRing.Field.ringType F))) (divisors n) (fun d : Equality.sort nat_eqType => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) d (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n d)) d))) *) (* Goal: is_true (dvdn (divn n (gcdn k n)) n) *) by rewrite -{3}(divnK (dvdn_gcdr k n)) dvdn_mulr. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) (GRing.one (poly_ringType (GRing.Field.ringType F))) (divisors n) (fun d : Equality.sort nat_eqType => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) d (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n d)) d))) *) have [uDn _ inDn] := divisors_correct n_gt0. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) (GRing.one (poly_ringType (GRing.Field.ringType F))) (divisors n) (fun d : Equality.sort nat_eqType => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) d (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n d)) d))) *) have defDn: divisors n = map val (map (@inord n) (divisors n)). (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) (GRing.one (poly_ringType (GRing.Field.ringType F))) (divisors n) (fun d : Equality.sort nat_eqType => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) d (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n d)) d))) *) (* Goal: @eq (list (Equality.sort nat_eqType)) (divisors n) (@map (@sub_sort nat (fun x : nat => leq (S x) (S n)) (ordinal_subType (S n))) nat (@val nat (fun x : nat => leq (S x) (S n)) (ordinal_subType (S n))) (@map nat (ordinal (S n)) (@inord n) (divisors n))) *) by rewrite -map_comp map_id_in // => d; rewrite inDn => /in_d. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) (GRing.one (poly_ringType (GRing.Field.ringType F))) (divisors n) (fun d : Equality.sort nat_eqType => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Equality.sort nat_eqType) d (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n d)) d))) *) rewrite defDn big_map big_uniq /=; last first. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n)))) (fun i : ordinal (S n) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@in_mem (ordinal (S n)) i (@mem (ordinal (S n)) (seq_predType (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n))))) (@map nat (ordinal (S n)) (@inord n) (divisors n)))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n (@nat_of_ord (S n) i))) (@nat_of_ord (S n) i)))) *) (* Goal: is_true (@uniq (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n)))) (@map nat (ordinal (S n)) (@inord n) (divisors n))) *) by rewrite -(map_inj_uniq val_inj) -defDn. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n)))) (fun i : ordinal (S n) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@in_mem (ordinal (S n)) i (@mem (ordinal (S n)) (seq_predType (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n))))) (@map nat (ordinal (S n)) (@inord n) (divisors n)))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n (@nat_of_ord (S n) i))) (@nat_of_ord (S n) i)))) *) pose h (k : 'I_n) : 'I_n.+1 := inord (n %/ gcdn k n). (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (GRing.one (poly_ringType (GRing.Field.ringType F))))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n)))) (fun i : ordinal (S n) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@in_mem (ordinal (S n)) i (@mem (ordinal (S n)) (seq_predType (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n))))) (@map nat (ordinal (S n)) (@inord n) (divisors n)))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n (@nat_of_ord (S n) i))) (@nat_of_ord (S n) i)))) *) rewrite -(factor_Xn_sub_1 prim_z) big_mkord. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (Finite.sort (ordinal_finType n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (GRing.Ring.sort (poly_ringType (GRing.Field.ringType F))) (ordinal n) i (@GRing.mul (poly_ringType (GRing.Field.ringType F))) true (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n i))))))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n)))) (fun i : ordinal (S n) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@in_mem (ordinal (S n)) i (@mem (ordinal (S n)) (seq_predType (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n))))) (@map nat (ordinal (S n)) (@inord n) (divisors n)))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n (@nat_of_ord (S n) i))) (@nat_of_ord (S n) i)))) *) rewrite (partition_big h (dvdn^~ n)) /= => [|k _]; last by rewrite in_d ?dv_n. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType (S n))) (fun j : ordinal (S n) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) j (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (dvdn (@nat_of_ord (S n) j) n) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h i) j) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n i))))))))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n)))) (fun i : ordinal (S n) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal (S n)) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@in_mem (ordinal (S n)) i (@mem (ordinal (S n)) (seq_predType (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (S n)) (ordinal_subFinType (S n))))) (@map nat (ordinal (S n)) (@inord n) (divisors n)))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n (@nat_of_ord (S n) i))) (@nat_of_ord (S n) i)))) *) apply: eq_big => d; first by rewrite -(mem_map val_inj) -defDn inDn. (* Goal: forall _ : is_true (dvdn (@nat_of_ord (S n) d) n), @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h i) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n i))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (divn n (@nat_of_ord (S n) d))) (@nat_of_ord (S n) d)) *) set q := (n %/ d)%N => d_dv_n. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h i) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n i))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) have [q_gt0 d_gt0]: (0 < q /\ 0 < d)%N by apply/andP; rewrite -muln_gt0 divnK. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h i) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n i))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) have fP (k : 'I_d): (q * k < n)%N by rewrite divn_mulAC ?ltn_divLR ?ltn_pmul2l. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (ordinal n) i (@GRing.mul (GRing.ComRing.ringType (poly_comRingType (GRing.Field.comRingType F)))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h i) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n i))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) rewrite (reindex (fun k => Ordinal (fP k))); last first. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType (@nat_of_ord (S n) d))) (fun j : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) j (@Monoid.operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (@Monoid.com_operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (GRing.mul_comoid (poly_comRingType (GRing.Field.comRingType F))))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) (* Goal: @bijective_on (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (Finite.sort (ordinal_finType n)) (@mem (Finite.sort (ordinal_finType n)) (simplPredType (Finite.sort (ordinal_finType n))) (@SimplPred (Finite.sort (ordinal_finType n)) (fun i : Finite.sort (ordinal_finType n) => @eq_op (Finite.eqType (ordinal_finType (S n))) (h i) d))) (fun k : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) k)) (fP k)) *) have f'P (k : 'I_n): (k %/ q < d)%N by rewrite ltn_divLR // mulnC divnK. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType (@nat_of_ord (S n) d))) (fun j : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) j (@Monoid.operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (@Monoid.com_operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (GRing.mul_comoid (poly_comRingType (GRing.Field.comRingType F))))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) (* Goal: @bijective_on (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (Finite.sort (ordinal_finType n)) (@mem (Finite.sort (ordinal_finType n)) (simplPredType (Finite.sort (ordinal_finType n))) (@SimplPred (Finite.sort (ordinal_finType n)) (fun i : Finite.sort (ordinal_finType n) => @eq_op (Finite.eqType (ordinal_finType (S n))) (h i) d))) (fun k : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) k)) (fP k)) *) exists (fun k => Ordinal (f'P k)) => [k _ | k /eqnP/=]. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType (@nat_of_ord (S n) d))) (fun j : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) j (@Monoid.operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (@Monoid.com_operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (GRing.mul_comoid (poly_comRingType (GRing.Field.comRingType F))))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) (* Goal: forall _ : @eq nat (@nat_of_ord (S n) (h k)) (@nat_of_ord (S n) d), @eq (ordinal n) (@Ordinal n (muln q (divn (@nat_of_ord n k) q)) (fP (@Ordinal (@nat_of_ord (S n) d) (divn (@nat_of_ord n k) q) (f'P k)))) k *) (* Goal: @eq (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (@Ordinal (@nat_of_ord (S n) d) (divn (@nat_of_ord n (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) k)) (fP k))) q) (f'P (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) k)) (fP k)))) k *) by apply: val_inj; rewrite /= mulKn. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType (@nat_of_ord (S n) d))) (fun j : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) j (@Monoid.operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (@Monoid.com_operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (GRing.mul_comoid (poly_comRingType (GRing.Field.comRingType F))))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) (* Goal: forall _ : @eq nat (@nat_of_ord (S n) (h k)) (@nat_of_ord (S n) d), @eq (ordinal n) (@Ordinal n (muln q (divn (@nat_of_ord n k) q)) (fP (@Ordinal (@nat_of_ord (S n) d) (divn (@nat_of_ord n k) q) (f'P k)))) k *) rewrite in_d // => Dd; apply: val_inj; rewrite /= mulnC divnK // /q -Dd. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType (@nat_of_ord (S n) d))) (fun j : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) j (@Monoid.operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (@Monoid.com_operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (GRing.mul_comoid (poly_comRingType (GRing.Field.comRingType F))))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) (* Goal: is_true (dvdn (divn n (divn n (gcdn (@nat_of_ord n k) n))) (@nat_of_ord n k)) *) by rewrite divnA ?mulKn ?dvdn_gcdl ?dvdn_gcdr. (* Goal: @eq (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (@BigOp.bigop (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (index_enum (ordinal_finType (@nat_of_ord (S n) d))) (fun j : Finite.sort (ordinal_finType (@nat_of_ord (S n) d)) => @BigBody (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (Finite.sort (ordinal_finType (@nat_of_ord (S n) d))) j (@Monoid.operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (@Monoid.com_operator (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (GRing.one (poly_ringType (GRing.Field.ringType F))) (GRing.mul_comoid (poly_comRingType (GRing.Field.comRingType F))))) (@eq_op (Finite.eqType (ordinal_finType (S n))) (h (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))) d) (@GRing.add (poly_zmodType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (@GRing.opp (poly_zmodType (GRing.Field.ringType F)) (@polyC (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z (@nat_of_ord n (@Ordinal n (muln q (@nat_of_ord (@nat_of_ord (S n) d) j)) (fP j))))))))) (@cyclotomic (GRing.Field.ringType F) (@GRing.exp (GRing.Field.ringType F) z q) (@nat_of_ord (S n) d)) *) apply: eq_big => k; rewrite ?exprM // -val_eqE in_d //=. (* Goal: @eq bool (@eq_op (Choice.eqType nat_choiceType) (divn n (gcdn (muln q (@nat_of_ord (@nat_of_ord (S n) d) k)) n)) (@nat_of_ord (S n) d)) (coprime (@nat_of_ord (@nat_of_ord (S n) d) k) (@nat_of_ord (S n) d)) *) rewrite -eqn_mul ?dvdn_gcdr ?gcdn_gt0 ?n_gt0 ?orbT //. (* Goal: @eq bool (@eq_op nat_eqType n (muln (@nat_of_ord (S n) d) (gcdn (muln q (@nat_of_ord (@nat_of_ord (S n) d) k)) n))) (coprime (@nat_of_ord (@nat_of_ord (S n) d) k) (@nat_of_ord (S n) d)) *) rewrite -[n in gcdn _ n](divnK d_dv_n) -muln_gcdr mulnCA mulnA divnK //. (* Goal: @eq bool (@eq_op nat_eqType n (muln n (gcdn (@nat_of_ord (@nat_of_ord (S n) d) k) (@nat_of_ord (S n) d)))) (coprime (@nat_of_ord (@nat_of_ord (S n) d) k) (@nat_of_ord (S n) d)) *) by rewrite mulnC eqn_mul // divnn n_gt0 eq_sym. Qed. End Field. End CyclotomicPoly. Local Notation ZtoQ := (intr : int -> rat). Local Notation ZtoC := (intr : int -> algC). Local Notation QtoC := (ratr : rat -> algC). Local Notation intrp := (map_poly intr). Local Notation pZtoQ := (map_poly ZtoQ). Local Notation pZtoC := (map_poly ZtoC). Local Notation pQtoC := (map_poly ratr). Local Hint Resolve (@intr_inj [numDomainType of algC]) : core. Local Notation QtoC_M := (ratr_rmorphism [numFieldType of algC]). Lemma C_prim_root_exists n : (n > 0)%N -> {z : algC | n.-primitive_root z}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @sig Algebraics.Implementation.type (fun z : Algebraics.Implementation.type => is_true (@primitive_root_of_unity Algebraics.Implementation.ringType n z)) *) pose p : {poly algC} := 'X^n - 1; have [r Dp] := closed_field_poly_normal p. (* Goal: forall _ : is_true (leq (S O) n), @sig Algebraics.Implementation.type (fun z : Algebraics.Implementation.type => is_true (@primitive_root_of_unity Algebraics.Implementation.ringType n z)) *) move=> n_gt0; apply/sigW; rewrite (monicP _) ?monic_Xn_sub_1 // scale1r in Dp. (* Goal: @ex (Choice.sort Algebraics.Implementation.choiceType) (fun x : Choice.sort Algebraics.Implementation.choiceType => is_true (@primitive_root_of_unity Algebraics.Implementation.ringType n x)) *) have rn1: all n.-unity_root r by apply/allP=> z; rewrite -root_prod_XsubC -Dp. (* Goal: @ex (Choice.sort Algebraics.Implementation.choiceType) (fun x : Choice.sort Algebraics.Implementation.choiceType => is_true (@primitive_root_of_unity Algebraics.Implementation.ringType n x)) *) have sz_r: (n < (size r).+1)%N. (* Goal: @ex (Choice.sort Algebraics.Implementation.choiceType) (fun x : Choice.sort Algebraics.Implementation.choiceType => is_true (@primitive_root_of_unity Algebraics.Implementation.ringType n x)) *) (* Goal: is_true (leq (S n) (S (@size (GRing.ClosedField.sort Algebraics.Implementation.closedFieldType) r))) *) by rewrite -(size_prod_XsubC r id) -Dp size_Xn_sub_1. (* Goal: @ex (Choice.sort Algebraics.Implementation.choiceType) (fun x : Choice.sort Algebraics.Implementation.choiceType => is_true (@primitive_root_of_unity Algebraics.Implementation.ringType n x)) *) have [|z] := hasP (has_prim_root n_gt0 rn1 _ sz_r); last by exists z. (* Goal: is_true (@uniq (GRing.Field.eqType (GRing.ClosedField.fieldType Algebraics.Implementation.closedFieldType)) r) *) by rewrite -separable_prod_XsubC -Dp separable_Xn_sub_1 // pnatr_eq0 -lt0n. Qed. Definition Cyclotomic n : {poly int} := let: exist z _ := C_prim_root_exists (ltn0Sn n.-1) in map_poly floorC (cyclotomic z n). Notation "''Phi_' n" := (Cyclotomic n) (at level 8, n at level 2, format "''Phi_' n"). Lemma Cyclotomic_monic n : 'Phi_n \is monic. Proof. (* Goal: is_true (@in_mem (@poly_of int_Ring (Phant int)) (Cyclotomic n) (@mem (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (predPredType (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring)))) (@has_quality O (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) (@monic int_Ring)))) *) rewrite /'Phi_n; case: (C_prim_root_exists _) => z /= _. (* Goal: is_true (@in_mem (@poly_of int_Ring (Phant int)) (@map_poly Algebraics.Implementation.ringType int_Ring floorC (@cyclotomic Algebraics.Implementation.ringType z n)) (@mem (@poly_of int_Ring (Phant int)) (predPredType (@poly_of int_Ring (Phant int))) (@has_quality O (@poly_of int_Ring (Phant int)) (@monic int_Ring)))) *) rewrite monicE lead_coefE coef_map_id0 ?(int_algC_K 0) ?getCint0 //. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType int_Ring)) (floorC (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@polyseq Algebraics.Implementation.ringType (@cyclotomic Algebraics.Implementation.ringType z n)) (Nat.pred (@size (GRing.Ring.sort int_Ring) (@polyseq int_Ring (@map_poly Algebraics.Implementation.ringType int_Ring floorC (@cyclotomic Algebraics.Implementation.ringType z n))))))) (GRing.one int_Ring)) *) by rewrite size_poly_eq -lead_coefE (monicP (cyclotomic_monic _ _)) (intCK 1). Qed. Lemma Cintr_Cyclotomic n z : n.-primitive_root z -> pZtoC 'Phi_n = cyclotomic z n. Lemma prod_Cyclotomic n : (n > 0)%N -> \prod_(d <- divisors n) 'Phi_d = 'X^n - 1. Lemma Cyclotomic0 : 'Phi_0 = 1. Proof. (* Goal: @eq (@poly_of int_Ring (Phant int)) (Cyclotomic O) (GRing.one (poly_ringType int_Ring)) *) rewrite /'Phi_0; case: (C_prim_root_exists _) => z /= _. (* Goal: @eq (@poly_of int_Ring (Phant int)) (@map_poly Algebraics.Implementation.ringType int_Ring floorC (@cyclotomic Algebraics.Implementation.ringType z O)) (GRing.one (poly_ringType int_Ring)) *) by rewrite -[1]polyseqK /cyclotomic big_ord0 map_polyE !polyseq1 /= (intCK 1). Qed. Lemma size_Cyclotomic n : size 'Phi_n = (totient n).+1. Proof. (* Goal: @eq nat (@size (GRing.Ring.sort int_Ring) (@polyseq int_Ring (Cyclotomic n))) (S (totient n)) *) have [-> | n_gt0] := posnP n; first by rewrite Cyclotomic0 polyseq1. (* Goal: @eq nat (@size (GRing.Ring.sort int_Ring) (@polyseq int_Ring (Cyclotomic n))) (S (totient n)) *) have [z prim_z] := C_prim_root_exists n_gt0. (* Goal: @eq nat (@size (GRing.Ring.sort int_Ring) (@polyseq int_Ring (Cyclotomic n))) (S (totient n)) *) rewrite -(size_map_inj_poly (can_inj intCK)) //. (* Goal: @eq nat (@size (GRing.Ring.sort Algebraics.Implementation.ringType) (@polyseq Algebraics.Implementation.ringType (@map_poly int_Ring Algebraics.Implementation.ringType (@intmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) (Cyclotomic n)))) (S (totient n)) *) rewrite (Cintr_Cyclotomic prim_z) -[_ n]big_filter filter_index_enum. (* Goal: @eq nat (@size (GRing.Ring.sort Algebraics.Implementation.ringType) (@polyseq Algebraics.Implementation.ringType (@BigOp.bigop (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (Finite.sort (ordinal_finType n)) (GRing.one (poly_ringType Algebraics.Implementation.ringType)) (@enum_mem (ordinal_finType n) (@mem (Finite.sort (ordinal_finType n)) (predPredType (Finite.sort (ordinal_finType n))) (fun i : Finite.sort (ordinal_finType n) => coprime (@nat_of_ord n i) n))) (fun i : Finite.sort (ordinal_finType n) => @BigBody (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (Finite.sort (ordinal_finType n)) i (@GRing.mul (poly_ringType Algebraics.Implementation.ringType)) true (@GRing.add (poly_zmodType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) (@GRing.opp (poly_zmodType Algebraics.Implementation.ringType) (@polyC Algebraics.Implementation.ringType (@GRing.exp Algebraics.Implementation.ringType z (@nat_of_ord n i))))))))) (S (totient n)) *) rewrite size_prod_XsubC -cardE totient_count_coprime big_mkord -big_mkcond /=. (* Goal: @eq nat (S (@card (ordinal_finType n) (@mem (ordinal n) (predPredType (ordinal n)) (fun i : ordinal n => coprime (@nat_of_ord n i) n)))) (S (@BigOp.bigop nat (ordinal n) O (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody nat (ordinal n) i addn (coprime n (@nat_of_ord n i)) (S O)))) *) by rewrite (eq_card (fun _ => coprime_sym _ _)) sum1_card. Qed. Lemma minCpoly_cyclotomic n z : n.-primitive_root z -> minCpoly z = cyclotomic z n.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat seq div choice fintype path. From mathcomp Require Import bigop ssralg finset fingroup zmodp poly. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Local Open Scope ring_scope. Import GRing.Theory. Reserved Notation "<= y" (at level 35). Reserved Notation ">= y" (at level 35). Reserved Notation "< y" (at level 35). Reserved Notation "> y" (at level 35). Reserved Notation "<= y :> T" (at level 35, y at next level). Reserved Notation ">= y :> T" (at level 35, y at next level). Reserved Notation "< y :> T" (at level 35, y at next level). Reserved Notation "> y :> T" (at level 35, y at next level). Module Num. Record mixin_of (R : ringType) := Mixin { norm_op : R -> R; le_op : rel R; lt_op : rel R; _ : forall x y, le_op (norm_op (x + y)) (norm_op x + norm_op y); _ : forall x y, lt_op 0 x -> lt_op 0 y -> lt_op 0 (x + y); _ : forall x, norm_op x = 0 -> x = 0; _ : forall x y, le_op 0 x -> le_op 0 y -> le_op x y || le_op y x; _ : {morph norm_op : x y / x * y}; _ : forall x y, (le_op x y) = (norm_op (y - x) == y - x); _ : forall x y, (lt_op x y) = (y != x) && (le_op x y) }. Local Notation ring_for T b := (@GRing.Ring.Pack T b). Module NumDomain. Section ClassDef. Record class_of T := Class { base : GRing.IntegralDomain.class_of T; mixin : mixin_of (ring_for T base) }. Local Coercion base : class_of >-> GRing.IntegralDomain.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition clone c of phant_id class c := @Pack T c. Definition pack b0 (m0 : mixin_of (ring_for T b0)) := fun bT b & phant_id (GRing.IntegralDomain.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @GRing.Zmodule.Pack cT xclass. Definition ringType := @GRing.Ring.Pack cT xclass. Definition comRingType := @GRing.ComRing.Pack cT xclass. Definition unitRingType := @GRing.UnitRing.Pack cT xclass. Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass. Definition idomainType := @GRing.IntegralDomain.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> GRing.IntegralDomain.class_of. Coercion mixin : class_of >-> mixin_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> GRing.Zmodule.type. Canonical zmodType. Coercion ringType : type >-> GRing.Ring.type. Canonical ringType. Coercion comRingType : type >-> GRing.ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> GRing.UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> GRing.ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> GRing.IntegralDomain.type. Canonical idomainType. Notation numDomainType := type. Notation NumMixin := Mixin. Notation NumDomainType T m := (@pack T _ m _ _ id _ id). Notation "[ 'numDomainType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'numDomainType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'numDomainType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'numDomainType' 'of' T ]") : form_scope. End Exports. End NumDomain. Import NumDomain.Exports. Module Import Def. Section Def. Import NumDomain. Context {R : type}. Implicit Types (x y : R) (C : bool). Definition normr : R -> R := norm_op (class R). Definition ler : rel R := le_op (class R). Definition ltr : rel R := lt_op (class R). Local Notation "x <= y" := (ler x y) : ring_scope. Local Notation "x < y" := (ltr x y) : ring_scope. Definition ger : simpl_rel R := [rel x y | y <= x]. Definition gtr : simpl_rel R := [rel x y | y < x]. Definition lerif x y C : Prop := ((x <= y) * ((x == y) = C))%type. Definition sgr x : R := if x == 0 then 0 else if x < 0 then -1 else 1. Definition minr x y : R := if x <= y then x else y. Definition maxr x y : R := if y <= x then x else y. Definition Rpos : qualifier 0 R := [qualify x : R | 0 < x]. Definition Rneg : qualifier 0 R := [qualify x : R | x < 0]. Definition Rnneg : qualifier 0 R := [qualify x : R | 0 <= x]. Definition Rreal : qualifier 0 R := [qualify x : R | (0 <= x) || (x <= 0)]. Definition Rpos_keyed := KeyedQualifier Rpos_key. Definition Rneg_keyed := KeyedQualifier Rneg_key. Definition Rnneg_keyed := KeyedQualifier Rnneg_key. Definition Rreal_keyed := KeyedQualifier Rreal_key. Definition ler_of_leif x y C (le_xy : @lerif R x y C) := le_xy.1 : le x y. End Keys. End Keys. Module Import Syntax. Import Def Keys. Notation "`| x |" := (norm x) : ring_scope. Notation "<%R" := lt : ring_scope. Notation ">%R" := gt : ring_scope. Notation "<=%R" := le : ring_scope. Notation ">=%R" := ge : ring_scope. Notation "<?=%R" := lerif : ring_scope. Notation "< y" := (gt y) : ring_scope. Notation "< y :> T" := (< (y : T)) : ring_scope. Notation "> y" := (lt y) : ring_scope. Notation "> y :> T" := (> (y : T)) : ring_scope. Notation "<= y" := (ge y) : ring_scope. Notation "<= y :> T" := (<= (y : T)) : ring_scope. Notation ">= y" := (le y) : ring_scope. Notation ">= y :> T" := (>= (y : T)) : ring_scope. Notation "x < y" := (lt x y) : ring_scope. Notation "x < y :> T" := ((x : T) < (y : T)) : ring_scope. Notation "x > y" := (y < x) (only parsing) : ring_scope. Notation "x > y :> T" := ((x : T) > (y : T)) (only parsing) : ring_scope. Notation "x <= y" := (le x y) : ring_scope. Notation "x <= y :> T" := ((x : T) <= (y : T)) : ring_scope. Notation "x >= y" := (y <= x) (only parsing) : ring_scope. Notation "x >= y :> T" := ((x : T) >= (y : T)) (only parsing) : ring_scope. Notation "x <= y <= z" := ((x <= y) && (y <= z)) : ring_scope. Notation "x < y <= z" := ((x < y) && (y <= z)) : ring_scope. Notation "x <= y < z" := ((x <= y) && (y < z)) : ring_scope. Notation "x < y < z" := ((x < y) && (y < z)) : ring_scope. Notation "x <= y ?= 'iff' C" := (lerif x y C) : ring_scope. Notation "x <= y ?= 'iff' C :> R" := ((x : R) <= (y : R) ?= iff C) (only parsing) : ring_scope. Coercion ler_of_leif : lerif >-> is_true. Canonical Rpos_keyed. Canonical Rneg_keyed. Canonical Rnneg_keyed. Canonical Rreal_keyed. End Syntax. Section ExtensionAxioms. Variable R : numDomainType. Definition real_axiom : Prop := forall x : R, x \is real. Definition archimedean_axiom : Prop := forall x : R, exists ub, `|x| < ub%:R. Definition real_closed_axiom : Prop := forall (p : {poly R}) (a b : R), a <= b -> p.[a] <= 0 <= p.[b] -> exists2 x, a <= x <= b & root p x. End ExtensionAxioms. Local Notation num_for T b := (@NumDomain.Pack T b). Module NumField. Section ClassDef. Record class_of R := Class { base : GRing.Field.class_of R; mixin : mixin_of (ring_for R base) }. Definition base2 R (c : class_of R) := NumDomain.Class (mixin c). Local Coercion base : class_of >-> GRing.Field.class_of. Local Coercion base2 : class_of >-> NumDomain.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack := fun bT b & phant_id (GRing.Field.class bT) (b : GRing.Field.class_of T) => fun mT m & phant_id (NumDomain.class mT) (@NumDomain.Class T b m) => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @GRing.Zmodule.Pack cT xclass. Definition ringType := @GRing.Ring.Pack cT xclass. Definition comRingType := @GRing.ComRing.Pack cT xclass. Definition unitRingType := @GRing.UnitRing.Pack cT xclass. Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass. Definition idomainType := @GRing.IntegralDomain.Pack cT xclass. Definition numDomainType := @NumDomain.Pack cT xclass. Definition fieldType := @GRing.Field.Pack cT xclass. Definition join_numDomainType := @NumDomain.Pack fieldType xclass. End ClassDef. Module Exports. Coercion base : class_of >-> GRing.Field.class_of. Coercion base2 : class_of >-> NumDomain.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> GRing.Zmodule.type. Canonical zmodType. Coercion ringType : type >-> GRing.Ring.type. Canonical ringType. Coercion comRingType : type >-> GRing.ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> GRing.UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> GRing.ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> GRing.IntegralDomain.type. Canonical idomainType. Coercion numDomainType : type >-> NumDomain.type. Canonical numDomainType. Coercion fieldType : type >-> GRing.Field.type. Canonical fieldType. Notation numFieldType := type. Notation "[ 'numFieldType' 'of' T ]" := (@pack T _ _ id _ _ id) (at level 0, format "[ 'numFieldType' 'of' T ]") : form_scope. End Exports. End NumField. Import NumField.Exports. Module ClosedField. Section ClassDef. Record imaginary_mixin_of (R : numDomainType) := ImaginaryMixin { imaginary : R; conj_op : {rmorphism R -> R}; _ : imaginary ^+ 2 = - 1; _ : forall x, x * conj_op x = `|x| ^+ 2; }. Record class_of R := Class { base : GRing.ClosedField.class_of R; mixin : mixin_of (ring_for R base); conj_mixin : imaginary_mixin_of (num_for R (NumDomain.Class mixin)) }. Definition base2 R (c : class_of R) := NumField.Class (mixin c). Local Coercion base : class_of >-> GRing.ClosedField.class_of. Local Coercion base2 : class_of >-> NumField.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack := fun bT b & phant_id (GRing.ClosedField.class bT) (b : GRing.ClosedField.class_of T) => fun mT m & phant_id (NumField.class mT) (@NumField.Class T b m) => fun mc => Pack (@Class T b m mc). Definition clone := fun b & phant_id class (b : class_of T) => Pack b. Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @GRing.Zmodule.Pack cT xclass. Definition ringType := @GRing.Ring.Pack cT xclass. Definition comRingType := @GRing.ComRing.Pack cT xclass. Definition unitRingType := @GRing.UnitRing.Pack cT xclass. Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass. Definition idomainType := @GRing.IntegralDomain.Pack cT xclass. Definition numDomainType := @NumDomain.Pack cT xclass. Definition fieldType := @GRing.Field.Pack cT xclass. Definition numFieldType := @NumField.Pack cT xclass. Definition decFieldType := @GRing.DecidableField.Pack cT xclass. Definition closedFieldType := @GRing.ClosedField.Pack cT xclass. Definition join_dec_numDomainType := @NumDomain.Pack decFieldType xclass. Definition join_dec_numFieldType := @NumField.Pack decFieldType xclass. Definition join_numDomainType := @NumDomain.Pack closedFieldType xclass. Definition join_numFieldType := @NumField.Pack closedFieldType xclass. End ClassDef. Module Exports. Coercion base : class_of >-> GRing.ClosedField.class_of. Coercion base2 : class_of >-> NumField.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> GRing.Zmodule.type. Canonical zmodType. Coercion ringType : type >-> GRing.Ring.type. Canonical ringType. Coercion comRingType : type >-> GRing.ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> GRing.UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> GRing.ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> GRing.IntegralDomain.type. Canonical idomainType. Coercion numDomainType : type >-> NumDomain.type. Canonical numDomainType. Coercion fieldType : type >-> GRing.Field.type. Canonical fieldType. Coercion decFieldType : type >-> GRing.DecidableField.type. Canonical decFieldType. Coercion numFieldType : type >-> NumField.type. Canonical numFieldType. Coercion closedFieldType : type >-> GRing.ClosedField.type. Canonical closedFieldType. Canonical join_dec_numDomainType. Canonical join_dec_numFieldType. Canonical join_numDomainType. Canonical join_numFieldType. Notation numClosedFieldType := type. Notation NumClosedFieldType T m := (@pack T _ _ id _ _ id m). Notation "[ 'numClosedFieldType' 'of' T 'for' cT ]" := (@clone T cT _ id) (at level 0, format "[ 'numClosedFieldType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'numClosedFieldType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'numClosedFieldType' 'of' T ]") : form_scope. End Exports. End ClosedField. Import ClosedField.Exports. Module RealDomain. Section ClassDef. Record class_of R := Class {base : NumDomain.class_of R; _ : @real_axiom (num_for R base)}. Local Coercion base : class_of >-> NumDomain.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition clone c of phant_id class c := @Pack T c. Definition pack b0 (m0 : real_axiom (num_for T b0)) := fun bT b & phant_id (NumDomain.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @GRing.Zmodule.Pack cT xclass. Definition ringType := @GRing.Ring.Pack cT xclass. Definition comRingType := @GRing.ComRing.Pack cT xclass. Definition unitRingType := @GRing.UnitRing.Pack cT xclass. Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass. Definition idomainType := @GRing.IntegralDomain.Pack cT xclass. Definition numDomainType := @NumDomain.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> NumDomain.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> GRing.Zmodule.type. Canonical zmodType. Coercion ringType : type >-> GRing.Ring.type. Canonical ringType. Coercion comRingType : type >-> GRing.ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> GRing.UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> GRing.ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> GRing.IntegralDomain.type. Canonical idomainType. Coercion numDomainType : type >-> NumDomain.type. Canonical numDomainType. Notation realDomainType := type. Notation RealDomainType T m := (@pack T _ m _ _ id _ id). Notation "[ 'realDomainType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'realDomainType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'realDomainType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'realDomainType' 'of' T ]") : form_scope. End Exports. End RealDomain. Import RealDomain.Exports. Module RealField. Section ClassDef. Record class_of R := Class { base : NumField.class_of R; mixin : real_axiom (num_for R base) }. Definition base2 R (c : class_of R) := RealDomain.Class (@mixin R c). Local Coercion base : class_of >-> NumField.class_of. Local Coercion base2 : class_of >-> RealDomain.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack := fun bT b & phant_id (NumField.class bT) (b : NumField.class_of T) => fun mT m & phant_id (RealDomain.class mT) (@RealDomain.Class T b m) => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @GRing.Zmodule.Pack cT xclass. Definition ringType := @GRing.Ring.Pack cT xclass. Definition comRingType := @GRing.ComRing.Pack cT xclass. Definition unitRingType := @GRing.UnitRing.Pack cT xclass. Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass. Definition idomainType := @GRing.IntegralDomain.Pack cT xclass. Definition numDomainType := @NumDomain.Pack cT xclass. Definition realDomainType := @RealDomain.Pack cT xclass. Definition fieldType := @GRing.Field.Pack cT xclass. Definition numFieldType := @NumField.Pack cT xclass. Definition join_realDomainType := @RealDomain.Pack numFieldType xclass. End ClassDef. Module Exports. Coercion base : class_of >-> NumField.class_of. Coercion base2 : class_of >-> RealDomain.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> GRing.Zmodule.type. Canonical zmodType. Coercion ringType : type >-> GRing.Ring.type. Canonical ringType. Coercion comRingType : type >-> GRing.ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> GRing.UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> GRing.ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> GRing.IntegralDomain.type. Canonical idomainType. Coercion numDomainType : type >-> NumDomain.type. Canonical numDomainType. Coercion realDomainType : type >-> RealDomain.type. Canonical realDomainType. Coercion fieldType : type >-> GRing.Field.type. Canonical fieldType. Coercion numFieldType : type >-> NumField.type. Canonical numFieldType. Canonical join_realDomainType. Notation realFieldType := type. Notation "[ 'realFieldType' 'of' T ]" := (@pack T _ _ id _ _ id) (at level 0, format "[ 'realFieldType' 'of' T ]") : form_scope. End Exports. End RealField. Import RealField.Exports. Module ArchimedeanField. Section ClassDef. Record class_of R := Class { base : RealField.class_of R; _ : archimedean_axiom (num_for R base) }. Local Coercion base : class_of >-> RealField.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition clone c of phant_id class c := @Pack T c. Definition pack b0 (m0 : archimedean_axiom (num_for T b0)) := fun bT b & phant_id (RealField.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @GRing.Zmodule.Pack cT xclass. Definition ringType := @GRing.Ring.Pack cT xclass. Definition comRingType := @GRing.ComRing.Pack cT xclass. Definition unitRingType := @GRing.UnitRing.Pack cT xclass. Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass. Definition idomainType := @GRing.IntegralDomain.Pack cT xclass. Definition numDomainType := @NumDomain.Pack cT xclass. Definition realDomainType := @RealDomain.Pack cT xclass. Definition fieldType := @GRing.Field.Pack cT xclass. Definition numFieldType := @NumField.Pack cT xclass. Definition realFieldType := @RealField.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> RealField.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> GRing.Zmodule.type. Canonical zmodType. Coercion ringType : type >-> GRing.Ring.type. Canonical ringType. Coercion comRingType : type >-> GRing.ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> GRing.UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> GRing.ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> GRing.IntegralDomain.type. Canonical idomainType. Coercion numDomainType : type >-> NumDomain.type. Canonical numDomainType. Coercion realDomainType : type >-> RealDomain.type. Canonical realDomainType. Coercion fieldType : type >-> GRing.Field.type. Canonical fieldType. Coercion numFieldType : type >-> NumField.type. Canonical numFieldType. Coercion realFieldType : type >-> RealField.type. Canonical realFieldType. Notation archiFieldType := type. Notation ArchiFieldType T m := (@pack T _ m _ _ id _ id). Notation "[ 'archiFieldType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'archiFieldType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'archiFieldType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'archiFieldType' 'of' T ]") : form_scope. End Exports. End ArchimedeanField. Import ArchimedeanField.Exports. Module RealClosedField. Section ClassDef. Record class_of R := Class { base : RealField.class_of R; _ : real_closed_axiom (num_for R base) }. Local Coercion base : class_of >-> RealField.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition clone c of phant_id class c := @Pack T c. Definition pack b0 (m0 : real_closed_axiom (num_for T b0)) := fun bT b & phant_id (RealField.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @GRing.Zmodule.Pack cT xclass. Definition ringType := @GRing.Ring.Pack cT xclass. Definition comRingType := @GRing.ComRing.Pack cT xclass. Definition unitRingType := @GRing.UnitRing.Pack cT xclass. Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass. Definition idomainType := @GRing.IntegralDomain.Pack cT xclass. Definition numDomainType := @NumDomain.Pack cT xclass. Definition realDomainType := @RealDomain.Pack cT xclass. Definition fieldType := @GRing.Field.Pack cT xclass. Definition numFieldType := @NumField.Pack cT xclass. Definition realFieldType := @RealField.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> RealField.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> GRing.Zmodule.type. Canonical zmodType. Coercion ringType : type >-> GRing.Ring.type. Canonical ringType. Coercion comRingType : type >-> GRing.ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> GRing.UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> GRing.ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> GRing.IntegralDomain.type. Canonical idomainType. Coercion numDomainType : type >-> NumDomain.type. Canonical numDomainType. Coercion realDomainType : type >-> RealDomain.type. Canonical realDomainType. Coercion fieldType : type >-> GRing.Field.type. Canonical fieldType. Coercion numFieldType : type >-> NumField.type. Canonical numFieldType. Coercion realFieldType : type >-> RealField.type. Canonical realFieldType. Notation rcfType := Num.RealClosedField.type. Notation RcfType T m := (@pack T _ m _ _ id _ id). Notation "[ 'rcfType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'rcfType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'rcfType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'rcfType' 'of' T ]") : form_scope. End Exports. End RealClosedField. Import RealClosedField.Exports. Module Import Internals. Section Domain. Variable R : numDomainType. Implicit Types x y : R. Lemma normr0_eq0 x : `|x| = 0 -> x = 0. Proof. (* Goal: forall _ : @eq (NumDomain.sort R) (@normr R x) (GRing.zero (NumDomain.zmodType R)), @eq (NumDomain.sort R) x (GRing.zero (NumDomain.zmodType R)) *) by case: R x => ? [? []]. Qed. Lemma ler_norm_add x y : `|x + y| <= `|x| + `|y|. Proof. (* Goal: is_true (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) x y)) (@GRing.add (NumDomain.zmodType R) (@normr R x) (@normr R y))) *) by case: R x y => ? [? []]. Qed. Lemma addr_gt0 x y : 0 < x -> 0 < y -> 0 < x + y. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y)) *) by case: R x y => ? [? []]. Qed. Lemma ger_leVge x y : 0 <= x -> 0 <= y -> (x <= y) || (y <= x). Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), is_true (orb (@ler R x y) (@ler R y x)) *) by case: R x y => ? [? []]. Qed. Lemma normrM : {morph norm : x y / x * y : R}. Proof. (* Goal: @morphism_2 (NumDomain.sort R) (NumDomain.sort R) (@normr R) (fun x y : NumDomain.sort R => @GRing.mul (NumDomain.ringType R) x y : NumDomain.sort R) (fun x y : NumDomain.sort R => @GRing.mul (NumDomain.ringType R) x y : NumDomain.sort R) *) by case: R => ? [? []]. Qed. Lemma ler_def x y : (x <= y) = (`|y - x| == y - x). Proof. (* Goal: @eq bool (@ler R x y) (@eq_op (NumDomain.eqType R) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) *) by case: R x y => ? [? []]. Qed. Lemma ltr_def x y : (x < y) = (y != x) && (x <= y). Proof. (* Goal: @eq bool (@ltr R x y) (andb (negb (@eq_op (NumDomain.eqType R) y x)) (@ler R x y)) *) by case: R x y => ? [? []]. Qed. Lemma ger0_def x : (0 <= x) = (`|x| == x). Proof. (* Goal: @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) x) (@eq_op (NumDomain.eqType R) (@normr R x) x) *) by rewrite ler_def subr0. Qed. Lemma subr_ge0 x y : (0 <= x - y) = (y <= x). Proof. (* Goal: @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@ler R y x) *) by rewrite ger0_def -ler_def. Qed. Lemma oppr_ge0 x : (0 <= - x) = (x <= 0). Proof. (* Goal: @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.opp (NumDomain.zmodType R) x)) (@ler R x (GRing.zero (NumDomain.zmodType R))) *) by rewrite -sub0r subr_ge0. Qed. Lemma ler01 : 0 <= 1 :> R. Proof. (* Goal: is_true (@ler R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (GRing.one (NumDomain.ringType R) : NumDomain.sort R)) *) have n1_nz: `|1| != 0 :> R by apply: contraNneq (@oner_neq0 R) => /normr0_eq0->. (* Goal: is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (GRing.one (NumDomain.ringType R))) *) by rewrite ger0_def -(inj_eq (mulfI n1_nz)) -normrM !mulr1. Qed. Lemma ltr01 : 0 < 1 :> R. Proof. by rewrite ltr_def oner_neq0 ler01. Qed. Proof. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (GRing.one (NumDomain.ringType R) : NumDomain.sort R)) *) by rewrite ltr_def oner_neq0 ler01. Qed. Lemma lerr x : x <= x. Proof. (* Goal: is_true (@ler R x x) *) have n2: `|2%:R| == 2%:R :> R by rewrite -ger0_def ltrW ?addr_gt0 ?ltr01. (* Goal: is_true (@ler R x x) *) rewrite ler_def subrr -(inj_eq (addrI `|0|)) addr0 -mulr2n -mulr_natr. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) (@normr R (GRing.zero (NumDomain.zmodType R))) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (S (S O)))) (@normr R (GRing.zero (NumDomain.zmodType R)))) *) by rewrite -(eqP n2) -normrM mul0r. Qed. Lemma le0r x : (0 <= x) = (x == 0) || (0 < x). Proof. (* Goal: @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) x) (orb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) *) by rewrite ltr_def; case: eqP => // ->; rewrite lerr. Qed. Lemma addr_ge0 x y : 0 <= x -> 0 <= y -> 0 <= x + y. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y)) *) rewrite le0r; case/predU1P=> [-> | x_pos]; rewrite ?add0r // le0r. (* Goal: forall _ : is_true (orb (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R))) (@ltr R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y)) *) by case/predU1P=> [-> | y_pos]; rewrite ltrW ?addr0 ?addr_gt0. Qed. Lemma pmulr_rgt0 x y : 0 < x -> (0 < x * y) = (0 < y). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) (@ltr R (GRing.zero (NumDomain.zmodType R)) y) *) rewrite !ltr_def !ger0_def normrM mulf_eq0 negb_or => /andP[x_neq0 /eqP->]. (* Goal: @eq bool (andb (andb (negb (@eq_op (GRing.IntegralDomain.eqType (NumDomain.idomainType R)) x (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R))))) (negb (@eq_op (GRing.IntegralDomain.eqType (NumDomain.idomainType R)) y (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R)))))) (@eq_op (NumDomain.eqType R) (@GRing.mul (NumDomain.ringType R) x (@normr R y)) (@GRing.mul (NumDomain.ringType R) x y))) (andb (negb (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R)))) (@eq_op (NumDomain.eqType R) (@normr R y) y)) *) by rewrite x_neq0 (inj_eq (mulfI x_neq0)). Qed. Lemma nnegrE x : (x \is nneg) = (0 <= x). Proof. by []. Qed. Proof. (* Goal: @eq bool (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R)))) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) by []. Qed. Fact pos_divr_closed : divr_closed (@pos R). Proof. (* Goal: @GRing.divr_closed (NumDomain.unitRingType R) (@has_quality O (NumDomain.sort R) (@Rpos R)) *) split=> [|x y x_gt0 y_gt0]; rewrite posrE ?ltr01 //. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y))) *) have [Uy|/invr_out->] := boolP (y \is a GRing.unit); last by rewrite pmulr_rgt0. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y))) *) by rewrite -(pmulr_rgt0 _ y_gt0) mulrC divrK. Qed. Canonical pos_mulrPred := MulrPred pos_divr_closed. Canonical pos_divrPred := DivrPred pos_divr_closed. Fact nneg_divr_closed : divr_closed (@nneg R). Proof. (* Goal: @GRing.divr_closed (NumDomain.unitRingType R) (@has_quality O (NumDomain.sort R) (@Rnneg R)) *) split=> [|x y]; rewrite !nnegrE ?ler01 ?le0r // -!posrE. (* Goal: forall (_ : is_true (orb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rpos R)))))) (_ : is_true (orb (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R))) (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rpos R)))))), is_true (orb (@eq_op (NumDomain.eqType R) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (GRing.zero (NumDomain.zmodType R))) (@in_mem (NumDomain.sort R) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rpos R))))) *) case/predU1P=> [-> _ | x_gt0]; first by rewrite mul0r eqxx. (* Goal: forall _ : is_true (orb (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R))) (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rpos R))))), is_true (orb (@eq_op (NumDomain.eqType R) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (GRing.zero (NumDomain.zmodType R))) (@in_mem (NumDomain.sort R) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rpos R))))) *) by case/predU1P=> [-> | y_gt0]; rewrite ?invr0 ?mulr0 ?eqxx // orbC rpred_div. Qed. Canonical nneg_mulrPred := MulrPred nneg_divr_closed. Canonical nneg_divrPred := DivrPred nneg_divr_closed. Fact nneg_addr_closed : addr_closed (@nneg R). Proof. (* Goal: @GRing.addr_closed (NumDomain.zmodType R) (@has_quality O (NumDomain.sort R) (@Rnneg R)) *) by split; [apply: lerr | apply: addr_ge0]. Qed. Canonical nneg_addrPred := AddrPred nneg_addr_closed. Canonical nneg_semiringPred := SemiringPred nneg_divr_closed. Fact real_oppr_closed : oppr_closed (@real R). Proof. (* Goal: @GRing.oppr_closed (NumDomain.zmodType R) (@has_quality O (NumDomain.sort R) (@Rreal R)) *) by move=> x; rewrite /= !realE oppr_ge0 orbC -!oppr_ge0 opprK. Qed. Canonical real_opprPred := OpprPred real_oppr_closed. Fact real_addr_closed : addr_closed (@real R). Proof. (* Goal: @GRing.addr_closed (NumDomain.zmodType R) (@has_quality O (NumDomain.sort R) (@Rreal R)) *) split=> [|x y Rx Ry]; first by rewrite realE lerr. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) without loss{Rx} x_ge0: x y Ry / 0 <= x. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) (* Goal: forall _ : forall (x y : GRing.Zmodule.sort (NumDomain.zmodType R)) (_ : is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) y (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))), is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) case/orP: Rx => [? | x_le0]; first exact. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) (* Goal: forall _ : forall (x y : GRing.Zmodule.sort (NumDomain.zmodType R)) (_ : is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) y (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))), is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite -rpredN opprD; apply; rewrite ?rpredN ?oppr_ge0. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) case/orP: Ry => [y_ge0 | y_le0]; first by rewrite realE -nnegrE rpredD. (* Goal: is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (predPredType (GRing.Zmodule.sort (NumDomain.zmodType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite realE -[y]opprK orbC -oppr_ge0 opprB !subr_ge0 ger_leVge ?oppr_ge0. Qed. Canonical real_addrPred := AddrPred real_addr_closed. Canonical real_zmodPred := ZmodPred real_oppr_closed. Fact real_divr_closed : divr_closed (@real R). Proof. (* Goal: @GRing.divr_closed (NumDomain.unitRingType R) (@has_quality O (NumDomain.sort R) (@Rreal R)) *) split=> [|x y Rx Ry]; first by rewrite realE ler01. (* Goal: is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) without loss{Rx} x_ge0: x / 0 <= x. (* Goal: is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) (* Goal: forall _ : forall (x : GRing.UnitRing.sort (NumDomain.unitRingType R)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) case/orP: Rx => [? | x_le0]; first exact. (* Goal: is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) (* Goal: forall _ : forall (x : GRing.UnitRing.sort (NumDomain.unitRingType R)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite -rpredN -mulNr; apply; rewrite ?oppr_ge0. (* Goal: is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) without loss{Ry} y_ge0: y / 0 <= y; last by rewrite realE -nnegrE rpred_div. (* Goal: forall _ : forall (y : GRing.UnitRing.sort (NumDomain.unitRingType R)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) case/orP: Ry => [? | y_le0]; first exact. (* Goal: forall _ : forall (y : GRing.UnitRing.sort (NumDomain.unitRingType R)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) x (@GRing.inv (NumDomain.unitRingType R) y)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite -rpredN -mulrN -invrN; apply; rewrite ?oppr_ge0. Qed. Canonical real_mulrPred := MulrPred real_divr_closed. Canonical real_smulrPred := SmulrPred real_divr_closed. Canonical real_divrPred := DivrPred real_divr_closed. Canonical real_sdivrPred := SdivrPred real_divr_closed. Canonical real_semiringPred := SemiringPred real_divr_closed. Canonical real_subringPred := SubringPred real_divr_closed. Canonical real_divringPred := DivringPred real_divr_closed. End Domain. Lemma num_real (R : realDomainType) (x : R) : x \is real. Proof. (* Goal: is_true (@in_mem (RealDomain.sort R) x (@mem (NumDomain.sort (RealDomain.numDomainType R)) (predPredType (NumDomain.sort (RealDomain.numDomainType R))) (@has_quality O (NumDomain.sort (RealDomain.numDomainType R)) (@Rreal (RealDomain.numDomainType R))))) *) by case: R x => T []. Qed. Fact archi_bound_subproof (R : archiFieldType) : archimedean_axiom R. Proof. (* Goal: archimedean_axiom (ArchimedeanField.numDomainType R) *) by case: R => ? []. Qed. Fact sqrtr_subproof (x : R) : exists2 y, 0 <= y & if 0 <= x return bool then y ^+ 2 == x else y == 0. Proof. (* Goal: @ex2 (NumDomain.sort (RealClosedField.numDomainType R)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) y)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (if @ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) x then @eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) y (S (S O))) x else @eq_op (NumDomain.eqType (RealClosedField.numDomainType R)) y (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))))) *) case x_ge0: (0 <= x); last by exists 0; rewrite ?lerr. (* Goal: @ex2 (NumDomain.sort (RealClosedField.numDomainType R)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) y)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) y (S (S O))) x)) *) have le0x1: 0 <= x + 1 by rewrite -nnegrE rpredD ?rpred1. (* Goal: @ex2 (NumDomain.sort (RealClosedField.numDomainType R)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) y)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) y (S (S O))) x)) *) have [|y /andP[y_ge0 _]] := @poly_ivt ('X^2 - x%:P) _ _ le0x1. (* Goal: forall _ : is_true (@root (NumDomain.ringType (RealClosedField.numDomainType R)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (RealClosedField.ringType R))) (@GRing.exp (poly_ringType (RealClosedField.ringType R)) (polyX (RealClosedField.ringType R)) (S (S O))) (@GRing.opp (poly_zmodType (RealClosedField.ringType R)) (@polyC (RealClosedField.ringType R) x))) y), @ex2 (NumDomain.sort (RealClosedField.numDomainType R)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) y)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) y (S (S O))) x)) *) (* Goal: is_true (andb (@ler (RealClosedField.numDomainType R) (@horner (NumDomain.ringType (RealClosedField.numDomainType R)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (RealClosedField.ringType R))) (@GRing.exp (poly_ringType (RealClosedField.ringType R)) (polyX (RealClosedField.ringType R)) (S (S O))) (@GRing.opp (poly_zmodType (RealClosedField.ringType R)) (@polyC (RealClosedField.ringType R) x))) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) (@horner (NumDomain.ringType (RealClosedField.numDomainType R)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (RealClosedField.ringType R))) (@GRing.exp (poly_ringType (RealClosedField.ringType R)) (polyX (RealClosedField.ringType R)) (S (S O))) (@GRing.opp (poly_zmodType (RealClosedField.ringType R)) (@polyC (RealClosedField.ringType R) x))) (@GRing.add (RealClosedField.zmodType R) x (GRing.one (RealClosedField.ringType R)))))) *) rewrite !hornerE -subr_ge0 add0r opprK x_ge0 -expr2 sqrrD mulr1. (* Goal: forall _ : is_true (@root (NumDomain.ringType (RealClosedField.numDomainType R)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (RealClosedField.ringType R))) (@GRing.exp (poly_ringType (RealClosedField.ringType R)) (polyX (RealClosedField.ringType R)) (S (S O))) (@GRing.opp (poly_zmodType (RealClosedField.ringType R)) (@polyC (RealClosedField.ringType R) x))) y), @ex2 (NumDomain.sort (RealClosedField.numDomainType R)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) y)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) y (S (S O))) x)) *) (* Goal: is_true (andb true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.add (GRing.Ring.zmodType (GRing.ComRing.ringType (NumDomain.comRingType (RealClosedField.numDomainType R)))) (@GRing.add (GRing.Ring.zmodType (GRing.ComRing.ringType (NumDomain.comRingType (RealClosedField.numDomainType R)))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType (RealClosedField.numDomainType R))) x (S (S O))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComRing.ringType (NumDomain.comRingType (RealClosedField.numDomainType R)))) x (S (S O)))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType (RealClosedField.numDomainType R))) (GRing.one (RealClosedField.ringType R)) (S (S O)))) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealClosedField.numDomainType R))) x)))) *) by rewrite addrAC !addrA addrK -nnegrE !rpredD ?rpredX ?rpred1. (* Goal: forall _ : is_true (@root (NumDomain.ringType (RealClosedField.numDomainType R)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (RealClosedField.ringType R))) (@GRing.exp (poly_ringType (RealClosedField.ringType R)) (polyX (RealClosedField.ringType R)) (S (S O))) (@GRing.opp (poly_zmodType (RealClosedField.ringType R)) (@polyC (RealClosedField.ringType R) x))) y), @ex2 (NumDomain.sort (RealClosedField.numDomainType R)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) y)) (fun y : NumDomain.sort (RealClosedField.numDomainType R) => is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) y (S (S O))) x)) *) by rewrite rootE !hornerE subr_eq0; exists y. Qed. End RealClosed. End Internals. Module PredInstances. Canonical pos_mulrPred. Canonical pos_divrPred. Canonical nneg_addrPred. Canonical nneg_mulrPred. Canonical nneg_divrPred. Canonical nneg_semiringPred. Canonical real_addrPred. Canonical real_opprPred. Canonical real_zmodPred. Canonical real_mulrPred. Canonical real_smulrPred. Canonical real_divrPred. Canonical real_sdivrPred. Canonical real_semiringPred. Canonical real_subringPred. Canonical real_divringPred. End PredInstances. Module Import ExtraDef. Definition archi_bound {R} x := sval (sigW (@archi_bound_subproof R x)). Definition sqrtr {R} x := s2val (sig2W (@sqrtr_subproof R x)). End ExtraDef. Notation bound := archi_bound. Notation sqrt := sqrtr. Module Theory. Section NumIntegralDomainTheory. Variable R : numDomainType. Implicit Types x y z t : R. Definition ler_norm_add x y : `|x + y| <= `|x| + `|y| := ler_norm_add x y. Definition addr_gt0 x y : 0 < x -> 0 < y -> 0 < x + y := @addr_gt0 R x y. Definition normr0_eq0 x : `|x| = 0 -> x = 0 := @normr0_eq0 R x. Definition ger_leVge x y : 0 <= x -> 0 <= y -> (x <= y) || (y <= x) := @ger_leVge R x y. Definition normrM : {morph normr : x y / x * y : R} := @normrM R. Definition ler_def x y : (x <= y) = (`|y - x| == y - x) := @ler_def R x y. Definition ltr_def x y : (x < y) = (y != x) && (x <= y) := @ltr_def R x y. Lemma gtrE x y : gt x y = (y < x). Proof. by []. Qed. Proof. (* Goal: @eq bool (@rel_of_simpl_rel (NumDomain.sort R) (@gtr R) x y) (@ltr R y x) *) by []. Qed. Lemma negrE x : (x \is neg) = (x < 0). Proof. by []. Qed. Proof. (* Goal: @eq bool (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rneg R)))) (@ltr R x (GRing.zero (NumDomain.zmodType R))) *) by []. Qed. Lemma realE x : (x \is real) = (0 <= x) || (x <= 0). Proof. by []. Qed. Proof. (* Goal: @eq bool (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (orb (@ler R (GRing.zero (NumDomain.zmodType R)) x) (@ler R x (GRing.zero (NumDomain.zmodType R)))) *) by []. Qed. Lemma ltrr x : x < x = false. Proof. by rewrite ltr_def eqxx. Qed. Proof. (* Goal: @eq bool (@ltr R x x) false *) by rewrite ltr_def eqxx. Qed. Hint Resolve lerr ltrr ltrW : core. Lemma ltr_neqAle x y : (x < y) = (x != y) && (x <= y). Proof. (* Goal: @eq bool (@ltr R x y) (andb (negb (@eq_op (NumDomain.eqType R) x y)) (@ler R x y)) *) by rewrite ltr_def eq_sym. Qed. Lemma ler_eqVlt x y : (x <= y) = (x == y) || (x < y). Proof. (* Goal: @eq bool (@ler R x y) (orb (@eq_op (NumDomain.eqType R) x y) (@ltr R x y)) *) by rewrite ltr_neqAle; case: eqP => // ->; rewrite lerr. Qed. Lemma lt0r x : (0 < x) = (x != 0) && (0 <= x). Proof. by rewrite ltr_def. Qed. Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) x) (andb (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) (@ler R (GRing.zero (NumDomain.zmodType R)) x)) *) by rewrite ltr_def. Qed. Lemma lt0r_neq0 (x : R) : 0 < x -> x != 0. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) *) by rewrite lt0r; case/andP. Qed. Lemma ltr0_neq0 (x : R) : x < 0 -> x != 0. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) *) by rewrite ltr_neqAle; case/andP. Qed. Lemma gtr_eqF x y : y < x -> x == y = false. Proof. (* Goal: forall _ : is_true (@ltr R y x), @eq bool (@eq_op (NumDomain.eqType R) x y) false *) by rewrite ltr_def; case/andP; move/negPf=> ->. Qed. Lemma ltr_eqF x y : x < y -> x == y = false. Proof. (* Goal: forall _ : is_true (@ltr R x y), @eq bool (@eq_op (NumDomain.eqType R) x y) false *) by move=> hyx; rewrite eq_sym gtr_eqF. Qed. Lemma pmulr_rgt0 x y : 0 < x -> (0 < x * y) = (0 < y). Lemma pmulr_rge0 x y : 0 < x -> (0 <= x * y) = (0 <= y). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) (@ler R (GRing.zero (NumDomain.zmodType R)) y) *) by rewrite !le0r mulf_eq0; case: eqP => // [-> /negPf[] | _ /pmulr_rgt0->]. Qed. Lemma ltr01 : 0 < 1 :> R. Proof. exact: ltr01. Qed. Hint Resolve ler01 ltr01 ler0n : core. Lemma ltr0Sn n : 0 < n.+1%:R :> R. Proof. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (S n) : NumDomain.sort R)) *) by elim: n => // n; apply: addr_gt0. Qed. Lemma ltr0n n : (0 < n%:R :> R) = (0 < n)%N. Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R)) (leq (S O) n) *) by case: n => //= n; apply: ltr0Sn. Qed. Hint Resolve ltr0Sn : core. Lemma pnatr_eq0 n : (n%:R == 0 :> R) = (n == 0)%N. Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R)) (@eq_op nat_eqType n O) *) by case: n => [|n]; rewrite ?mulr0n ?eqxx // gtr_eqF. Qed. Lemma char_num : [char R] =i pred0. Proof. (* Goal: @eq_mem nat (@mem nat (simplPredType nat) (@GRing.char (NumDomain.ringType R) (Phant (NumDomain.sort R)))) (@mem nat (simplPredType nat) (@pred0 nat)) *) by case=> // p /=; rewrite !inE pnatr_eq0 andbF. Qed. Lemma normr_idP {x} : reflect (`|x| = x) (0 <= x). Proof. (* Goal: Bool.reflect (@eq (NumDomain.sort R) (@normr R x) x) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) by rewrite ger0_def; apply: eqP. Qed. Lemma ger0_norm x : 0 <= x -> `|x| = x. Proof. exact: normr_idP. Qed. Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), @eq (NumDomain.sort R) (@normr R x) x *) exact: normr_idP. Qed. Lemma normr1 : `|1| = 1 :> R. Proof. exact: ger0_norm. Qed. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (GRing.one (NumDomain.ringType R))) (GRing.one (NumDomain.ringType R)) *) exact: ger0_norm. Qed. Lemma normrMn x n : `|x *+ n| = `|x| *+ n. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@GRing.natmul (NumDomain.zmodType R) x n)) (@GRing.natmul (NumDomain.zmodType R) (@normr R x) n) *) by rewrite -mulr_natl normrM normr_nat mulr_natl. Qed. Lemma normr_prod I r (P : pred I) (F : I -> R) : `|\prod_(i <- r | P i) F i| = \prod_(i <- r | P i) `|F i|. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) I i (@GRing.mul (NumDomain.ringType R)) (P i) (F i)))) (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) I i (@GRing.mul (NumDomain.ringType R)) (P i) (@normr R (F i)))) *) exact: (big_morph norm normrM normr1). Qed. Lemma normrX n x : `|x ^+ n| = `|x| ^+ n. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@GRing.exp (NumDomain.ringType R) x n)) (@GRing.exp (NumDomain.ringType R) (@normr R x) n) *) by rewrite -(card_ord n) -!prodr_const normr_prod. Qed. Lemma normr_unit : {homo (@norm R) : x / x \is a GRing.unit}. Proof. (* Goal: @homomorphism_1 (NumDomain.sort R) (NumDomain.sort R) (@normr R) (fun x : NumDomain.sort R => is_true (@in_mem (NumDomain.sort R) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R)))))) (fun x : NumDomain.sort R => is_true (@in_mem (NumDomain.sort R) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R)))))) *) move=> x /= /unitrP [y [yx xy]]; apply/unitrP; exists `|y|. (* Goal: and (@eq (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) (@normr R y) (@normr R x)) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType R)))) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType (NumDomain.unitRingType R))) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType R)) (@normr R x) (@normr R y)) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType R)))) *) by rewrite -!normrM xy yx normr1. Qed. Lemma normrV : {in GRing.unit, {morph (@normr R) : x / x ^-1}}. Lemma normr0P {x} : reflect (`|x| = 0) (x == 0). Proof. (* Goal: Bool.reflect (@eq (NumDomain.sort R) (@normr R x) (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) *) by apply: (iffP eqP)=> [->|/normr0_eq0 //]; apply: normr0. Qed. Definition normr_eq0 x := sameP (`|x| =P 0) normr0P. Lemma normrN1 : `|-1| = 1 :> R. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)))) (GRing.one (NumDomain.ringType R)) *) have: `|-1| ^+ 2 == 1 :> R by rewrite -normrX -signr_odd normr1. (* Goal: forall _ : is_true (@eq_op (NumDomain.eqType R) (@GRing.exp (NumDomain.ringType R) (@normr R (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)))) (S (S O))) (GRing.one (NumDomain.ringType R))), @eq (NumDomain.sort R) (@normr R (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)))) (GRing.one (NumDomain.ringType R)) *) rewrite sqrf_eq1 => /orP[/eqP //|]; rewrite -ger0_def le0r oppr_eq0 oner_eq0. (* Goal: forall _ : is_true (orb false (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))))), @eq (NumDomain.sort R) (@normr R (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)))) (GRing.one (NumDomain.ringType R)) *) by move/(addr_gt0 ltr01); rewrite subrr ltrr. Qed. Lemma normrN x : `|- x| = `|x|. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@GRing.opp (NumDomain.zmodType R) x)) (@normr R x) *) by rewrite -mulN1r normrM normrN1 mul1r. Qed. Lemma distrC x y : `|x - y| = `|y - x|. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) *) by rewrite -opprB normrN. Qed. Lemma ler0_def x : (x <= 0) = (`|x| == - x). Proof. (* Goal: @eq bool (@ler R x (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) (@normr R x) (@GRing.opp (NumDomain.zmodType R) x)) *) by rewrite ler_def sub0r normrN. Qed. Lemma normr_id x : `|`|x| | = `|x|. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@normr R x)) (@normr R x) *) have nz2: 2%:R != 0 :> R by rewrite pnatr_eq0. (* Goal: @eq (NumDomain.sort R) (@normr R (@normr R x)) (@normr R x) *) apply: (mulfI nz2); rewrite -{1}normr_nat -normrM mulr_natl mulr2n ger0_norm //. (* Goal: is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType R)) (@normr R x) (@normr R x))) *) by rewrite -{2}normrN -normr0 -(subrr x) ler_norm_add. Qed. Hint Resolve normr_ge0 : core. Lemma ler0_norm x : x <= 0 -> `|x| = - x. Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), @eq (NumDomain.sort R) (@normr R x) (@GRing.opp (NumDomain.zmodType R) x) *) by move=> x_le0; rewrite -[r in _ = r]ger0_norm ?normrN ?oppr_ge0. Qed. Definition gtr0_norm x (hx : 0 < x) := ger0_norm (ltrW hx). Definition ltr0_norm x (hx : x < 0) := ler0_norm (ltrW hx). Lemma subr_gt0 x y : (0 < y - x) = (x < y). Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) (@ltr R x y) *) by rewrite !ltr_def subr_eq0 subr_ge0. Qed. Lemma subr_le0 x y : (y - x <= 0) = (y <= x). Proof. (* Goal: @eq bool (@ler R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x)) (GRing.zero (NumDomain.zmodType R))) (@ler R y x) *) by rewrite -subr_ge0 opprB add0r subr_ge0. Qed. Lemma subr_lt0 x y : (y - x < 0) = (y < x). Proof. (* Goal: @eq bool (@ltr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x)) (GRing.zero (NumDomain.zmodType R))) (@ltr R y x) *) by rewrite -subr_gt0 opprB add0r subr_gt0. Qed. Definition subr_lte0 := (subr_le0, subr_lt0). Definition subr_gte0 := (subr_ge0, subr_gt0). Definition subr_cp0 := (subr_lte0, subr_gte0). Lemma ler_asym : antisymmetric (<=%R : rel R). Proof. (* Goal: @antisymmetric (NumDomain.sort R) (@ler R : rel (NumDomain.sort R)) *) move=> x y; rewrite !ler_def distrC -opprB -addr_eq0 => /andP[/eqP->]. (* Goal: forall _ : is_true (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) (GRing.zero (NumDomain.zmodType R))), @eq (NumDomain.sort R) x y *) by rewrite -mulr2n -mulr_natl mulf_eq0 subr_eq0 pnatr_eq0 => /eqP. Qed. Lemma eqr_le x y : (x == y) = (x <= y <= x). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType R) x y) (andb (@ler R x y) (@ler R y x)) *) by apply/eqP/idP=> [->|/ler_asym]; rewrite ?lerr. Qed. Lemma ltr_trans : transitive (@ltr R). Proof. (* Goal: @transitive (NumDomain.sort R) (@ltr R) *) move=> y x z le_xy le_yz. (* Goal: is_true (@ltr R x z) *) by rewrite -subr_gt0 -(subrK y z) -addrA addr_gt0 ?subr_gt0. Qed. Lemma ler_lt_trans y x z : x <= y -> y < z -> x < z. Proof. (* Goal: forall (_ : is_true (@ler R x y)) (_ : is_true (@ltr R y z)), is_true (@ltr R x z) *) by rewrite !ler_eqVlt => /orP[/eqP -> //|/ltr_trans]; apply. Qed. Lemma ltr_le_trans y x z : x < y -> y <= z -> x < z. Proof. (* Goal: forall (_ : is_true (@ltr R x y)) (_ : is_true (@ler R y z)), is_true (@ltr R x z) *) by rewrite !ler_eqVlt => lxy /orP[/eqP <- //|/(ltr_trans lxy)]. Qed. Lemma ler_trans : transitive (@ler R). Proof. (* Goal: @transitive (NumDomain.sort R) (@ler R) *) move=> y x z; rewrite !ler_eqVlt => /orP [/eqP -> //|lxy]. (* Goal: forall _ : is_true (orb (@eq_op (NumDomain.eqType R) y z) (@ltr R y z)), is_true (orb (@eq_op (NumDomain.eqType R) x z) (@ltr R x z)) *) by move=> /orP [/eqP <-|/(ltr_trans lxy) ->]; rewrite ?lxy orbT. Qed. Definition lter01 := (ler01, ltr01). Definition lterr := (lerr, ltrr). Lemma addr_ge0 x y : 0 <= x -> 0 <= y -> 0 <= x + y. Lemma lerifP x y C : reflect (x <= y ?= iff C) (if C then x == y else x < y). Lemma ltr_asym x y : x < y < x = false. Proof. (* Goal: @eq bool (andb (@ltr R x y) (@ltr R y x)) false *) by apply/negP=> /andP [/ltr_trans hyx /hyx]; rewrite ltrr. Qed. Lemma ler_anti : antisymmetric (@ler R). Proof. (* Goal: @antisymmetric (NumDomain.sort R) (@ler R) *) by move=> x y; rewrite -eqr_le=> /eqP. Qed. Lemma ltr_le_asym x y : x < y <= x = false. Proof. (* Goal: @eq bool (andb (@ltr R x y) (@ler R y x)) false *) by rewrite ltr_neqAle -andbA -eqr_le eq_sym; case: (_ == _). Qed. Lemma ler_lt_asym x y : x <= y < x = false. Proof. (* Goal: @eq bool (andb (@ler R x y) (@ltr R y x)) false *) by rewrite andbC ltr_le_asym. Qed. Definition lter_anti := (=^~ eqr_le, ltr_asym, ltr_le_asym, ler_lt_asym). Lemma ltr_geF x y : x < y -> (y <= x = false). Proof. (* Goal: forall _ : is_true (@ltr R x y), @eq bool (@ler R y x) false *) by move=> xy; apply: contraTF isT=> /(ltr_le_trans xy); rewrite ltrr. Qed. Lemma ler_gtF x y : x <= y -> (y < x = false). Proof. (* Goal: forall _ : is_true (@ler R x y), @eq bool (@ltr R y x) false *) by apply: contraTF=> /ltr_geF->. Qed. Definition ltr_gtF x y hxy := ler_gtF (@ltrW x y hxy). Lemma normr_le0 x : (`|x| <= 0) = (x == 0). Proof. (* Goal: @eq bool (@ler R (@normr R x) (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) *) by rewrite -normr_eq0 eqr_le normr_ge0 andbT. Qed. Lemma normr_lt0 x : `|x| < 0 = false. Proof. (* Goal: @eq bool (@ltr R (@normr R x) (GRing.zero (NumDomain.zmodType R))) false *) by rewrite ltr_neqAle normr_le0 normr_eq0 andNb. Qed. Lemma normr_gt0 x : (`|x| > 0) = (x != 0). Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@normr R x)) (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) *) by rewrite ltr_def normr_eq0 normr_ge0 andbT. Qed. Definition normrE x := (normr_id, normr0, normr1, normrN1, normr_ge0, normr_eq0, normr_lt0, normr_le0, normr_gt0, normrN). End NumIntegralDomainTheory. Arguments ler01 {R}. Arguments ltr01 {R}. Arguments normr_idP {R x}. Arguments normr0P {R x}. Arguments lerifP {R x y C}. Hint Resolve @ler01 @ltr01 lerr ltrr ltrW ltr_eqF ltr0Sn ler0n normr_ge0 : core. Section NumIntegralDomainMonotonyTheory. Variables R R' : numDomainType. Implicit Types m n p : nat. Implicit Types x y z : R. Implicit Types u v w : R'. Let leqnn := leqnn. Let ltnE := ltn_neqAle. Let ltrE := @ltr_neqAle R. Let ltr'E := @ltr_neqAle R'. Let gtnE (m n : nat) : (m > n)%N = (m != n) && (m >= n)%N. Proof. (* Goal: @eq bool (leq (S n) m) (andb (negb (@eq_op nat_eqType m n)) (leq n m)) *) by rewrite ltn_neqAle eq_sym. Qed. Let gtrE (x y : R) : (x > y) = (x != y) && (x >= y). Let gtr'E (x y : R') : (x > y) = (x != y) && (x >= y). Proof. (* Goal: @eq bool (@ltr R' y x) (andb (negb (@eq_op (NumDomain.eqType R') x y)) (@ler R' y x)) *) by rewrite ltr_neqAle eq_sym. Qed. Let leq_anti : antisymmetric leq. Proof. (* Goal: @antisymmetric nat leq *) by move=> m n; rewrite -eqn_leq => /eqP. Qed. Let geq_anti : antisymmetric geq. Proof. (* Goal: @antisymmetric nat (@rel_of_simpl_rel nat geq) *) by move=> m n; rewrite -eqn_leq => /eqP. Qed. Let ler_antiR := @ler_anti R. Let ler_antiR' := @ler_anti R'. Let ger_antiR : antisymmetric (>=%R : rel R). Proof. (* Goal: @antisymmetric (NumDomain.sort R) (@rel_of_simpl_rel (NumDomain.sort R) (@ger R) : rel (NumDomain.sort R)) *) by move=> ??; rewrite andbC; apply: ler_anti. Qed. Let ger_antiR' : antisymmetric (>=%R : rel R'). Proof. (* Goal: @antisymmetric (NumDomain.sort R') (@rel_of_simpl_rel (NumDomain.sort R') (@ger R') : rel (NumDomain.sort R')) *) by move=> ??; rewrite andbC; apply: ler_anti. Qed. Let leq_total := leq_total. Let geq_total : total geq. Proof. (* Goal: @total nat (@rel_of_simpl_rel nat geq) *) by move=> m n; apply: leq_total. Qed. Section AcrossTypes. Variable D D' : pred R. Variable (f : R -> R'). Lemma ltrW_homo : {homo f : x y / x < y} -> {homo f : x y / x <= y}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)), @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y)) *) exact: homoW. Qed. Lemma ltrW_nhomo : {homo f : x y /~ x < y} -> {homo f : x y /~ x <= y}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)), @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y)) *) exact: homoW. Qed. Lemma inj_homo_ltr : injective f -> {homo f : x y / x <= y} -> {homo f : x y / x < y}. Proof. (* Goal: forall (_ : @injective (NumDomain.sort R') (NumDomain.sort R) f) (_ : @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y))), @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)) *) exact: inj_homo. Qed. Lemma inj_nhomo_ltr : injective f -> {homo f : x y /~ x <= y} -> {homo f : x y /~ x < y}. Proof. (* Goal: forall (_ : @injective (NumDomain.sort R') (NumDomain.sort R) f) (_ : @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y))), @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)) *) exact: inj_homo. Qed. Lemma incr_inj : {mono f : x y / x <= y} -> injective f. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y), @injective (NumDomain.sort R') (NumDomain.sort R) f *) exact: mono_inj. Qed. Lemma decr_inj : {mono f : x y /~ x <= y} -> injective f. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y), @injective (NumDomain.sort R') (NumDomain.sort R) f *) exact: mono_inj. Qed. Lemma lerW_mono : {mono f : x y / x <= y} -> {mono f : x y / x < y}. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y), @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ltr R x y) (fun x y : NumDomain.sort R' => @ltr R' x y) *) exact: anti_mono. Qed. Lemma lerW_nmono : {mono f : x y /~ x <= y} -> {mono f : x y /~ x < y}. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y), @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ltr R x y) (fun x y : NumDomain.sort R' => @ltr R' x y) *) exact: anti_mono. Qed. Lemma ltrW_homo_in : {in D & D', {homo f : x y / x < y}} -> {in D & D', {homo f : x y / x <= y}}. Proof. (* Goal: forall _ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun x0 y0 : NumDomain.sort R => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun x0 y0 : NumDomain.sort R => is_true (@ler R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ler R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y)))) *) exact: homoW_in. Qed. Lemma ltrW_nhomo_in : {in D & D', {homo f : x y /~ x < y}} -> {in D & D', {homo f : x y /~ x <= y}}. Proof. (* Goal: forall _ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun y0 x0 : NumDomain.sort R => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun y0 x0 : NumDomain.sort R => is_true (@ler R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ler R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y)))) *) exact: homoW_in. Qed. Lemma inj_homo_ltr_in : {in D & D', injective f} -> {in D & D', {homo f : x y / x <= y}} -> {in D & D', {homo f : x y / x < y}}. Proof. (* Goal: forall (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x1 x2 : NumDomain.sort R => forall _ : @eq (NumDomain.sort R') (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective (NumDomain.sort R') (NumDomain.sort R) f))) (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun x0 y0 : NumDomain.sort R => is_true (@ler R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ler R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y))))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun x0 y0 : NumDomain.sort R => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))) *) exact: inj_homo_in. Qed. Lemma inj_nhomo_ltr_in : {in D & D', injective f} -> {in D & D', {homo f : x y /~ x <= y}} -> {in D & D', {homo f : x y /~ x < y}}. Proof. (* Goal: forall (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x1 x2 : NumDomain.sort R => forall _ : @eq (NumDomain.sort R') (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective (NumDomain.sort R') (NumDomain.sort R) f))) (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun y0 x0 : NumDomain.sort R => is_true (@ler R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ler R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ler R x y)) (fun x y : NumDomain.sort R' => is_true (@ler R' x y))))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun y0 x0 : NumDomain.sort R => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))) *) exact: inj_homo_in. Qed. Lemma incr_inj_in : {in D &, {mono f : x y / x <= y}} -> {in D &, injective f}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x1 x2 : NumDomain.sort R => forall _ : @eq (NumDomain.sort R') (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective (NumDomain.sort R') (NumDomain.sort R) f)) *) exact: mono_inj_in. Qed. Lemma decr_inj_in : {in D &, {mono f : x y /~ x <= y}} -> {in D &, injective f}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun y0 x0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x1 x2 : NumDomain.sort R => forall _ : @eq (NumDomain.sort R') (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective (NumDomain.sort R') (NumDomain.sort R) f)) *) exact: mono_inj_in. Qed. Lemma lerW_mono_in : {in D &, {mono f : x y / x <= y}} -> {in D &, {mono f : x y / x < y}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ltr R' x0 y0) (f x) (f y)) ((fun x0 y0 : NumDomain.sort R => @ltr R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ltr R x y) (fun x y : NumDomain.sort R' => @ltr R' x y))) *) exact: anti_mono_in. Qed. Lemma lerW_nmono_in : {in D &, {mono f : x y /~ x <= y}} -> {in D &, {mono f : x y /~ x < y}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun y0 x0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ltr R' x0 y0) (f x) (f y)) ((fun y0 x0 : NumDomain.sort R => @ltr R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ltr R x y) (fun x y : NumDomain.sort R' => @ltr R' x y))) *) exact: anti_mono_in. Qed. End AcrossTypes. Section NatToR. Variable D D' : pred nat. Variable (f : nat -> R). Lemma ltnrW_homo : {homo f : m n / (m < n)%N >-> m < n} -> {homo f : m n / (m <= n)%N >-> m <= n}. Proof. (* Goal: forall _ : @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S m) n)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)), @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq m n)) (fun m n : NumDomain.sort R => is_true (@ler R m n)) *) exact: homoW. Qed. Lemma ltnrW_nhomo : {homo f : m n / (n < m)%N >-> m < n} -> {homo f : m n / (n <= m)%N >-> m <= n}. Proof. (* Goal: forall _ : @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S n) m)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)), @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq n m)) (fun m n : NumDomain.sort R => is_true (@ler R m n)) *) exact: homoW. Qed. Lemma inj_homo_ltnr : injective f -> {homo f : m n / (m <= n)%N >-> m <= n} -> {homo f : m n / (m < n)%N >-> m < n}. Proof. (* Goal: forall (_ : @injective (NumDomain.sort R) nat f) (_ : @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq m n)) (fun m n : NumDomain.sort R => is_true (@ler R m n))), @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S m) n)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)) *) exact: inj_homo. Qed. Lemma inj_nhomo_ltnr : injective f -> {homo f : m n / (n <= m)%N >-> m <= n} -> {homo f : m n / (n < m)%N >-> m < n}. Proof. (* Goal: forall (_ : @injective (NumDomain.sort R) nat f) (_ : @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq n m)) (fun m n : NumDomain.sort R => is_true (@ler R m n))), @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S n) m)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)) *) exact: inj_homo. Qed. Lemma incnr_inj : {mono f : m n / (m <= n)%N >-> m <= n} -> injective f. Proof. (* Goal: forall _ : @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq m n) (fun m n : NumDomain.sort R => @ler R m n), @injective (NumDomain.sort R) nat f *) exact: mono_inj. Qed. Lemma decnr_inj_inj : {mono f : m n / (n <= m)%N >-> m <= n} -> injective f. Proof. (* Goal: forall _ : @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq n m) (fun m n : NumDomain.sort R => @ler R m n), @injective (NumDomain.sort R) nat f *) exact: mono_inj. Qed. Lemma lenrW_mono : {mono f : m n / (m <= n)%N >-> m <= n} -> {mono f : m n / (m < n)%N >-> m < n}. Proof. (* Goal: forall _ : @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq m n) (fun m n : NumDomain.sort R => @ler R m n), @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq (S m) n) (fun m n : NumDomain.sort R => @ltr R m n) *) exact: anti_mono. Qed. Lemma lenrW_nmono : {mono f : m n / (n <= m)%N >-> m <= n} -> {mono f : m n / (n < m)%N >-> m < n}. Proof. (* Goal: forall _ : @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq n m) (fun m n : NumDomain.sort R => @ler R m n), @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq (S n) m) (fun m n : NumDomain.sort R => @ltr R m n) *) exact: anti_mono. Qed. Lemma lenr_mono : {homo f : m n / (m < n)%N >-> m < n} -> {mono f : m n / (m <= n)%N >-> m <= n}. Proof. (* Goal: forall _ : @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S m) n)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)), @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq m n) (fun m n : NumDomain.sort R => @ler R m n) *) exact: total_homo_mono. Qed. Lemma lenr_nmono : {homo f : m n / (n < m)%N >-> m < n} -> {mono f : m n / (n <= m)%N >-> m <= n}. Proof. (* Goal: forall _ : @homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S n) m)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)), @monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq n m) (fun m n : NumDomain.sort R => @ler R m n) *) exact: total_homo_mono. Qed. Lemma ltnrW_homo_in : {in D & D', {homo f : m n / (m < n)%N >-> m < n}} -> {in D & D', {homo f : m n / (m <= n)%N >-> m <= n}}. Proof. (* Goal: forall _ : @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq (S m) n)) x y, (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S m) n)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)))), @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq m n)) x y, (fun m n : NumDomain.sort R => is_true (@ler R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq m n)) (fun m n : NumDomain.sort R => is_true (@ler R m n)))) *) exact: homoW_in. Qed. Lemma ltnrW_nhomo_in : {in D & D', {homo f : m n / (n < m)%N >-> m < n}} -> {in D & D', {homo f : m n / (n <= m)%N >-> m <= n}}. Proof. (* Goal: forall _ : @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq (S n) m)) x y, (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S n) m)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)))), @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq n m)) x y, (fun m n : NumDomain.sort R => is_true (@ler R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq n m)) (fun m n : NumDomain.sort R => is_true (@ler R m n)))) *) exact: homoW_in. Qed. Lemma inj_homo_ltnr_in : {in D & D', injective f} -> {in D & D', {homo f : m n / (m <= n)%N >-> m <= n}} -> {in D & D', {homo f : m n / (m < n)%N >-> m < n}}. Proof. (* Goal: forall (_ : @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x1 x2 : nat => forall _ : @eq (NumDomain.sort R) (f x1) (f x2), @eq nat x1 x2) (inPhantom (@injective (NumDomain.sort R) nat f))) (_ : @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq m n)) x y, (fun m n : NumDomain.sort R => is_true (@ler R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq m n)) (fun m n : NumDomain.sort R => is_true (@ler R m n))))), @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq (S m) n)) x y, (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S m) n)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)))) *) exact: inj_homo_in. Qed. Lemma inj_nhomo_ltnr_in : {in D & D', injective f} -> {in D & D', {homo f : m n / (n <= m)%N >-> m <= n}} -> {in D & D', {homo f : m n / (n < m)%N >-> m < n}}. Proof. (* Goal: forall (_ : @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x1 x2 : nat => forall _ : @eq (NumDomain.sort R) (f x1) (f x2), @eq nat x1 x2) (inPhantom (@injective (NumDomain.sort R) nat f))) (_ : @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq n m)) x y, (fun m n : NumDomain.sort R => is_true (@ler R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq n m)) (fun m n : NumDomain.sort R => is_true (@ler R m n))))), @prop_in11 nat nat (@mem nat (predPredType nat) D) (@mem nat (predPredType nat) D') (fun x y : nat => forall _ : (fun m n : nat => is_true (leq (S n) m)) x y, (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S n) m)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)))) *) exact: inj_homo_in. Qed. Lemma incnr_inj_in : {in D &, {mono f : m n / (m <= n)%N >-> m <= n}} -> {in D &, injective f}. Proof. (* Goal: forall _ : @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ler R m n) (f x) (f y)) ((fun m n : nat => leq m n) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq m n) (fun m n : NumDomain.sort R => @ler R m n))), @prop_in2 nat (@mem nat (predPredType nat) D) (fun x1 x2 : nat => forall _ : @eq (NumDomain.sort R) (f x1) (f x2), @eq nat x1 x2) (inPhantom (@injective (NumDomain.sort R) nat f)) *) exact: mono_inj_in. Qed. Lemma decnr_inj_inj_in : {in D &, {mono f : m n / (n <= m)%N >-> m <= n}} -> {in D &, injective f}. Proof. (* Goal: forall _ : @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ler R m n) (f x) (f y)) ((fun m n : nat => leq n m) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq n m) (fun m n : NumDomain.sort R => @ler R m n))), @prop_in2 nat (@mem nat (predPredType nat) D) (fun x1 x2 : nat => forall _ : @eq (NumDomain.sort R) (f x1) (f x2), @eq nat x1 x2) (inPhantom (@injective (NumDomain.sort R) nat f)) *) exact: mono_inj_in. Qed. Lemma lenrW_mono_in : {in D &, {mono f : m n / (m <= n)%N >-> m <= n}} -> {in D &, {mono f : m n / (m < n)%N >-> m < n}}. Proof. (* Goal: forall _ : @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ler R m n) (f x) (f y)) ((fun m n : nat => leq m n) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq m n) (fun m n : NumDomain.sort R => @ler R m n))), @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ltr R m n) (f x) (f y)) ((fun m n : nat => leq (S m) n) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq (S m) n) (fun m n : NumDomain.sort R => @ltr R m n))) *) exact: anti_mono_in. Qed. Lemma lenrW_nmono_in : {in D &, {mono f : m n / (n <= m)%N >-> m <= n}} -> {in D &, {mono f : m n / (n < m)%N >-> m < n}}. Proof. (* Goal: forall _ : @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ler R m n) (f x) (f y)) ((fun m n : nat => leq n m) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq n m) (fun m n : NumDomain.sort R => @ler R m n))), @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ltr R m n) (f x) (f y)) ((fun m n : nat => leq (S n) m) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq (S n) m) (fun m n : NumDomain.sort R => @ltr R m n))) *) exact: anti_mono_in. Qed. Lemma lenr_mono_in : {in D &, {homo f : m n / (m < n)%N >-> m < n}} -> {in D &, {mono f : m n / (m <= n)%N >-> m <= n}}. Proof. (* Goal: forall _ : @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => forall _ : (fun m n : nat => is_true (leq (S m) n)) x y, (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S m) n)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)))), @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ler R m n) (f x) (f y)) ((fun m n : nat => leq m n) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq m n) (fun m n : NumDomain.sort R => @ler R m n))) *) exact: total_homo_mono_in. Qed. Lemma lenr_nmono_in : {in D &, {homo f : m n / (n < m)%N >-> m < n}} -> {in D &, {mono f : m n / (n <= m)%N >-> m <= n}}. Proof. (* Goal: forall _ : @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => forall _ : (fun m n : nat => is_true (leq (S n) m)) x y, (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (f x) (f y)) (inPhantom (@homomorphism_2 nat (NumDomain.sort R) f (fun m n : nat => is_true (leq (S n) m)) (fun m n : NumDomain.sort R => is_true (@ltr R m n)))), @prop_in2 nat (@mem nat (predPredType nat) D) (fun x y : nat => @eq bool ((fun m n : NumDomain.sort R => @ler R m n) (f x) (f y)) ((fun m n : nat => leq n m) x y)) (inPhantom (@monomorphism_2 nat (NumDomain.sort R) bool f (fun m n : nat => leq n m) (fun m n : NumDomain.sort R => @ler R m n))) *) exact: total_homo_mono_in. Qed. End NatToR. Section RToNat. Variable D D' : pred R. Variable (f : R -> nat). Lemma ltrnW_homo : {homo f : m n / m < n >-> (m < n)%N} -> {homo f : m n / m <= n >-> (m <= n)%N}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (fun m n : nat => is_true (leq (S m) n)), @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R m n)) (fun m n : nat => is_true (leq m n)) *) exact: homoW. Qed. Lemma ltrnW_nhomo : {homo f : m n / n < m >-> (m < n)%N} -> {homo f : m n / n <= m >-> (m <= n)%N}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R n m)) (fun m n : nat => is_true (leq (S m) n)), @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R n m)) (fun m n : nat => is_true (leq m n)) *) exact: homoW. Qed. Lemma inj_homo_ltrn : injective f -> {homo f : m n / m <= n >-> (m <= n)%N} -> {homo f : m n / m < n >-> (m < n)%N}. Proof. (* Goal: forall (_ : @injective nat (NumDomain.sort R) f) (_ : @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R m n)) (fun m n : nat => is_true (leq m n))), @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (fun m n : nat => is_true (leq (S m) n)) *) exact: inj_homo. Qed. Lemma inj_nhomo_ltrn : injective f -> {homo f : m n / n <= m >-> (m <= n)%N} -> {homo f : m n / n < m >-> (m < n)%N}. Proof. (* Goal: forall (_ : @injective nat (NumDomain.sort R) f) (_ : @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R n m)) (fun m n : nat => is_true (leq m n))), @homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R n m)) (fun m n : nat => is_true (leq (S m) n)) *) exact: inj_homo. Qed. Lemma incrn_inj : {mono f : m n / m <= n >-> (m <= n)%N} -> injective f. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R m n) (fun m n : nat => leq m n), @injective nat (NumDomain.sort R) f *) exact: mono_inj. Qed. Lemma decrn_inj : {mono f : m n / n <= m >-> (m <= n)%N} -> injective f. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R n m) (fun m n : nat => leq m n), @injective nat (NumDomain.sort R) f *) exact: mono_inj. Qed. Lemma lernW_mono : {mono f : m n / m <= n >-> (m <= n)%N} -> {mono f : m n / m < n >-> (m < n)%N}. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R m n) (fun m n : nat => leq m n), @monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ltr R m n) (fun m n : nat => leq (S m) n) *) exact: anti_mono. Qed. Lemma lernW_nmono : {mono f : m n / n <= m >-> (m <= n)%N} -> {mono f : m n / n < m >-> (m < n)%N}. Proof. (* Goal: forall _ : @monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R n m) (fun m n : nat => leq m n), @monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ltr R n m) (fun m n : nat => leq (S m) n) *) exact: anti_mono. Qed. Lemma ltrnW_homo_in : {in D & D', {homo f : m n / m < n >-> (m < n)%N}} -> {in D & D', {homo f : m n / m <= n >-> (m <= n)%N}}. Proof. (* Goal: forall _ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ltr R m n)) x y, (fun m n : nat => is_true (leq (S m) n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (fun m n : nat => is_true (leq (S m) n)))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ler R m n)) x y, (fun m n : nat => is_true (leq m n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R m n)) (fun m n : nat => is_true (leq m n)))) *) exact: homoW_in. Qed. Lemma ltrnW_nhomo_in : {in D & D', {homo f : m n / n < m >-> (m < n)%N}} -> {in D & D', {homo f : m n / n <= m >-> (m <= n)%N}}. Proof. (* Goal: forall _ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ltr R n m)) x y, (fun m n : nat => is_true (leq (S m) n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R n m)) (fun m n : nat => is_true (leq (S m) n)))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ler R n m)) x y, (fun m n : nat => is_true (leq m n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R n m)) (fun m n : nat => is_true (leq m n)))) *) exact: homoW_in. Qed. Lemma inj_homo_ltrn_in : {in D & D', injective f} -> {in D & D', {homo f : m n / m <= n >-> (m <= n)%N}} -> {in D & D', {homo f : m n / m < n >-> (m < n)%N}}. Proof. (* Goal: forall (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x1 x2 : NumDomain.sort R => forall _ : @eq nat (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective nat (NumDomain.sort R) f))) (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ler R m n)) x y, (fun m n : nat => is_true (leq m n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R m n)) (fun m n : nat => is_true (leq m n))))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ltr R m n)) x y, (fun m n : nat => is_true (leq (S m) n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R m n)) (fun m n : nat => is_true (leq (S m) n)))) *) exact: inj_homo_in. Qed. Lemma inj_nhomo_ltrn_in : {in D & D', injective f} -> {in D & D', {homo f : m n / n <= m >-> (m <= n)%N}} -> {in D & D', {homo f : m n / n < m >-> (m < n)%N}}. Proof. (* Goal: forall (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x1 x2 : NumDomain.sort R => forall _ : @eq nat (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective nat (NumDomain.sort R) f))) (_ : @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ler R n m)) x y, (fun m n : nat => is_true (leq m n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ler R n m)) (fun m n : nat => is_true (leq m n))))), @prop_in11 (NumDomain.sort R) (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D') (fun x y : NumDomain.sort R => forall _ : (fun m n : NumDomain.sort R => is_true (@ltr R n m)) x y, (fun m n : nat => is_true (leq (S m) n)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f (fun m n : NumDomain.sort R => is_true (@ltr R n m)) (fun m n : nat => is_true (leq (S m) n)))) *) exact: inj_homo_in. Qed. Lemma incrn_inj_in : {in D &, {mono f : m n / m <= n >-> (m <= n)%N}} -> {in D &, injective f}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun m n : nat => leq m n) (f x) (f y)) ((fun m n : NumDomain.sort R => @ler R m n) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R m n) (fun m n : nat => leq m n))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x1 x2 : NumDomain.sort R => forall _ : @eq nat (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective nat (NumDomain.sort R) f)) *) exact: mono_inj_in. Qed. Lemma decrn_inj_in : {in D &, {mono f : m n / n <= m >-> (m <= n)%N}} -> {in D &, injective f}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun m n : nat => leq m n) (f x) (f y)) ((fun m n : NumDomain.sort R => @ler R n m) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R n m) (fun m n : nat => leq m n))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x1 x2 : NumDomain.sort R => forall _ : @eq nat (f x1) (f x2), @eq (NumDomain.sort R) x1 x2) (inPhantom (@injective nat (NumDomain.sort R) f)) *) exact: mono_inj_in. Qed. Lemma lernW_mono_in : {in D &, {mono f : m n / m <= n >-> (m <= n)%N}} -> {in D &, {mono f : m n / m < n >-> (m < n)%N}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun m n : nat => leq m n) (f x) (f y)) ((fun m n : NumDomain.sort R => @ler R m n) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R m n) (fun m n : nat => leq m n))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun m n : nat => leq (S m) n) (f x) (f y)) ((fun m n : NumDomain.sort R => @ltr R m n) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ltr R m n) (fun m n : nat => leq (S m) n))) *) exact: anti_mono_in. Qed. Lemma lernW_nmono_in : {in D &, {mono f : m n / n <= m >-> (m <= n)%N}} -> {in D &, {mono f : m n / n < m >-> (m < n)%N}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun m n : nat => leq m n) (f x) (f y)) ((fun m n : NumDomain.sort R => @ler R n m) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ler R n m) (fun m n : nat => leq m n))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => @eq bool ((fun m n : nat => leq (S m) n) (f x) (f y)) ((fun m n : NumDomain.sort R => @ltr R n m) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f (fun m n : NumDomain.sort R => @ltr R n m) (fun m n : nat => leq (S m) n))) *) exact: anti_mono_in. Qed. End RToNat. End NumIntegralDomainMonotonyTheory. Section NumDomainOperationTheory. Variable R : numDomainType. Implicit Types x y z t : R. Lemma ler_opp2 : {mono -%R : x y /~ x <= y :> R}. Proof. (* Goal: @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.opp (NumDomain.zmodType R)) (fun y x : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R (x : NumDomain.sort R) (y : NumDomain.sort R)) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R (x : NumDomain.sort R) (y : NumDomain.sort R)) *) by move=> x y /=; rewrite -subr_ge0 opprK addrC subr_ge0. Qed. Hint Resolve ler_opp2 : core. Lemma ltr_opp2 : {mono -%R : x y /~ x < y :> R}. Proof. (* Goal: @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.opp (NumDomain.zmodType R)) (fun y x : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R (x : NumDomain.sort R) (y : NumDomain.sort R)) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R (x : NumDomain.sort R) (y : NumDomain.sort R)) *) by move=> x y /=; rewrite lerW_nmono. Qed. Hint Resolve ltr_opp2 : core. Definition lter_opp2 := (ler_opp2, ltr_opp2). Lemma ler_oppr x y : (x <= - y) = (y <= - x). Proof. (* Goal: @eq bool (@ler R x (@GRing.opp (NumDomain.zmodType R) y)) (@ler R y (@GRing.opp (NumDomain.zmodType R) x)) *) by rewrite (monoRL opprK ler_opp2). Qed. Lemma ltr_oppr x y : (x < - y) = (y < - x). Proof. (* Goal: @eq bool (@ltr R x (@GRing.opp (NumDomain.zmodType R) y)) (@ltr R y (@GRing.opp (NumDomain.zmodType R) x)) *) by rewrite (monoRL opprK (lerW_nmono _)). Qed. Definition lter_oppr := (ler_oppr, ltr_oppr). Lemma ler_oppl x y : (- x <= y) = (- y <= x). Proof. (* Goal: @eq bool (@ler R (@GRing.opp (NumDomain.zmodType R) x) y) (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) *) by rewrite (monoLR opprK ler_opp2). Qed. Lemma ltr_oppl x y : (- x < y) = (- y < x). Proof. (* Goal: @eq bool (@ltr R (@GRing.opp (NumDomain.zmodType R) x) y) (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) *) by rewrite (monoLR opprK (lerW_nmono _)). Qed. Definition lter_oppl := (ler_oppl, ltr_oppl). Lemma oppr_ge0 x : (0 <= - x) = (x <= 0). Lemma oppr_gt0 x : (0 < - x) = (x < 0). Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.opp (NumDomain.zmodType R) x)) (@ltr R x (GRing.zero (NumDomain.zmodType R))) *) by rewrite lter_oppr oppr0. Qed. Definition oppr_gte0 := (oppr_ge0, oppr_gt0). Lemma oppr_le0 x : (- x <= 0) = (0 <= x). Proof. (* Goal: @eq bool (@ler R (@GRing.opp (NumDomain.zmodType R) x) (GRing.zero (NumDomain.zmodType R))) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) by rewrite lter_oppl oppr0. Qed. Lemma oppr_lt0 x : (- x < 0) = (0 < x). Proof. (* Goal: @eq bool (@ltr R (@GRing.opp (NumDomain.zmodType R) x) (GRing.zero (NumDomain.zmodType R))) (@ltr R (GRing.zero (NumDomain.zmodType R)) x) *) by rewrite lter_oppl oppr0. Qed. Definition oppr_lte0 := (oppr_le0, oppr_lt0). Definition oppr_cp0 := (oppr_gte0, oppr_lte0). Definition lter_oppE := (oppr_cp0, lter_opp2). Lemma ge0_cp x : 0 <= x -> (- x <= 0) * (- x <= x). Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), prod (is_true (@ler R (@GRing.opp (NumDomain.zmodType R) x) (GRing.zero (NumDomain.zmodType R)))) (is_true (@ler R (@GRing.opp (NumDomain.zmodType R) x) x)) *) by move=> hx; rewrite oppr_cp0 hx (@ler_trans _ 0) ?oppr_cp0. Qed. Lemma gt0_cp x : 0 < x -> (0 <= x) * (- x <= 0) * (- x <= x) * (- x < 0) * (- x < x). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), prod (prod (prod (prod (is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (is_true (@ler R (@GRing.opp (NumDomain.zmodType R) x) (GRing.zero (NumDomain.zmodType R))))) (is_true (@ler R (@GRing.opp (NumDomain.zmodType R) x) x))) (is_true (@ltr R (@GRing.opp (NumDomain.zmodType R) x) (GRing.zero (NumDomain.zmodType R))))) (is_true (@ltr R (@GRing.opp (NumDomain.zmodType R) x) x)) *) move=> hx; move: (ltrW hx) => hx'; rewrite !ge0_cp hx' //. (* Goal: prod (prod (prod (prod (is_true true) (is_true true)) (is_true true)) (is_true (@ltr R (@GRing.opp (NumDomain.zmodType R) x) (GRing.zero (NumDomain.zmodType R))))) (is_true (@ltr R (@GRing.opp (NumDomain.zmodType R) x) x)) *) by rewrite oppr_cp0 hx // (@ltr_trans _ 0) ?oppr_cp0. Qed. Lemma le0_cp x : x <= 0 -> (0 <= - x) * (x <= - x). Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), prod (is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.opp (NumDomain.zmodType R) x))) (is_true (@ler R x (@GRing.opp (NumDomain.zmodType R) x))) *) by move=> hx; rewrite oppr_cp0 hx (@ler_trans _ 0) ?oppr_cp0. Qed. Lemma lt0_cp x : x < 0 -> (x <= 0) * (0 <= - x) * (x <= - x) * (0 < - x) * (x < - x). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), prod (prod (prod (prod (is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.opp (NumDomain.zmodType R) x)))) (is_true (@ler R x (@GRing.opp (NumDomain.zmodType R) x)))) (is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.opp (NumDomain.zmodType R) x)))) (is_true (@ltr R x (@GRing.opp (NumDomain.zmodType R) x))) *) move=> hx; move: (ltrW hx) => hx'; rewrite !le0_cp // hx'. (* Goal: prod (prod (prod (prod (is_true true) (is_true true)) (is_true true)) (is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.opp (NumDomain.zmodType R) x)))) (is_true (@ltr R x (@GRing.opp (NumDomain.zmodType R) x))) *) by rewrite oppr_cp0 hx // (@ltr_trans _ 0) ?oppr_cp0. Qed. Lemma ger0_real x : 0 <= x -> x \is real. Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite realE => ->. Qed. Lemma ler0_real x : x <= 0 -> x \is real. Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite realE orbC => ->. Qed. Lemma gtr0_real x : 0 < x -> x \is real. Lemma ltr0_real x : x < 0 -> x \is real. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> /ltrW/ler0_real. Qed. Hint Resolve real0 : core. Lemma real1 : 1 \is @real R. Proof. by rewrite ger0_real. Qed. Proof. (* Goal: is_true (@in_mem (GRing.Ring.sort (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite ger0_real. Qed. Lemma ler_leVge x y : x <= 0 -> y <= 0 -> (x <= y) || (y <= x). Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))), is_true (orb (@ler R x y) (@ler R y x)) *) by rewrite -!oppr_ge0 => /(ger_leVge _) h /h; rewrite !ler_opp2. Qed. Lemma real_leVge x y : x \is real -> y \is real -> (x <= y) || (y <= x). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), is_true (orb (@ler R x y) (@ler R y x)) *) rewrite !realE; have [x_ge0 _|x_nge0 /= x_le0] := boolP (_ <= _); last first. (* Goal: forall _ : is_true (orb (@ler R (GRing.zero (NumDomain.zmodType R)) y) (@ler R y (GRing.zero (NumDomain.zmodType R)))), is_true (orb (@ler R x y) (@ler R y x)) *) (* Goal: forall _ : is_true (orb (@ler R (GRing.zero (NumDomain.zmodType R)) y) (@ler R y (GRing.zero (NumDomain.zmodType R)))), is_true (orb (@ler R x y) (@ler R y x)) *) by have [/(ler_trans x_le0)->|_ /(ler_leVge x_le0) //] := boolP (0 <= _). (* Goal: forall _ : is_true (orb (@ler R (GRing.zero (NumDomain.zmodType R)) y) (@ler R y (GRing.zero (NumDomain.zmodType R)))), is_true (orb (@ler R x y) (@ler R y x)) *) by have [/(ger_leVge x_ge0)|_ /ler_trans->] := boolP (0 <= _); rewrite ?orbT. Qed. Lemma realB : {in real &, forall x y, x - y \is real}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (inPhantom (forall x y : NumDomain.sort R, is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))) *) exact: rpredB. Qed. Lemma realN : {mono (@GRing.opp R) : x / x \is real}. Proof. (* Goal: @monomorphism_1 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.opp (NumDomain.zmodType R)) (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) exact: rpredN. Qed. Lemma realBC x y : (x - y \is real) = (y - x \is real). Proof. (* Goal: @eq bool (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by rewrite -realN opprB. Qed. Lemma realD : {in real &, forall x y, x + y \is real}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (inPhantom (forall x y : NumDomain.sort R, is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))) *) exact: rpredD. Qed. Variant ler_xor_gt (x y : R) : R -> R -> bool -> bool -> Set := | LerNotGt of x <= y : ler_xor_gt x y (y - x) (y - x) true false | GtrNotLe of y < x : ler_xor_gt x y (x - y) (x - y) false true. Variant ltr_xor_ge (x y : R) : R -> R -> bool -> bool -> Set := | LtrNotGe of x < y : ltr_xor_ge x y (y - x) (y - x) false true | GerNotLt of y <= x : ltr_xor_ge x y (x - y) (x - y) true false. Variant comparer x y : R -> R -> bool -> bool -> bool -> bool -> bool -> bool -> Set := | ComparerLt of x < y : comparer x y (y - x) (y - x) false false true false true false | ComparerGt of x > y : comparer x y (x - y) (x - y) false false false true false true | ComparerEq of x = y : comparer x y 0 0 true true true true false false. Lemma real_lerP x y : x \is real -> y \is real -> ler_xor_gt x y `|x - y| `|y - x| (x <= y) (y < x). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) (@ler R x y) (@ltr R y x) *) move=> xR /(real_leVge xR); have [le_xy _|Nle_xy /= le_yx] := boolP (_ <= _). (* Goal: ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) false (@ltr R y x) *) (* Goal: ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) true (@ltr R y x) *) have [/(ler_lt_trans le_xy)|] := boolP (_ < _); first by rewrite ltrr. (* Goal: ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) false (@ltr R y x) *) (* Goal: forall _ : is_true (negb (@ltr R y x)), ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) true false *) by rewrite ler0_norm ?ger0_norm ?subr_cp0 ?opprB //; constructor. (* Goal: ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) false (@ltr R y x) *) have [lt_yx|] := boolP (_ < _). (* Goal: forall _ : is_true (negb (@ltr R y x)), ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) false false *) (* Goal: ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) false true *) by rewrite ger0_norm ?ler0_norm ?subr_cp0 ?opprB //; constructor. (* Goal: forall _ : is_true (negb (@ltr R y x)), ler_xor_gt x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) false false *) by rewrite ltr_def le_yx andbT negbK=> /eqP exy; rewrite exy lerr in Nle_xy. Qed. Lemma real_ltrP x y : x \is real -> y \is real -> ltr_xor_ge x y `|x - y| `|y - x| (y <= x) (x < y). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), ltr_xor_ge x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) (@ler R y x) (@ltr R x y) *) by move=> xR yR; case: real_lerP=> //; constructor. Qed. Lemma real_ltrNge : {in real &, forall x y, (x < y) = ~~ (y <= x)}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => @eq bool (@ltr R x y) (negb (@ler R y x))) (inPhantom (forall x y : NumDomain.sort R, @eq bool (@ltr R x y) (negb (@ler R y x)))) *) by move=> x y xR yR /=; case: real_lerP. Qed. Lemma real_lerNgt : {in real &, forall x y, (x <= y) = ~~ (y < x)}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => @eq bool (@ler R x y) (negb (@ltr R y x))) (inPhantom (forall x y : NumDomain.sort R, @eq bool (@ler R x y) (negb (@ltr R y x)))) *) by move=> x y xR yR /=; case: real_lerP. Qed. Lemma real_ltrgtP x y : x \is real -> y \is real -> comparer x y `|x - y| `|y - x| (y == x) (x == y) (x <= y) (y <= x) (x < y) (x > y). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), comparer x y (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@normr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x))) (@eq_op (NumDomain.eqType R) y x) (@eq_op (NumDomain.eqType R) x y) (@ler R x y) (@ler R y x) (@ltr R x y) (@ltr R y x) *) move=> xR yR; case: real_lerP => // [le_yx|lt_xy]; last first. (* Goal: comparer x y (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@eq_op (NumDomain.eqType R) y x) (@eq_op (NumDomain.eqType R) x y) (@ler R x y) true false (@ltr R y x) *) (* Goal: comparer x y (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x)) (@eq_op (NumDomain.eqType R) y x) (@eq_op (NumDomain.eqType R) x y) (@ler R x y) false true (@ltr R y x) *) by rewrite gtr_eqF // ltr_eqF // ler_gtF ?ltrW //; constructor. (* Goal: comparer x y (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@eq_op (NumDomain.eqType R) y x) (@eq_op (NumDomain.eqType R) x y) (@ler R x y) true false (@ltr R y x) *) case: real_lerP => // [le_xy|lt_yx]; last first. (* Goal: comparer x y (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@eq_op (NumDomain.eqType R) y x) (@eq_op (NumDomain.eqType R) x y) true true false false *) (* Goal: comparer x y (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@eq_op (NumDomain.eqType R) y x) (@eq_op (NumDomain.eqType R) x y) false true false true *) by rewrite ltr_eqF // gtr_eqF //; constructor. (* Goal: comparer x y (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@eq_op (NumDomain.eqType R) y x) (@eq_op (NumDomain.eqType R) x y) true true false false *) have /eqP ->: x == y by rewrite eqr_le le_yx le_xy. (* Goal: comparer y y (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) y)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) y)) (@eq_op (NumDomain.eqType R) y y) (@eq_op (NumDomain.eqType R) y y) true true false false *) by rewrite subrr eqxx; constructor. Qed. Variant ger0_xor_lt0 (x : R) : R -> bool -> bool -> Set := | Ger0NotLt0 of 0 <= x : ger0_xor_lt0 x x false true | Ltr0NotGe0 of x < 0 : ger0_xor_lt0 x (- x) true false. Variant ler0_xor_gt0 (x : R) : R -> bool -> bool -> Set := | Ler0NotLe0 of x <= 0 : ler0_xor_gt0 x (- x) false true | Gtr0NotGt0 of 0 < x : ler0_xor_gt0 x x true false. Variant comparer0 x : R -> bool -> bool -> bool -> bool -> bool -> bool -> Set := | ComparerGt0 of 0 < x : comparer0 x x false false false true false true | ComparerLt0 of x < 0 : comparer0 x (- x) false false true false true false | ComparerEq0 of x = 0 : comparer0 x 0 true true true true false false. Lemma real_ger0P x : x \is real -> ger0_xor_lt0 x `|x| (x < 0) (0 <= x). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), ger0_xor_lt0 x (@normr R x) (@ltr R x (GRing.zero (NumDomain.zmodType R))) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) move=> hx; rewrite -{2}[x]subr0; case: real_ltrP; by rewrite ?subr0 ?sub0r //; constructor. Qed. Lemma real_ler0P x : x \is real -> ler0_xor_gt0 x `|x| (0 < x) (x <= 0). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), ler0_xor_gt0 x (@normr R x) (@ltr R (GRing.zero (NumDomain.zmodType R)) x) (@ler R x (GRing.zero (NumDomain.zmodType R))) *) move=> hx; rewrite -{2}[x]subr0; case: real_ltrP; by rewrite ?subr0 ?sub0r //; constructor. Qed. Lemma real_ltrgt0P x : x \is real -> comparer0 x `|x| (0 == x) (x == 0) (x <= 0) (0 <= x) (x < 0) (x > 0). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), comparer0 x (@normr R x) (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (GRing.zero (NumDomain.zmodType R)) x) (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) (@ler R x (GRing.zero (NumDomain.zmodType R))) (@ler R (GRing.zero (NumDomain.zmodType R)) x) (@ltr R x (GRing.zero (NumDomain.zmodType R))) (@ltr R (GRing.zero (NumDomain.zmodType R)) x) *) move=> hx; rewrite -{2}[x]subr0; case: real_ltrgtP; by rewrite ?subr0 ?sub0r //; constructor. Qed. Lemma real_neqr_lt : {in real &, forall x y, (x != y) = (x < y) || (y < x)}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => @eq bool (negb (@eq_op (NumDomain.eqType R) x y)) (orb (@ltr R x y) (@ltr R y x))) (inPhantom (forall x y : NumDomain.sort R, @eq bool (negb (@eq_op (NumDomain.eqType R) x y)) (orb (@ltr R x y) (@ltr R y x)))) *) by move=> * /=; case: real_ltrgtP. Qed. Lemma ler_sub_real x y : x <= y -> y - x \is real. Proof. (* Goal: forall _ : is_true (@ler R x y), is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) x)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> le_xy; rewrite ger0_real // subr_ge0. Qed. Lemma ger_sub_real x y : x <= y -> x - y \is real. Proof. (* Goal: forall _ : is_true (@ler R x y), is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> le_xy; rewrite ler0_real // subr_le0. Qed. Lemma ler_real y x : x <= y -> (x \is real) = (y \is real). Proof. (* Goal: forall _ : is_true (@ler R x y), @eq bool (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> le_xy; rewrite -(addrNK x y) rpredDl ?ler_sub_real. Qed. Lemma ger_real x y : y <= x -> (x \is real) = (y \is real). Proof. (* Goal: forall _ : is_true (@ler R y x), @eq bool (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> le_yx; rewrite -(ler_real le_yx). Qed. Lemma ger1_real x : 1 <= x -> x \is real. Proof. by move=> /ger_real->. Qed. Proof. (* Goal: forall _ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x), is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> /ger_real->. Qed. Lemma Nreal_leF x y : y \is real -> x \notin real -> (x <= y) = false. Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))), @eq bool (@ler R x y) false *) by move=> yR; apply: contraNF=> /ler_real->. Qed. Lemma Nreal_geF x y : y \is real -> x \notin real -> (y <= x) = false. Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))), @eq bool (@ler R y x) false *) by move=> yR; apply: contraNF=> /ger_real->. Qed. Lemma Nreal_ltF x y : y \is real -> x \notin real -> (x < y) = false. Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))), @eq bool (@ltr R x y) false *) by move=> yR xNR; rewrite ltr_def Nreal_leF ?andbF. Qed. Lemma Nreal_gtF x y : y \is real -> x \notin real -> (y < x) = false. Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))), @eq bool (@ltr R y x) false *) by move=> yR xNR; rewrite ltr_def Nreal_geF ?andbF. Qed. Lemma real_wlog_ler P : (forall a b, P b a -> P a b) -> (forall a b, a <= b -> P a b) -> forall a b : R, a \is real -> b \is real -> P a b. Proof. (* Goal: forall (_ : forall (a b : NumDomain.sort R) (_ : P b a), P a b) (_ : forall (a b : NumDomain.sort R) (_ : is_true (@ler R a b)), P a b) (a b : NumDomain.sort R) (_ : is_true (@in_mem (NumDomain.sort R) a (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) b (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), P a b *) move=> sP hP a b ha hb; wlog: a b ha hb / a <= b => [hwlog|]; last exact: hP. (* Goal: P a b *) by case: (real_lerP ha hb)=> [/hP //|/ltrW hba]; apply: sP; apply: hP. Qed. Lemma real_wlog_ltr P : (forall a, P a a) -> (forall a b, (P b a -> P a b)) -> (forall a b, a < b -> P a b) -> forall a b : R, a \is real -> b \is real -> P a b. Proof. (* Goal: forall (_ : forall a : NumDomain.sort R, P a a) (_ : forall (a b : NumDomain.sort R) (_ : P b a), P a b) (_ : forall (a b : NumDomain.sort R) (_ : is_true (@ltr R a b)), P a b) (a b : NumDomain.sort R) (_ : is_true (@in_mem (NumDomain.sort R) a (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) b (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), P a b *) move=> rP sP hP; apply: real_wlog_ler=> // a b. (* Goal: forall _ : is_true (@ler R a b), P a b *) by rewrite ler_eqVlt; case: (altP (_ =P _))=> [->|] //= _ lab; apply: hP. Qed. Lemma ler_add2l x : {mono +%R x : y z / y <= z}. Proof. (* Goal: @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.add (NumDomain.zmodType R) x) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R y z) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R y z) *) by move=> y z /=; rewrite -subr_ge0 opprD addrAC addNKr addrC subr_ge0. Qed. Lemma ler_add2r x : {mono +%R^~ x : y z / y <= z}. Proof. (* Goal: @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (fun x0 : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.add (NumDomain.zmodType R) x0 x) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R y z) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R y z) *) by move=> y z /=; rewrite ![_ + x]addrC ler_add2l. Qed. Lemma ltr_add2l x : {mono +%R x : y z / y < z}. Proof. (* Goal: @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.add (NumDomain.zmodType R) x) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R y z) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R y z) *) by move=> y z /=; rewrite (lerW_mono (ler_add2l _)). Qed. Lemma ltr_add2r x : {mono +%R^~ x : y z / y < z}. Proof. (* Goal: @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (fun x0 : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.add (NumDomain.zmodType R) x0 x) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R y z) (fun y z : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R y z) *) by move=> y z /=; rewrite (lerW_mono (ler_add2r _)). Qed. Definition ler_add2 := (ler_add2l, ler_add2r). Definition ltr_add2 := (ltr_add2l, ltr_add2r). Definition lter_add2 := (ler_add2, ltr_add2). Lemma ler_add x y z t : x <= y -> z <= t -> x + z <= y + t. Proof. (* Goal: forall (_ : is_true (@ler R x y)) (_ : is_true (@ler R z t)), is_true (@ler R (@GRing.add (NumDomain.zmodType R) x z) (@GRing.add (NumDomain.zmodType R) y t)) *) by move=> lxy lzt; rewrite (@ler_trans _ (y + z)) ?lter_add2. Qed. Lemma ler_lt_add x y z t : x <= y -> z < t -> x + z < y + t. Proof. (* Goal: forall (_ : is_true (@ler R x y)) (_ : is_true (@ltr R z t)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x z) (@GRing.add (NumDomain.zmodType R) y t)) *) by move=> lxy lzt; rewrite (@ler_lt_trans _ (y + z)) ?lter_add2. Qed. Lemma ltr_le_add x y z t : x < y -> z <= t -> x + z < y + t. Proof. (* Goal: forall (_ : is_true (@ltr R x y)) (_ : is_true (@ler R z t)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x z) (@GRing.add (NumDomain.zmodType R) y t)) *) by move=> lxy lzt; rewrite (@ltr_le_trans _ (y + z)) ?lter_add2. Qed. Lemma ltr_add x y z t : x < y -> z < t -> x + z < y + t. Proof. (* Goal: forall (_ : is_true (@ltr R x y)) (_ : is_true (@ltr R z t)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x z) (@GRing.add (NumDomain.zmodType R) y t)) *) by move=> lxy lzt; rewrite ltr_le_add // ltrW. Qed. Lemma ler_sub x y z t : x <= y -> t <= z -> x - z <= y - t. Proof. (* Goal: forall (_ : is_true (@ler R x y)) (_ : is_true (@ler R t z)), is_true (@ler R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) z)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) t))) *) by move=> lxy ltz; rewrite ler_add // lter_opp2. Qed. Lemma ler_lt_sub x y z t : x <= y -> t < z -> x - z < y - t. Proof. (* Goal: forall (_ : is_true (@ler R x y)) (_ : is_true (@ltr R t z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) z)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) t))) *) by move=> lxy lzt; rewrite ler_lt_add // lter_opp2. Qed. Lemma ltr_le_sub x y z t : x < y -> t <= z -> x - z < y - t. Proof. (* Goal: forall (_ : is_true (@ltr R x y)) (_ : is_true (@ler R t z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) z)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) t))) *) by move=> lxy lzt; rewrite ltr_le_add // lter_opp2. Qed. Lemma ltr_sub x y z t : x < y -> t < z -> x - z < y - t. Proof. (* Goal: forall (_ : is_true (@ltr R x y)) (_ : is_true (@ltr R t z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) z)) (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) t))) *) by move=> lxy lzt; rewrite ltr_add // lter_opp2. Qed. Lemma ler_subl_addr x y z : (x - y <= z) = (x <= z + y). Proof. (* Goal: @eq bool (@ler R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) z) (@ler R x (@GRing.add (NumDomain.zmodType R) z y)) *) by rewrite (monoLR (addrK _) (ler_add2r _)). Qed. Lemma ltr_subl_addr x y z : (x - y < z) = (x < z + y). Proof. (* Goal: @eq bool (@ltr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) z) (@ltr R x (@GRing.add (NumDomain.zmodType R) z y)) *) by rewrite (monoLR (addrK _) (ltr_add2r _)). Qed. Lemma ler_subr_addr x y z : (x <= y - z) = (x + z <= y). Proof. (* Goal: @eq bool (@ler R x (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) z))) (@ler R (@GRing.add (NumDomain.zmodType R) x z) y) *) by rewrite (monoLR (addrNK _) (ler_add2r _)). Qed. Lemma ltr_subr_addr x y z : (x < y - z) = (x + z < y). Proof. (* Goal: @eq bool (@ltr R x (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) z))) (@ltr R (@GRing.add (NumDomain.zmodType R) x z) y) *) by rewrite (monoLR (addrNK _) (ltr_add2r _)). Qed. Definition ler_sub_addr := (ler_subl_addr, ler_subr_addr). Definition ltr_sub_addr := (ltr_subl_addr, ltr_subr_addr). Definition lter_sub_addr := (ler_sub_addr, ltr_sub_addr). Lemma ler_subl_addl x y z : (x - y <= z) = (x <= y + z). Proof. (* Goal: @eq bool (@ler R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) z) (@ler R x (@GRing.add (NumDomain.zmodType R) y z)) *) by rewrite lter_sub_addr addrC. Qed. Lemma ltr_subl_addl x y z : (x - y < z) = (x < y + z). Proof. (* Goal: @eq bool (@ltr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) z) (@ltr R x (@GRing.add (NumDomain.zmodType R) y z)) *) by rewrite lter_sub_addr addrC. Qed. Lemma ler_subr_addl x y z : (x <= y - z) = (z + x <= y). Proof. (* Goal: @eq bool (@ler R x (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) z))) (@ler R (@GRing.add (NumDomain.zmodType R) z x) y) *) by rewrite lter_sub_addr addrC. Qed. Lemma ltr_subr_addl x y z : (x < y - z) = (z + x < y). Proof. (* Goal: @eq bool (@ltr R x (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) z))) (@ltr R (@GRing.add (NumDomain.zmodType R) z x) y) *) by rewrite lter_sub_addr addrC. Qed. Definition ler_sub_addl := (ler_subl_addl, ler_subr_addl). Definition ltr_sub_addl := (ltr_subl_addl, ltr_subr_addl). Definition lter_sub_addl := (ler_sub_addl, ltr_sub_addl). Lemma ler_addl x y : (x <= x + y) = (0 <= y). Proof. (* Goal: @eq bool (@ler R x (@GRing.add (NumDomain.zmodType R) x y)) (@ler R (GRing.zero (NumDomain.zmodType R)) y) *) by rewrite -{1}[x]addr0 lter_add2. Qed. Lemma ltr_addl x y : (x < x + y) = (0 < y). Proof. (* Goal: @eq bool (@ltr R x (@GRing.add (NumDomain.zmodType R) x y)) (@ltr R (GRing.zero (NumDomain.zmodType R)) y) *) by rewrite -{1}[x]addr0 lter_add2. Qed. Lemma ler_addr x y : (x <= y + x) = (0 <= y). Proof. (* Goal: @eq bool (@ler R x (@GRing.add (NumDomain.zmodType R) y x)) (@ler R (GRing.zero (NumDomain.zmodType R)) y) *) by rewrite -{1}[x]add0r lter_add2. Qed. Lemma ltr_addr x y : (x < y + x) = (0 < y). Proof. (* Goal: @eq bool (@ltr R x (@GRing.add (NumDomain.zmodType R) y x)) (@ltr R (GRing.zero (NumDomain.zmodType R)) y) *) by rewrite -{1}[x]add0r lter_add2. Qed. Lemma ger_addl x y : (x + y <= x) = (y <= 0). Proof. (* Goal: @eq bool (@ler R (@GRing.add (NumDomain.zmodType R) x y) x) (@ler R y (GRing.zero (NumDomain.zmodType R))) *) by rewrite -{2}[x]addr0 lter_add2. Qed. Lemma gtr_addl x y : (x + y < x) = (y < 0). Proof. (* Goal: @eq bool (@ltr R (@GRing.add (NumDomain.zmodType R) x y) x) (@ltr R y (GRing.zero (NumDomain.zmodType R))) *) by rewrite -{2}[x]addr0 lter_add2. Qed. Lemma ger_addr x y : (y + x <= x) = (y <= 0). Proof. (* Goal: @eq bool (@ler R (@GRing.add (NumDomain.zmodType R) y x) x) (@ler R y (GRing.zero (NumDomain.zmodType R))) *) by rewrite -{2}[x]add0r lter_add2. Qed. Lemma gtr_addr x y : (y + x < x) = (y < 0). Proof. (* Goal: @eq bool (@ltr R (@GRing.add (NumDomain.zmodType R) y x) x) (@ltr R y (GRing.zero (NumDomain.zmodType R))) *) by rewrite -{2}[x]add0r lter_add2. Qed. Definition cpr_add := (ler_addl, ler_addr, ger_addl, ger_addl, ltr_addl, ltr_addr, gtr_addl, gtr_addl). Lemma ler_paddl y x z : 0 <= x -> y <= z -> y <= x + z. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R y z)), is_true (@ler R y (@GRing.add (NumDomain.zmodType R) x z)) *) by move=> *; rewrite -[y]add0r ler_add. Qed. Lemma ltr_paddl y x z : 0 <= x -> y < z -> y < x + z. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R y z)), is_true (@ltr R y (@GRing.add (NumDomain.zmodType R) x z)) *) by move=> *; rewrite -[y]add0r ler_lt_add. Qed. Lemma ltr_spaddl y x z : 0 < x -> y <= z -> y < x + z. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R y z)), is_true (@ltr R y (@GRing.add (NumDomain.zmodType R) x z)) *) by move=> *; rewrite -[y]add0r ltr_le_add. Qed. Lemma ltr_spsaddl y x z : 0 < x -> y < z -> y < x + z. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R y z)), is_true (@ltr R y (@GRing.add (NumDomain.zmodType R) x z)) *) by move=> *; rewrite -[y]add0r ltr_add. Qed. Lemma ler_naddl y x z : x <= 0 -> y <= z -> x + y <= z. Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y z)), is_true (@ler R (@GRing.add (NumDomain.zmodType R) x y) z) *) by move=> *; rewrite -[z]add0r ler_add. Qed. Lemma ltr_naddl y x z : x <= 0 -> y < z -> x + y < z. Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ltr R y z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x y) z) *) by move=> *; rewrite -[z]add0r ler_lt_add. Qed. Lemma ltr_snaddl y x z : x < 0 -> y <= z -> x + y < z. Proof. (* Goal: forall (_ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x y) z) *) by move=> *; rewrite -[z]add0r ltr_le_add. Qed. Lemma ltr_snsaddl y x z : x < 0 -> y < z -> x + y < z. Proof. (* Goal: forall (_ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ltr R y z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) x y) z) *) by move=> *; rewrite -[z]add0r ltr_add. Qed. Lemma ler_paddr y x z : 0 <= x -> y <= z -> y <= z + x. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R y z)), is_true (@ler R y (@GRing.add (NumDomain.zmodType R) z x)) *) by move=> *; rewrite [_ + x]addrC ler_paddl. Qed. Lemma ltr_paddr y x z : 0 <= x -> y < z -> y < z + x. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R y z)), is_true (@ltr R y (@GRing.add (NumDomain.zmodType R) z x)) *) by move=> *; rewrite [_ + x]addrC ltr_paddl. Qed. Lemma ltr_spaddr y x z : 0 < x -> y <= z -> y < z + x. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R y z)), is_true (@ltr R y (@GRing.add (NumDomain.zmodType R) z x)) *) by move=> *; rewrite [_ + x]addrC ltr_spaddl. Qed. Lemma ltr_spsaddr y x z : 0 < x -> y < z -> y < z + x. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R y z)), is_true (@ltr R y (@GRing.add (NumDomain.zmodType R) z x)) *) by move=> *; rewrite [_ + x]addrC ltr_spsaddl. Qed. Lemma ler_naddr y x z : x <= 0 -> y <= z -> y + x <= z. Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y z)), is_true (@ler R (@GRing.add (NumDomain.zmodType R) y x) z) *) by move=> *; rewrite [_ + x]addrC ler_naddl. Qed. Lemma ltr_naddr y x z : x <= 0 -> y < z -> y + x < z. Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ltr R y z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) y x) z) *) by move=> *; rewrite [_ + x]addrC ltr_naddl. Qed. Lemma ltr_snaddr y x z : x < 0 -> y <= z -> y + x < z. Proof. (* Goal: forall (_ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) y x) z) *) by move=> *; rewrite [_ + x]addrC ltr_snaddl. Qed. Lemma ltr_snsaddr y x z : x < 0 -> y < z -> y + x < z. Proof. (* Goal: forall (_ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ltr R y z)), is_true (@ltr R (@GRing.add (NumDomain.zmodType R) y x) z) *) by move=> *; rewrite [_ + x]addrC ltr_snsaddl. Qed. Lemma paddr_eq0 (x y : R) : 0 <= x -> 0 <= y -> (x + y == 0) = (x == 0) && (y == 0). Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (GRing.zero (NumDomain.zmodType R))) (andb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R)))) *) rewrite le0r; case/orP=> [/eqP->|hx]; first by rewrite add0r eqxx. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (GRing.zero (NumDomain.zmodType R))) (andb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R)))) *) by rewrite (gtr_eqF hx) /= => hy; rewrite gtr_eqF // ltr_spaddl. Qed. Lemma naddr_eq0 (x y : R) : x <= 0 -> y <= 0 -> (x + y == 0) = (x == 0) && (y == 0). Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))), @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (GRing.zero (NumDomain.zmodType R))) (andb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R)))) *) by move=> lex0 ley0; rewrite -oppr_eq0 opprD paddr_eq0 ?oppr_cp0 // !oppr_eq0. Qed. Lemma addr_ss_eq0 (x y : R) : (0 <= x) && (0 <= y) || (x <= 0) && (y <= 0) -> (x + y == 0) = (x == 0) && (y == 0). Proof. (* Goal: forall _ : is_true (orb (andb (@ler R (GRing.zero (NumDomain.zmodType R)) x) (@ler R (GRing.zero (NumDomain.zmodType R)) y)) (andb (@ler R x (GRing.zero (NumDomain.zmodType R))) (@ler R y (GRing.zero (NumDomain.zmodType R))))), @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x y) (GRing.zero (NumDomain.zmodType R))) (andb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R)))) *) by case/orP=> /andP []; [apply: paddr_eq0 | apply: naddr_eq0]. Qed. Lemma sumr_ge0 I (r : seq I) (P : pred I) (F : I -> R) : (forall i, P i -> (0 <= F i)) -> 0 <= \sum_(i <- r | P i) (F i). Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (F i)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) I (GRing.zero (NumDomain.zmodType R)) r (fun i : I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) I i (@GRing.add (NumDomain.zmodType R)) (P i) (F i)))) *) exact: (big_ind _ _ (@ler_paddl 0)). Qed. Lemma ler_sum I (r : seq I) (P : pred I) (F G : I -> R) : (forall i, P i -> F i <= G i) -> \sum_(i <- r | P i) F i <= \sum_(i <- r | P i) G i. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@ler R (F i) (G i)), is_true (@ler R (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) I (GRing.zero (NumDomain.zmodType R)) r (fun i : I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) I i (@GRing.add (NumDomain.zmodType R)) (P i) (F i))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) I (GRing.zero (NumDomain.zmodType R)) r (fun i : I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) I i (@GRing.add (NumDomain.zmodType R)) (P i) (G i)))) *) exact: (big_ind2 _ (lerr _) ler_add). Qed. Lemma psumr_eq0 (I : eqType) (r : seq I) (P : pred I) (F : I -> R) : (forall i, P i -> 0 <= F i) -> (\sum_(i <- r | P i) (F i) == 0) = (all (fun i => (P i) ==> (F i == 0)) r). Proof. (* Goal: forall _ : forall (i : Equality.sort I) (_ : is_true (P i)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (F i)), @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) (Equality.sort I) (GRing.zero (NumDomain.zmodType R)) r (fun i : Equality.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) (Equality.sort I) i (@GRing.add (NumDomain.zmodType R)) (P i) (F i))) (GRing.zero (NumDomain.zmodType R))) (@all (Equality.sort I) (fun i : Equality.sort I => implb (P i) (@eq_op (NumDomain.eqType R) (F i) (GRing.zero (NumDomain.zmodType R)))) r) *) elim: r=> [|a r ihr hr] /=; rewrite (big_nil, big_cons); first by rewrite eqxx. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (if P a then @GRing.add (NumDomain.zmodType R) (F a) (@BigOp.bigop (NumDomain.sort R) (Equality.sort I) (GRing.zero (NumDomain.zmodType R)) r (fun j : Equality.sort I => @BigBody (NumDomain.sort R) (Equality.sort I) j (@GRing.add (NumDomain.zmodType R)) (P j) (F j))) else @BigOp.bigop (NumDomain.sort R) (Equality.sort I) (GRing.zero (NumDomain.zmodType R)) r (fun j : Equality.sort I => @BigBody (NumDomain.sort R) (Equality.sort I) j (@GRing.add (NumDomain.zmodType R)) (P j) (F j))) (GRing.zero (NumDomain.zmodType R))) (andb (implb (P a) (@eq_op (NumDomain.eqType R) (F a) (GRing.zero (NumDomain.zmodType R)))) (@all (Equality.sort I) (fun i : Equality.sort I => implb (P i) (@eq_op (NumDomain.eqType R) (F i) (GRing.zero (NumDomain.zmodType R)))) r)) *) by case: ifP=> pa /=; rewrite ?paddr_eq0 ?ihr ?hr // sumr_ge0. Qed. Lemma psumr_eq0P (I : finType) (P : pred I) (F : I -> R) : (forall i, P i -> 0 <= F i) -> \sum_(i | P i) F i = 0 -> (forall i, P i -> F i = 0). Proof. (* Goal: forall (_ : forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (F i))) (_ : @eq (GRing.Zmodule.sort (NumDomain.zmodType R)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) (GRing.zero (NumDomain.zmodType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) i (@GRing.add (NumDomain.zmodType R)) (P i) (F i))) (GRing.zero (NumDomain.zmodType R))) (i : Finite.sort I) (_ : is_true (P i)), @eq (NumDomain.sort R) (F i) (GRing.zero (NumDomain.zmodType R)) *) move=> F_ge0 /eqP; rewrite psumr_eq0 // -big_all big_andE => /forallP hF i Pi. (* Goal: @eq (NumDomain.sort R) (F i) (GRing.zero (NumDomain.zmodType R)) *) by move: (hF i); rewrite implyTb Pi /= => /eqP. Qed. Lemma ler_pmul2l x : 0 < x -> {mono *%R x : x y / x <= y}. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (@GRing.mul (NumDomain.ringType R) x) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) *) by move=> x_gt0 y z /=; rewrite -subr_ge0 -mulrBr pmulr_rge0 // subr_ge0. Qed. Lemma ltr_pmul2l x : 0 < x -> {mono *%R x : x y / x < y}. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (@GRing.mul (NumDomain.ringType R) x) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) *) by move=> x_gt0; apply: lerW_mono (ler_pmul2l _). Qed. Definition lter_pmul2l := (ler_pmul2l, ltr_pmul2l). Lemma ler_pmul2r x : 0 < x -> {mono *%R^~ x : x y / x <= y}. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.mul (NumDomain.ringType R) x0 x) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) *) by move=> x_gt0 y z /=; rewrite ![_ * x]mulrC ler_pmul2l. Qed. Lemma ltr_pmul2r x : 0 < x -> {mono *%R^~ x : x y / x < y}. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.mul (NumDomain.ringType R) x0 x) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) *) by move=> x_gt0; apply: lerW_mono (ler_pmul2r _). Qed. Definition lter_pmul2r := (ler_pmul2r, ltr_pmul2r). Lemma ler_nmul2l x : x < 0 -> {mono *%R x : x y /~ x <= y}. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (@GRing.mul (NumDomain.ringType R) x) (fun y x : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) *) by move=> x_lt0 y z /=; rewrite -ler_opp2 -!mulNr ler_pmul2l ?oppr_gt0. Qed. Lemma ltr_nmul2l x : x < 0 -> {mono *%R x : x y /~ x < y}. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (@GRing.mul (NumDomain.ringType R) x) (fun y x : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) *) by move=> x_lt0; apply: lerW_nmono (ler_nmul2l _). Qed. Definition lter_nmul2l := (ler_nmul2l, ltr_nmul2l). Lemma ler_nmul2r x : x < 0 -> {mono *%R^~ x : x y /~ x <= y}. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.mul (NumDomain.ringType R) x0 x) (fun y x : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) *) by move=> x_lt0 y z /=; rewrite ![_ * x]mulrC ler_nmul2l. Qed. Lemma ltr_nmul2r x : x < 0 -> {mono *%R^~ x : x y /~ x < y}. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.mul (NumDomain.ringType R) x0 x) (fun y x : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) *) by move=> x_lt0; apply: lerW_nmono (ler_nmul2r _). Qed. Definition lter_nmul2r := (ler_nmul2r, ltr_nmul2r). Lemma ler_wpmul2l x : 0 <= x -> {homo *%R x : y z / y <= z}. Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), @homomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x) (fun y z : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) (fun y z : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) *) by rewrite le0r => /orP[/eqP-> y z | /ler_pmul2l/mono2W//]; rewrite !mul0r. Qed. Lemma ler_wpmul2r x : 0 <= x -> {homo *%R^~ x : y z / y <= z}. Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), @homomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) (fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.mul (NumDomain.ringType R) x0 x) (fun y z : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) (fun y z : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) *) by move=> x_ge0 y z leyz; rewrite ![_ * x]mulrC ler_wpmul2l. Qed. Lemma ler_wnmul2l x : x <= 0 -> {homo *%R x : y z /~ y <= z}. Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), @homomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x) (fun z y : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) (fun y z : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) *) by move=> x_le0 y z leyz; rewrite -![x * _]mulrNN ler_wpmul2l ?lter_oppE. Qed. Lemma ler_wnmul2r x : x <= 0 -> {homo *%R^~ x : y z /~ y <= z}. Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), @homomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) (fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.mul (NumDomain.ringType R) x0 x) (fun z y : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) (fun y z : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R y z)) *) by move=> x_le0 y z leyz; rewrite -![_ * x]mulrNN ler_wpmul2r ?lter_oppE. Qed. Lemma ler_pmul x1 y1 x2 y2 : 0 <= x1 -> 0 <= x2 -> x1 <= y1 -> x2 <= y2 -> x1 * x2 <= y1 * y2. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x1)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x2)) (_ : is_true (@ler R x1 y1)) (_ : is_true (@ler R x2 y2)), is_true (@ler R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2)) *) move=> x1ge0 x2ge0 le_xy1 le_xy2; have y1ge0 := ler_trans x1ge0 le_xy1. (* Goal: is_true (@ler R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2)) *) exact: ler_trans (ler_wpmul2r x2ge0 le_xy1) (ler_wpmul2l y1ge0 le_xy2). Qed. Lemma ltr_pmul x1 y1 x2 y2 : 0 <= x1 -> 0 <= x2 -> x1 < y1 -> x2 < y2 -> x1 * x2 < y1 * y2. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x1)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x2)) (_ : is_true (@ltr R x1 y1)) (_ : is_true (@ltr R x2 y2)), is_true (@ltr R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2)) *) move=> x1ge0 x2ge0 lt_xy1 lt_xy2; have y1gt0 := ler_lt_trans x1ge0 lt_xy1. (* Goal: is_true (@ltr R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2)) *) by rewrite (ler_lt_trans (ler_wpmul2r x2ge0 (ltrW lt_xy1))) ?ltr_pmul2l. Qed. Lemma ler_pmuln2r n : (0 < n)%N -> {mono (@GRing.natmul R)^~ n : x y / x <= y}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.natmul (NumDomain.zmodType R) x n) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R x y) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R x y) *) by case: n => // n _ x y /=; rewrite -mulr_natl -[y *+ _]mulr_natl ler_pmul2l. Qed. Lemma ltr_pmuln2r n : (0 < n)%N -> {mono (@GRing.natmul R)^~ n : x y / x < y}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.natmul (NumDomain.zmodType R) x n) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R x y) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R x y) *) by move/ler_pmuln2r/lerW_mono. Qed. Lemma pmulrnI n : (0 < n)%N -> injective ((@GRing.natmul R)^~ n). Proof. (* Goal: forall _ : is_true (leq (S O) n), @injective (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.natmul (NumDomain.zmodType R) x n) *) by move/ler_pmuln2r/incr_inj. Qed. Lemma eqr_pmuln2r n : (0 < n)%N -> {mono (@GRing.natmul R)^~ n : x y / x == y}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @monomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.natmul (NumDomain.zmodType R) x n) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) x y) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => @eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) x y) *) by move/pmulrnI/inj_eq. Qed. Lemma pmulrn_lgt0 x n : (0 < n)%N -> (0 < x *+ n) = (0 < x). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) (@ltr R (GRing.zero (NumDomain.zmodType R)) x) *) by move=> n_gt0; rewrite -(mul0rn _ n) ltr_pmuln2r // mul0rn. Qed. Lemma pmulrn_llt0 x n : (0 < n)%N -> (x *+ n < 0) = (x < 0). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ltr R (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) (@ltr R x (GRing.zero (NumDomain.zmodType R))) *) by move=> n_gt0; rewrite -(mul0rn _ n) ltr_pmuln2r // mul0rn. Qed. Lemma pmulrn_lge0 x n : (0 < n)%N -> (0 <= x *+ n) = (0 <= x). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) by move=> n_gt0; rewrite -(mul0rn _ n) ler_pmuln2r // mul0rn. Qed. Lemma pmulrn_lle0 x n : (0 < n)%N -> (x *+ n <= 0) = (x <= 0). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ler R (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) (@ler R x (GRing.zero (NumDomain.zmodType R))) *) by move=> n_gt0; rewrite -(mul0rn _ n) ler_pmuln2r // mul0rn. Qed. Lemma ltr_wmuln2r x y n : x < y -> (x *+ n < y *+ n) = (0 < n)%N. Proof. (* Goal: forall _ : is_true (@ltr R x y), @eq bool (@ltr R (@GRing.natmul (NumDomain.zmodType R) x n) (@GRing.natmul (NumDomain.zmodType R) y n)) (leq (S O) n) *) by move=> ltxy; case: n=> // n; rewrite ltr_pmuln2r. Qed. Lemma ltr_wpmuln2r n : (0 < n)%N -> {homo (@GRing.natmul R)^~ n : x y / x < y}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @homomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.natmul (NumDomain.zmodType R) x n) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => is_true (@ltr R x y)) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => is_true (@ltr R x y)) *) by move=> n_gt0 x y /= / ltr_wmuln2r ->. Qed. Lemma ler_wmuln2r n : {homo (@GRing.natmul R)^~ n : x y / x <= y}. Proof. (* Goal: @homomorphism_2 (GRing.Zmodule.sort (NumDomain.zmodType R)) (GRing.Zmodule.sort (NumDomain.zmodType R)) (fun x : GRing.Zmodule.sort (NumDomain.zmodType R) => @GRing.natmul (NumDomain.zmodType R) x n) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => is_true (@ler R x y)) (fun x y : GRing.Zmodule.sort (NumDomain.zmodType R) => is_true (@ler R x y)) *) by move=> x y hxy /=; case: n=> // n; rewrite ler_pmuln2r. Qed. Lemma mulrn_wge0 x n : 0 <= x -> 0 <= x *+ n. Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) *) by move=> /(ler_wmuln2r n); rewrite mul0rn. Qed. Lemma mulrn_wle0 x n : x <= 0 -> x *+ n <= 0. Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), is_true (@ler R (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) *) by move=> /(ler_wmuln2r n); rewrite mul0rn. Qed. Lemma ler_muln2r n x y : (x *+ n <= y *+ n) = ((n == 0%N) || (x <= y)). Proof. (* Goal: @eq bool (@ler R (@GRing.natmul (NumDomain.zmodType R) x n) (@GRing.natmul (NumDomain.zmodType R) y n)) (orb (@eq_op nat_eqType n O) (@ler R x y)) *) by case: n => [|n]; rewrite ?lerr ?eqxx // ler_pmuln2r. Qed. Lemma ltr_muln2r n x y : (x *+ n < y *+ n) = ((0 < n)%N && (x < y)). Proof. (* Goal: @eq bool (@ltr R (@GRing.natmul (NumDomain.zmodType R) x n) (@GRing.natmul (NumDomain.zmodType R) y n)) (andb (leq (S O) n) (@ltr R x y)) *) by case: n => [|n]; rewrite ?lerr ?eqxx // ltr_pmuln2r. Qed. Lemma eqr_muln2r n x y : (x *+ n == y *+ n) = (n == 0)%N || (x == y). Proof. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n) (@GRing.natmul (NumDomain.zmodType R) y n)) (orb (@eq_op nat_eqType n O) (@eq_op (NumDomain.eqType R) x y)) *) by rewrite !eqr_le !ler_muln2r -orb_andr. Qed. Lemma mulrn_eq0 x n : (x *+ n == 0) = ((n == 0)%N || (x == 0)). Proof. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) (orb (@eq_op nat_eqType n O) (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) *) by rewrite -mulr_natl mulf_eq0 pnatr_eq0. Qed. Lemma mulrIn x : x != 0 -> injective (GRing.natmul x). Proof. (* Goal: forall _ : is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))), @injective (GRing.Zmodule.sort (NumDomain.zmodType R)) nat (@GRing.natmul (NumDomain.zmodType R) x) *) move=> x_neq0 m n; without loss /subnK <-: m n / (n <= m)%N. (* Goal: forall _ : @eq (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x (addn (subn m n) n)) (@GRing.natmul (NumDomain.zmodType R) x n), @eq nat (addn (subn m n) n) n *) (* Goal: forall (_ : forall (m n : nat) (_ : is_true (leq n m)) (_ : @eq (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x m) (@GRing.natmul (NumDomain.zmodType R) x n)), @eq nat m n) (_ : @eq (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x m) (@GRing.natmul (NumDomain.zmodType R) x n)), @eq nat m n *) by move=> IH eq_xmn; case/orP: (leq_total m n) => /IH->. (* Goal: forall _ : @eq (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x (addn (subn m n) n)) (@GRing.natmul (NumDomain.zmodType R) x n), @eq nat (addn (subn m n) n) n *) by move/eqP; rewrite mulrnDr -subr_eq0 addrK mulrn_eq0 => /predU1P[-> | /idPn]. Qed. Lemma ler_wpmuln2l x : 0 <= x -> {homo (@GRing.natmul R x) : m n / (m <= n)%N >-> m <= n}. Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), @homomorphism_2 nat (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x) (fun m n : nat => is_true (leq m n)) (fun m n : GRing.Zmodule.sort (NumDomain.zmodType R) => is_true (@ler R m n)) *) by move=> xge0 m n /subnK <-; rewrite mulrnDr ler_paddl ?mulrn_wge0. Qed. Lemma ler_wnmuln2l x : x <= 0 -> {homo (@GRing.natmul R x) : m n / (n <= m)%N >-> m <= n}. Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), @homomorphism_2 nat (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x) (fun m n : nat => is_true (leq n m)) (fun m n : GRing.Zmodule.sort (NumDomain.zmodType R) => is_true (@ler R m n)) *) by move=> xle0 m n hmn /=; rewrite -ler_opp2 -!mulNrn ler_wpmuln2l // oppr_cp0. Qed. Lemma mulrn_wgt0 x n : 0 < x -> 0 < x *+ n = (0 < n)%N. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) (leq (S O) n) *) by case: n => // n hx; rewrite pmulrn_lgt0. Qed. Lemma mulrn_wlt0 x n : x < 0 -> x *+ n < 0 = (0 < n)%N. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) (leq (S O) n) *) by case: n => // n hx; rewrite pmulrn_llt0. Qed. Lemma ler_pmuln2l x : 0 < x -> {mono (@GRing.natmul R x) : m n / (m <= n)%N >-> m <= n}. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @monomorphism_2 nat (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.natmul (NumDomain.zmodType R) x) (fun m n : nat => leq m n) (fun m n : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R m n) *) move=> x_gt0 m n /=; case: leqP => hmn; first by rewrite ler_wpmuln2l // ltrW. (* Goal: @eq bool (@ler R (@GRing.natmul (NumDomain.zmodType R) x m) (@GRing.natmul (NumDomain.zmodType R) x n)) false *) rewrite -(subnK (ltnW hmn)) mulrnDr ger_addr ltr_geF //. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x (subn m n))) *) by rewrite mulrn_wgt0 // subn_gt0. Qed. Lemma ltr_pmuln2l x : 0 < x -> {mono (@GRing.natmul R x) : m n / (m < n)%N >-> m < n}. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @monomorphism_2 nat (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.natmul (NumDomain.zmodType R) x) (fun m n : nat => leq (S m) n) (fun m n : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R m n) *) by move=> x_gt0; apply: lenrW_mono (ler_pmuln2l _). Qed. Lemma ler_nmuln2l x : x < 0 -> {mono (@GRing.natmul R x) : m n / (n <= m)%N >-> m <= n}. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @monomorphism_2 nat (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.natmul (NumDomain.zmodType R) x) (fun m n : nat => leq n m) (fun m n : GRing.Zmodule.sort (NumDomain.zmodType R) => @ler R m n) *) by move=> x_lt0 m n /=; rewrite -ler_opp2 -!mulNrn ler_pmuln2l // oppr_gt0. Qed. Lemma ltr_nmuln2l x : x < 0 -> {mono (@GRing.natmul R x) : m n / (n < m)%N >-> m < n}. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @monomorphism_2 nat (GRing.Zmodule.sort (NumDomain.zmodType R)) bool (@GRing.natmul (NumDomain.zmodType R) x) (fun m n : nat => leq (S n) m) (fun m n : GRing.Zmodule.sort (NumDomain.zmodType R) => @ltr R m n) *) by move=> x_lt0; apply: lenrW_nmono (ler_nmuln2l _). Qed. Lemma ler_nat m n : (m%:R <= n%:R :> R) = (m <= n)%N. Proof. (* Goal: @eq bool (@ler R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) m : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R)) (leq m n) *) by rewrite ler_pmuln2l. Qed. Lemma ltr_nat m n : (m%:R < n%:R :> R) = (m < n)%N. Proof. (* Goal: @eq bool (@ltr R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) m : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R)) (leq (S m) n) *) by rewrite ltr_pmuln2l. Qed. Lemma eqr_nat m n : (m%:R == n%:R :> R) = (m == n)%N. Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) m : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R)) (@eq_op nat_eqType m n) *) by rewrite (inj_eq (mulrIn _)) ?oner_eq0. Qed. Lemma pnatr_eq1 n : (n%:R == 1 :> R) = (n == 1)%N. Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R) (GRing.one (NumDomain.ringType R) : NumDomain.sort R)) (@eq_op nat_eqType n (S O)) *) exact: eqr_nat 1%N. Qed. Lemma lern0 n : (n%:R <= 0 :> R) = (n == 0%N). Proof. (* Goal: @eq bool (@ler R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R)) (@eq_op nat_eqType n O) *) by rewrite -[0]/0%:R ler_nat leqn0. Qed. Lemma ltrn0 n : (n%:R < 0 :> R) = false. Proof. (* Goal: @eq bool (@ltr R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R)) false *) by rewrite -[0]/0%:R ltr_nat ltn0. Qed. Lemma ler1n n : 1 <= n%:R :> R = (1 <= n)%N. Proof. by rewrite -ler_nat. Qed. Proof. (* Goal: @eq bool (@ler R (GRing.one (NumDomain.ringType R) : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R)) (leq (S O) n) *) by rewrite -ler_nat. Qed. Lemma lern1 n : n%:R <= 1 :> R = (n <= 1)%N. Proof. by rewrite -ler_nat. Qed. Lemma ltrN10 : -1 < 0 :> R. Proof. by rewrite oppr_lt0. Qed. Proof. (* Goal: is_true (@ltr R (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R)) *) by rewrite oppr_lt0. Qed. Lemma ltr10 : 1 < 0 :> R = false. Proof. by rewrite ler_gtF. Qed. Proof. (* Goal: @eq bool (@ltr R (GRing.one (NumDomain.ringType R) : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R)) false *) by rewrite ler_gtF. Qed. Lemma ltr0N1 : 0 < -1 :> R = false. Proof. by rewrite ler_gtF // lerN10. Qed. Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) : NumDomain.sort R)) false *) by rewrite ler_gtF // lerN10. Qed. Lemma pmulrn_rgt0 x n : 0 < x -> 0 < x *+ n = (0 < n)%N. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) (leq (S O) n) *) by move=> x_gt0; rewrite -(mulr0n x) ltr_pmuln2l. Qed. Lemma pmulrn_rlt0 x n : 0 < x -> x *+ n < 0 = false. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ltr R (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) false *) by move=> x_gt0; rewrite -(mulr0n x) ltr_pmuln2l. Qed. Lemma pmulrn_rge0 x n : 0 < x -> 0 <= x *+ n. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) *) by move=> x_gt0; rewrite -(mulr0n x) ler_pmuln2l. Qed. Lemma pmulrn_rle0 x n : 0 < x -> x *+ n <= 0 = (n == 0)%N. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ler R (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) (@eq_op nat_eqType n O) *) by move=> x_gt0; rewrite -(mulr0n x) ler_pmuln2l ?leqn0. Qed. Lemma nmulrn_rgt0 x n : x < 0 -> 0 < x *+ n = false. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) false *) by move=> x_lt0; rewrite -(mulr0n x) ltr_nmuln2l. Qed. Lemma nmulrn_rge0 x n : x < 0 -> 0 <= x *+ n = (n == 0)%N. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n)) (@eq_op nat_eqType n O) *) by move=> x_lt0; rewrite -(mulr0n x) ler_nmuln2l ?leqn0. Qed. Lemma nmulrn_rle0 x n : x < 0 -> x *+ n <= 0. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), is_true (@ler R (@GRing.natmul (NumDomain.zmodType R) x n) (GRing.zero (NumDomain.zmodType R))) *) by move=> x_lt0; rewrite -(mulr0n x) ler_nmuln2l. Qed. Lemma pmulr_rlt0 x y : 0 < x -> (x * y < 0) = (y < 0). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R))) (@ltr R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_gt0; rewrite -oppr_gt0 -mulrN pmulr_rgt0 // oppr_gt0. Qed. Lemma pmulr_rle0 x y : 0 < x -> (x * y <= 0) = (y <= 0). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R))) (@ler R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_gt0; rewrite -oppr_ge0 -mulrN pmulr_rge0 // oppr_ge0. Qed. Lemma pmulr_lgt0 x y : 0 < x -> (0 < y * x) = (0 < y). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) y x)) (@ltr R (GRing.zero (NumDomain.zmodType R)) y) *) by move=> x_gt0; rewrite mulrC pmulr_rgt0. Qed. Lemma pmulr_lge0 x y : 0 < x -> (0 <= y * x) = (0 <= y). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) y x)) (@ler R (GRing.zero (NumDomain.zmodType R)) y) *) by move=> x_gt0; rewrite mulrC pmulr_rge0. Qed. Lemma pmulr_llt0 x y : 0 < x -> (y * x < 0) = (y < 0). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) y x) (GRing.zero (NumDomain.zmodType R))) (@ltr R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_gt0; rewrite mulrC pmulr_rlt0. Qed. Lemma pmulr_lle0 x y : 0 < x -> (y * x <= 0) = (y <= 0). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) y x) (GRing.zero (NumDomain.zmodType R))) (@ler R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_gt0; rewrite mulrC pmulr_rle0. Qed. Lemma nmulr_rgt0 x y : x < 0 -> (0 < x * y) = (y < 0). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) (@ltr R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_lt0; rewrite -mulrNN pmulr_rgt0 lter_oppE. Qed. Lemma nmulr_rge0 x y : x < 0 -> (0 <= x * y) = (y <= 0). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) (@ler R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_lt0; rewrite -mulrNN pmulr_rge0 lter_oppE. Qed. Lemma nmulr_rlt0 x y : x < 0 -> (x * y < 0) = (0 < y). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R))) (@ltr R (GRing.zero (NumDomain.zmodType R)) y) *) by move=> x_lt0; rewrite -mulrNN pmulr_rlt0 lter_oppE. Qed. Lemma nmulr_rle0 x y : x < 0 -> (x * y <= 0) = (0 <= y). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R))) (@ler R (GRing.zero (NumDomain.zmodType R)) y) *) by move=> x_lt0; rewrite -mulrNN pmulr_rle0 lter_oppE. Qed. Lemma nmulr_lgt0 x y : x < 0 -> (0 < y * x) = (y < 0). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) y x)) (@ltr R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_lt0; rewrite mulrC nmulr_rgt0. Qed. Lemma nmulr_lge0 x y : x < 0 -> (0 <= y * x) = (y <= 0). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) y x)) (@ler R y (GRing.zero (NumDomain.zmodType R))) *) by move=> x_lt0; rewrite mulrC nmulr_rge0. Qed. Lemma nmulr_llt0 x y : x < 0 -> (y * x < 0) = (0 < y). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) y x) (GRing.zero (NumDomain.zmodType R))) (@ltr R (GRing.zero (NumDomain.zmodType R)) y) *) by move=> x_lt0; rewrite mulrC nmulr_rlt0. Qed. Lemma nmulr_lle0 x y : x < 0 -> (y * x <= 0) = (0 <= y). Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) y x) (GRing.zero (NumDomain.zmodType R))) (@ler R (GRing.zero (NumDomain.zmodType R)) y) *) by move=> x_lt0; rewrite mulrC nmulr_rle0. Qed. Lemma mulr_ge0 x y : 0 <= x -> 0 <= y -> 0 <= x * y. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) *) by move=> x_ge0 y_ge0; rewrite -(mulr0 x) ler_wpmul2l. Qed. Lemma mulr_le0 x y : x <= 0 -> y <= 0 -> 0 <= x * y. Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) *) by move=> x_le0 y_le0; rewrite -(mulr0 x) ler_wnmul2l. Qed. Lemma mulr_ge0_le0 x y : 0 <= x -> y <= 0 -> x * y <= 0. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))), is_true (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R))) *) by move=> x_le0 y_le0; rewrite -(mulr0 x) ler_wpmul2l. Qed. Lemma mulr_le0_ge0 x y : x <= 0 -> 0 <= y -> x * y <= 0. Proof. (* Goal: forall (_ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R))) *) by move=> x_le0 y_le0; rewrite -(mulr0 x) ler_wnmul2l. Qed. Lemma mulr_gt0 x y : 0 < x -> 0 < y -> 0 < x * y. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) *) by move=> x_gt0 y_gt0; rewrite pmulr_rgt0. Qed. Lemma prodr_ge0 I r (P : pred I) (E : I -> R) : (forall i, P i -> 0 <= E i) -> 0 <= \prod_(i <- r | P i) E i. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (E i)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) I i (@GRing.mul (NumDomain.ringType R)) (P i) (E i)))) *) by move=> Ege0; rewrite -nnegrE rpred_prod. Qed. Lemma prodr_gt0 I r (P : pred I) (E : I -> R) : (forall i, P i -> 0 < E i) -> 0 < \prod_(i <- r | P i) E i. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (E i)), is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) I i (@GRing.mul (NumDomain.ringType R)) (P i) (E i)))) *) by move=> Ege0; rewrite -posrE rpred_prod. Qed. Lemma ler_prod I r (P : pred I) (E1 E2 : I -> R) : (forall i, P i -> 0 <= E1 i <= E2 i) -> \prod_(i <- r | P i) E1 i <= \prod_(i <- r | P i) E2 i. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (andb (@ler R (GRing.zero (NumDomain.zmodType R)) (E1 i)) (@ler R (E1 i) (E2 i))), is_true (@ler R (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) I i (@GRing.mul (NumDomain.ringType R)) (P i) (E1 i))) (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) I i (@GRing.mul (NumDomain.ringType R)) (P i) (E2 i)))) *) move=> leE12; elim/(big_load (fun x => 0 <= x)): _. (* Goal: prod (is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@BigOp.bigop (NumDomain.sort R) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (NumDomain.sort R) I i (@GRing.mul (NumDomain.ringType R)) (P i) (E1 i))))) (is_true (@ler R (@BigOp.bigop (NumDomain.sort R) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (NumDomain.sort R) I i (@GRing.mul (NumDomain.ringType R)) (P i) (E1 i))) (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) I (GRing.one (NumDomain.ringType R)) r (fun i : I => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) I i (@GRing.mul (NumDomain.ringType R)) (P i) (E2 i))))) *) elim/big_rec2: _ => // i x2 x1 /leE12/andP[le0Ei leEi12] [x1ge0 le_x12]. (* Goal: prod (is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) (E1 i) x1))) (is_true (@ler R (@GRing.mul (NumDomain.ringType R) (E1 i) x1) (@GRing.mul (NumDomain.ringType R) (E2 i) x2))) *) by rewrite mulr_ge0 // ler_pmul. Qed. Lemma ltr_prod I r (P : pred I) (E1 E2 : I -> R) : has P r -> (forall i, P i -> 0 <= E1 i < E2 i) -> \prod_(i <- r | P i) E1 i < \prod_(i <- r | P i) E2 i. Lemma ltr_prod_nat (E1 E2 : nat -> R) (n m : nat) : (m < n)%N -> (forall i, (m <= i < n)%N -> 0 <= E1 i < E2 i) -> \prod_(m <= i < n) E1 i < \prod_(m <= i < n) E2 i. Proof. (* Goal: forall (_ : is_true (leq (S m) n)) (_ : forall (i : nat) (_ : is_true (andb (leq m i) (leq (S i) n))), is_true (andb (@ler R (GRing.zero (NumDomain.zmodType R)) (E1 i)) (@ltr R (E1 i) (E2 i)))), is_true (@ltr R (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) nat (GRing.one (NumDomain.ringType R)) (index_iota m n) (fun i : nat => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) nat i (@GRing.mul (NumDomain.ringType R)) true (E1 i))) (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType R)) nat (GRing.one (NumDomain.ringType R)) (index_iota m n) (fun i : nat => @BigBody (GRing.Ring.sort (NumDomain.ringType R)) nat i (@GRing.mul (NumDomain.ringType R)) true (E2 i)))) *) move=> lt_mn ltE12; rewrite !big_nat ltr_prod {ltE12}//. (* Goal: is_true (@has nat (fun i : nat => andb (leq m i) (leq (S i) n)) (index_iota m n)) *) by apply/hasP; exists m; rewrite ?mem_index_iota leqnn. Qed. Lemma realMr x y : x != 0 -> x \is real -> (x * y \is real) = (y \is real). Proof. (* Goal: forall (_ : is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))))) (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), @eq bool (@in_mem (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) move=> x_neq0 xR; case: real_ltrgtP x_neq0 => // hx _; rewrite !realE. (* Goal: @eq bool (orb (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R)))) (orb (@ler R (GRing.zero (NumDomain.zmodType R)) y) (@ler R y (GRing.zero (NumDomain.zmodType R)))) *) (* Goal: @eq bool (orb (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R)))) (orb (@ler R (GRing.zero (NumDomain.zmodType R)) y) (@ler R y (GRing.zero (NumDomain.zmodType R)))) *) by rewrite nmulr_rge0 // nmulr_rle0 // orbC. (* Goal: @eq bool (orb (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x y)) (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType R)))) (orb (@ler R (GRing.zero (NumDomain.zmodType R)) y) (@ler R y (GRing.zero (NumDomain.zmodType R)))) *) by rewrite pmulr_rge0 // pmulr_rle0 // orbC. Qed. Lemma realrM x y : y != 0 -> y \is real -> (x * y \is real) = (x \is real). Proof. (* Goal: forall (_ : is_true (negb (@eq_op (NumDomain.eqType R) y (GRing.zero (NumDomain.zmodType R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), @eq bool (@in_mem (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> y_neq0 yR; rewrite mulrC realMr. Qed. Lemma realM : {in real &, forall x y, x * y \is real}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => is_true (@in_mem (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (inPhantom (forall x y : NumDomain.sort R, is_true (@in_mem (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))) *) exact: rpredM. Qed. Lemma realrMn x n : (n != 0)%N -> (x *+ n \is real) = (x \is real). Proof. (* Goal: forall _ : is_true (negb (@eq_op nat_eqType n O)), @eq bool (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.natmul (NumDomain.zmodType R) x n) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) by move=> n_neq0; rewrite -mulr_natl realMr ?realn ?pnatr_eq0. Qed. Lemma ger_pmull x y : 0 < y -> (x * y <= y) = (x <= 1). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) x y) y) (@ler R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{2}[y]mul1r ler_pmul2r. Qed. Lemma gtr_pmull x y : 0 < y -> (x * y < y) = (x < 1). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) x y) y) (@ltr R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{2}[y]mul1r ltr_pmul2r. Qed. Lemma ger_pmulr x y : 0 < y -> (y * x <= y) = (x <= 1). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) y x) y) (@ler R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{2}[y]mulr1 ler_pmul2l. Qed. Lemma gtr_pmulr x y : 0 < y -> (y * x < y) = (x < 1). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) y x) y) (@ltr R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{2}[y]mulr1 ltr_pmul2l. Qed. Lemma ler_pmull x y : 0 < y -> (y <= x * y) = (1 <= x). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ler R y (@GRing.mul (NumDomain.ringType R) x y)) (@ler R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{1}[y]mul1r ler_pmul2r. Qed. Lemma ltr_pmull x y : 0 < y -> (y < x * y) = (1 < x). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ltr R y (@GRing.mul (NumDomain.ringType R) x y)) (@ltr R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{1}[y]mul1r ltr_pmul2r. Qed. Lemma ler_pmulr x y : 0 < y -> (y <= y * x) = (1 <= x). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ler R y (@GRing.mul (NumDomain.ringType R) y x)) (@ler R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{1}[y]mulr1 ler_pmul2l. Qed. Lemma ltr_pmulr x y : 0 < y -> (y < y * x) = (1 < x). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y), @eq bool (@ltr R y (@GRing.mul (NumDomain.ringType R) y x)) (@ltr R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{1}[y]mulr1 ltr_pmul2l. Qed. Lemma ger_nmull x y : y < 0 -> (x * y <= y) = (1 <= x). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) x y) y) (@ler R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{2}[y]mul1r ler_nmul2r. Qed. Lemma gtr_nmull x y : y < 0 -> (x * y < y) = (1 < x). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) x y) y) (@ltr R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{2}[y]mul1r ltr_nmul2r. Qed. Lemma ger_nmulr x y : y < 0 -> (y * x <= y) = (1 <= x). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) y x) y) (@ler R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{2}[y]mulr1 ler_nmul2l. Qed. Lemma gtr_nmulr x y : y < 0 -> (y * x < y) = (1 < x). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) y x) y) (@ltr R (GRing.one (NumDomain.ringType R)) x) *) by move=> hy; rewrite -{2}[y]mulr1 ltr_nmul2l. Qed. Lemma ler_nmull x y : y < 0 -> (y <= x * y) = (x <= 1). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R y (@GRing.mul (NumDomain.ringType R) x y)) (@ler R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{1}[y]mul1r ler_nmul2r. Qed. Lemma ltr_nmull x y : y < 0 -> (y < x * y) = (x < 1). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R y (@GRing.mul (NumDomain.ringType R) x y)) (@ltr R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{1}[y]mul1r ltr_nmul2r. Qed. Lemma ler_nmulr x y : y < 0 -> (y <= y * x) = (x <= 1). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R y (@GRing.mul (NumDomain.ringType R) y x)) (@ler R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{1}[y]mulr1 ler_nmul2l. Qed. Lemma ltr_nmulr x y : y < 0 -> (y < y * x) = (x < 1). Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R y (@GRing.mul (NumDomain.ringType R) y x)) (@ltr R x (GRing.one (NumDomain.ringType R))) *) by move=> hy; rewrite -{1}[y]mulr1 ltr_nmul2l. Qed. Lemma ler_pemull x y : 0 <= y -> 1 <= x -> y <= x * y. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)) (_ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x)), is_true (@ler R y (@GRing.mul (NumDomain.ringType R) x y)) *) by move=> hy hx; rewrite -{1}[y]mul1r ler_wpmul2r. Qed. Lemma ler_nemull x y : y <= 0 -> 1 <= x -> x * y <= y. Proof. (* Goal: forall (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x)), is_true (@ler R (@GRing.mul (NumDomain.ringType R) x y) y) *) by move=> hy hx; rewrite -{2}[y]mul1r ler_wnmul2r. Qed. Lemma ler_pemulr x y : 0 <= y -> 1 <= x -> y <= y * x. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)) (_ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x)), is_true (@ler R y (@GRing.mul (NumDomain.ringType R) y x)) *) by move=> hy hx; rewrite -{1}[y]mulr1 ler_wpmul2l. Qed. Lemma ler_nemulr x y : y <= 0 -> 1 <= x -> y * x <= y. Proof. (* Goal: forall (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x)), is_true (@ler R (@GRing.mul (NumDomain.ringType R) y x) y) *) by move=> hy hx; rewrite -{2}[y]mulr1 ler_wnmul2l. Qed. Lemma ler_pimull x y : 0 <= y -> x <= 1 -> x * y <= y. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))), is_true (@ler R (@GRing.mul (NumDomain.ringType R) x y) y) *) by move=> hy hx; rewrite -{2}[y]mul1r ler_wpmul2r. Qed. Lemma ler_nimull x y : y <= 0 -> x <= 1 -> y <= x * y. Proof. (* Goal: forall (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))), is_true (@ler R y (@GRing.mul (NumDomain.ringType R) x y)) *) by move=> hy hx; rewrite -{1}[y]mul1r ler_wnmul2r. Qed. Lemma ler_pimulr x y : 0 <= y -> x <= 1 -> y * x <= y. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))), is_true (@ler R (@GRing.mul (NumDomain.ringType R) y x) y) *) by move=> hy hx; rewrite -{2}[y]mulr1 ler_wpmul2l. Qed. Lemma ler_nimulr x y : y <= 0 -> x <= 1 -> y <= y * x. Proof. (* Goal: forall (_ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))), is_true (@ler R y (@GRing.mul (NumDomain.ringType R) y x)) *) by move=> hx hy; rewrite -{1}[y]mulr1 ler_wnmul2l. Qed. Lemma mulr_ile1 x y : 0 <= x -> 0 <= y -> x <= 1 -> y <= 1 -> x * y <= 1. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))) (_ : is_true (@ler R y (GRing.one (NumDomain.ringType R)))), is_true (@ler R (@GRing.mul (NumDomain.ringType R) x y) (GRing.one (NumDomain.ringType R))) *) by move=> *; rewrite (@ler_trans _ y) ?ler_pimull. Qed. Lemma mulr_ilt1 x y : 0 <= x -> 0 <= y -> x < 1 -> y < 1 -> x * y < 1. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)) (_ : is_true (@ltr R x (GRing.one (NumDomain.ringType R)))) (_ : is_true (@ltr R y (GRing.one (NumDomain.ringType R)))), is_true (@ltr R (@GRing.mul (NumDomain.ringType R) x y) (GRing.one (NumDomain.ringType R))) *) by move=> *; rewrite (@ler_lt_trans _ y) ?ler_pimull // ltrW. Qed. Definition mulr_ilte1 := (mulr_ile1, mulr_ilt1). Lemma mulr_ege1 x y : 1 <= x -> 1 <= y -> 1 <= x * y. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x)) (_ : is_true (@ler R (GRing.one (NumDomain.ringType R)) y)), is_true (@ler R (GRing.one (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y)) *) by move=> le1x le1y; rewrite (@ler_trans _ y) ?ler_pemull // (ler_trans ler01). Qed. Lemma mulr_egt1 x y : 1 < x -> 1 < y -> 1 < x * y. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x)) (_ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) y)), is_true (@ltr R (GRing.one (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y)) *) by move=> le1x lt1y; rewrite (@ltr_trans _ y) // ltr_pmull // (ltr_trans ltr01). Qed. Definition mulr_egte1 := (mulr_ege1, mulr_egt1). Definition mulr_cp1 := (mulr_ilte1, mulr_egte1). Lemma invr_gt0 x : (0 < x^-1) = (0 < x). Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.inv (NumDomain.unitRingType R) x)) (@ltr R (GRing.zero (NumDomain.zmodType R)) x) *) have [ux | nux] := boolP (x \is a GRing.unit); last by rewrite invr_out. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.inv (NumDomain.unitRingType R) x)) (@ltr R (GRing.zero (NumDomain.zmodType R)) x) *) by apply/idP/idP=> /ltr_pmul2r<-; rewrite mul0r (mulrV, mulVr) ?ltr01. Qed. Lemma invr_ge0 x : (0 <= x^-1) = (0 <= x). Proof. (* Goal: @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.inv (NumDomain.unitRingType R) x)) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) by rewrite !le0r invr_gt0 invr_eq0. Qed. Lemma invr_lt0 x : (x^-1 < 0) = (x < 0). Proof. (* Goal: @eq bool (@ltr R (@GRing.inv (NumDomain.unitRingType R) x) (GRing.zero (NumDomain.zmodType R))) (@ltr R x (GRing.zero (NumDomain.zmodType R))) *) by rewrite -oppr_cp0 -invrN invr_gt0 oppr_cp0. Qed. Lemma invr_le0 x : (x^-1 <= 0) = (x <= 0). Proof. (* Goal: @eq bool (@ler R (@GRing.inv (NumDomain.unitRingType R) x) (GRing.zero (NumDomain.zmodType R))) (@ler R x (GRing.zero (NumDomain.zmodType R))) *) by rewrite -oppr_cp0 -invrN invr_ge0 oppr_cp0. Qed. Definition invr_gte0 := (invr_ge0, invr_gt0). Definition invr_lte0 := (invr_le0, invr_lt0). Lemma divr_ge0 x y : 0 <= x -> 0 <= y -> 0 <= x / y. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x (@GRing.inv (NumDomain.unitRingType R) y))) *) by move=> x_ge0 y_ge0; rewrite mulr_ge0 ?invr_ge0. Qed. Lemma divr_gt0 x y : 0 < x -> 0 < y -> 0 < x / y. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) y)), is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.mul (NumDomain.ringType R) x (@GRing.inv (NumDomain.unitRingType R) y))) *) by move=> x_gt0 y_gt0; rewrite pmulr_rgt0 ?invr_gt0. Qed. Lemma realV : {mono (@GRing.inv R) : x / x \is real}. Proof. (* Goal: @monomorphism_1 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (GRing.UnitRing.sort (NumDomain.unitRingType R)) bool (@GRing.inv (NumDomain.unitRingType R)) (fun x : GRing.UnitRing.sort (NumDomain.unitRingType R) => @in_mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (fun x : GRing.UnitRing.sort (NumDomain.unitRingType R) => @in_mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) *) exact: rpredV. Qed. Lemma exprn_ge0 n x : 0 <= x -> 0 <= x ^+ n. Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) *) by move=> xge0; rewrite -nnegrE rpredX. Qed. Lemma realX n : {in real, forall x, x ^+ n \is real}. Proof. (* Goal: @prop_in1 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x : NumDomain.sort R => is_true (@in_mem (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (inPhantom (forall x : NumDomain.sort R, is_true (@in_mem (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))))) *) exact: rpredX. Qed. Lemma exprn_gt0 n x : 0 < x -> 0 < x ^+ n. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) *) by rewrite !lt0r expf_eq0 => /andP[/negPf-> /exprn_ge0->]; rewrite andbF. Qed. Definition exprn_gte0 := (exprn_ge0, exprn_gt0). Lemma exprn_ile1 n x : 0 <= x -> x <= 1 -> x ^+ n <= 1. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))), is_true (@ler R (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) *) move=> xge0 xle1; elim: n=> [|*]; rewrite ?expr0 // exprS. (* Goal: is_true (@ler R (@GRing.mul (NumDomain.ringType R) x (@GRing.exp (NumDomain.ringType R) x _n_)) (GRing.one (NumDomain.ringType R))) *) by rewrite mulr_ile1 ?exprn_ge0. Qed. Lemma exprn_ilt1 n x : 0 <= x -> x < 1 -> x ^+ n < 1 = (n != 0%N). Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R x (GRing.one (NumDomain.ringType R)))), @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) (negb (@eq_op nat_eqType n O)) *) move=> xge0 xlt1. (* Goal: @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) (negb (@eq_op nat_eqType n O)) *) case: n; [by rewrite eqxx ltrr | elim=> [|n ihn]; first by rewrite expr1]. (* Goal: @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x (S (S n))) (GRing.one (NumDomain.ringType R))) (negb (@eq_op nat_eqType (S (S n)) O)) *) by rewrite exprS mulr_ilt1 // exprn_ge0. Qed. Definition exprn_ilte1 := (exprn_ile1, exprn_ilt1). Lemma exprn_ege1 n x : 1 <= x -> 1 <= x ^+ n. Proof. (* Goal: forall _ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x), is_true (@ler R (GRing.one (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n)) *) by move=> x_ge1; elim: n=> [|n ihn]; rewrite ?expr0 // exprS mulr_ege1. Qed. Lemma exprn_egt1 n x : 1 < x -> 1 < x ^+ n = (n != 0%N). Proof. (* Goal: forall _ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x), @eq bool (@ltr R (GRing.one (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n)) (negb (@eq_op nat_eqType n O)) *) move=> xgt1; case: n; first by rewrite eqxx ltrr. (* Goal: forall n : nat, @eq bool (@ltr R (GRing.one (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n))) (negb (@eq_op nat_eqType (S n) O)) *) elim=> [|n ihn]; first by rewrite expr1. (* Goal: @eq bool (@ltr R (GRing.one (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S (S n)))) (negb (@eq_op nat_eqType (S (S n)) O)) *) by rewrite exprS mulr_egt1 // exprn_ge0. Qed. Definition exprn_egte1 := (exprn_ege1, exprn_egt1). Definition exprn_cp1 := (exprn_ilte1, exprn_egte1). Lemma ler_iexpr x n : (0 < n)%N -> 0 <= x -> x <= 1 -> x ^+ n <= x. Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))), is_true (@ler R (@GRing.exp (NumDomain.ringType R) x n) x) *) by case: n => n // *; rewrite exprS ler_pimulr // exprn_ile1. Qed. Lemma ltr_iexpr x n : 0 < x -> x < 1 -> (x ^+ n < x) = (1 < n)%N. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R x (GRing.one (NumDomain.ringType R)))), @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x n) x) (leq (S (S O)) n) *) case: n=> [|[|n]] //; first by rewrite expr0 => _ /ltr_gtF ->. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R x (GRing.one (NumDomain.ringType R)))), @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x (S (S n))) x) (leq (S (S O)) (S (S n))) *) by move=> x0 x1; rewrite exprS gtr_pmulr // ?exprn_ilt1 // ltrW. Qed. Definition lter_iexpr := (ler_iexpr, ltr_iexpr). Lemma ler_eexpr x n : (0 < n)%N -> 1 <= x -> x <= x ^+ n. Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x)), is_true (@ler R x (@GRing.exp (NumDomain.ringType R) x n)) *) case: n => // n _ x_ge1. (* Goal: is_true (@ler R x (@GRing.exp (NumDomain.ringType R) x (S n))) *) by rewrite exprS ler_pemulr ?(ler_trans _ x_ge1) // exprn_ege1. Qed. Lemma ltr_eexpr x n : 1 < x -> (x < x ^+ n) = (1 < n)%N. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x), @eq bool (@ltr R x (@GRing.exp (NumDomain.ringType R) x n)) (leq (S (S O)) n) *) move=> x_ge1; case: n=> [|[|n]] //; first by rewrite expr0 ltr_gtF. (* Goal: @eq bool (@ltr R x (@GRing.exp (NumDomain.ringType R) x (S (S n)))) (leq (S (S O)) (S (S n))) *) by rewrite exprS ltr_pmulr ?(ltr_trans _ x_ge1) ?exprn_egt1. Qed. Definition lter_eexpr := (ler_eexpr, ltr_eexpr). Definition lter_expr := (lter_iexpr, lter_eexpr). Lemma ler_wiexpn2l x : 0 <= x -> x <= 1 -> {homo (GRing.exp x) : m n / (n <= m)%N >-> m <= n}. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R x (GRing.one (NumDomain.ringType R)))), @homomorphism_2 nat (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x) (fun m n : nat => is_true (leq n m)) (fun m n : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R m n)) *) move=> xge0 xle1 m n /= hmn. (* Goal: is_true (@ler R (@GRing.exp (NumDomain.ringType R) x m) (@GRing.exp (NumDomain.ringType R) x n)) *) by rewrite -(subnK hmn) exprD ler_pimull ?(exprn_ge0, exprn_ile1). Qed. Lemma ler_weexpn2l x : 1 <= x -> {homo (GRing.exp x) : m n / (m <= n)%N >-> m <= n}. Proof. (* Goal: forall _ : is_true (@ler R (GRing.one (NumDomain.ringType R)) x), @homomorphism_2 nat (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x) (fun m n : nat => is_true (leq m n)) (fun m n : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R m n)) *) move=> xge1 m n /= hmn; rewrite -(subnK hmn) exprD. (* Goal: is_true (@ler R (@GRing.exp (NumDomain.ringType R) x m) (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) x (subn n m)) (@GRing.exp (NumDomain.ringType R) x m))) *) by rewrite ler_pemull ?(exprn_ge0, exprn_ege1) // (ler_trans _ xge1) ?ler01. Qed. Lemma ieexprn_weq1 x n : 0 <= x -> (x ^+ n == 1) = ((n == 0%N) || (x == 1)). Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType n O) (@eq_op (NumDomain.eqType R) x (GRing.one (NumDomain.ringType R)))) *) move=> xle0; case: n => [|n]; first by rewrite expr0 eqxx. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) (@eq_op (NumDomain.eqType R) x (GRing.one (NumDomain.ringType R)))) *) case: (@real_ltrgtP x 1); do ?by rewrite ?ger0_real. (* Goal: forall _ : @eq (NumDomain.sort R) x (GRing.one (NumDomain.ringType R)), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) true) *) (* Goal: forall _ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) false) *) (* Goal: forall _ : is_true (@ltr R x (GRing.one (NumDomain.ringType R))), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) false) *) + (* Goal: forall _ : @eq (NumDomain.sort R) x (GRing.one (NumDomain.ringType R)), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) true) *) (* Goal: forall _ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) false) *) (* Goal: forall _ : is_true (@ltr R x (GRing.one (NumDomain.ringType R))), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) false) *) by move=> x_lt1; rewrite ?ltr_eqF // exprn_ilt1. (* Goal: forall _ : @eq (NumDomain.sort R) x (GRing.one (NumDomain.ringType R)), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) true) *) (* Goal: forall _ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) false) *) + (* Goal: forall _ : @eq (NumDomain.sort R) x (GRing.one (NumDomain.ringType R)), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) true) *) (* Goal: forall _ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) false) *) by move=> x_lt1; rewrite ?gtr_eqF // exprn_egt1. (* Goal: forall _ : @eq (NumDomain.sort R) x (GRing.one (NumDomain.ringType R)), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S n)) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType (S n) O) true) *) by move->; rewrite expr1n eqxx. Qed. Lemma ieexprIn x : 0 < x -> x != 1 -> injective (GRing.exp x). Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.one (NumDomain.ringType R))))), @injective (GRing.Ring.sort (NumDomain.ringType R)) nat (@GRing.exp (NumDomain.ringType R) x) *) move=> x_gt0 x_neq1 m n; without loss /subnK <-: m n / (n <= m)%N. (* Goal: forall _ : @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (addn (subn m n) n)) (@GRing.exp (NumDomain.ringType R) x n), @eq nat (addn (subn m n) n) n *) (* Goal: forall (_ : forall (m n : nat) (_ : is_true (leq n m)) (_ : @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x m) (@GRing.exp (NumDomain.ringType R) x n)), @eq nat m n) (_ : @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x m) (@GRing.exp (NumDomain.ringType R) x n)), @eq nat m n *) by move=> IH eq_xmn; case/orP: (leq_total m n) => /IH->. (* Goal: forall _ : @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (addn (subn m n) n)) (@GRing.exp (NumDomain.ringType R) x n), @eq nat (addn (subn m n) n) n *) case: {m}(m - n)%N => // m /eqP/idPn[]; rewrite -[x ^+ n]mul1r exprD. (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) x (S m)) (@GRing.exp (NumDomain.ringType R) x n)) (@GRing.mul (NumDomain.ringType R) (GRing.one (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n)))) *) by rewrite (inj_eq (mulIf _)) ?ieexprn_weq1 ?ltrW // expf_neq0 ?gtr_eqF. Qed. Lemma ler_iexpn2l x : 0 < x -> x < 1 -> {mono (GRing.exp x) : m n / (n <= m)%N >-> m <= n}. Lemma ltr_iexpn2l x : 0 < x -> x < 1 -> {mono (GRing.exp x) : m n / (n < m)%N >-> m < n}. Proof. (* Goal: forall (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R x (GRing.one (NumDomain.ringType R)))), @monomorphism_2 nat (GRing.Ring.sort (NumDomain.ringType R)) bool (@GRing.exp (NumDomain.ringType R) x) (fun m n : nat => leq (S n) m) (fun m n : GRing.Ring.sort (NumDomain.ringType R) => @ltr R m n) *) by move=> xgt0 xlt1; apply: (lenrW_nmono (ler_iexpn2l _ _)). Qed. Definition lter_iexpn2l := (ler_iexpn2l, ltr_iexpn2l). Lemma ler_eexpn2l x : 1 < x -> {mono (GRing.exp x) : m n / (m <= n)%N >-> m <= n}. Lemma ltr_eexpn2l x : 1 < x -> {mono (GRing.exp x) : m n / (m < n)%N >-> m < n}. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.one (NumDomain.ringType R)) x), @monomorphism_2 nat (GRing.Ring.sort (NumDomain.ringType R)) bool (@GRing.exp (NumDomain.ringType R) x) (fun m n : nat => leq (S m) n) (fun m n : GRing.Ring.sort (NumDomain.ringType R) => @ltr R m n) *) by move=> xgt1; apply: (lenrW_mono (ler_eexpn2l _)). Qed. Definition lter_eexpn2l := (ler_eexpn2l, ltr_eexpn2l). Lemma ltr_expn2r n x y : 0 <= x -> x < y -> x ^+ n < y ^+ n = (n != 0%N). Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ltr R x y)), @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x n) (@GRing.exp (NumDomain.ringType R) y n)) (negb (@eq_op nat_eqType n O)) *) move=> xge0 xlty; case: n; first by rewrite ltrr. (* Goal: forall n : nat, @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x (S n)) (@GRing.exp (NumDomain.ringType R) y (S n))) (negb (@eq_op nat_eqType (S n) O)) *) elim=> [|n IHn]; rewrite ?[_ ^+ _.+2]exprS //. (* Goal: @eq bool (@ltr R (@GRing.mul (NumDomain.ringType R) x (@GRing.exp (NumDomain.ringType R) x (S n))) (@GRing.mul (NumDomain.ringType R) y (@GRing.exp (NumDomain.ringType R) y (S n)))) (negb (@eq_op nat_eqType (S (S n)) O)) *) rewrite (@ler_lt_trans _ (x * y ^+ n.+1)) ?ler_wpmul2l ?ltr_pmul2r ?IHn //. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) y (S n))) *) (* Goal: is_true (@ler R (@GRing.exp (NumDomain.ringType R) x (S n)) (@GRing.exp (NumDomain.ringType R) y (S n))) *) by rewrite ltrW // ihn. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) y (S n))) *) by rewrite exprn_gt0 // (ler_lt_trans xge0). Qed. Lemma ler_expn2r n : {in nneg & , {homo ((@GRing.exp R)^~ n) : x y / x <= y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R))) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => forall _ : (fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R x0 y0)) x y, (fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R x0 y0)) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) x) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) y)) (inPhantom (@homomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) (fun x : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x n) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R x y)) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ler R x y)))) *) move=> x y /= x0 y0 xy; elim: n => [|n IHn]; rewrite !(expr0, exprS) //. (* Goal: is_true (@ler R (@GRing.mul (NumDomain.ringType R) x (@GRing.exp (NumDomain.ringType R) x n)) (@GRing.mul (NumDomain.ringType R) y (@GRing.exp (NumDomain.ringType R) y n))) *) by rewrite (@ler_trans _ (x * y ^+ n)) ?ler_wpmul2l ?ler_wpmul2r ?exprn_ge0. Qed. Definition lter_expn2r := (ler_expn2r, ltr_expn2r). Lemma ltr_wpexpn2r n : (0 < n)%N -> {in nneg & , {homo ((@GRing.exp R)^~ n) : x y / x < y}}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R))) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => forall _ : (fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ltr R x0 y0)) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) x) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) y)) (inPhantom (@homomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) (fun x : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x n) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ltr R x y)) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => is_true (@ltr R x y)))) *) by move=> ngt0 x y /= x0 y0 hxy; rewrite ltr_expn2r // -lt0n. Qed. Lemma ler_pexpn2r n : (0 < n)%N -> {in nneg & , {mono ((@GRing.exp R)^~ n) : x y / x <= y}}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R))) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @eq bool ((fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => @ler R x0 y0) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) x) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) y)) ((fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x n) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y))) *) case: n => // n _ x y; rewrite !qualifE /= => x_ge0 y_ge0. (* Goal: @eq bool (@ler R (@GRing.exp (NumDomain.ringType R) x (S n)) (@GRing.exp (NumDomain.ringType R) y (S n))) (@ler R x y) *) have [-> | nzx] := eqVneq x 0; first by rewrite exprS mul0r exprn_ge0. (* Goal: @eq bool (@ler R (@GRing.exp (NumDomain.ringType R) x (S n)) (@GRing.exp (NumDomain.ringType R) y (S n))) (@ler R x y) *) rewrite -subr_ge0 subrXX pmulr_lge0 ?subr_ge0 //= big_ord_recr /=. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) (@BigOp.bigop (NumDomain.sort R) (ordinal n) (GRing.zero (GRing.Ring.zmodType (GRing.ComRing.ringType (NumDomain.comRingType R)))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (NumDomain.sort R) (ordinal n) i (@GRing.add (NumDomain.zmodType R)) true (@GRing.mul (GRing.ComRing.ringType (NumDomain.comRingType R)) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) y (subn n (@nat_of_ord n i))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) x (@nat_of_ord n i))))) (@GRing.mul (GRing.ComRing.ringType (NumDomain.comRingType R)) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) y (subn n n)) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) x n)))) *) rewrite subnn expr0 mul1r /= ltr_spaddr // ?exprn_gt0 ?lt0r ?nzx //. (* Goal: is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@BigOp.bigop (NumDomain.sort R) (ordinal n) (GRing.zero (GRing.Ring.zmodType (GRing.ComRing.ringType (NumDomain.comRingType R)))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (NumDomain.sort R) (ordinal n) i (@GRing.add (NumDomain.zmodType R)) true (@GRing.mul (GRing.ComRing.ringType (NumDomain.comRingType R)) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) y (subn n (@nat_of_ord n i))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) x (@nat_of_ord n i)))))) *) by rewrite sumr_ge0 // => i _; rewrite mulr_ge0 ?exprn_ge0. Qed. Lemma ltr_pexpn2r n : (0 < n)%N -> {in nneg & , {mono ((@GRing.exp R)^~ n) : x y / x < y}}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R))) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @eq bool ((fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x0 y0) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) x) ((fun x0 : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x0 n) y)) ((fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x n) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y))) *) by move=> n_gt0 x y x_ge0 y_ge0; rewrite !ltr_neqAle !eqr_le !ler_pexpn2r. Qed. Definition lter_pexpn2r := (ler_pexpn2r, ltr_pexpn2r). Lemma pexpIrn n : (0 < n)%N -> {in nneg &, injective ((@GRing.exp R)^~ n)}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R))) (fun x1 x2 : GRing.Ring.sort (NumDomain.ringType R) => forall _ : @eq (GRing.Ring.sort (NumDomain.ringType R)) ((fun x : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x n) x1) ((fun x : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x n) x2), @eq (GRing.Ring.sort (NumDomain.ringType R)) x1 x2) (inPhantom (@injective (GRing.Ring.sort (NumDomain.ringType R)) (GRing.Ring.sort (NumDomain.ringType R)) (fun x : GRing.Ring.sort (NumDomain.ringType R) => @GRing.exp (NumDomain.ringType R) x n))) *) by move=> n_gt0; apply: incr_inj_in (ler_pexpn2r _). Qed. Lemma expr_le1 n x : (0 < n)%N -> 0 <= x -> (x ^+ n <= 1) = (x <= 1). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), @eq bool (@ler R (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) (@ler R x (GRing.one (NumDomain.ringType R))) *) by move=> ngt0 xge0; rewrite -{1}[1](expr1n _ n) ler_pexpn2r // [_ \in _]ler01. Qed. Lemma expr_lt1 n x : (0 < n)%N -> 0 <= x -> (x ^+ n < 1) = (x < 1). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) (@ltr R x (GRing.one (NumDomain.ringType R))) *) by move=> ngt0 xge0; rewrite -{1}[1](expr1n _ n) ltr_pexpn2r // [_ \in _]ler01. Qed. Definition expr_lte1 := (expr_le1, expr_lt1). Lemma expr_ge1 n x : (0 < n)%N -> 0 <= x -> (1 <= x ^+ n) = (1 <= x). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), @eq bool (@ler R (GRing.one (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n)) (@ler R (GRing.one (NumDomain.ringType R)) x) *) by move=> ngt0 xge0; rewrite -{1}[1](expr1n _ n) ler_pexpn2r // [_ \in _]ler01. Qed. Lemma expr_gt1 n x : (0 < n)%N -> 0 <= x -> (1 < x ^+ n) = (1 < x). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), @eq bool (@ltr R (GRing.one (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n)) (@ltr R (GRing.one (NumDomain.ringType R)) x) *) by move=> ngt0 xge0; rewrite -{1}[1](expr1n _ n) ltr_pexpn2r // [_ \in _]ler01. Qed. Definition expr_gte1 := (expr_ge1, expr_gt1). Lemma pexpr_eq1 x n : (0 < n)%N -> 0 <= x -> (x ^+ n == 1) = (x == 1). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) (@eq_op (NumDomain.eqType R) x (GRing.one (NumDomain.ringType R))) *) by move=> ngt0 xge0; rewrite !eqr_le expr_le1 // expr_ge1. Qed. Lemma pexprn_eq1 x n : 0 <= x -> (x ^+ n == 1) = (n == 0%N) || (x == 1). Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n) (GRing.one (NumDomain.ringType R))) (orb (@eq_op nat_eqType n O) (@eq_op (NumDomain.eqType R) x (GRing.one (NumDomain.ringType R)))) *) by case: n => [|n] xge0; rewrite ?eqxx // pexpr_eq1 ?gtn_eqF. Qed. Lemma eqr_expn2 n x y : (0 < n)%N -> 0 <= x -> 0 <= y -> (x ^+ n == y ^+ n) = (x == y). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) y)), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x n) (@GRing.exp (NumDomain.ringType R) y n)) (@eq_op (NumDomain.eqType R) x y) *) by move=> ngt0 xge0 yge0; rewrite (inj_in_eq (pexpIrn _)). Qed. Lemma sqrp_eq1 x : 0 <= x -> (x ^+ 2 == 1) = (x == 1). Proof. (* Goal: forall _ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S (S O))) (GRing.one (NumDomain.ringType R))) (@eq_op (NumDomain.eqType R) x (GRing.one (NumDomain.ringType R))) *) by move/pexpr_eq1->. Qed. Lemma sqrn_eq1 x : x <= 0 -> (x ^+ 2 == 1) = (x == -1). Proof. (* Goal: forall _ : is_true (@ler R x (GRing.zero (NumDomain.zmodType R))), @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S (S O))) (GRing.one (NumDomain.ringType R))) (@eq_op (NumDomain.eqType R) x (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)))) *) by rewrite -sqrrN -oppr_ge0 -eqr_oppLR => /sqrp_eq1. Qed. Lemma ler_sqr : {in nneg &, {mono (fun x => x ^+ 2) : x y / x <= y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => @ler R x0 y0) ((fun x0 : NumDomain.sort R => @GRing.exp (NumDomain.ringType R) x0 (S (S O))) x) ((fun x0 : NumDomain.sort R => @GRing.exp (NumDomain.ringType R) x0 (S (S O))) y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x : NumDomain.sort R => @GRing.exp (NumDomain.ringType R) x (S (S O))) (fun x y : NumDomain.sort R => @ler R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ler R x y))) *) exact: ler_pexpn2r. Qed. Lemma ltr_sqr : {in nneg &, {mono (fun x => x ^+ 2) : x y / x < y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rnneg R))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x0 y0) ((fun x0 : NumDomain.sort R => @GRing.exp (NumDomain.ringType R) x0 (S (S O))) x) ((fun x0 : NumDomain.sort R => @GRing.exp (NumDomain.ringType R) x0 (S (S O))) y)) ((fun x0 y0 : NumDomain.sort R => @ltr R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (GRing.Ring.sort (NumDomain.ringType R)) bool (fun x : NumDomain.sort R => @GRing.exp (NumDomain.ringType R) x (S (S O))) (fun x y : NumDomain.sort R => @ltr R x y) (fun x y : GRing.Ring.sort (NumDomain.ringType R) => @ltr R x y))) *) exact: ltr_pexpn2r. Qed. Lemma ler_pinv : {in [pred x in GRing.unit | 0 < x] &, {mono (@GRing.inv R) : x y /~ x <= y}}. Proof. (* Goal: @prop_in2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (simplPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@SimplPred (GRing.UnitRing.sort (NumDomain.unitRingType R)) (fun x : GRing.UnitRing.sort (NumDomain.unitRingType R) => andb (@in_mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R))))) (@ltr R (GRing.zero (NumDomain.zmodType R)) x)))) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x0 y0) (@GRing.inv (NumDomain.unitRingType R) x) (@GRing.inv (NumDomain.unitRingType R) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (GRing.UnitRing.sort (NumDomain.unitRingType R)) bool (@GRing.inv (NumDomain.unitRingType R)) (fun y x : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x y) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x y))) *) move=> x y /andP [ux hx] /andP [uy hy] /=. (* Goal: @eq bool (@ler R (@GRing.inv (NumDomain.unitRingType R) x) (@GRing.inv (NumDomain.unitRingType R) y)) (@ler R y x) *) rewrite -(ler_pmul2l hx) -(ler_pmul2r hy). (* Goal: @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) (@GRing.mul (NumDomain.ringType R) x (@GRing.inv (NumDomain.unitRingType R) x)) y) (@GRing.mul (NumDomain.ringType R) (@GRing.mul (NumDomain.ringType R) x (@GRing.inv (NumDomain.unitRingType R) y)) y)) (@ler R y x) *) by rewrite !(divrr, mulrVK) ?unitf_gt0 // mul1r. Qed. Lemma ler_ninv : {in [pred x in GRing.unit | x < 0] &, {mono (@GRing.inv R) : x y /~ x <= y}}. Proof. (* Goal: @prop_in2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (simplPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@SimplPred (GRing.UnitRing.sort (NumDomain.unitRingType R)) (fun x : GRing.UnitRing.sort (NumDomain.unitRingType R) => andb (@in_mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R))))) (@ltr R x (GRing.zero (NumDomain.zmodType R)))))) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x0 y0) (@GRing.inv (NumDomain.unitRingType R) x) (@GRing.inv (NumDomain.unitRingType R) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (GRing.UnitRing.sort (NumDomain.unitRingType R)) bool (@GRing.inv (NumDomain.unitRingType R)) (fun y x : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x y) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ler R x y))) *) move=> x y /andP [ux hx] /andP [uy hy] /=. (* Goal: @eq bool (@ler R (@GRing.inv (NumDomain.unitRingType R) x) (@GRing.inv (NumDomain.unitRingType R) y)) (@ler R y x) *) rewrite -(ler_nmul2l hx) -(ler_nmul2r hy). (* Goal: @eq bool (@ler R (@GRing.mul (NumDomain.ringType R) (@GRing.mul (NumDomain.ringType R) x (@GRing.inv (NumDomain.unitRingType R) x)) y) (@GRing.mul (NumDomain.ringType R) (@GRing.mul (NumDomain.ringType R) x (@GRing.inv (NumDomain.unitRingType R) y)) y)) (@ler R y x) *) by rewrite !(divrr, mulrVK) ?unitf_lt0 // mul1r. Qed. Lemma ltr_pinv : {in [pred x in GRing.unit | 0 < x] &, {mono (@GRing.inv R) : x y /~ x < y}}. Proof. (* Goal: @prop_in2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (simplPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@SimplPred (GRing.UnitRing.sort (NumDomain.unitRingType R)) (fun x : GRing.UnitRing.sort (NumDomain.unitRingType R) => andb (@in_mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R))))) (@ltr R (GRing.zero (NumDomain.zmodType R)) x)))) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x0 y0) (@GRing.inv (NumDomain.unitRingType R) x) (@GRing.inv (NumDomain.unitRingType R) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (GRing.UnitRing.sort (NumDomain.unitRingType R)) bool (@GRing.inv (NumDomain.unitRingType R)) (fun y x : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x y) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x y))) *) exact: lerW_nmono_in ler_pinv. Qed. Lemma ltr_ninv : {in [pred x in GRing.unit | x < 0] &, {mono (@GRing.inv R) : x y /~ x < y}}. Proof. (* Goal: @prop_in2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (simplPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@SimplPred (GRing.UnitRing.sort (NumDomain.unitRingType R)) (fun x : GRing.UnitRing.sort (NumDomain.unitRingType R) => andb (@in_mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R))))) (@ltr R x (GRing.zero (NumDomain.zmodType R)))))) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x0 y0) (@GRing.inv (NumDomain.unitRingType R) x) (@GRing.inv (NumDomain.unitRingType R) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumDomain.unitRingType R)) (GRing.UnitRing.sort (NumDomain.unitRingType R)) bool (@GRing.inv (NumDomain.unitRingType R)) (fun y x : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x y) (fun x y : GRing.UnitRing.sort (NumDomain.unitRingType R) => @ltr R x y))) *) exact: lerW_nmono_in ler_ninv. Qed. Lemma invr_gt1 x : x \is a GRing.unit -> 0 < x -> (1 < x^-1) = (x < 1). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R)))))) (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)), @eq bool (@ltr R (GRing.one (NumDomain.ringType R)) (@GRing.inv (NumDomain.unitRingType R) x)) (@ltr R x (GRing.one (NumDomain.ringType R))) *) by move=> Ux xgt0; rewrite -{1}[1]invr1 ltr_pinv ?inE ?unitr1 ?ltr01 ?Ux. Qed. Lemma invr_ge1 x : x \is a GRing.unit -> 0 < x -> (1 <= x^-1) = (x <= 1). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (GRing.UnitRing.sort (NumDomain.unitRingType R)) (predPredType (GRing.UnitRing.sort (NumDomain.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (NumDomain.unitRingType R)) (@GRing.unit (NumDomain.unitRingType R)))))) (_ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x)), @eq bool (@ler R (GRing.one (NumDomain.ringType R)) (@GRing.inv (NumDomain.unitRingType R) x)) (@ler R x (GRing.one (NumDomain.ringType R))) *) by move=> Ux xgt0; rewrite -{1}[1]invr1 ler_pinv ?inE ?unitr1 ?ltr01 // Ux. Qed. Definition invr_gte1 := (invr_ge1, invr_gt1). Lemma invr_le1 x (ux : x \is a GRing.unit) (hx : 0 < x) : Proof. (* Goal: @eq bool (@ler R (@GRing.inv (NumDomain.unitRingType R) x) (GRing.one (NumDomain.ringType R))) (@ler R (GRing.one (NumDomain.ringType R)) x) *) by rewrite -invr_ge1 ?invr_gt0 ?unitrV // invrK. Qed. Lemma invr_lt1 x (ux : x \is a GRing.unit) (hx : 0 < x) : (x^-1 < 1) = (1 < x). Proof. (* Goal: @eq bool (@ltr R (@GRing.inv (NumDomain.unitRingType R) x) (GRing.one (NumDomain.ringType R))) (@ltr R (GRing.one (NumDomain.ringType R)) x) *) by rewrite -invr_gt1 ?invr_gt0 ?unitrV // invrK. Qed. Definition invr_lte1 := (invr_le1, invr_lt1). Definition invr_cp1 := (invr_gte1, invr_lte1). Lemma real_ler_norm x : x \is real -> x <= `|x|. Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), is_true (@ler R x (@normr R x)) *) by case/real_ger0P=> hx //; rewrite (ler_trans (ltrW hx)) // oppr_ge0 ltrW. Qed. Hint Resolve normr_real : core. Lemma ler_norm_sum I r (G : I -> R) (P : pred I): `|\sum_(i <- r | P i) G i| <= \sum_(i <- r | P i) `|G i|. Proof. (* Goal: is_true (@ler R (@normr R (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) I (GRing.zero (NumDomain.zmodType R)) r (fun i : I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) I i (@GRing.add (NumDomain.zmodType R)) (P i) (G i)))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) I (GRing.zero (NumDomain.zmodType R)) r (fun i : I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) I i (@GRing.add (NumDomain.zmodType R)) (P i) (@normr R (G i))))) *) elim/big_rec2: _ => [|i y x _]; first by rewrite normr0. (* Goal: forall _ : is_true (@ler R (@normr R x) y), is_true (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) (G i) x)) (@GRing.add (NumDomain.zmodType R) (@normr R (G i)) y)) *) by rewrite -(ler_add2l `|G i|); apply: ler_trans; apply: ler_norm_add. Qed. Lemma ler_norm_sub x y : `|x - y| <= `|x| + `|y|. Proof. (* Goal: is_true (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@GRing.add (NumDomain.zmodType R) (@normr R x) (@normr R y))) *) by rewrite (ler_trans (ler_norm_add _ _)) ?normrN. Qed. Lemma ler_dist_add z x y : `|x - y| <= `|x - z| + `|z - y|. Proof. (* Goal: is_true (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) (@GRing.add (NumDomain.zmodType R) (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) z))) (@normr R (@GRing.add (NumDomain.zmodType R) z (@GRing.opp (NumDomain.zmodType R) y))))) *) by rewrite (ler_trans _ (ler_norm_add _ _)) // addrA addrNK. Qed. Lemma ler_sub_norm_add x y : `|x| - `|y| <= `|x + y|. Proof. (* Goal: is_true (@ler R (@GRing.add (NumDomain.zmodType R) (@normr R x) (@GRing.opp (NumDomain.zmodType R) (@normr R y))) (@normr R (@GRing.add (NumDomain.zmodType R) x y))) *) rewrite -{1}[x](addrK y) lter_sub_addl. (* Goal: is_true (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) (@GRing.add (NumDomain.zmodType R) x y) (@GRing.opp (NumDomain.zmodType R) y))) (@GRing.add (NumDomain.zmodType R) (@normr R y) (@normr R (@GRing.add (NumDomain.zmodType R) x y)))) *) by rewrite (ler_trans (ler_norm_add _ _)) // addrC normrN. Qed. Lemma ler_sub_dist x y : `|x| - `|y| <= `|x - y|. Proof. (* Goal: is_true (@ler R (@GRing.add (NumDomain.zmodType R) (@normr R x) (@GRing.opp (NumDomain.zmodType R) (@normr R y))) (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)))) *) by rewrite -[`|y|]normrN ler_sub_norm_add. Qed. Lemma ler_dist_dist x y : `|`|x| - `|y| | <= `|x - y|. Proof. (* Goal: is_true (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) (@normr R x) (@GRing.opp (NumDomain.zmodType R) (@normr R y)))) (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)))) *) have [||_|_] // := @real_lerP `|x| `|y|; last by rewrite ler_sub_dist. (* Goal: is_true (@ler R (@GRing.add (NumDomain.zmodType R) (@normr R y) (@GRing.opp (NumDomain.zmodType R) (@normr R x))) (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)))) *) by rewrite distrC ler_sub_dist. Qed. Lemma ler_dist_norm_add x y : `| `|x| - `|y| | <= `| x + y |. Proof. (* Goal: is_true (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) (@normr R x) (@GRing.opp (NumDomain.zmodType R) (@normr R y)))) (@normr R (@GRing.add (NumDomain.zmodType R) x y))) *) by rewrite -[y]opprK normrN ler_dist_dist. Qed. Lemma real_ler_norml x y : x \is real -> (`|x| <= y) = (- y <= x <= y). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq bool (@ler R (@normr R x) y) (andb (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) (@ler R x y)) *) move=> xR; wlog x_ge0 : x xR / 0 <= x => [hwlog|]. (* Goal: @eq bool (@ler R (@normr R x) y) (andb (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) (@ler R x y)) *) (* Goal: @eq bool (@ler R (@normr R x) y) (andb (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) (@ler R x y)) *) move: (xR) => /(@real_leVge 0) /orP [|/hwlog->|hx] //. (* Goal: @eq bool (@ler R (@normr R x) y) (andb (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) (@ler R x y)) *) (* Goal: @eq bool (@ler R (@normr R x) y) (andb (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) (@ler R x y)) *) by rewrite -[x]opprK normrN ler_opp2 andbC ler_oppl hwlog ?realN ?oppr_ge0. (* Goal: @eq bool (@ler R (@normr R x) y) (andb (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) (@ler R x y)) *) rewrite ger0_norm //; have [le_xy|] := boolP (x <= y); last by rewrite andbF. (* Goal: @eq bool true (andb (@ler R (@GRing.opp (NumDomain.zmodType R) y) x) true) *) by rewrite (ler_trans _ x_ge0) // oppr_le0 (ler_trans x_ge0). Qed. Lemma real_ler_normlP x y : x \is real -> reflect ((-x <= y) * (x <= y)) (`|x| <= y). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), Bool.reflect (prod (is_true (@ler R (@GRing.opp (NumDomain.zmodType R) x) y)) (is_true (@ler R x y))) (@ler R (@normr R x) y) *) by move=> Rx; rewrite real_ler_norml // ler_oppl; apply: (iffP andP) => [] []. Qed. Arguments real_ler_normlP {x y}. Lemma real_eqr_norml x y : x \is real -> (`|x| == y) = ((x == y) || (x == -y)) && (0 <= y). Lemma real_eqr_norm2 x y : x \is real -> y \is real -> (`|x| == `|y|) = (x == y) || (x == -y). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), @eq bool (@eq_op (NumDomain.eqType R) (@normr R x) (@normr R y)) (orb (@eq_op (NumDomain.eqType R) x y) (@eq_op (NumDomain.eqType R) x (@GRing.opp (NumDomain.zmodType R) y))) *) move=> Rx Ry; rewrite real_eqr_norml // normrE andbT. (* Goal: @eq bool (orb (@eq_op (NumDomain.eqType R) x (@normr R y)) (@eq_op (NumDomain.eqType R) x (@GRing.opp (NumDomain.zmodType R) (@normr R y)))) (orb (@eq_op (NumDomain.eqType R) x y) (@eq_op (NumDomain.eqType R) x (@GRing.opp (NumDomain.zmodType R) y))) *) by case: real_ler0P; rewrite // opprK orbC. Qed. Lemma real_ltr_norml x y : x \is real -> (`|x| < y) = (- y < x < y). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq bool (@ltr R (@normr R x) y) (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) (@ltr R x y)) *) move=> Rx; wlog x_ge0 : x Rx / 0 <= x => [hwlog|]. (* Goal: @eq bool (@ltr R (@normr R x) y) (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) (@ltr R x y)) *) (* Goal: @eq bool (@ltr R (@normr R x) y) (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) (@ltr R x y)) *) move: (Rx) => /(@real_leVge 0) /orP [|/hwlog->|hx] //. (* Goal: @eq bool (@ltr R (@normr R x) y) (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) (@ltr R x y)) *) (* Goal: @eq bool (@ltr R (@normr R x) y) (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) (@ltr R x y)) *) by rewrite -[x]opprK normrN ltr_opp2 andbC ltr_oppl hwlog ?realN ?oppr_ge0. (* Goal: @eq bool (@ltr R (@normr R x) y) (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) (@ltr R x y)) *) rewrite ger0_norm //; have [le_xy|] := boolP (x < y); last by rewrite andbF. (* Goal: @eq bool true (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) true) *) by rewrite (ltr_le_trans _ x_ge0) // oppr_lt0 (ler_lt_trans x_ge0). Qed. Definition real_lter_norml := (real_ler_norml, real_ltr_norml). Lemma real_ltr_normlP x y : x \is real -> reflect ((-x < y) * (x < y)) (`|x| < y). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), Bool.reflect (prod (is_true (@ltr R (@GRing.opp (NumDomain.zmodType R) x) y)) (is_true (@ltr R x y))) (@ltr R (@normr R x) y) *) move=> Rx; rewrite real_ltr_norml // ltr_oppl. (* Goal: Bool.reflect (prod (is_true (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x)) (is_true (@ltr R x y))) (andb (@ltr R (@GRing.opp (NumDomain.zmodType R) y) x) (@ltr R x y)) *) by apply: (iffP (@andP _ _)); case. Qed. Arguments real_ltr_normlP {x y}. Lemma real_ler_normr x y : y \is real -> (x <= `|y|) = (x <= y) || (x <= - y). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq bool (@ler R x (@normr R y)) (orb (@ler R x y) (@ler R x (@GRing.opp (NumDomain.zmodType R) y))) *) move=> Ry. (* Goal: @eq bool (@ler R x (@normr R y)) (orb (@ler R x y) (@ler R x (@GRing.opp (NumDomain.zmodType R) y))) *) have [xR|xNR] := boolP (x \is real); last by rewrite ?Nreal_leF ?realN. (* Goal: @eq bool (@ler R x (@normr R y)) (orb (@ler R x y) (@ler R x (@GRing.opp (NumDomain.zmodType R) y))) *) rewrite real_lerNgt ?real_ltr_norml // negb_and -?real_lerNgt ?realN //. (* Goal: @eq bool (orb (@ler R y (@GRing.opp (NumDomain.zmodType R) x)) (@ler R x y)) (orb (@ler R x y) (@ler R x (@GRing.opp (NumDomain.zmodType R) y))) *) by rewrite orbC ler_oppr. Qed. Lemma real_ltr_normr x y : y \is real -> (x < `|y|) = (x < y) || (x < - y). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq bool (@ltr R x (@normr R y)) (orb (@ltr R x y) (@ltr R x (@GRing.opp (NumDomain.zmodType R) y))) *) move=> Ry. (* Goal: @eq bool (@ltr R x (@normr R y)) (orb (@ltr R x y) (@ltr R x (@GRing.opp (NumDomain.zmodType R) y))) *) have [xR|xNR] := boolP (x \is real); last by rewrite ?Nreal_ltF ?realN. (* Goal: @eq bool (@ltr R x (@normr R y)) (orb (@ltr R x y) (@ltr R x (@GRing.opp (NumDomain.zmodType R) y))) *) rewrite real_ltrNge ?real_ler_norml // negb_and -?real_ltrNge ?realN //. (* Goal: @eq bool (orb (@ltr R y (@GRing.opp (NumDomain.zmodType R) x)) (@ltr R x y)) (orb (@ltr R x y) (@ltr R x (@GRing.opp (NumDomain.zmodType R) y))) *) by rewrite orbC ltr_oppr. Qed. Definition real_lter_normr := (real_ler_normr, real_ltr_normr). Lemma ler_nnorml x y : y < 0 -> `|x| <= y = false. Proof. (* Goal: forall _ : is_true (@ltr R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ler R (@normr R x) y) false *) by move=> y_lt0; rewrite ltr_geF // (ltr_le_trans y_lt0). Qed. Lemma ltr_nnorml x y : y <= 0 -> `|x| < y = false. Proof. (* Goal: forall _ : is_true (@ler R y (GRing.zero (NumDomain.zmodType R))), @eq bool (@ltr R (@normr R x) y) false *) by move=> y_le0; rewrite ler_gtF // (ler_trans y_le0). Qed. Definition lter_nnormr := (ler_nnorml, ltr_nnorml). Lemma real_ler_distl x y e : x - y \is real -> (`|x - y| <= e) = (y - e <= x <= y + e). Proof. (* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq bool (@ler R (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) e) (andb (@ler R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) e)) x) (@ler R x (@GRing.add (NumDomain.zmodType R) y e))) *) by move=> Rxy; rewrite real_lter_norml // !lter_sub_addl. Qed. Lemma real_ltr_distl x y e : x - y \is real -> (`|x - y| < e) = (y - e < x < y + e). Proof. (* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq bool (@ltr R (@normr R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y))) e) (andb (@ltr R (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) e)) x) (@ltr R x (@GRing.add (NumDomain.zmodType R) y e))) *) by move=> Rxy; rewrite real_lter_norml // !lter_sub_addl. Qed. Definition real_lter_distl := (real_ler_distl, real_ltr_distl). Lemma eqr_norm_id x : (`|x| == x) = (0 <= x). Proof. by rewrite ger0_def. Qed. Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType R) (@normr R x) x) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) by rewrite ger0_def. Qed. Definition eqr_norm_idVN := =^~ (ger0_def, ler0_def). Lemma real_exprn_even_ge0 n x : x \is real -> ~~ odd n -> 0 <= x ^+ n. Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (odd n))), is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) *) move=> xR even_n; have [/exprn_ge0 -> //|x_lt0] := real_ger0P xR. (* Goal: is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) *) rewrite -[x]opprK -mulN1r exprMn -signr_odd (negPf even_n) expr0 mul1r. (* Goal: is_true (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) (@GRing.opp (NumDomain.zmodType R) x) n)) *) by rewrite exprn_ge0 ?oppr_ge0 ?ltrW. Qed. Lemma real_exprn_even_gt0 n x : x \is real -> ~~ odd n -> (0 < x ^+ n) = (n == 0)%N || (x != 0). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (odd n))), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) (orb (@eq_op nat_eqType n O) (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))))) *) move=> xR n_even; rewrite lt0r real_exprn_even_ge0 ?expf_eq0 //. (* Goal: @eq bool (andb (negb (andb (leq (S O) n) (@eq_op (GRing.IntegralDomain.eqType (NumDomain.idomainType R)) x (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R)))))) true) (orb (@eq_op nat_eqType n O) (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))))) *) by rewrite andbT negb_and lt0n negbK. Qed. Lemma real_exprn_even_le0 n x : x \is real -> ~~ odd n -> (x ^+ n <= 0) = (n != 0%N) && (x == 0). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (odd n))), @eq bool (@ler R (@GRing.exp (NumDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType R))) (andb (negb (@eq_op nat_eqType n O)) (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) *) move=> xR n_even; rewrite !real_lerNgt ?rpred0 ?rpredX //. (* Goal: @eq bool (negb (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n))) (andb (negb (@eq_op nat_eqType n O)) (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) *) by rewrite real_exprn_even_gt0 // negb_or negbK. Qed. Lemma real_exprn_even_lt0 n x : x \is real -> ~~ odd n -> (x ^+ n < 0) = false. Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (negb (odd n))), @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType R))) false *) by move=> xR n_even; rewrite ler_gtF // real_exprn_even_ge0. Qed. Lemma real_exprn_odd_ge0 n x : x \is real -> odd n -> (0 <= x ^+ n) = (0 <= x). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (odd n)), @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) case/real_ger0P => [x_ge0|x_lt0] n_odd; first by rewrite exprn_ge0. (* Goal: @eq bool (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) false *) apply: negbTE; rewrite ltr_geF //. (* Goal: is_true (@ltr R (@GRing.exp (NumDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType R))) *) case: n n_odd => // n /= n_even; rewrite exprS pmulr_llt0 //. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) *) by rewrite real_exprn_even_gt0 ?ler0_real ?ltrW // ltr_eqF ?orbT. Qed. Lemma real_exprn_odd_gt0 n x : x \is real -> odd n -> (0 < x ^+ n) = (0 < x). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (odd n)), @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x n)) (@ltr R (GRing.zero (NumDomain.zmodType R)) x) *) by move=> xR n_odd; rewrite !lt0r expf_eq0 real_exprn_odd_ge0; case: n n_odd. Qed. Lemma real_exprn_odd_le0 n x : x \is real -> odd n -> (x ^+ n <= 0) = (x <= 0). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (odd n)), @eq bool (@ler R (@GRing.exp (NumDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType R))) (@ler R x (GRing.zero (NumDomain.zmodType R))) *) by move=> xR n_odd; rewrite !real_lerNgt ?rpred0 ?rpredX // real_exprn_odd_gt0. Qed. Lemma real_exprn_odd_lt0 n x : x \is real -> odd n -> (x ^+ n < 0) = (x < 0). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (odd n)), @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType R))) (@ltr R x (GRing.zero (NumDomain.zmodType R))) *) by move=> xR n_odd; rewrite !real_ltrNge ?rpred0 ?rpredX // real_exprn_odd_ge0. Qed. Lemma realEsqr x : (x \is real) = (0 <= x ^+ 2). Proof. (* Goal: @eq bool (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))) (@ler R (GRing.zero (NumDomain.zmodType R)) (@GRing.exp (NumDomain.ringType R) x (S (S O)))) *) by rewrite ger0_def normrX eqf_sqr -ger0_def -ler0_def. Qed. Lemma real_normK x : x \is real -> `|x| ^+ 2 = x ^+ 2. Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) (@normr R x) (S (S O))) (@GRing.exp (NumDomain.ringType R) x (S (S O))) *) by move=> Rx; rewrite -normrX ger0_norm -?realEsqr. Qed. Lemma normr_sign s : `|(-1) ^+ s| = 1 :> R. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) s)) (GRing.one (NumDomain.ringType R)) *) by rewrite normrX normrN1 expr1n. Qed. Lemma normrMsign s x : `|(-1) ^+ s * x| = `|x|. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) s) x)) (@normr R x) *) by rewrite normrM normr_sign mul1r. Qed. Lemma signr_gt0 (b : bool) : (0 < (-1) ^+ b :> R) = ~~ b. Proof. (* Goal: @eq bool (@ltr R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool b) : NumDomain.sort R)) (negb b) *) by case: b; rewrite (ltr01, ltr0N1). Qed. Lemma signr_lt0 (b : bool) : ((-1) ^+ b < 0 :> R) = b. Proof. (* Goal: @eq bool (@ltr R (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool b) : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R)) b *) by case: b; rewrite // ?(ltrN10, ltr10). Qed. Lemma signr_ge0 (b : bool) : (0 <= (-1) ^+ b :> R) = ~~ b. Proof. (* Goal: @eq bool (@ler R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool b) : NumDomain.sort R)) (negb b) *) by rewrite le0r signr_eq0 signr_gt0. Qed. Lemma signr_le0 (b : bool) : ((-1) ^+ b <= 0 :> R) = b. Proof. (* Goal: @eq bool (@ler R (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool b) : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R)) b *) by rewrite ler_eqVlt signr_eq0 signr_lt0. Qed. Lemma signr_inj : injective (fun b : bool => (-1) ^+ b : R). Proof. (* Goal: @injective (NumDomain.sort R) bool (fun b : bool => @GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool b) : NumDomain.sort R) *) exact: can_inj (fun x => 0 >= x) signr_le0. Qed. Lemma sgr_def x : sg x = (-1) ^+ (x < 0)%R *+ (x != 0). Proof. (* Goal: @eq (NumDomain.sort R) (@sgr R x) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool (@ltr R x (GRing.zero (NumDomain.zmodType R))))) (nat_of_bool (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))))) *) by rewrite /sg; do 2!case: ifP => //. Qed. Lemma neqr0_sign x : x != 0 -> (-1) ^+ (x < 0)%R = sgr x. Proof. (* Goal: forall _ : is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))), @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool (@ltr R x (GRing.zero (NumDomain.zmodType R))))) (@sgr R x) *) by rewrite sgr_def => ->. Qed. Lemma gtr0_sg x : 0 < x -> sg x = 1. Proof. (* Goal: forall _ : is_true (@ltr R (GRing.zero (NumDomain.zmodType R)) x), @eq (NumDomain.sort R) (@sgr R x) (GRing.one (NumDomain.ringType R)) *) by move=> x_gt0; rewrite /sg gtr_eqF // ltr_gtF. Qed. Lemma ltr0_sg x : x < 0 -> sg x = -1. Proof. (* Goal: forall _ : is_true (@ltr R x (GRing.zero (NumDomain.zmodType R))), @eq (NumDomain.sort R) (@sgr R x) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) *) by move=> x_lt0; rewrite /sg x_lt0 ltr_eqF. Qed. Lemma sgr1 : sg 1 = 1 :> R. Proof. by rewrite gtr0_sg // ltr01. Qed. Proof. (* Goal: @eq (NumDomain.sort R) (@sgr R (GRing.one (NumDomain.ringType R))) (GRing.one (NumDomain.ringType R)) *) by rewrite gtr0_sg // ltr01. Qed. Definition sgrE := (sgr0, sgr1, sgrN1). Lemma sqr_sg x : sg x ^+ 2 = (x != 0)%:R. Proof. (* Goal: @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) (@sgr R x) (S (S O))) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (nat_of_bool (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))))) *) by rewrite sgr_def exprMn_n sqrr_sign -mulnn mulnb andbb. Qed. Lemma mulr_sg_eq1 x y : (sg x * y == 1) = (x != 0) && (sg x == y). Proof. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (@sgr R x) y) (GRing.one (NumDomain.ringType R))) (andb (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) (@eq_op (NumDomain.eqType R) (@sgr R x) y)) *) rewrite /sg eq_sym; case: ifP => _; first by rewrite mul0r oner_eq0. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (if @ltr R x (GRing.zero (NumDomain.zmodType R)) then @GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) else GRing.one (NumDomain.ringType R)) y)) (andb (negb false) (@eq_op (NumDomain.eqType R) (if @ltr R x (GRing.zero (NumDomain.zmodType R)) then @GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) else GRing.one (NumDomain.ringType R)) y)) *) by case: ifP => _; rewrite ?mul1r // mulN1r eqr_oppLR. Qed. Lemma mulr_sg_eqN1 x y : (sg x * sg y == -1) = (x != 0) && (sg x == - sg y). Proof. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (@sgr R x) (@sgr R y)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)))) (andb (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) (@eq_op (NumDomain.eqType R) (@sgr R x) (@GRing.opp (NumDomain.zmodType R) (@sgr R y)))) *) move/sg: y => y; rewrite /sg eq_sym eqr_oppLR. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumDomain.ringType R))) (GRing.one (NumDomain.ringType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (if @eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)) then GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R)) else if @ltr R x (GRing.zero (NumDomain.zmodType R)) then @GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) else GRing.one (NumDomain.ringType R)) y))) (andb (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))) (@eq_op (NumDomain.eqType R) (if @eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)) then GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R)) else if @ltr R x (GRing.zero (NumDomain.zmodType R)) then @GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) else GRing.one (NumDomain.ringType R)) (@GRing.opp (NumDomain.zmodType R) y))) *) case: ifP => _; first by rewrite mul0r oppr0 oner_eq0. (* Goal: @eq bool (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumDomain.ringType R))) (GRing.one (NumDomain.ringType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (if @ltr R x (GRing.zero (NumDomain.zmodType R)) then @GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) else GRing.one (NumDomain.ringType R)) y))) (andb (negb false) (@eq_op (NumDomain.eqType R) (if @ltr R x (GRing.zero (NumDomain.zmodType R)) then @GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) else GRing.one (NumDomain.ringType R)) (@GRing.opp (NumDomain.zmodType R) y))) *) by case: ifP => _; rewrite ?mul1r // mulN1r eqr_oppLR. Qed. Lemma sgr_eq0 x : (sg x == 0) = (x == 0). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType R) (@sgr R x) (GRing.zero (NumDomain.zmodType R))) (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R))) *) by rewrite -sqrf_eq0 sqr_sg pnatr_eq0; case: (x == 0). Qed. Lemma sgr_odd n x : x != 0 -> (sg x) ^+ n = (sg x) ^+ (odd n). Proof. (* Goal: forall _ : is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))), @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) (@sgr R x) n) (@GRing.exp (NumDomain.ringType R) (@sgr R x) (nat_of_bool (odd n))) *) by rewrite /sg; do 2!case: ifP => // _; rewrite ?expr1n ?signr_odd. Qed. Lemma sgrMn x n : sg (x *+ n) = (n != 0%N)%:R * sg x. Proof. (* Goal: @eq (NumDomain.sort R) (@sgr R (@GRing.natmul (NumDomain.zmodType R) x n)) (@GRing.mul (NumDomain.ringType R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (nat_of_bool (negb (@eq_op nat_eqType n O)))) (@sgr R x)) *) case: n => [|n]; first by rewrite mulr0n sgr0 mul0r. (* Goal: @eq (NumDomain.sort R) (@sgr R (@GRing.natmul (NumDomain.zmodType R) x (S n))) (@GRing.mul (NumDomain.ringType R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (nat_of_bool (negb (@eq_op nat_eqType (S n) O)))) (@sgr R x)) *) by rewrite !sgr_def mulrn_eq0 mul1r pmulrn_llt0. Qed. Lemma sgr_nat n : sg n%:R = (n != 0%N)%:R :> R. Proof. (* Goal: @eq (NumDomain.sort R) (@sgr R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (nat_of_bool (negb (@eq_op nat_eqType n O)))) *) by rewrite sgrMn sgr1 mulr1. Qed. Lemma sgr_id x : sg (sg x) = sg x. Proof. (* Goal: @eq (NumDomain.sort R) (@sgr R (@sgr R x)) (@sgr R x) *) by rewrite !(fun_if sg) !sgrE. Qed. Lemma sgr_lt0 x : (sg x < 0) = (x < 0). Proof. (* Goal: @eq bool (@ltr R (@sgr R x) (GRing.zero (NumDomain.zmodType R))) (@ltr R x (GRing.zero (NumDomain.zmodType R))) *) rewrite /sg; case: eqP => [-> // | _]. (* Goal: @eq bool (@ltr R (if @ltr R x (GRing.zero (NumDomain.zmodType R)) then @GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) else GRing.one (NumDomain.ringType R)) (GRing.zero (NumDomain.zmodType R))) (@ltr R x (GRing.zero (NumDomain.zmodType R))) *) by case: ifP => _; rewrite ?ltrN10 // ltr_gtF. Qed. Lemma sgr_le0 x : (sgr x <= 0) = (x <= 0). Proof. (* Goal: @eq bool (@ler R (@sgr R x) (GRing.zero (NumDomain.zmodType R))) (@ler R x (GRing.zero (NumDomain.zmodType R))) *) by rewrite !ler_eqVlt sgr_eq0 sgr_lt0. Qed. Lemma realEsign x : x \is real -> x = (-1) ^+ (x < 0)%R * `|x|. Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq (NumDomain.sort R) x (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool (@ltr R x (GRing.zero (NumDomain.zmodType R))))) (@normr R x)) *) by case/real_ger0P; rewrite (mul1r, mulN1r) ?opprK. Qed. Lemma realNEsign x : x \is real -> - x = (-1) ^+ (0 < x)%R * `|x|. Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq (GRing.Zmodule.sort (NumDomain.zmodType R)) (@GRing.opp (NumDomain.zmodType R) x) (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool (@ltr R (GRing.zero (NumDomain.zmodType R)) x))) (@normr R x)) *) by move=> Rx; rewrite -normrN -oppr_lt0 -realEsign ?rpredN. Qed. Lemma real_normrEsign (x : R) (xR : x \is real) : `|x| = (-1) ^+ (x < 0)%R * x. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R x) (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool (@ltr R x (GRing.zero (NumDomain.zmodType R))))) x) *) by rewrite {3}[x]realEsign // signrMK. Qed. Lemma real_mulr_sign_norm x : x \is real -> (-1) ^+ (x < 0)%R * `|x| = x. Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool (@ltr R x (GRing.zero (NumDomain.zmodType R))))) (@normr R x)) x *) by move/realEsign. Qed. Lemma real_mulr_Nsign_norm x : x \is real -> (-1) ^+ (0 < x)%R * `|x| = - x. Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq (GRing.Ring.sort (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (@GRing.exp (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R))) (nat_of_bool (@ltr R (GRing.zero (NumDomain.zmodType R)) x))) (@normr R x)) (@GRing.opp (NumDomain.zmodType R) x) *) by move/realNEsign. Qed. Lemma realEsg x : x \is real -> x = sgr x * `|x|. Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @eq (NumDomain.sort R) x (@GRing.mul (NumDomain.ringType R) (@sgr R x) (@normr R x)) *) move=> xR; have [-> | ] := eqVneq x 0; first by rewrite normr0 mulr0. (* Goal: forall _ : is_true (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))), @eq (NumDomain.sort R) x (@GRing.mul (NumDomain.ringType R) (@sgr R x) (@normr R x)) *) by move=> /neqr0_sign <-; rewrite -realEsign. Qed. Lemma normr_sg x : `|sg x| = (x != 0)%:R. Proof. (* Goal: @eq (NumDomain.sort R) (@normr R (@sgr R x)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (nat_of_bool (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))))) *) by rewrite sgr_def -mulr_natr normrMsign normr_nat. Qed. Lemma sgr_norm x : sg `|x| = (x != 0)%:R. Proof. (* Goal: @eq (NumDomain.sort R) (@sgr R (@normr R x)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (nat_of_bool (negb (@eq_op (NumDomain.eqType R) x (GRing.zero (NumDomain.zmodType R)))))) *) by rewrite /sg ler_gtF ?normr_ge0 // normr_eq0 mulrb if_neg. Qed. Lemma lerif_refl x C : reflect (x <= x ?= iff C) C. Proof. (* Goal: Bool.reflect (@lerif R x x C) C *) by apply: (iffP idP) => [-> | <-] //; split; rewrite ?eqxx. Qed. Lemma lerif_trans x1 x2 x3 C12 C23 : x1 <= x2 ?= iff C12 -> x2 <= x3 ?= iff C23 -> x1 <= x3 ?= iff C12 && C23. Proof. (* Goal: forall (_ : @lerif R x1 x2 C12) (_ : @lerif R x2 x3 C23), @lerif R x1 x3 (andb C12 C23) *) move=> ltx12 ltx23; apply/lerifP; rewrite -ltx12. (* Goal: is_true (if andb (@eq_op (NumDomain.eqType R) x1 x2) C23 then @eq_op (NumDomain.eqType R) x1 x3 else @ltr R x1 x3) *) case eqx12: (x1 == x2). (* Goal: is_true (if andb false C23 then @eq_op (NumDomain.eqType R) x1 x3 else @ltr R x1 x3) *) (* Goal: is_true (if andb true C23 then @eq_op (NumDomain.eqType R) x1 x3 else @ltr R x1 x3) *) by rewrite (eqP eqx12) ltr_neqAle !ltx23 andbT; case C23. (* Goal: is_true (if andb false C23 then @eq_op (NumDomain.eqType R) x1 x3 else @ltr R x1 x3) *) by rewrite (@ltr_le_trans _ x2) ?ltx23 // ltr_neqAle eqx12 ltx12. Qed. Lemma lerif_le x y : x <= y -> x <= y ?= iff (x >= y). Proof. (* Goal: forall _ : is_true (@ler R x y), @lerif R x y (@ler R y x) *) by move=> lexy; split=> //; rewrite eqr_le lexy. Qed. Lemma lerif_eq x y : x <= y -> x <= y ?= iff (x == y). Proof. (* Goal: forall _ : is_true (@ler R x y), @lerif R x y (@eq_op (NumDomain.eqType R) x y) *) by []. Qed. Lemma ger_lerif x y C : x <= y ?= iff C -> (y <= x) = C. Proof. (* Goal: forall _ : @lerif R x y C, @eq bool (@ler R y x) C *) by case=> le_xy; rewrite eqr_le le_xy. Qed. Lemma ltr_lerif x y C : x <= y ?= iff C -> (x < y) = ~~ C. Proof. (* Goal: forall _ : @lerif R x y C, @eq bool (@ltr R x y) (negb C) *) by move=> le_xy; rewrite ltr_neqAle !le_xy andbT. Qed. Lemma lerif_nat m n C : (m%:R <= n%:R ?= iff C :> R) = (m <= n ?= iff C)%N. Proof. (* Goal: @eq Prop (@lerif R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) m : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) n : NumDomain.sort R) C) (leqif m n C) *) by rewrite /lerif !ler_nat eqr_nat. Qed. Lemma mono_in_lerif (A : pred R) (f : R -> R) C : {in A &, {mono f : x y / x <= y}} -> {in A &, forall x y, (f x <= f y ?= iff C) = (x <= y ?= iff C)}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) A) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) (f x) (f y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R) bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R => @ler R x y))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) A) (fun x y : NumDomain.sort R => @eq Prop (@lerif R (f x) (f y) C) (@lerif R x y C)) (inPhantom (forall x y : NumDomain.sort R, @eq Prop (@lerif R (f x) (f y) C) (@lerif R x y C))) *) by move=> mf x y Ax Ay; rewrite /lerif mf ?(inj_in_eq (incr_inj_in mf)). Qed. Lemma mono_lerif (f : R -> R) C : {mono f : x y / x <= y} -> forall x y, (f x <= f y ?= iff C) = (x <= y ?= iff C). Proof. (* Goal: forall (_ : @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R) bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R => @ler R x y)) (x y : NumDomain.sort R), @eq Prop (@lerif R (f x) (f y) C) (@lerif R x y C) *) by move=> mf x y; rewrite /lerif mf (inj_eq (incr_inj _)). Qed. Lemma nmono_in_lerif (A : pred R) (f : R -> R) C : {in A &, {mono f : x y /~ x <= y}} -> {in A &, forall x y, (f x <= f y ?= iff C) = (y <= x ?= iff C)}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) A) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) (f x) (f y)) ((fun y0 x0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R) bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R => @ler R x y))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) A) (fun x y : NumDomain.sort R => @eq Prop (@lerif R (f x) (f y) C) (@lerif R y x C)) (inPhantom (forall x y : NumDomain.sort R, @eq Prop (@lerif R (f x) (f y) C) (@lerif R y x C))) *) move=> mf x y Ax Ay; rewrite /lerif eq_sym mf //. (* Goal: @eq Prop (prod (is_true (@ler R y x)) (@eq bool (@eq_op (NumDomain.eqType R) (f y) (f x)) C)) (prod (is_true (@ler R y x)) (@eq bool (@eq_op (NumDomain.eqType R) y x) C)) *) by rewrite ?(inj_in_eq (decr_inj_in mf)). Qed. Lemma nmono_lerif (f : R -> R) C : {mono f : x y /~ x <= y} -> forall x y, (f x <= f y ?= iff C) = (y <= x ?= iff C). Proof. (* Goal: forall (_ : @monomorphism_2 (NumDomain.sort R) (NumDomain.sort R) bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R => @ler R x y)) (x y : NumDomain.sort R), @eq Prop (@lerif R (f x) (f y) C) (@lerif R y x C) *) by move=> mf x y; rewrite /lerif eq_sym mf ?(inj_eq (decr_inj mf)). Qed. Lemma lerif_subLR x y z C : (x - y <= z ?= iff C) = (x <= z + y ?= iff C). Proof. (* Goal: @eq Prop (@lerif R (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) z C) (@lerif R x (@GRing.add (NumDomain.zmodType R) z y) C) *) by rewrite /lerif !eqr_le ler_subr_addr ler_subl_addr. Qed. Lemma lerif_subRL x y z C : (x <= y - z ?= iff C) = (x + z <= y ?= iff C). Proof. (* Goal: @eq Prop (@lerif R x (@GRing.add (NumDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType R) z)) C) (@lerif R (@GRing.add (NumDomain.zmodType R) x z) y C) *) by rewrite -lerif_subLR opprK. Qed. Lemma lerif_add x1 y1 C1 x2 y2 C2 : x1 <= y1 ?= iff C1 -> x2 <= y2 ?= iff C2 -> x1 + x2 <= y1 + y2 ?= iff C1 && C2. Proof. (* Goal: forall (_ : @lerif R x1 y1 C1) (_ : @lerif R x2 y2 C2), @lerif R (@GRing.add (NumDomain.zmodType R) x1 x2) (@GRing.add (NumDomain.zmodType R) y1 y2) (andb C1 C2) *) rewrite -(mono_lerif _ (ler_add2r x2)) -(mono_lerif C2 (ler_add2l y1)). (* Goal: forall (_ : @lerif R (@GRing.add (NumDomain.zmodType R) x1 x2) (@GRing.add (NumDomain.zmodType R) y1 x2) C1) (_ : @lerif R (@GRing.add (NumDomain.zmodType R) y1 x2) (@GRing.add (NumDomain.zmodType R) y1 y2) C2), @lerif R (@GRing.add (NumDomain.zmodType R) x1 x2) (@GRing.add (NumDomain.zmodType R) y1 y2) (andb C1 C2) *) exact: lerif_trans. Qed. Lemma lerif_sum (I : finType) (P C : pred I) (E1 E2 : I -> R) : (forall i, P i -> E1 i <= E2 i ?= iff C i) -> \sum_(i | P i) E1 i <= \sum_(i | P i) E2 i ?= iff [forall (i | P i), C i]. Proof. (* Goal: forall _ : forall (i : Finite.sort I) (_ : is_true (P i)), @lerif R (E1 i) (E2 i) (C i), @lerif R (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) (GRing.zero (NumDomain.zmodType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) i (@GRing.add (NumDomain.zmodType R)) (P i) (E1 i))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) (GRing.zero (NumDomain.zmodType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) i (@GRing.add (NumDomain.zmodType R)) (P i) (E2 i))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (P i) (FiniteQuant.Quantified (C i)) i)) *) move=> leE12; rewrite -big_andE. (* Goal: @lerif R (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) (GRing.zero (NumDomain.zmodType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) i (@GRing.add (NumDomain.zmodType R)) (P i) (E1 i))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) (GRing.zero (NumDomain.zmodType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) i (@GRing.add (NumDomain.zmodType R)) (P i) (E2 i))) (@BigOp.bigop bool (Finite.sort I) true (index_enum I) (fun i : Finite.sort I => @BigBody bool (Finite.sort I) i andb (P i) (C i))) *) elim/big_rec3: _ => [|i Ci m2 m1 /leE12]; first by rewrite /lerif lerr eqxx. (* Goal: forall (_ : @lerif R (E1 i) (E2 i) (C i)) (_ : @lerif R m1 m2 Ci), @lerif R (@GRing.add (NumDomain.zmodType R) (E1 i) m1) (@GRing.add (NumDomain.zmodType R) (E2 i) m2) (andb (C i) Ci) *) exact: lerif_add. Qed. Lemma lerif_0_sum (I : finType) (P C : pred I) (E : I -> R) : (forall i, P i -> 0 <= E i ?= iff C i) -> 0 <= \sum_(i | P i) E i ?= iff [forall (i | P i), C i]. Proof. (* Goal: forall _ : forall (i : Finite.sort I) (_ : is_true (P i)), @lerif R (GRing.zero (NumDomain.zmodType R)) (E i) (C i), @lerif R (GRing.zero (NumDomain.zmodType R)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) (GRing.zero (NumDomain.zmodType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType R)) (Finite.sort I) i (@GRing.add (NumDomain.zmodType R)) (P i) (E i))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (P i) (FiniteQuant.Quantified (C i)) i)) *) by move/lerif_sum; rewrite big1_eq. Qed. Lemma real_lerif_norm x : x \is real -> x <= `|x| ?= iff (0 <= x). Proof. (* Goal: forall _ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R)))), @lerif R x (@normr R x) (@ler R (GRing.zero (NumDomain.zmodType R)) x) *) by move=> xR; rewrite ger0_def eq_sym; apply: lerif_eq; rewrite real_ler_norm. Qed. Lemma lerif_pmul x1 x2 y1 y2 C1 C2 : 0 <= x1 -> 0 <= x2 -> x1 <= y1 ?= iff C1 -> x2 <= y2 ?= iff C2 -> x1 * x2 <= y1 * y2 ?= iff (y1 * y2 == 0) || C1 && C2. Proof. (* Goal: forall (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x1)) (_ : is_true (@ler R (GRing.zero (NumDomain.zmodType R)) x2)) (_ : @lerif R x1 y1 C1) (_ : @lerif R x2 y2 C2), @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (orb (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) y1 y2) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R)))) (andb C1 C2)) *) move=> x1_ge0 x2_ge0 le_xy1 le_xy2; have [y_0 | ] := altP (_ =P 0). (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumDomain.ringType R))) (@GRing.mul (NumDomain.ringType R) y1 y2) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))))), @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (orb false (andb C1 C2)) *) (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (orb true (andb C1 C2)) *) apply/lerifP; rewrite y_0 /= mulf_eq0 !eqr_le x1_ge0 x2_ge0 !andbT. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumDomain.ringType R))) (@GRing.mul (NumDomain.ringType R) y1 y2) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))))), @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (orb false (andb C1 C2)) *) (* Goal: is_true (orb (@ler R x1 (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R)))) (@ler R x2 (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R))))) *) move/eqP: y_0; rewrite mulf_eq0. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumDomain.ringType R))) (@GRing.mul (NumDomain.ringType R) y1 y2) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))))), @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (orb false (andb C1 C2)) *) (* Goal: forall _ : is_true (orb (@eq_op (GRing.IntegralDomain.eqType (NumDomain.idomainType R)) y1 (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R)))) (@eq_op (GRing.IntegralDomain.eqType (NumDomain.idomainType R)) y2 (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R))))), is_true (orb (@ler R x1 (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R)))) (@ler R x2 (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType R))))) *) by case/pred2P=> <-; rewrite (le_xy1, le_xy2) ?orbT. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumDomain.ringType R))) (@GRing.mul (NumDomain.ringType R) y1 y2) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))))), @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (orb false (andb C1 C2)) *) rewrite /= mulf_eq0 => /norP[y1nz y2nz]. (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (andb C1 C2) *) have y1_gt0: 0 < y1 by rewrite ltr_def y1nz (ler_trans _ le_xy1). (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (andb C1 C2) *) have [x2_0 | x2nz] := eqVneq x2 0. (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (andb C1 C2) *) (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (andb C1 C2) *) apply/lerifP; rewrite -le_xy2 x2_0 eq_sym (negPf y2nz) andbF mulr0. (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (andb C1 C2) *) (* Goal: is_true (@ltr R (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))) (@GRing.mul (NumDomain.ringType R) y1 y2)) *) by rewrite mulr_gt0 // ltr_def y2nz -x2_0 le_xy2. (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (andb C1 C2) *) have:= le_xy2; rewrite -(mono_lerif _ (ler_pmul2l y1_gt0)). (* Goal: forall _ : @lerif R (@GRing.mul (NumDomain.ringType R) y1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) C2, @lerif R (@GRing.mul (NumDomain.ringType R) x1 x2) (@GRing.mul (NumDomain.ringType R) y1 y2) (andb C1 C2) *) by apply: lerif_trans; rewrite (mono_lerif _ (ler_pmul2r _)) // ltr_def x2nz. Qed. Lemma lerif_nmul x1 x2 y1 y2 C1 C2 : y1 <= 0 -> y2 <= 0 -> x1 <= y1 ?= iff C1 -> x2 <= y2 ?= iff C2 -> y1 * y2 <= x1 * x2 ?= iff (x1 * x2 == 0) || C1 && C2. Proof. (* Goal: forall (_ : is_true (@ler R y1 (GRing.zero (NumDomain.zmodType R)))) (_ : is_true (@ler R y2 (GRing.zero (NumDomain.zmodType R)))) (_ : @lerif R x1 y1 C1) (_ : @lerif R x2 y2 C2), @lerif R (@GRing.mul (NumDomain.ringType R) y1 y2) (@GRing.mul (NumDomain.ringType R) x1 x2) (orb (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x1 x2) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R)))) (andb C1 C2)) *) rewrite -!oppr_ge0 -mulrNN -[x1 * x2]mulrNN => y1le0 y2le0 le_xy1 le_xy2. (* Goal: @lerif R (@GRing.mul (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) y1) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) y2)) (@GRing.mul (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) x1) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) x2)) (orb (@eq_op (GRing.Ring.eqType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) x1) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType R)) x2)) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R)))) (andb C1 C2)) *) by apply: lerif_pmul => //; rewrite (nmono_lerif _ ler_opp2). Qed. Lemma lerif_pprod (I : finType) (P C : pred I) (E1 E2 : I -> R) : (forall i, P i -> 0 <= E1 i) -> (forall i, P i -> E1 i <= E2 i ?= iff C i) -> let pi E := \prod_(i | P i) E i in pi E1 <= pi E2 ?= iff (pi E2 == 0) || [forall (i | P i), C i]. Lemma real_lerif_mean_square_scaled x y : x \is real -> y \is real -> x * y *+ 2 <= x ^+ 2 + y ^+ 2 ?= iff (x == y). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), @lerif R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y) (S (S O))) (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType R)) (@GRing.exp (NumDomain.ringType R) x (S (S O))) (@GRing.exp (NumDomain.ringType R) y (S (S O)))) (@eq_op (NumDomain.eqType R) x y) *) move=> Rx Ry; rewrite -[_ *+ 2]add0r -lerif_subRL addrAC -sqrrB -subr_eq0. (* Goal: @lerif R (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) (@GRing.add (GRing.ComRing.zmodType (NumDomain.comRingType R)) x (@GRing.opp (GRing.ComRing.zmodType (NumDomain.comRingType R)) y)) (S (S O))) (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType R)) (@GRing.add (NumDomain.zmodType R) x (@GRing.opp (NumDomain.zmodType R) y)) (GRing.zero (NumDomain.zmodType R))) *) by rewrite -sqrf_eq0 eq_sym; apply: lerif_eq; rewrite -realEsqr rpredB. Qed. Lemma real_lerif_AGM2_scaled x y : x \is real -> y \is real -> x * y *+ 4 <= (x + y) ^+ 2 ?= iff (x == y). Proof. (* Goal: forall (_ : is_true (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))) (_ : is_true (@in_mem (NumDomain.sort R) y (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))), @lerif R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y) (S (S (S (S O))))) (@GRing.exp (NumDomain.ringType R) (@GRing.add (NumDomain.zmodType R) x y) (S (S O))) (@eq_op (NumDomain.eqType R) x y) *) move=> Rx Ry; rewrite sqrrD addrAC (mulrnDr _ 2) -lerif_subLR addrK. (* Goal: @lerif R (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (@GRing.mul (NumDomain.ringType R) x y) (S (S O))) (@GRing.add (GRing.Ring.zmodType (GRing.ComRing.ringType (NumDomain.comRingType R))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) x (S (S O))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType R)) y (S (S O)))) (@eq_op (NumDomain.eqType R) x y) *) exact: real_lerif_mean_square_scaled. Qed. Lemma lerif_AGM_scaled (I : finType) (A : pred I) (E : I -> R) (n := #|A|) : {in A, forall i, 0 <= E i *+ n} -> \prod_(i in A) (E i *+ n) <= (\sum_(i in A) E i) ^+ n ?= iff [forall i in A, forall j in A, E i == E j]. Implicit Type p : {poly R}. Lemma poly_disk_bound p b : {ub | forall x, `|x| <= b -> `|p.[x]| <= ub}. Proof. (* Goal: @sig (NumDomain.sort R) (fun ub : NumDomain.sort R => forall (x : NumDomain.sort R) (_ : is_true (@ler R (@normr R x) b)), is_true (@ler R (@normr R (@horner (NumDomain.ringType R) p x)) ub)) *) exists (\sum_(j < size p) `|p`_j| * b ^+ j) => x le_x_b. (* Goal: is_true (@ler R (@normr R (@horner (NumDomain.ringType R) p x)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (NumDomain.ringType R))) (Finite.sort (ordinal_finType (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)))) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))) (index_enum (ordinal_finType (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)))) (fun j : ordinal (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (NumDomain.ringType R))) (ordinal (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p))) j (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType R))) true (@GRing.mul (NumDomain.ringType R) (@normr R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (NumDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))) (@polyseq (NumDomain.ringType R) p) (@nat_of_ord (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)) j))) (@GRing.exp (NumDomain.ringType R) b (@nat_of_ord (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)) j)))))) *) rewrite horner_coef (ler_trans (ler_norm_sum _ _ _)) ?ler_sum // => j _. (* Goal: is_true (@ler R (@normr R (@GRing.mul (NumDomain.ringType R) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (NumDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))) (@polyseq (NumDomain.ringType R) p) (@nat_of_ord (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)) j)) (@GRing.exp (NumDomain.ringType R) x (@nat_of_ord (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)) j)))) (@GRing.mul (NumDomain.ringType R) (@normr R (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (NumDomain.ringType R))) (GRing.zero (GRing.Ring.zmodType (NumDomain.ringType R))) (@polyseq (NumDomain.ringType R) p) (@nat_of_ord (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)) j))) (@GRing.exp (NumDomain.ringType R) b (@nat_of_ord (@size (GRing.Ring.sort (NumDomain.ringType R)) (@polyseq (NumDomain.ringType R) p)) j)))) *) rewrite normrM normrX ler_wpmul2l ?ler_expn2r ?unfold_in ?normr_ge0 //. (* Goal: is_true (@ler R (GRing.zero (NumDomain.zmodType R)) b) *) exact: ler_trans (normr_ge0 x) le_x_b. Qed. End NumDomainOperationTheory. Hint Resolve ler_opp2 ltr_opp2 real0 real1 normr_real : core. Arguments ler_sqr {R} [x y]. Arguments ltr_sqr {R} [x y]. Arguments signr_inj {R} [x1 x2]. Arguments real_ler_normlP {R x y}. Arguments real_ltr_normlP {R x y}. Arguments lerif_refl {R x C}. Arguments mono_in_lerif [R A f C]. Arguments nmono_in_lerif [R A f C]. Arguments mono_lerif [R f C]. Arguments nmono_lerif [R f C]. Section NumDomainMonotonyTheoryForReals. Variables (R R' : numDomainType) (D : pred R) (f : R -> R') (f' : R -> nat). Implicit Types (m n p : nat) (x y z : R) (u v w : R'). Lemma real_mono : {homo f : x y / x < y} -> {in real &, {mono f : x y / x <= y}}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))) *) move=> mf x y xR yR /=; have [lt_xy | le_yx] := real_lerP xR yR. (* Goal: @eq bool (@ler R' (f x) (f y)) false *) (* Goal: @eq bool (@ler R' (f x) (f y)) true *) by rewrite ltrW_homo. (* Goal: @eq bool (@ler R' (f x) (f y)) false *) by rewrite ltr_geF ?mf. Qed. Lemma real_nmono : {homo f : x y /~ x < y} -> {in real &, {mono f : x y /~ x <= y}}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun y0 x0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))) *) move=> mf x y xR yR /=; have [lt_xy|le_yx] := real_ltrP xR yR. (* Goal: @eq bool (@ler R' (f x) (f y)) true *) (* Goal: @eq bool (@ler R' (f x) (f y)) false *) by rewrite ltr_geF ?mf. (* Goal: @eq bool (@ler R' (f x) (f y)) true *) by rewrite ltrW_nhomo. Qed. Lemma real_mono_in : {in D &, {homo f : x y / x < y}} -> {in [pred x in D | x \is real] &, {mono f : x y / x <= y}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => forall _ : (fun x0 y0 : NumDomain.sort R => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (simplPredType (NumDomain.sort R)) (@SimplPred (NumDomain.sort R) (fun x : NumDomain.sort R => andb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D)) (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun x y : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))) *) move=> Dmf x y /andP[hx xR] /andP[hy yR] /=. (* Goal: @eq bool (@ler R' (f x) (f y)) (@ler R x y) *) have [lt_xy|le_yx] := real_lerP xR yR; first by rewrite (ltrW_homo_in Dmf). (* Goal: @eq bool (@ler R' (f x) (f y)) false *) by rewrite ltr_geF ?Dmf. Qed. Lemma real_nmono_in : {in D &, {homo f : x y /~ x < y}} -> {in [pred x in D | x \is real] &, {mono f : x y /~ x <= y}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => forall _ : (fun y0 x0 : NumDomain.sort R => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) (NumDomain.sort R') f (fun y x : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (simplPredType (NumDomain.sort R)) (@SimplPred (NumDomain.sort R) (fun x : NumDomain.sort R => andb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D)) (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun y0 x0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) (NumDomain.sort R') bool f (fun y x : NumDomain.sort R => @ler R x y) (fun x y : NumDomain.sort R' => @ler R' x y))) *) move=> Dmf x y /andP[hx xR] /andP[hy yR] /=. (* Goal: @eq bool (@ler R' (f x) (f y)) (@ler R y x) *) have [lt_xy|le_yx] := real_ltrP xR yR; last by rewrite (ltrW_nhomo_in Dmf). (* Goal: @eq bool (@ler R' (f x) (f y)) false *) by rewrite ltr_geF ?Dmf. Qed. Lemma realn_mono : {homo f' : x y / x < y >-> (x < y)%N} -> {in real &, {mono f' : x y / x <= y >-> (x <= y)%N}}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) nat f' (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : nat => is_true (leq (S x) y)), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : nat => leq x0 y0) (f' x) (f' y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f' (fun x y : NumDomain.sort R => @ler R x y) (fun x y : nat => leq x y))) *) move=> mf x y xR yR /=; have [lt_xy | le_yx] := real_lerP xR yR. (* Goal: @eq bool (leq (f' x) (f' y)) false *) (* Goal: @eq bool (leq (f' x) (f' y)) true *) by rewrite ltrnW_homo. (* Goal: @eq bool (leq (f' x) (f' y)) false *) by rewrite ltn_geF ?mf. Qed. Lemma realn_nmono : {homo f' : x y / y < x >-> (x < y)%N} -> {in real &, {mono f' : x y / y <= x >-> (x <= y)%N}}. Proof. (* Goal: forall _ : @homomorphism_2 (NumDomain.sort R) nat f' (fun x y : NumDomain.sort R => is_true (@ltr R y x)) (fun x y : nat => is_true (leq (S x) y)), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : nat => leq x0 y0) (f' x) (f' y)) ((fun x0 y0 : NumDomain.sort R => @ler R y0 x0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f' (fun x y : NumDomain.sort R => @ler R y x) (fun x y : nat => leq x y))) *) move=> mf x y xR yR /=; have [lt_xy|le_yx] := real_ltrP xR yR. (* Goal: @eq bool (leq (f' x) (f' y)) true *) (* Goal: @eq bool (leq (f' x) (f' y)) false *) by rewrite ltn_geF ?mf. (* Goal: @eq bool (leq (f' x) (f' y)) true *) by rewrite ltrnW_nhomo. Qed. Lemma realn_mono_in : {in D &, {homo f' : x y / x < y >-> (x < y)%N}} -> {in [pred x in D | x \is real] &, {mono f' : x y / x <= y >-> (x <= y)%N}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => forall _ : (fun x0 y0 : NumDomain.sort R => is_true (@ltr R x0 y0)) x y, (fun x0 y0 : nat => is_true (leq (S x0) y0)) (f' x) (f' y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f' (fun x y : NumDomain.sort R => is_true (@ltr R x y)) (fun x y : nat => is_true (leq (S x) y)))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (simplPredType (NumDomain.sort R)) (@SimplPred (NumDomain.sort R) (fun x : NumDomain.sort R => andb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D)) (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : nat => leq x0 y0) (f' x) (f' y)) ((fun x0 y0 : NumDomain.sort R => @ler R x0 y0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f' (fun x y : NumDomain.sort R => @ler R x y) (fun x y : nat => leq x y))) *) move=> Dmf x y /andP[hx xR] /andP[hy yR] /=. (* Goal: @eq bool (leq (f' x) (f' y)) (@ler R x y) *) have [lt_xy|le_yx] := real_lerP xR yR; first by rewrite (ltrnW_homo_in Dmf). (* Goal: @eq bool (leq (f' x) (f' y)) false *) by rewrite ltn_geF ?Dmf. Qed. Lemma realn_nmono_in : {in D &, {homo f' : x y / y < x >-> (x < y)%N}} -> {in [pred x in D | x \is real] &, {mono f' : x y / y <= x >-> (x <= y)%N}}. Proof. (* Goal: forall _ : @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D) (fun x y : NumDomain.sort R => forall _ : (fun x0 y0 : NumDomain.sort R => is_true (@ltr R y0 x0)) x y, (fun x0 y0 : nat => is_true (leq (S x0) y0)) (f' x) (f' y)) (inPhantom (@homomorphism_2 (NumDomain.sort R) nat f' (fun x y : NumDomain.sort R => is_true (@ltr R y x)) (fun x y : nat => is_true (leq (S x) y)))), @prop_in2 (NumDomain.sort R) (@mem (NumDomain.sort R) (simplPredType (NumDomain.sort R)) (@SimplPred (NumDomain.sort R) (fun x : NumDomain.sort R => andb (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) D)) (@in_mem (NumDomain.sort R) x (@mem (NumDomain.sort R) (predPredType (NumDomain.sort R)) (@has_quality O (NumDomain.sort R) (@Rreal R))))))) (fun x y : NumDomain.sort R => @eq bool ((fun x0 y0 : nat => leq x0 y0) (f' x) (f' y)) ((fun x0 y0 : NumDomain.sort R => @ler R y0 x0) x y)) (inPhantom (@monomorphism_2 (NumDomain.sort R) nat bool f' (fun x y : NumDomain.sort R => @ler R y x) (fun x y : nat => leq x y))) *) move=> Dmf x y /andP[hx xR] /andP[hy yR] /=. (* Goal: @eq bool (leq (f' x) (f' y)) (@ler R y x) *) have [lt_xy|le_yx] := real_ltrP xR yR; last by rewrite (ltrnW_nhomo_in Dmf). (* Goal: @eq bool (leq (f' x) (f' y)) false *) by rewrite ltn_geF ?Dmf. Qed. End NumDomainMonotonyTheoryForReals. Section FinGroup. Import GroupScope. Variables (R : numDomainType) (gT : finGroupType). Implicit Types G : {group gT}. Lemma natrG_gt0 G : #|G|%:R > 0 :> R. Proof. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) : NumDomain.sort R)) *) by rewrite ltr0n cardG_gt0. Qed. Lemma natrG_neq0 G : #|G|%:R != 0 :> R. Proof. (* Goal: is_true (negb (@eq_op (NumDomain.eqType R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R))) *) by rewrite gtr_eqF // natrG_gt0. Qed. Lemma natr_indexg_gt0 G B : #|G : B|%:R > 0 :> R. Proof. (* Goal: is_true (@ltr R (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (@indexg gT (@gval gT G) B) : NumDomain.sort R)) *) by rewrite ltr0n indexg_gt0. Qed. Lemma natr_indexg_neq0 G B : #|G : B|%:R != 0 :> R. Proof. (* Goal: is_true (negb (@eq_op (NumDomain.eqType R) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType R)) (GRing.one (NumDomain.ringType R)) (@indexg gT (@gval gT G) B) : NumDomain.sort R) (GRing.zero (NumDomain.zmodType R) : NumDomain.sort R))) *) by rewrite gtr_eqF // natr_indexg_gt0. Qed. End FinGroup. Section NumFieldTheory. Variable F : numFieldType. Implicit Types x y z t : F. Lemma unitf_gt0 x : 0 < x -> x \is a GRing.unit. Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) x), is_true (@in_mem (NumField.sort F) x (@mem (GRing.UnitRing.sort (NumField.unitRingType F)) (predPredType (GRing.UnitRing.sort (NumField.unitRingType F))) (@has_quality (S O) (GRing.UnitRing.sort (NumField.unitRingType F)) (@GRing.unit (NumField.unitRingType F))))) *) by move=> hx; rewrite unitfE eq_sym ltr_eqF. Qed. Lemma unitf_lt0 x : x < 0 -> x \is a GRing.unit. Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) x (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), is_true (@in_mem (NumField.sort F) x (@mem (GRing.UnitRing.sort (NumField.unitRingType F)) (predPredType (GRing.UnitRing.sort (NumField.unitRingType F))) (@has_quality (S O) (GRing.UnitRing.sort (NumField.unitRingType F)) (@GRing.unit (NumField.unitRingType F))))) *) by move=> hx; rewrite unitfE ltr_eqF. Qed. Lemma lef_pinv : {in pos &, {mono (@GRing.inv F) : x y /~ x <= y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (NumField.numDomainType F)) (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rpos (NumField.numDomainType F)))) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x0 y0) (@GRing.inv (NumField.unitRingType F) x) (@GRing.inv (NumField.unitRingType F) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumField.unitRingType F)) (GRing.UnitRing.sort (NumField.unitRingType F)) bool (@GRing.inv (NumField.unitRingType F)) (fun y x : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x y) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x y))) *) by move=> x y hx hy /=; rewrite ler_pinv ?inE ?unitf_gt0. Qed. Lemma lef_ninv : {in neg &, {mono (@GRing.inv F) : x y /~ x <= y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (NumField.numDomainType F)) (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rneg (NumField.numDomainType F)))) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x0 y0) (@GRing.inv (NumField.unitRingType F) x) (@GRing.inv (NumField.unitRingType F) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumField.unitRingType F)) (GRing.UnitRing.sort (NumField.unitRingType F)) bool (@GRing.inv (NumField.unitRingType F)) (fun y x : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x y) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @ler (NumField.numDomainType F) x y))) *) by move=> x y hx hy /=; rewrite ler_ninv ?inE ?unitf_lt0. Qed. Lemma ltf_pinv : {in pos &, {mono (@GRing.inv F) : x y /~ x < y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (NumField.numDomainType F)) (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rpos (NumField.numDomainType F)))) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x0 y0) (@GRing.inv (NumField.unitRingType F) x) (@GRing.inv (NumField.unitRingType F) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumField.unitRingType F)) (GRing.UnitRing.sort (NumField.unitRingType F)) bool (@GRing.inv (NumField.unitRingType F)) (fun y x : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x y) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x y))) *) exact: lerW_nmono_in lef_pinv. Qed. Lemma ltf_ninv: {in neg &, {mono (@GRing.inv F) : x y /~ x < y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (NumField.numDomainType F)) (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rneg (NumField.numDomainType F)))) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @eq bool ((fun x0 y0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x0 y0) (@GRing.inv (NumField.unitRingType F) x) (@GRing.inv (NumField.unitRingType F) y)) ((fun y0 x0 : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x0 y0) x y)) (inPhantom (@monomorphism_2 (GRing.UnitRing.sort (NumField.unitRingType F)) (GRing.UnitRing.sort (NumField.unitRingType F)) bool (@GRing.inv (NumField.unitRingType F)) (fun y x : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x y) (fun x y : GRing.UnitRing.sort (NumField.unitRingType F) => @ltr (NumField.numDomainType F) x y))) *) exact: lerW_nmono_in lef_ninv. Qed. Definition ltef_pinv := (lef_pinv, ltf_pinv). Definition ltef_ninv := (lef_ninv, ltf_ninv). Lemma invf_gt1 x : 0 < x -> (1 < x^-1) = (x < 1). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) x), @eq bool (@ltr (NumField.numDomainType F) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) (@GRing.inv (NumField.unitRingType F) x)) (@ltr (NumField.numDomainType F) x (GRing.one (NumDomain.ringType (NumField.numDomainType F)))) *) by move=> x_gt0; rewrite -{1}[1]invr1 ltf_pinv ?posrE ?ltr01. Qed. Lemma invf_ge1 x : 0 < x -> (1 <= x^-1) = (x <= 1). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) x), @eq bool (@ler (NumField.numDomainType F) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) (@GRing.inv (NumField.unitRingType F) x)) (@ler (NumField.numDomainType F) x (GRing.one (NumDomain.ringType (NumField.numDomainType F)))) *) by move=> x_lt0; rewrite -{1}[1]invr1 lef_pinv ?posrE ?ltr01. Qed. Definition invf_gte1 := (invf_ge1, invf_gt1). Lemma invf_le1 x : 0 < x -> (x^-1 <= 1) = (1 <= x). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) x), @eq bool (@ler (NumField.numDomainType F) (@GRing.inv (NumField.unitRingType F) x) (GRing.one (NumDomain.ringType (NumField.numDomainType F)))) (@ler (NumField.numDomainType F) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) x) *) by move=> x_gt0; rewrite -invf_ge1 ?invr_gt0 // invrK. Qed. Lemma invf_lt1 x : 0 < x -> (x^-1 < 1) = (1 < x). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) x), @eq bool (@ltr (NumField.numDomainType F) (@GRing.inv (NumField.unitRingType F) x) (GRing.one (NumDomain.ringType (NumField.numDomainType F)))) (@ltr (NumField.numDomainType F) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) x) *) by move=> x_lt0; rewrite -invf_gt1 ?invr_gt0 // invrK. Qed. Definition invf_lte1 := (invf_le1, invf_lt1). Definition invf_cp1 := (invf_gte1, invf_lte1). Lemma ler_pdivl_mulr z x y : 0 < z -> (x <= y / z) = (x * z <= y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ler (NumField.numDomainType F) x (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z))) (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) x z) y) *) by move=> z_gt0; rewrite -(@ler_pmul2r _ z) ?mulfVK ?gtr_eqF. Qed. Lemma ltr_pdivl_mulr z x y : 0 < z -> (x < y / z) = (x * z < y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ltr (NumField.numDomainType F) x (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z))) (@ltr (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) x z) y) *) by move=> z_gt0; rewrite -(@ltr_pmul2r _ z) ?mulfVK ?gtr_eqF. Qed. Definition lter_pdivl_mulr := (ler_pdivl_mulr, ltr_pdivl_mulr). Lemma ler_pdivr_mulr z x y : 0 < z -> (y / z <= x) = (y <= x * z). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z)) x) (@ler (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) x z)) *) by move=> z_gt0; rewrite -(@ler_pmul2r _ z) ?mulfVK ?gtr_eqF. Qed. Lemma ltr_pdivr_mulr z x y : 0 < z -> (y / z < x) = (y < x * z). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ltr (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z)) x) (@ltr (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) x z)) *) by move=> z_gt0; rewrite -(@ltr_pmul2r _ z) ?mulfVK ?gtr_eqF. Qed. Definition lter_pdivr_mulr := (ler_pdivr_mulr, ltr_pdivr_mulr). Lemma ler_pdivl_mull z x y : 0 < z -> (x <= z^-1 * y) = (z * x <= y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ler (NumField.numDomainType F) x (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y)) (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) z x) y) *) by move=> z_gt0; rewrite mulrC ler_pdivl_mulr ?[z * _]mulrC. Qed. Lemma ltr_pdivl_mull z x y : 0 < z -> (x < z^-1 * y) = (z * x < y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ltr (NumField.numDomainType F) x (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y)) (@ltr (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) z x) y) *) by move=> z_gt0; rewrite mulrC ltr_pdivl_mulr ?[z * _]mulrC. Qed. Definition lter_pdivl_mull := (ler_pdivl_mull, ltr_pdivl_mull). Lemma ler_pdivr_mull z x y : 0 < z -> (z^-1 * y <= x) = (y <= z * x). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ler (NumField.numDomainType F) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y) x) (@ler (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) z x)) *) by move=> z_gt0; rewrite mulrC ler_pdivr_mulr ?[z * _]mulrC. Qed. Lemma ltr_pdivr_mull z x y : 0 < z -> (z^-1 * y < x) = (y < z * x). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (GRing.zero (NumDomain.zmodType (NumField.numDomainType F))) z), @eq bool (@ltr (NumField.numDomainType F) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y) x) (@ltr (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) z x)) *) by move=> z_gt0; rewrite mulrC ltr_pdivr_mulr ?[z * _]mulrC. Qed. Definition lter_pdivr_mull := (ler_pdivr_mull, ltr_pdivr_mull). Lemma ler_ndivl_mulr z x y : z < 0 -> (x <= y / z) = (y <= x * z). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ler (NumField.numDomainType F) x (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z))) (@ler (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) x z)) *) by move=> z_lt0; rewrite -(@ler_nmul2r _ z) ?mulfVK ?ltr_eqF. Qed. Lemma ltr_ndivl_mulr z x y : z < 0 -> (x < y / z) = (y < x * z). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ltr (NumField.numDomainType F) x (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z))) (@ltr (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) x z)) *) by move=> z_lt0; rewrite -(@ltr_nmul2r _ z) ?mulfVK ?ltr_eqF. Qed. Definition lter_ndivl_mulr := (ler_ndivl_mulr, ltr_ndivl_mulr). Lemma ler_ndivr_mulr z x y : z < 0 -> (y / z <= x) = (x * z <= y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z)) x) (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) x z) y) *) by move=> z_lt0; rewrite -(@ler_nmul2r _ z) ?mulfVK ?ltr_eqF. Qed. Lemma ltr_ndivr_mulr z x y : z < 0 -> (y / z < x) = (x * z < y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ltr (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) y (@GRing.inv (NumField.unitRingType F) z)) x) (@ltr (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) x z) y) *) by move=> z_lt0; rewrite -(@ltr_nmul2r _ z) ?mulfVK ?ltr_eqF. Qed. Definition lter_ndivr_mulr := (ler_ndivr_mulr, ltr_ndivr_mulr). Lemma ler_ndivl_mull z x y : z < 0 -> (x <= z^-1 * y) = (y <= z * x). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ler (NumField.numDomainType F) x (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y)) (@ler (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) z x)) *) by move=> z_lt0; rewrite mulrC ler_ndivl_mulr ?[z * _]mulrC. Qed. Lemma ltr_ndivl_mull z x y : z < 0 -> (x < z^-1 * y) = (y < z * x). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ltr (NumField.numDomainType F) x (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y)) (@ltr (NumField.numDomainType F) y (@GRing.mul (NumField.ringType F) z x)) *) by move=> z_lt0; rewrite mulrC ltr_ndivl_mulr ?[z * _]mulrC. Qed. Definition lter_ndivl_mull := (ler_ndivl_mull, ltr_ndivl_mull). Lemma ler_ndivr_mull z x y : z < 0 -> (z^-1 * y <= x) = (z * x <= y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ler (NumField.numDomainType F) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y) x) (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) z x) y) *) by move=> z_lt0; rewrite mulrC ler_ndivr_mulr ?[z * _]mulrC. Qed. Lemma ltr_ndivr_mull z x y : z < 0 -> (z^-1 * y < x) = (z * x < y). Proof. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) z (GRing.zero (NumDomain.zmodType (NumField.numDomainType F)))), @eq bool (@ltr (NumField.numDomainType F) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) z) y) x) (@ltr (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) z x) y) *) by move=> z_lt0; rewrite mulrC ltr_ndivr_mulr ?[z * _]mulrC. Qed. Definition lter_ndivr_mull := (ler_ndivr_mull, ltr_ndivr_mull). Lemma natf_div m d : (d %| m)%N -> (m %/ d)%:R = m%:R / d%:R :> F. Proof. (* Goal: forall _ : is_true (dvdn d m), @eq (NumField.sort F) (@GRing.natmul (GRing.Ring.zmodType (NumField.ringType F)) (GRing.one (NumField.ringType F)) (divn m d)) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) m) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) d))) *) by apply: char0_natf_div; apply: (@char_num F). Qed. Lemma normfV : {morph (@norm F) : x / x ^-1}. Proof. (* Goal: @morphism_1 (NumDomain.sort (NumField.numDomainType F)) (NumDomain.sort (NumField.numDomainType F)) (@normr (NumField.numDomainType F)) (fun x : NumDomain.sort (NumField.numDomainType F) => @GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) x) (fun x : NumDomain.sort (NumField.numDomainType F) => @GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) x) *) move=> x /=; have [/normrV //|Nux] := boolP (x \is a GRing.unit). (* Goal: @eq (NumField.sort F) (@normr (NumField.numDomainType F) (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) x)) (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@normr (NumField.numDomainType F) x)) *) by rewrite !invr_out // unitfE normr_eq0 -unitfE. Qed. Lemma normf_div : {morph (@norm F) : x y / x / y}. Proof. (* Goal: @morphism_2 (NumDomain.sort (NumField.numDomainType F)) (NumDomain.sort (NumField.numDomainType F)) (@normr (NumField.numDomainType F)) (fun x y : NumDomain.sort (NumField.numDomainType F) => @GRing.mul (NumDomain.ringType (NumField.numDomainType F)) x (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) y)) (fun x y : NumDomain.sort (NumField.numDomainType F) => @GRing.mul (NumDomain.ringType (NumField.numDomainType F)) x (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) y)) *) by move=> x y /=; rewrite normrM normfV. Qed. Lemma invr_sg x : (sg x)^-1 = sgr x. Proof. (* Goal: @eq (GRing.UnitRing.sort (NumDomain.unitRingType (NumField.numDomainType F))) (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@sgr (NumField.numDomainType F) x)) (@sgr (NumField.numDomainType F) x) *) by rewrite !(fun_if GRing.inv) !(invr0, invrN, invr1). Qed. Lemma sgrV x : sgr x^-1 = sgr x. Proof. (* Goal: @eq (NumDomain.sort (NumField.numDomainType F)) (@sgr (NumField.numDomainType F) (@GRing.inv (NumField.unitRingType F) x)) (@sgr (NumField.numDomainType F) x) *) by rewrite /sgr invr_eq0 invr_lt0. Qed. Local Notation mid x y := ((x + y) / 2%:R). Lemma midf_le x y : x <= y -> (x <= mid x y) * (mid x y <= y). Proof. (* Goal: forall _ : is_true (@ler (NumField.numDomainType F) x y), prod (is_true (@ler (NumField.numDomainType F) x (@GRing.mul (NumField.ringType F) (@GRing.add (NumField.zmodType F) x y) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O))))))) (is_true (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) (@GRing.add (NumField.zmodType F) x y) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O))))) y)) *) move=> lexy; rewrite ler_pdivl_mulr ?ler_pdivr_mulr ?ltr0Sn //. (* Goal: prod (is_true (@ler (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) x (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O)))) (@GRing.add (NumField.zmodType F) x y))) (is_true (@ler (NumField.numDomainType F) (@GRing.add (NumField.zmodType F) x y) (@GRing.mul (NumField.ringType F) y (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O)))))) *) by rewrite !mulrDr !mulr1 ler_add2r ler_add2l. Qed. Lemma midf_lt x y : x < y -> (x < mid x y) * (mid x y < y). Definition midf_lte := (midf_le, midf_lt). Lemma real_lerif_mean_square x y : x \is real -> y \is real -> x * y <= mid (x ^+ 2) (y ^+ 2) ?= iff (x == y). Proof. (* Goal: forall (_ : is_true (@in_mem (NumField.sort F) x (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rreal (NumField.numDomainType F)))))) (_ : is_true (@in_mem (NumField.sort F) y (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rreal (NumField.numDomainType F)))))), @lerif (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) x y) (@GRing.mul (NumField.ringType F) (@GRing.add (GRing.Ring.zmodType (NumField.ringType F)) (@GRing.exp (NumField.ringType F) x (S (S O))) (@GRing.exp (NumField.ringType F) y (S (S O)))) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O))))) (@eq_op (NumField.eqType F) x y) *) move=> Rx Ry; rewrite -(mono_lerif (ler_pmul2r (ltr_nat F 0 2))). (* Goal: @lerif (NumField.numDomainType F) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) (@GRing.mul (NumField.ringType F) x y) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) (S (S O)))) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) (@GRing.mul (NumField.ringType F) (@GRing.add (GRing.Ring.zmodType (NumField.ringType F)) (@GRing.exp (NumField.ringType F) x (S (S O))) (@GRing.exp (NumField.ringType F) y (S (S O)))) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O))))) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) (S (S O)))) (@eq_op (NumField.eqType F) x y) *) by rewrite divfK ?pnatr_eq0 // mulr_natr; apply: real_lerif_mean_square_scaled. Qed. Lemma real_lerif_AGM2 x y : x \is real -> y \is real -> x * y <= mid x y ^+ 2 ?= iff (x == y). Proof. (* Goal: forall (_ : is_true (@in_mem (NumField.sort F) x (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rreal (NumField.numDomainType F)))))) (_ : is_true (@in_mem (NumField.sort F) y (@mem (NumDomain.sort (NumField.numDomainType F)) (predPredType (NumDomain.sort (NumField.numDomainType F))) (@has_quality O (NumDomain.sort (NumField.numDomainType F)) (@Rreal (NumField.numDomainType F)))))), @lerif (NumField.numDomainType F) (@GRing.mul (NumField.ringType F) x y) (@GRing.exp (NumField.ringType F) (@GRing.mul (NumField.ringType F) (@GRing.add (NumField.zmodType F) x y) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O))))) (S (S O))) (@eq_op (NumField.eqType F) x y) *) move=> Rx Ry; rewrite -(mono_lerif (ler_pmul2r (ltr_nat F 0 4))). (* Goal: @lerif (NumField.numDomainType F) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) (@GRing.mul (NumField.ringType F) x y) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) (S (S (S (S O)))))) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) (@GRing.exp (NumField.ringType F) (@GRing.mul (NumField.ringType F) (@GRing.add (NumField.zmodType F) x y) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (S (S O))))) (S (S O))) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (GRing.one (NumDomain.ringType (NumField.numDomainType F))) (S (S (S (S O)))))) (@eq_op (NumField.eqType F) x y) *) rewrite mulr_natr (natrX F 2 2) -exprMn divfK ?pnatr_eq0 //. (* Goal: @lerif (NumField.numDomainType F) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (@GRing.mul (NumField.ringType F) x y) (S (S (S (S O))))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType (NumField.numDomainType F))) (@GRing.add (NumField.zmodType F) x y) (S (S O))) (@eq_op (NumField.eqType F) x y) *) exact: real_lerif_AGM2_scaled. Qed. Lemma lerif_AGM (I : finType) (A : pred I) (E : I -> F) : let n := #|A| in let mu := (\sum_(i in A) E i) / n%:R in {in A, forall i, 0 <= E i} -> \prod_(i in A) E i <= mu ^+ n ?= iff [forall i in A, forall j in A, E i == E j]. Implicit Type p : {poly F}. Lemma Cauchy_root_bound p : p != 0 -> {b | forall x, root p x -> `|x| <= b}. Proof. (* Goal: forall _ : is_true (negb (@eq_op (poly_eqType (NumField.ringType F)) p (GRing.zero (poly_zmodType (NumField.ringType F))))), @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) move=> nz_p; set a := lead_coef p; set n := (size p).-1. (* Goal: @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) have [q Dp]: {q | forall x, x != 0 -> p.[x] = (a - q.[x^-1] / x) * x ^+ n}. (* Goal: @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) (* Goal: @sig (@poly_of (GRing.UnitRing.ringType (NumField.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (NumField.unitRingType F))))) (fun q : @poly_of (GRing.UnitRing.ringType (NumField.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (NumField.unitRingType F)))) => forall (x : NumField.sort F) (_ : is_true (negb (@eq_op (NumField.eqType F) x (GRing.zero (NumField.zmodType F))))), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (NumField.ringType F))) (@horner (NumField.ringType F) p x) (@GRing.mul (NumField.ringType F) (@GRing.add (GRing.Ring.zmodType (NumField.ringType F)) a (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@horner (GRing.UnitRing.ringType (NumField.unitRingType F)) q (@GRing.inv (NumField.unitRingType F) x)) (@GRing.inv (NumField.unitRingType F) x)))) (@GRing.exp (NumField.ringType F) x n))) *) exists (- \poly_(i < n) p`_(n - i.+1)) => x nz_x. (* Goal: @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (NumField.ringType F))) (@horner (NumField.ringType F) p x) (@GRing.mul (NumField.ringType F) (@GRing.add (GRing.Ring.zmodType (NumField.ringType F)) a (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@horner (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.opp (poly_zmodType (NumField.ringType F)) (@poly (NumField.ringType F) n (fun i : nat => @nth (GRing.Zmodule.sort (GRing.Ring.zmodType (NumField.ringType F))) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (@polyseq (NumField.ringType F) p) (subn n (S i))))) (@GRing.inv (NumField.unitRingType F) x)) (@GRing.inv (NumField.unitRingType F) x)))) (@GRing.exp (NumField.ringType F) x n)) *) rewrite hornerN mulNr opprK horner_poly mulrDl !mulr_suml addrC. (* Goal: @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (NumField.ringType F))) (@horner (NumField.ringType F) p x) (@GRing.add (GRing.Ring.zmodType (NumField.ringType F)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (NumField.ringType F))) (Finite.sort (ordinal_finType n)) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (index_enum (ordinal_finType n)) (fun i : Finite.sort (ordinal_finType n) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (NumField.ringType F))) (Finite.sort (ordinal_finType n)) i (@GRing.add (GRing.Ring.zmodType (NumField.ringType F))) true (@GRing.mul (NumField.ringType F) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (NumField.ringType F))) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (@polyseq (NumField.ringType F) p) (subn n (S (@nat_of_ord n i)))) (@GRing.exp (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) x) (@nat_of_ord n i))) (@GRing.inv (NumField.unitRingType F) x)) (@GRing.exp (NumField.ringType F) x n)))) (@GRing.mul (NumField.ringType F) a (@GRing.exp (NumField.ringType F) x n))) *) rewrite horner_coef polySpred // big_ord_recr (reindex_inj rev_ord_inj) /=. (* Goal: @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) (* Goal: @eq (NumField.sort F) (@GRing.add (GRing.Ring.zmodType (NumField.ringType F)) (@BigOp.bigop (NumField.sort F) (ordinal (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p)))) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (index_enum (ordinal_finType (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p))))) (fun j : ordinal (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p))) => @BigBody (NumField.sort F) (ordinal (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p)))) j (@GRing.add (GRing.Ring.zmodType (NumField.ringType F))) true (@GRing.mul (NumField.ringType F) (@nth (NumField.sort F) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (@polyseq (NumField.ringType F) p) (subn (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p))) (S (@nat_of_ord (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p))) j)))) (@GRing.exp (NumField.ringType F) x (subn (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p))) (S (@nat_of_ord (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p))) j))))))) (@GRing.mul (NumField.ringType F) (@nth (NumField.sort F) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (@polyseq (NumField.ringType F) p) (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p)))) (@GRing.exp (NumField.ringType F) x (Nat.pred (@size (NumField.sort F) (@polyseq (NumField.ringType F) p)))))) (@GRing.add (GRing.Ring.zmodType (NumField.ringType F)) (@BigOp.bigop (NumField.sort F) (ordinal n) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (NumField.sort F) (ordinal n) i (@GRing.add (GRing.Ring.zmodType (NumField.ringType F))) true (@GRing.mul (NumField.ringType F) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@nth (NumField.sort F) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (@polyseq (NumField.ringType F) p) (subn n (S (@nat_of_ord n i)))) (@GRing.exp (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) x) (@nat_of_ord n i))) (@GRing.inv (NumField.unitRingType F) x)) (@GRing.exp (NumField.ringType F) x n)))) (@GRing.mul (NumField.ringType F) a (@GRing.exp (NumField.ringType F) x n))) *) rewrite -/n -lead_coefE; congr (_ + _); apply: eq_bigr=> i _. (* Goal: @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) (* Goal: @eq (GRing.Zmodule.sort (NumField.zmodType F)) (@GRing.mul (NumField.ringType F) (@nth (NumField.sort F) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (@polyseq (NumField.ringType F) p) (subn n (S (@nat_of_ord n i)))) (@GRing.exp (NumField.ringType F) x (subn n (S (@nat_of_ord n i))))) (@GRing.mul (NumField.ringType F) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@nth (NumField.sort F) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))) (@polyseq (NumField.ringType F) p) (subn n (S (@nat_of_ord n i)))) (@GRing.exp (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.inv (NumField.unitRingType F) x) (@nat_of_ord n i))) (@GRing.inv (NumField.unitRingType F) x)) (@GRing.exp (NumField.ringType F) x n)) *) by rewrite exprB ?unitfE // -exprVn mulrA mulrAC exprSr mulrA. (* Goal: @sig (NumDomain.sort (NumField.numDomainType F)) (fun b : NumDomain.sort (NumField.numDomainType F) => forall (x : NumField.sort F) (_ : is_true (@root (NumField.ringType F) p x)), is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) b)) *) have [b ub_q] := poly_disk_bound q 1; exists (b / `|a| + 1) => x px0. (* Goal: is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) b (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@normr (NumField.numDomainType F) a))) (GRing.one (NumDomain.ringType (NumField.numDomainType F))))) *) have b_ge0: 0 <= b by rewrite (ler_trans (normr_ge0 q.[1])) ?ub_q ?normr1. (* Goal: is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) b (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@normr (NumField.numDomainType F) a))) (GRing.one (NumDomain.ringType (NumField.numDomainType F))))) *) have{b_ge0} ba_ge0: 0 <= b / `|a| by rewrite divr_ge0 ?normr_ge0. (* Goal: is_true (@ler (NumField.numDomainType F) (@normr (NumField.numDomainType F) x) (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) b (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@normr (NumField.numDomainType F) a))) (GRing.one (NumDomain.ringType (NumField.numDomainType F))))) *) rewrite real_lerNgt ?rpredD ?rpred1 ?ger0_real ?normr_ge0 //. (* Goal: is_true (negb (@ltr (NumField.numDomainType F) (@GRing.add (GRing.Ring.zmodType (NumDomain.ringType (NumField.numDomainType F))) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) b (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@normr (NumField.numDomainType F) a))) (GRing.one (NumDomain.ringType (NumField.numDomainType F)))) (@normr (NumField.numDomainType F) x))) *) apply: contraL px0 => lb_x; rewrite rootE. (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumField.ringType F))) (@horner (NumField.ringType F) p x) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))))) *) have x_ge1: 1 <= `|x| by rewrite (ler_trans _ (ltrW lb_x)) // ler_paddl. (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumField.ringType F))) (@horner (NumField.ringType F) p x) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))))) *) have nz_x: x != 0 by rewrite -normr_gt0 (ltr_le_trans ltr01). (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumField.ringType F))) (@horner (NumField.ringType F) p x) (GRing.zero (GRing.Ring.zmodType (NumField.ringType F))))) *) rewrite {}Dp // mulf_neq0 ?expf_neq0 // subr_eq0 eq_sym. (* Goal: is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.IntegralDomain.zmodType (NumField.idomainType F))) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@horner (GRing.UnitRing.ringType (NumField.unitRingType F)) q (@GRing.inv (NumField.unitRingType F) x)) (@GRing.inv (NumField.unitRingType F) x)) a)) *) have: (b / `|a|) < `|x| by rewrite (ltr_trans _ lb_x) // ltr_spaddr ?ltr01. (* Goal: forall _ : is_true (@ltr (NumField.numDomainType F) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) b (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@normr (NumField.numDomainType F) a))) (@normr (NumField.numDomainType F) x)), is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.IntegralDomain.zmodType (NumField.idomainType F))) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@horner (GRing.UnitRing.ringType (NumField.unitRingType F)) q (@GRing.inv (NumField.unitRingType F) x)) (@GRing.inv (NumField.unitRingType F) x)) a)) *) apply: contraTneq => /(canRL (divfK nz_x))Dax. (* Goal: is_true (negb (@ltr (NumField.numDomainType F) (@GRing.mul (NumDomain.ringType (NumField.numDomainType F)) b (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType F)) (@normr (NumField.numDomainType F) a))) (@normr (NumField.numDomainType F) x))) *) rewrite ltr_pdivr_mulr ?normr_gt0 ?lead_coef_eq0 // mulrC -normrM -{}Dax. (* Goal: is_true (negb (@ltr (NumField.numDomainType F) b (@normr (NumField.numDomainType F) (@horner (GRing.UnitRing.ringType (NumField.unitRingType F)) q (@GRing.inv (NumField.unitRingType F) x))))) *) by rewrite ler_gtF // ub_q // normfV invf_le1 ?normr_gt0. Qed. Import GroupScope. Lemma natf_indexg (gT : finGroupType) (G H : {group gT}) : H \subset G -> #|G : H|%:R = (#|G|%:R / #|H|%:R)%R :> F. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (NumField.sort F) (@GRing.natmul (GRing.Ring.zmodType (NumField.ringType F)) (GRing.one (NumField.ringType F)) (@indexg gT (@gval gT G) (@gval gT H))) (@GRing.mul (GRing.UnitRing.ringType (NumField.unitRingType F)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.inv (NumField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (NumField.unitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))))) *) by move=> sHG; rewrite -divgS // natf_div ?cardSg. Qed. End NumFieldTheory. Section RealDomainTheory. Hint Resolve lerr : core. Variable R : realDomainType. Implicit Types x y z t : R. Lemma num_real x : x \is real. Proof. exact: num_real. Qed. Lemma ltr_total x y : x != y -> (x < y) || (y < x). Proof. (* Goal: forall _ : is_true (negb (@eq_op (RealDomain.eqType R) x y)), is_true (orb (@ltr (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) y x)) *) by rewrite !ltr_def [_ == y]eq_sym => ->; apply: ler_total. Qed. Lemma wlog_ler P : (forall a b, P b a -> P a b) -> (forall a b, a <= b -> P a b) -> forall a b : R, P a b. Proof. (* Goal: forall (_ : forall (a b : NumDomain.sort (RealDomain.numDomainType R)) (_ : P b a), P a b) (_ : forall (a b : NumDomain.sort (RealDomain.numDomainType R)) (_ : is_true (@ler (RealDomain.numDomainType R) a b)), P a b) (a b : RealDomain.sort R), P a b *) by move=> sP hP a b; apply: real_wlog_ler. Qed. Lemma wlog_ltr P : (forall a, P a a) -> (forall a b, (P b a -> P a b)) -> (forall a b, a < b -> P a b) -> forall a b : R, P a b. Proof. (* Goal: forall (_ : forall a : NumDomain.sort (RealDomain.numDomainType R), P a a) (_ : forall (a b : NumDomain.sort (RealDomain.numDomainType R)) (_ : P b a), P a b) (_ : forall (a b : NumDomain.sort (RealDomain.numDomainType R)) (_ : is_true (@ltr (RealDomain.numDomainType R) a b)), P a b) (a b : RealDomain.sort R), P a b *) by move=> rP sP hP a b; apply: real_wlog_ltr. Qed. Lemma ltrNge x y : (x < y) = ~~ (y <= x). Proof. exact: real_ltrNge. Qed. Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) x y) (negb (@ler (RealDomain.numDomainType R) y x)) *) exact: real_ltrNge. Qed. Lemma lerP x y : ler_xor_gt x y `|x - y| `|y - x| (x <= y) (y < x). Proof. (* Goal: @ler_xor_gt (RealDomain.numDomainType R) x y (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x (@GRing.opp (RealDomain.zmodType R) y))) (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) y (@GRing.opp (RealDomain.zmodType R) x))) (@ler (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) y x) *) exact: real_lerP. Qed. Lemma ltrP x y : ltr_xor_ge x y `|x - y| `|y - x| (y <= x) (x < y). Proof. (* Goal: @ltr_xor_ge (RealDomain.numDomainType R) x y (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x (@GRing.opp (RealDomain.zmodType R) y))) (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) y (@GRing.opp (RealDomain.zmodType R) x))) (@ler (RealDomain.numDomainType R) y x) (@ltr (RealDomain.numDomainType R) x y) *) exact: real_ltrP. Qed. Lemma ltrgtP x y : comparer x y `|x - y| `|y - x| (y == x) (x == y) (x <= y) (y <= x) (x < y) (x > y) . Proof. (* Goal: @comparer (RealDomain.numDomainType R) x y (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x (@GRing.opp (RealDomain.zmodType R) y))) (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) y (@GRing.opp (RealDomain.zmodType R) x))) (@eq_op (RealDomain.eqType R) y x) (@eq_op (RealDomain.eqType R) x y) (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) y x) (@ltr (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) y x) *) exact: real_ltrgtP. Qed. Lemma ger0P x : ger0_xor_lt0 x `|x| (x < 0) (0 <= x). Proof. (* Goal: @ger0_xor_lt0 (RealDomain.numDomainType R) x (@normr (RealDomain.numDomainType R) x) (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) *) exact: real_ger0P. Qed. Lemma ler0P x : ler0_xor_gt0 x `|x| (0 < x) (x <= 0). Proof. (* Goal: @ler0_xor_gt0 (RealDomain.numDomainType R) x (@normr (RealDomain.numDomainType R) x) (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) *) exact: real_ler0P. Qed. Lemma ltrgt0P x : comparer0 x `|x| (0 == x) (x == 0) (x <= 0) (0 <= x) (x < 0) (x > 0). Proof. (* Goal: @comparer0 (RealDomain.numDomainType R) x (@normr (RealDomain.numDomainType R) x) (@eq_op (GRing.Zmodule.eqType (RealDomain.zmodType R)) (GRing.zero (RealDomain.zmodType R)) x) (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R))) (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) *) exact: real_ltrgt0P. Qed. Lemma neqr_lt x y : (x != y) = (x < y) || (y < x). Proof. (* Goal: @eq bool (negb (@eq_op (RealDomain.eqType R) x y)) (orb (@ltr (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) y x)) *) exact: real_neqr_lt. Qed. Lemma eqr_leLR x y z t : (x <= y -> z <= t) -> (y < x -> t < z) -> (x <= y) = (z <= t). Proof. (* Goal: forall (_ : forall _ : is_true (@ler (RealDomain.numDomainType R) x y), is_true (@ler (RealDomain.numDomainType R) z t)) (_ : forall _ : is_true (@ltr (RealDomain.numDomainType R) y x), is_true (@ltr (RealDomain.numDomainType R) t z)), @eq bool (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) z t) *) by move=> *; apply/idP/idP; rewrite // !lerNgt; apply: contra. Qed. Lemma eqr_leRL x y z t : (x <= y -> z <= t) -> (y < x -> t < z) -> (z <= t) = (x <= y). Proof. (* Goal: forall (_ : forall _ : is_true (@ler (RealDomain.numDomainType R) x y), is_true (@ler (RealDomain.numDomainType R) z t)) (_ : forall _ : is_true (@ltr (RealDomain.numDomainType R) y x), is_true (@ltr (RealDomain.numDomainType R) t z)), @eq bool (@ler (RealDomain.numDomainType R) z t) (@ler (RealDomain.numDomainType R) x y) *) by move=> *; symmetry; apply: eqr_leLR. Qed. Lemma eqr_ltLR x y z t : (x < y -> z < t) -> (y <= x -> t <= z) -> (x < y) = (z < t). Proof. (* Goal: forall (_ : forall _ : is_true (@ltr (RealDomain.numDomainType R) x y), is_true (@ltr (RealDomain.numDomainType R) z t)) (_ : forall _ : is_true (@ler (RealDomain.numDomainType R) y x), is_true (@ler (RealDomain.numDomainType R) t z)), @eq bool (@ltr (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) z t) *) by move=> *; rewrite !ltrNge; congr negb; apply: eqr_leLR. Qed. Lemma eqr_ltRL x y z t : (x < y -> z < t) -> (y <= x -> t <= z) -> (z < t) = (x < y). Proof. (* Goal: forall (_ : forall _ : is_true (@ltr (RealDomain.numDomainType R) x y), is_true (@ltr (RealDomain.numDomainType R) z t)) (_ : forall _ : is_true (@ler (RealDomain.numDomainType R) y x), is_true (@ler (RealDomain.numDomainType R) t z)), @eq bool (@ltr (RealDomain.numDomainType R) z t) (@ltr (RealDomain.numDomainType R) x y) *) by move=> *; symmetry; apply: eqr_ltLR. Qed. Lemma mulr_lt0 x y : (x * y < 0) = [&& x != 0, y != 0 & (x < 0) (+) (y < 0)]. Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (andb (negb (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R)))) (andb (negb (@eq_op (RealDomain.eqType R) y (GRing.zero (RealDomain.zmodType R)))) (addb (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ltr (RealDomain.numDomainType R) y (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))))) *) have [x_gt0|x_lt0|->] /= := ltrgt0P x; last by rewrite mul0r. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (andb (negb (@eq_op (RealDomain.eqType R) y (GRing.zero (RealDomain.zmodType R)))) (negb (@ltr (RealDomain.numDomainType R) y (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) *) (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (andb (negb (@eq_op (RealDomain.eqType R) y (GRing.zero (RealDomain.zmodType R)))) (@ltr (RealDomain.numDomainType R) y (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))) *) by rewrite pmulr_rlt0 //; case: ltrgt0P. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (andb (negb (@eq_op (RealDomain.eqType R) y (GRing.zero (RealDomain.zmodType R)))) (negb (@ltr (RealDomain.numDomainType R) y (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) *) by rewrite nmulr_rlt0 //; case: ltrgt0P. Qed. Lemma neq0_mulr_lt0 x y : x != 0 -> y != 0 -> (x * y < 0) = (x < 0) (+) (y < 0). Proof. (* Goal: forall (_ : is_true (negb (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R))))) (_ : is_true (negb (@eq_op (RealDomain.eqType R) y (GRing.zero (RealDomain.zmodType R))))), @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (addb (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ltr (RealDomain.numDomainType R) y (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))) *) by move=> x_neq0 y_neq0; rewrite mulr_lt0 x_neq0 y_neq0. Qed. Lemma mulr_sign_lt0 (b : bool) x : ((-1) ^+ b * x < 0) = (x != 0) && (b (+) (x < 0)%R). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) (@GRing.exp (RealDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (RealDomain.ringType R)) (GRing.one (RealDomain.ringType R))) (nat_of_bool b)) x) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (andb (negb (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R)))) (addb b (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) *) by rewrite mulr_lt0 signr_lt0 signr_eq0. Qed. Lemma mulr_sign_norm x : (-1) ^+ (x < 0)%R * `|x| = x. Proof. (* Goal: @eq (GRing.Ring.sort (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (@normr (RealDomain.numDomainType R) x)) x *) by rewrite real_mulr_sign_norm. Qed. Lemma mulr_Nsign_norm x : (-1) ^+ (0 < x)%R * `|x| = - x. Proof. (* Goal: @eq (GRing.Ring.sort (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x))) (@normr (RealDomain.numDomainType R) x)) (@GRing.opp (RealDomain.zmodType R) x) *) by rewrite real_mulr_Nsign_norm. Qed. Lemma numEsign x : x = (-1) ^+ (x < 0)%R * `|x|. Proof. (* Goal: @eq (RealDomain.sort R) x (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (@normr (RealDomain.numDomainType R) x)) *) by rewrite -realEsign. Qed. Lemma numNEsign x : -x = (-1) ^+ (0 < x)%R * `|x|. Proof. (* Goal: @eq (GRing.Zmodule.sort (RealDomain.zmodType R)) (@GRing.opp (RealDomain.zmodType R) x) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x))) (@normr (RealDomain.numDomainType R) x)) *) by rewrite -realNEsign. Qed. Lemma normrEsign x : `|x| = (-1) ^+ (x < 0)%R * x. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@normr (RealDomain.numDomainType R) x) (@GRing.mul (RealDomain.ringType R) (@GRing.exp (RealDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (RealDomain.ringType R)) (GRing.one (RealDomain.ringType R))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) x) *) by rewrite -real_normrEsign. Qed. End RealDomainTheory. Hint Resolve num_real : core. Section RealDomainMonotony. Variables (R : realDomainType) (R' : numDomainType) (D : pred R). Variables (f : R -> R') (f' : R -> nat). Implicit Types (m n p : nat) (x y z : R) (u v w : R'). Hint Resolve (@num_real R) : core. Lemma ler_mono : {homo f : x y / x < y} -> {mono f : x y / x <= y}. Proof. (* Goal: forall _ : @homomorphism_2 (RealDomain.sort R) (NumDomain.sort R') f (fun x y : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)), @monomorphism_2 (RealDomain.sort R) (NumDomain.sort R') bool f (fun x y : RealDomain.sort R => @ler (RealDomain.numDomainType R) x y) (fun x y : NumDomain.sort R' => @ler R' x y) *) by move=> mf x y; apply: real_mono. Qed. Lemma ler_nmono : {homo f : x y /~ x < y} -> {mono f : x y /~ x <= y}. Proof. (* Goal: forall _ : @homomorphism_2 (RealDomain.sort R) (NumDomain.sort R') f (fun y x : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)), @monomorphism_2 (RealDomain.sort R) (NumDomain.sort R') bool f (fun y x : RealDomain.sort R => @ler (RealDomain.numDomainType R) x y) (fun x y : NumDomain.sort R' => @ler R' x y) *) by move=> mf x y; apply: real_nmono. Qed. Lemma ler_mono_in : {in D &, {homo f : x y / x < y}} -> {in D &, {mono f : x y / x <= y}}. Proof. (* Goal: forall _ : @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => forall _ : (fun x0 y0 : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (RealDomain.sort R) (NumDomain.sort R') f (fun x y : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))), @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun x0 y0 : RealDomain.sort R => @ler (RealDomain.numDomainType R) x0 y0) x y)) (inPhantom (@monomorphism_2 (RealDomain.sort R) (NumDomain.sort R') bool f (fun x y : RealDomain.sort R => @ler (RealDomain.numDomainType R) x y) (fun x y : NumDomain.sort R' => @ler R' x y))) *) by move=> mf x y Dx Dy; apply: (real_mono_in mf); rewrite ?inE ?Dx ?Dy /=. Qed. Lemma ler_nmono_in : {in D &, {homo f : x y /~ x < y}} -> {in D &, {mono f : x y /~ x <= y}}. Proof. (* Goal: forall _ : @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => forall _ : (fun y0 x0 : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) x0 y0)) x y, (fun x0 y0 : NumDomain.sort R' => is_true (@ltr R' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (RealDomain.sort R) (NumDomain.sort R') f (fun y x : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) x y)) (fun x y : NumDomain.sort R' => is_true (@ltr R' x y)))), @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => @eq bool ((fun x0 y0 : NumDomain.sort R' => @ler R' x0 y0) (f x) (f y)) ((fun y0 x0 : RealDomain.sort R => @ler (RealDomain.numDomainType R) x0 y0) x y)) (inPhantom (@monomorphism_2 (RealDomain.sort R) (NumDomain.sort R') bool f (fun y x : RealDomain.sort R => @ler (RealDomain.numDomainType R) x y) (fun x y : NumDomain.sort R' => @ler R' x y))) *) by move=> mf x y Dx Dy; apply: (real_nmono_in mf); rewrite ?inE ?Dx ?Dy /=. Qed. Lemma lern_mono : {homo f' : m n / m < n >-> (m < n)%N} -> {mono f' : m n / m <= n >-> (m <= n)%N}. Proof. (* Goal: forall _ : @homomorphism_2 (RealDomain.sort R) nat f' (fun m n : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) m n)) (fun m n : nat => is_true (leq (S m) n)), @monomorphism_2 (RealDomain.sort R) nat bool f' (fun m n : RealDomain.sort R => @ler (RealDomain.numDomainType R) m n) (fun m n : nat => leq m n) *) by move=> mf x y; apply: realn_mono. Qed. Lemma lern_nmono : {homo f' : m n / n < m >-> (m < n)%N} -> {mono f' : m n / n <= m >-> (m <= n)%N}. Proof. (* Goal: forall _ : @homomorphism_2 (RealDomain.sort R) nat f' (fun m n : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) n m)) (fun m n : nat => is_true (leq (S m) n)), @monomorphism_2 (RealDomain.sort R) nat bool f' (fun m n : RealDomain.sort R => @ler (RealDomain.numDomainType R) n m) (fun m n : nat => leq m n) *) by move=> mf x y; apply: realn_nmono. Qed. Lemma lern_mono_in : {in D &, {homo f' : m n / m < n >-> (m < n)%N}} -> {in D &, {mono f' : m n / m <= n >-> (m <= n)%N}}. Proof. (* Goal: forall _ : @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => forall _ : (fun m n : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) m n)) x y, (fun m n : nat => is_true (leq (S m) n)) (f' x) (f' y)) (inPhantom (@homomorphism_2 (RealDomain.sort R) nat f' (fun m n : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) m n)) (fun m n : nat => is_true (leq (S m) n)))), @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => @eq bool ((fun m n : nat => leq m n) (f' x) (f' y)) ((fun m n : RealDomain.sort R => @ler (RealDomain.numDomainType R) m n) x y)) (inPhantom (@monomorphism_2 (RealDomain.sort R) nat bool f' (fun m n : RealDomain.sort R => @ler (RealDomain.numDomainType R) m n) (fun m n : nat => leq m n))) *) by move=> mf x y Dx Dy; apply: (realn_mono_in mf); rewrite ?inE ?Dx ?Dy /=. Qed. Lemma lern_nmono_in : {in D &, {homo f' : m n / n < m >-> (m < n)%N}} -> {in D &, {mono f' : m n / n <= m >-> (m <= n)%N}}. Proof. (* Goal: forall _ : @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => forall _ : (fun m n : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) n m)) x y, (fun m n : nat => is_true (leq (S m) n)) (f' x) (f' y)) (inPhantom (@homomorphism_2 (RealDomain.sort R) nat f' (fun m n : RealDomain.sort R => is_true (@ltr (RealDomain.numDomainType R) n m)) (fun m n : nat => is_true (leq (S m) n)))), @prop_in2 (RealDomain.sort R) (@mem (RealDomain.sort R) (predPredType (RealDomain.sort R)) D) (fun x y : RealDomain.sort R => @eq bool ((fun m n : nat => leq m n) (f' x) (f' y)) ((fun m n : RealDomain.sort R => @ler (RealDomain.numDomainType R) n m) x y)) (inPhantom (@monomorphism_2 (RealDomain.sort R) nat bool f' (fun m n : RealDomain.sort R => @ler (RealDomain.numDomainType R) n m) (fun m n : nat => leq m n))) *) by move=> mf x y Dx Dy; apply: (realn_nmono_in mf); rewrite ?inE ?Dx ?Dy /=. Qed. End RealDomainMonotony. Section RealDomainArgExtremum. Context {R : realDomainType} {I : finType} (i0 : I). Context (P : pred I) (F : I -> R) (Pi0 : P i0). Definition arg_minr := extremum <=%R i0 P F. Definition arg_maxr := extremum >=%R i0 P F. Lemma arg_minrP: extremum_spec <=%R P F arg_minr. Proof. (* Goal: @extremum_spec (NumDomain.eqType (RealDomain.numDomainType R)) (@ler (RealDomain.numDomainType R)) I P F arg_minr *) by apply: extremumP => //; [apply: ler_trans|apply: ler_total]. Qed. Lemma arg_maxrP: extremum_spec >=%R P F arg_maxr. End RealDomainArgExtremum. Notation "[ 'arg' 'minr_' ( i < i0 | P ) F ]" := (arg_minr i0 (fun i => P%B) (fun i => F)) (at level 0, i, i0 at level 10, format "[ 'arg' 'minr_' ( i < i0 | P ) F ]") : form_scope. Notation "[ 'arg' 'minr_' ( i < i0 'in' A ) F ]" := [arg minr_(i < i0 | i \in A) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'minr_' ( i < i0 'in' A ) F ]") : form_scope. Notation "[ 'arg' 'minr_' ( i < i0 ) F ]" := [arg minr_(i < i0 | true) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'minr_' ( i < i0 ) F ]") : form_scope. Notation "[ 'arg' 'maxr_' ( i > i0 | P ) F ]" := (arg_maxr i0 (fun i => P%B) (fun i => F)) (at level 0, i, i0 at level 10, format "[ 'arg' 'maxr_' ( i > i0 | P ) F ]") : form_scope. Notation "[ 'arg' 'maxr_' ( i > i0 'in' A ) F ]" := [arg maxr_(i > i0 | i \in A) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'maxr_' ( i > i0 'in' A ) F ]") : form_scope. Notation "[ 'arg' 'maxr_' ( i > i0 ) F ]" := [arg maxr_(i > i0 | true) F] (at level 0, i, i0 at level 10, format "[ 'arg' 'maxr_' ( i > i0 ) F ]") : form_scope. Section RealDomainOperations. Variable R : realDomainType. Implicit Types x y z t : R. Hint Resolve (@num_real R) : core. Lemma sgr_cp0 x : ((sg x == 1) = (0 < x)) * ((sg x == -1) = (x < 0)) * ((sg x == 0) = (x == 0)). Proof. (* Goal: prod (prod (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x)) (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R))))) (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R)))) *) rewrite -[1]/((-1) ^+ false) -signrN lt0r lerNgt sgr_def. (* Goal: prod (prod (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (nat_of_bool (negb (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (negb false))) (nat_of_bool false))) (andb (negb (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))) (negb (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))))) (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (nat_of_bool (negb (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (negb false)))) (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (nat_of_bool (negb (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))))) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R)))) *) case: (x =P 0) => [-> | _]; first by rewrite !(eq_sym 0) !signr_eq0 ltrr eqxx. (* Goal: prod (prod (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (nat_of_bool (negb false))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (negb false))) (nat_of_bool false))) (andb (negb false) (negb (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))))) (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (nat_of_bool (negb false))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (negb false)))) (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (@eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (nat_of_bool (negb false))) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) false) *) by rewrite !(inj_eq signr_inj) eqb_id eqbF_neg signr_eq0 //. Qed. Variant sgr_val x : R -> bool -> bool -> bool -> bool -> bool -> bool -> bool -> bool -> bool -> bool -> bool -> bool -> R -> Set := | SgrNull of x = 0 : sgr_val x 0 true true true true false false true false false true false false 0 | SgrPos of x > 0 : sgr_val x x false false true false false true false false true false false true 1 | SgrNeg of x < 0 : sgr_val x (- x) false true false false true false false true false false true false (-1). Lemma sgrP x : sgr_val x `|x| (0 == x) (x <= 0) (0 <= x) (x == 0) (x < 0) (0 < x) (0 == sg x) (-1 == sg x) (1 == sg x) (sg x == 0) (sg x == -1) (sg x == 1) (sg x). Proof. (* Goal: sgr_val x (@normr (RealDomain.numDomainType R) x) (@eq_op (GRing.Zmodule.eqType (RealDomain.zmodType R)) (GRing.zero (RealDomain.zmodType R)) x) (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R))) (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) (@eq_op (GRing.Zmodule.eqType (NumDomain.zmodType (RealDomain.numDomainType R))) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) (@sgr (RealDomain.numDomainType R) x)) (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R)))) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (@sgr (RealDomain.numDomainType R) x)) (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R))) (@sgr (RealDomain.numDomainType R) x)) (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R))))) (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (@sgr (RealDomain.numDomainType R) x) *) by rewrite ![_ == sg _]eq_sym !sgr_cp0 /sg; case: ltrgt0P; constructor. Qed. Lemma normrEsg x : `|x| = sg x * x. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@normr (RealDomain.numDomainType R) x) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) x) *) by case: sgrP; rewrite ?(mul0r, mul1r, mulN1r). Qed. Lemma numEsg x : x = sg x * `|x|. Proof. (* Goal: @eq (RealDomain.sort R) x (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (@normr (RealDomain.numDomainType R) x)) *) by case: sgrP; rewrite !(mul1r, mul0r, mulrNN). Qed. Lemma sgrM x y : sg (x * y) = sg x * sg y. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y)) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (@sgr (RealDomain.numDomainType R) y)) *) rewrite !sgr_def mulr_lt0 andbA mulrnAr mulrnAl -mulrnA mulnb -negb_or mulf_eq0. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (andb (negb (orb (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R))) (@eq_op (RealDomain.eqType R) y (GRing.zero (RealDomain.zmodType R))))) (addb (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ltr (RealDomain.numDomainType R) y (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))))) (nat_of_bool (negb (orb (@eq_op (GRing.IntegralDomain.eqType (NumDomain.idomainType (RealDomain.numDomainType R))) x (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType (RealDomain.numDomainType R))))) (@eq_op (GRing.IntegralDomain.eqType (NumDomain.idomainType (RealDomain.numDomainType R))) y (GRing.zero (GRing.IntegralDomain.zmodType (NumDomain.idomainType (RealDomain.numDomainType R))))))))) (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))))) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@GRing.opp (GRing.Ring.zmodType (NumDomain.ringType (RealDomain.numDomainType R))) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) (nat_of_bool (@ltr (RealDomain.numDomainType R) y (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))))))) (nat_of_bool (negb (orb (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R))) (@eq_op (RealDomain.eqType R) y (GRing.zero (RealDomain.zmodType R))))))) *) by case: (~~ _) => //; rewrite signr_addb. Qed. Lemma sgrN x : sg (- x) = - sg x. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x)) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x)) *) by rewrite -mulrN1 sgrM sgrN1 mulrN1. Qed. Lemma sgrX n x : sg (x ^+ n) = (sg x) ^+ n. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) (@GRing.exp (RealDomain.ringType R) x n)) (@GRing.exp (NumDomain.ringType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) n) *) by elim: n => [|n IHn]; rewrite ?sgr1 // !exprS sgrM IHn. Qed. Lemma sgr_smul x y : sg (sg x * y) = sg x * sg y. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) y)) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@sgr (RealDomain.numDomainType R) x) (@sgr (RealDomain.numDomainType R) y)) *) by rewrite sgrM sgr_id. Qed. Lemma sgr_gt0 x : (sg x > 0) = (x > 0). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) (@sgr (RealDomain.numDomainType R) x)) (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) *) by rewrite -sgr_cp0 sgr_id sgr_cp0. Qed. Lemma sgr_ge0 x : (sgr x >= 0) = (x >= 0). Proof. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) (@sgr (RealDomain.numDomainType R) x)) (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) *) by rewrite !lerNgt sgr_lt0. Qed. Lemma ler_norm x : (x <= `|x|). Proof. (* Goal: is_true (@ler (RealDomain.numDomainType R) x (@normr (RealDomain.numDomainType R) x)) *) exact: real_ler_norm. Qed. Lemma ler_norml x y : (`|x| <= y) = (- y <= x <= y). Proof. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) y) (andb (@ler (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) y) x) (@ler (RealDomain.numDomainType R) x y)) *) exact: real_ler_norml. Qed. Lemma ler_normlP x y : reflect ((- x <= y) * (x <= y)) (`|x| <= y). Proof. (* Goal: Bool.reflect (prod (is_true (@ler (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) y)) (is_true (@ler (RealDomain.numDomainType R) x y))) (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) y) *) exact: real_ler_normlP. Qed. Arguments ler_normlP {x y}. Lemma eqr_norml x y : (`|x| == y) = ((x == y) || (x == -y)) && (0 <= y). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@normr (RealDomain.numDomainType R) x) y) (andb (orb (@eq_op (RealDomain.eqType R) x y) (@eq_op (RealDomain.eqType R) x (@GRing.opp (RealDomain.zmodType R) y))) (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) y)) *) exact: real_eqr_norml. Qed. Lemma eqr_norm2 x y : (`|x| == `|y|) = (x == y) || (x == -y). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@normr (RealDomain.numDomainType R) x) (@normr (RealDomain.numDomainType R) y)) (orb (@eq_op (RealDomain.eqType R) x y) (@eq_op (RealDomain.eqType R) x (@GRing.opp (RealDomain.zmodType R) y))) *) exact: real_eqr_norm2. Qed. Lemma ltr_norml x y : (`|x| < y) = (- y < x < y). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) y) (andb (@ltr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) y) x) (@ltr (RealDomain.numDomainType R) x y)) *) exact: real_ltr_norml. Qed. Definition lter_norml := (ler_norml, ltr_norml). Lemma ltr_normlP x y : reflect ((-x < y) * (x < y)) (`|x| < y). Proof. (* Goal: Bool.reflect (prod (is_true (@ltr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) y)) (is_true (@ltr (RealDomain.numDomainType R) x y))) (@ltr (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) y) *) exact: real_ltr_normlP. Qed. Arguments ltr_normlP {x y}. Lemma ler_normr x y : (x <= `|y|) = (x <= y) || (x <= - y). Proof. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) x (@normr (RealDomain.numDomainType R) y)) (orb (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) x (@GRing.opp (RealDomain.zmodType R) y))) *) by rewrite lerNgt ltr_norml negb_and -!lerNgt orbC ler_oppr. Qed. Lemma ltr_normr x y : (x < `|y|) = (x < y) || (x < - y). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) x (@normr (RealDomain.numDomainType R) y)) (orb (@ltr (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) x (@GRing.opp (RealDomain.zmodType R) y))) *) by rewrite ltrNge ler_norml negb_and -!ltrNge orbC ltr_oppr. Qed. Definition lter_normr := (ler_normr, ltr_normr). Lemma ler_distl x y e : (`|x - y| <= e) = (y - e <= x <= y + e). Proof. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x (@GRing.opp (RealDomain.zmodType R) y))) e) (andb (@ler (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) e)) x) (@ler (RealDomain.numDomainType R) x (@GRing.add (RealDomain.zmodType R) y e))) *) by rewrite lter_norml !lter_sub_addl. Qed. Lemma ltr_distl x y e : (`|x - y| < e) = (y - e < x < y + e). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x (@GRing.opp (RealDomain.zmodType R) y))) e) (andb (@ltr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) y (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) e)) x) (@ltr (RealDomain.numDomainType R) x (@GRing.add (RealDomain.zmodType R) y e))) *) by rewrite lter_norml !lter_sub_addl. Qed. Definition lter_distl := (ler_distl, ltr_distl). Lemma exprn_even_ge0 n x : ~~ odd n -> 0 <= x ^+ n. Proof. (* Goal: forall _ : is_true (negb (odd n)), is_true (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.exp (RealDomain.ringType R) x n)) *) by move=> even_n; rewrite real_exprn_even_ge0 ?num_real. Qed. Lemma exprn_even_gt0 n x : ~~ odd n -> (0 < x ^+ n) = (n == 0)%N || (x != 0). Proof. (* Goal: forall _ : is_true (negb (odd n)), @eq bool (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.exp (RealDomain.ringType R) x n)) (orb (@eq_op nat_eqType n O) (negb (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R))))) *) by move=> even_n; rewrite real_exprn_even_gt0 ?num_real. Qed. Lemma exprn_even_le0 n x : ~~ odd n -> (x ^+ n <= 0) = (n != 0%N) && (x == 0). Proof. (* Goal: forall _ : is_true (negb (odd n)), @eq bool (@ler (RealDomain.numDomainType R) (@GRing.exp (RealDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (andb (negb (@eq_op nat_eqType n O)) (@eq_op (RealDomain.eqType R) x (GRing.zero (RealDomain.zmodType R)))) *) by move=> even_n; rewrite real_exprn_even_le0 ?num_real. Qed. Lemma exprn_even_lt0 n x : ~~ odd n -> (x ^+ n < 0) = false. Proof. (* Goal: forall _ : is_true (negb (odd n)), @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.exp (RealDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) false *) by move=> even_n; rewrite real_exprn_even_lt0 ?num_real. Qed. Lemma exprn_odd_ge0 n x : odd n -> (0 <= x ^+ n) = (0 <= x). Proof. (* Goal: forall _ : is_true (odd n), @eq bool (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.exp (RealDomain.ringType R) x n)) (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) *) by move=> even_n; rewrite real_exprn_odd_ge0 ?num_real. Qed. Lemma exprn_odd_gt0 n x : odd n -> (0 < x ^+ n) = (0 < x). Proof. (* Goal: forall _ : is_true (odd n), @eq bool (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.exp (RealDomain.ringType R) x n)) (@ltr (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x) *) by move=> even_n; rewrite real_exprn_odd_gt0 ?num_real. Qed. Lemma exprn_odd_le0 n x : odd n -> (x ^+ n <= 0) = (x <= 0). Proof. (* Goal: forall _ : is_true (odd n), @eq bool (@ler (RealDomain.numDomainType R) (@GRing.exp (RealDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) *) by move=> even_n; rewrite real_exprn_odd_le0 ?num_real. Qed. Lemma exprn_odd_lt0 n x : odd n -> (x ^+ n < 0) = (x < 0). Proof. (* Goal: forall _ : is_true (odd n), @eq bool (@ltr (RealDomain.numDomainType R) (@GRing.exp (RealDomain.ringType R) x n) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) (@ltr (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))) *) by move=> even_n; rewrite real_exprn_odd_lt0 ?num_real. Qed. Lemma sqr_norm_eq1 x : (x ^+ 2 == 1) = (`|x| == 1). Proof. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (RealDomain.ringType R)) (@GRing.exp (RealDomain.ringType R) x (S (S O))) (GRing.one (RealDomain.ringType R))) (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@normr (RealDomain.numDomainType R) x) (GRing.one (NumDomain.ringType (RealDomain.numDomainType R)))) *) by rewrite sqrf_eq1 eqr_norml ler01 andbT. Qed. Lemma lerif_mean_square_scaled x y : x * y *+ 2 <= x ^+ 2 + y ^+ 2 ?= iff (x == y). Proof. (* Goal: @lerif (RealDomain.numDomainType R) (@GRing.natmul (GRing.Ring.zmodType (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x y) (S (S O))) (@GRing.add (GRing.Ring.zmodType (RealDomain.ringType R)) (@GRing.exp (RealDomain.ringType R) x (S (S O))) (@GRing.exp (RealDomain.ringType R) y (S (S O)))) (@eq_op (RealDomain.eqType R) x y) *) exact: real_lerif_mean_square_scaled. Qed. Lemma lerif_AGM2_scaled x y : x * y *+ 4 <= (x + y) ^+ 2 ?= iff (x == y). Proof. (* Goal: @lerif (RealDomain.numDomainType R) (@GRing.natmul (GRing.Ring.zmodType (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x y) (S (S (S (S O))))) (@GRing.exp (RealDomain.ringType R) (@GRing.add (RealDomain.zmodType R) x y) (S (S O))) (@eq_op (RealDomain.eqType R) x y) *) exact: real_lerif_AGM2_scaled. Qed. Section MinMax. Lemma minrC : @commutative R R min. Proof. (* Goal: @commutative (RealDomain.sort R) (RealDomain.sort R) (@minr (RealDomain.numDomainType R)) *) by move=> x y; rewrite /min; case: ltrgtP. Qed. Lemma minrr : @idempotent R min. Proof. (* Goal: @idempotent (RealDomain.sort R) (@minr (RealDomain.numDomainType R)) *) by move=> x; rewrite /min if_same. Qed. Lemma minr_l x y : x <= y -> min x y = x. Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) x y), @eq (NumDomain.sort (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y) x *) by rewrite /minr => ->. Qed. Lemma minr_r x y : y <= x -> min x y = y. Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) y x), @eq (NumDomain.sort (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y) y *) by move/minr_l; rewrite minrC. Qed. Lemma maxrC : @commutative R R max. Proof. (* Goal: @commutative (RealDomain.sort R) (RealDomain.sort R) (@maxr (RealDomain.numDomainType R)) *) by move=> x y; rewrite /maxr; case: ltrgtP. Qed. Lemma maxrr : @idempotent R max. Proof. (* Goal: @idempotent (RealDomain.sort R) (@maxr (RealDomain.numDomainType R)) *) by move=> x; rewrite /max if_same. Qed. Lemma maxr_l x y : y <= x -> max x y = x. Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) y x), @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y) x *) by move=> hxy; rewrite /max hxy. Qed. Lemma maxr_r x y : x <= y -> max x y = y. Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) x y), @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y) y *) by move=> hxy; rewrite maxrC maxr_l. Qed. Lemma addr_min_max x y : min x y + max x y = x + y. Proof. (* Goal: @eq (GRing.Zmodule.sort (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.add (NumDomain.zmodType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y) (@maxr (RealDomain.numDomainType R) x y)) (@GRing.add (RealDomain.zmodType R) x y) *) case: (lerP x y)=> hxy; first by rewrite maxr_r ?minr_l. (* Goal: @eq (GRing.Zmodule.sort (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.add (NumDomain.zmodType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y) (@maxr (RealDomain.numDomainType R) x y)) (@GRing.add (RealDomain.zmodType R) x y) *) by rewrite maxr_l ?minr_r ?ltrW // addrC. Qed. Lemma addr_max_min x y : max x y + min x y = x + y. Proof. (* Goal: @eq (GRing.Zmodule.sort (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.add (NumDomain.zmodType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y) (@minr (RealDomain.numDomainType R) x y)) (@GRing.add (RealDomain.zmodType R) x y) *) by rewrite addrC addr_min_max. Qed. Lemma minr_to_max x y : min x y = x + y - max x y. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y) (@GRing.add (RealDomain.zmodType R) (@GRing.add (RealDomain.zmodType R) x y) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y))) *) by rewrite -[x + y]addr_min_max addrK. Qed. Lemma maxr_to_min x y : max x y = x + y - min x y. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y) (@GRing.add (RealDomain.zmodType R) (@GRing.add (RealDomain.zmodType R) x y) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y))) *) by rewrite -[x + y]addr_max_min addrK. Qed. Lemma minrA x y z : min x (min y z) = min (min x y) z. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x (@minr (RealDomain.numDomainType R) y z)) (@minr (RealDomain.numDomainType R) (@minr (RealDomain.numDomainType R) x y) z) *) rewrite /min; case: (lerP y z) => [hyz | /ltrW hyz]. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (if @ler (RealDomain.numDomainType R) x z then x else z) (if @ler (RealDomain.numDomainType R) (if @ler (RealDomain.numDomainType R) x y then x else y) z then if @ler (RealDomain.numDomainType R) x y then x else y else z) *) (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (if @ler (RealDomain.numDomainType R) x y then x else y) (if @ler (RealDomain.numDomainType R) (if @ler (RealDomain.numDomainType R) x y then x else y) z then if @ler (RealDomain.numDomainType R) x y then x else y else z) *) by case: lerP => hxy; rewrite ?hyz // (@ler_trans _ y). (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (if @ler (RealDomain.numDomainType R) x z then x else z) (if @ler (RealDomain.numDomainType R) (if @ler (RealDomain.numDomainType R) x y then x else y) z then if @ler (RealDomain.numDomainType R) x y then x else y else z) *) case: lerP=> hxz; first by rewrite !(ler_trans hxz). (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) z (if @ler (RealDomain.numDomainType R) (if @ler (RealDomain.numDomainType R) x y then x else y) z then if @ler (RealDomain.numDomainType R) x y then x else y else z) *) case: (lerP x y)=> hxy; first by rewrite lerNgt hxz. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) z (if @ler (RealDomain.numDomainType R) y z then y else z) *) by case: ltrgtP hyz. Qed. Lemma minrCA : @left_commutative R R min. Proof. (* Goal: @left_commutative (RealDomain.sort R) (RealDomain.sort R) (@minr (RealDomain.numDomainType R)) *) by move=> x y z; rewrite !minrA [minr x y]minrC. Qed. Lemma minrAC : @right_commutative R R min. Proof. (* Goal: @right_commutative (RealDomain.sort R) (RealDomain.sort R) (@minr (RealDomain.numDomainType R)) *) by move=> x y z; rewrite -!minrA [minr y z]minrC. Qed. Variant minr_spec x y : bool -> bool -> R -> Type := | Minr_r of x <= y : minr_spec x y true false x | Minr_l of y < x : minr_spec x y false true y. Lemma minrP x y : minr_spec x y (x <= y) (y < x) (min x y). Proof. (* Goal: minr_spec x y (@ler (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) y x) (@minr (RealDomain.numDomainType R) x y) *) case: lerP=> hxy; first by rewrite minr_l //; constructor. (* Goal: minr_spec x y false true (@minr (RealDomain.numDomainType R) x y) *) by rewrite minr_r 1?ltrW //; constructor. Qed. Lemma oppr_max x y : - max x y = min (- x) (- y). Proof. (* Goal: @eq (GRing.Zmodule.sort (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y)) (@minr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) (@GRing.opp (RealDomain.zmodType R) y)) *) case: minrP; rewrite lter_opp2 => hxy; first by rewrite maxr_l. (* Goal: @eq (GRing.Zmodule.sort (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y)) (@GRing.opp (RealDomain.zmodType R) y) *) by rewrite maxr_r // ltrW. Qed. Lemma oppr_min x y : - min x y = max (- x) (- y). Proof. (* Goal: @eq (GRing.Zmodule.sort (NumDomain.zmodType (RealDomain.numDomainType R))) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y)) (@maxr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) (@GRing.opp (RealDomain.zmodType R) y)) *) by rewrite -[maxr _ _]opprK oppr_max !opprK. Qed. Lemma maxrA x y z : max x (max y z) = max (max x y) z. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x (@maxr (RealDomain.numDomainType R) y z)) (@maxr (RealDomain.numDomainType R) (@maxr (RealDomain.numDomainType R) x y) z) *) by apply/eqP; rewrite -eqr_opp !oppr_max minrA. Qed. Lemma maxrCA : @left_commutative R R max. Proof. (* Goal: @left_commutative (RealDomain.sort R) (RealDomain.sort R) (@maxr (RealDomain.numDomainType R)) *) by move=> x y z; rewrite !maxrA [maxr x y]maxrC. Qed. Lemma maxrAC : @right_commutative R R max. Proof. (* Goal: @right_commutative (RealDomain.sort R) (RealDomain.sort R) (@maxr (RealDomain.numDomainType R)) *) by move=> x y z; rewrite -!maxrA [maxr y z]maxrC. Qed. Variant maxr_spec x y : bool -> bool -> R -> Type := | Maxr_r of y <= x : maxr_spec x y true false x | Maxr_l of x < y : maxr_spec x y false true y. Lemma maxrP x y : maxr_spec x y (y <= x) (x < y) (maxr x y). Proof. (* Goal: maxr_spec x y (@ler (RealDomain.numDomainType R) y x) (@ltr (RealDomain.numDomainType R) x y) (@maxr (RealDomain.numDomainType R) x y) *) case: lerP => hxy; first by rewrite maxr_l //; constructor. (* Goal: maxr_spec x y false true (@maxr (RealDomain.numDomainType R) x y) *) by rewrite maxr_r 1?ltrW //; constructor. Qed. Lemma eqr_minl x y : (min x y == x) = (x <= y). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y) x) (@ler (RealDomain.numDomainType R) x y) *) by case: minrP=> hxy; rewrite ?eqxx // ltr_eqF. Qed. Lemma eqr_minr x y : (min x y == y) = (y <= x). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x y) y) (@ler (RealDomain.numDomainType R) y x) *) by rewrite minrC eqr_minl. Qed. Lemma eqr_maxl x y : (max x y == x) = (y <= x). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y) x) (@ler (RealDomain.numDomainType R) y x) *) by case: maxrP=> hxy; rewrite ?eqxx // eq_sym ltr_eqF. Qed. Lemma eqr_maxr x y : (max x y == y) = (x <= y). Proof. (* Goal: @eq bool (@eq_op (NumDomain.eqType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x y) y) (@ler (RealDomain.numDomainType R) x y) *) by rewrite maxrC eqr_maxl. Qed. Lemma ler_minr x y z : (x <= min y z) = (x <= y) && (x <= z). Proof. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) x (@minr (RealDomain.numDomainType R) y z)) (andb (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) x z)) *) case: minrP=> hyz. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) x z) (andb (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) x z)) *) (* Goal: @eq bool (@ler (RealDomain.numDomainType R) x y) (andb (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) x z)) *) by case: lerP=> hxy //; rewrite (ler_trans _ hyz). (* Goal: @eq bool (@ler (RealDomain.numDomainType R) x z) (andb (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) x z)) *) by case: lerP=> hxz; rewrite andbC // (ler_trans hxz) // ltrW. Qed. Lemma ler_minl x y z : (min y z <= x) = (y <= x) || (z <= x). Lemma ler_maxr x y z : (x <= max y z) = (x <= y) || (x <= z). Proof. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) x (@maxr (RealDomain.numDomainType R) y z)) (orb (@ler (RealDomain.numDomainType R) x y) (@ler (RealDomain.numDomainType R) x z)) *) by rewrite -lter_opp2 oppr_max ler_minl !ler_opp2. Qed. Lemma ler_maxl x y z : (max y z <= x) = (y <= x) && (z <= x). Proof. (* Goal: @eq bool (@ler (RealDomain.numDomainType R) (@maxr (RealDomain.numDomainType R) y z) x) (andb (@ler (RealDomain.numDomainType R) y x) (@ler (RealDomain.numDomainType R) z x)) *) by rewrite -lter_opp2 oppr_max ler_minr !ler_opp2. Qed. Lemma ltr_minr x y z : (x < min y z) = (x < y) && (x < z). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) x (@minr (RealDomain.numDomainType R) y z)) (andb (@ltr (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) x z)) *) by rewrite !ltrNge ler_minl negb_or. Qed. Lemma ltr_minl x y z : (min y z < x) = (y < x) || (z < x). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@minr (RealDomain.numDomainType R) y z) x) (orb (@ltr (RealDomain.numDomainType R) y x) (@ltr (RealDomain.numDomainType R) z x)) *) by rewrite !ltrNge ler_minr negb_and. Qed. Lemma ltr_maxr x y z : (x < max y z) = (x < y) || (x < z). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) x (@maxr (RealDomain.numDomainType R) y z)) (orb (@ltr (RealDomain.numDomainType R) x y) (@ltr (RealDomain.numDomainType R) x z)) *) by rewrite !ltrNge ler_maxl negb_and. Qed. Lemma ltr_maxl x y z : (max y z < x) = (y < x) && (z < x). Proof. (* Goal: @eq bool (@ltr (RealDomain.numDomainType R) (@maxr (RealDomain.numDomainType R) y z) x) (andb (@ltr (RealDomain.numDomainType R) y x) (@ltr (RealDomain.numDomainType R) z x)) *) by rewrite !ltrNge ler_maxr negb_or. Qed. Definition lter_minr := (ler_minr, ltr_minr). Definition lter_minl := (ler_minl, ltr_minl). Definition lter_maxr := (ler_maxr, ltr_maxr). Definition lter_maxl := (ler_maxl, ltr_maxl). Lemma addr_minl : @left_distributive R R +%R min. Proof. (* Goal: @left_distributive (RealDomain.sort R) (RealDomain.sort R) (@GRing.add (RealDomain.zmodType R)) (@minr (RealDomain.numDomainType R)) *) move=> x y z; case: minrP=> hxy; first by rewrite minr_l // ler_add2r. (* Goal: @eq (RealDomain.sort R) (@GRing.add (RealDomain.zmodType R) y z) (@minr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x z) (@GRing.add (RealDomain.zmodType R) y z)) *) by rewrite minr_r // ltrW // ltr_add2r. Qed. Lemma addr_minr : @right_distributive R R +%R min. Proof. (* Goal: @right_distributive (RealDomain.sort R) (RealDomain.sort R) (@GRing.add (RealDomain.zmodType R)) (@minr (RealDomain.numDomainType R)) *) move=> x y z; case: minrP=> hxy; first by rewrite minr_l // ler_add2l. (* Goal: @eq (RealDomain.sort R) (@GRing.add (RealDomain.zmodType R) x z) (@minr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x y) (@GRing.add (RealDomain.zmodType R) x z)) *) by rewrite minr_r // ltrW // ltr_add2l. Qed. Lemma addr_maxl : @left_distributive R R +%R max. Proof. (* Goal: @left_distributive (RealDomain.sort R) (RealDomain.sort R) (@GRing.add (RealDomain.zmodType R)) (@maxr (RealDomain.numDomainType R)) *) move=> x y z; rewrite -[_ + _]opprK opprD oppr_max. (* Goal: @eq (RealDomain.sort R) (@GRing.opp (RealDomain.zmodType R) (@GRing.add (RealDomain.zmodType R) (@minr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) (@GRing.opp (RealDomain.zmodType R) y)) (@GRing.opp (RealDomain.zmodType R) z))) (@maxr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x z) (@GRing.add (RealDomain.zmodType R) y z)) *) by rewrite addr_minl -!opprD oppr_min !opprK. Qed. Lemma addr_maxr : @right_distributive R R +%R max. Proof. (* Goal: @right_distributive (RealDomain.sort R) (RealDomain.sort R) (@GRing.add (RealDomain.zmodType R)) (@maxr (RealDomain.numDomainType R)) *) move=> x y z; rewrite -[_ + _]opprK opprD oppr_max. (* Goal: @eq (RealDomain.sort R) (@GRing.opp (RealDomain.zmodType R) (@GRing.add (RealDomain.zmodType R) (@GRing.opp (RealDomain.zmodType R) x) (@minr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) y) (@GRing.opp (RealDomain.zmodType R) z)))) (@maxr (RealDomain.numDomainType R) (@GRing.add (RealDomain.zmodType R) x y) (@GRing.add (RealDomain.zmodType R) x z)) *) by rewrite addr_minr -!opprD oppr_min !opprK. Qed. Lemma minrK x y : max (min x y) x = x. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) (@minr (RealDomain.numDomainType R) x y) x) x *) by case: minrP => hxy; rewrite ?maxrr ?maxr_r // ltrW. Qed. Lemma minKr x y : min y (max x y) = y. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) y (@maxr (RealDomain.numDomainType R) x y)) y *) by case: maxrP => hxy; rewrite ?minrr ?minr_l. Qed. Lemma maxr_minl : @left_distributive R R max min. Proof. (* Goal: @left_distributive (RealDomain.sort R) (RealDomain.sort R) (@maxr (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R)) *) move=> x y z; case: minrP => hxy. (* Goal: @eq (RealDomain.sort R) (@maxr (RealDomain.numDomainType R) y z) (@minr (RealDomain.numDomainType R) (@maxr (RealDomain.numDomainType R) x z) (@maxr (RealDomain.numDomainType R) y z)) *) (* Goal: @eq (RealDomain.sort R) (@maxr (RealDomain.numDomainType R) x z) (@minr (RealDomain.numDomainType R) (@maxr (RealDomain.numDomainType R) x z) (@maxr (RealDomain.numDomainType R) y z)) *) by case: maxrP => hm; rewrite minr_l // ler_maxr (hxy, lerr) ?orbT. (* Goal: @eq (RealDomain.sort R) (@maxr (RealDomain.numDomainType R) y z) (@minr (RealDomain.numDomainType R) (@maxr (RealDomain.numDomainType R) x z) (@maxr (RealDomain.numDomainType R) y z)) *) by case: maxrP => hyz; rewrite minr_r // ler_maxr (ltrW hxy, lerr) ?orbT. Qed. Lemma maxr_minr : @right_distributive R R max min. Proof. (* Goal: @right_distributive (RealDomain.sort R) (RealDomain.sort R) (@maxr (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R)) *) by move=> x y z; rewrite maxrC maxr_minl ![_ _ x]maxrC. Qed. Lemma minr_maxl : @left_distributive R R min max. Proof. (* Goal: @left_distributive (RealDomain.sort R) (RealDomain.sort R) (@minr (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R)) *) move=> x y z; rewrite -[min _ _]opprK !oppr_min [- max x y]oppr_max. (* Goal: @eq (RealDomain.sort R) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) (@minr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) (@GRing.opp (RealDomain.zmodType R) y)) (@GRing.opp (RealDomain.zmodType R) z))) (@maxr (RealDomain.numDomainType R) (@minr (RealDomain.numDomainType R) x z) (@minr (RealDomain.numDomainType R) y z)) *) by rewrite maxr_minl !(oppr_max, oppr_min, opprK). Qed. Lemma minr_maxr : @right_distributive R R min max. Proof. (* Goal: @right_distributive (RealDomain.sort R) (RealDomain.sort R) (@minr (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R)) *) by move=> x y z; rewrite minrC minr_maxl ![_ _ x]minrC. Qed. Lemma minr_pmulr x y z : 0 <= x -> x * min y z = min (x * y) (x * z). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x), @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x (@minr (RealDomain.numDomainType R) y z)) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) case: sgrP=> // hx _; first by rewrite hx !mul0r minrr. (* Goal: @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x (@minr (RealDomain.numDomainType R) y z)) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) case: minrP=> hyz; first by rewrite minr_l // ler_pmul2l. (* Goal: @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x z) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) by rewrite minr_r // ltrW // ltr_pmul2l. Qed. Lemma minr_nmulr x y z : x <= 0 -> x * min y z = max (x * y) (x * z). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))), @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x (@minr (RealDomain.numDomainType R) y z)) (@maxr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) move=> hx; rewrite -[_ * _]opprK -mulNr minr_pmulr ?oppr_cp0 //. (* Goal: @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.opp (GRing.Ring.zmodType (RealDomain.ringType R)) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (RealDomain.ringType R)) x) y) (@GRing.mul (RealDomain.ringType R) (@GRing.opp (GRing.Ring.zmodType (RealDomain.ringType R)) x) z))) (@maxr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) by rewrite oppr_min !mulNr !opprK. Qed. Lemma maxr_pmulr x y z : 0 <= x -> x * max y z = max (x * y) (x * z). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x), @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x (@maxr (RealDomain.numDomainType R) y z)) (@maxr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) move=> hx; rewrite -[_ * _]opprK -mulrN oppr_max minr_pmulr //. (* Goal: @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.opp (GRing.Ring.zmodType (RealDomain.ringType R)) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x (@GRing.opp (RealDomain.zmodType R) y)) (@GRing.mul (RealDomain.ringType R) x (@GRing.opp (RealDomain.zmodType R) z)))) (@maxr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) by rewrite oppr_min !mulrN !opprK. Qed. Lemma maxr_nmulr x y z : x <= 0 -> x * max y z = min (x * y) (x * z). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))), @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.mul (RealDomain.ringType R) x (@maxr (RealDomain.numDomainType R) y z)) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) move=> hx; rewrite -[_ * _]opprK -mulrN oppr_max minr_nmulr //. (* Goal: @eq (GRing.Ring.sort (RealDomain.ringType R)) (@GRing.opp (GRing.Ring.zmodType (RealDomain.ringType R)) (@maxr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x (@GRing.opp (RealDomain.zmodType R) y)) (@GRing.mul (RealDomain.ringType R) x (@GRing.opp (RealDomain.zmodType R) z)))) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) x y) (@GRing.mul (RealDomain.ringType R) x z)) *) by rewrite oppr_max !mulrN !opprK. Qed. Lemma minr_pmull x y z : 0 <= x -> min y z * x = min (y * x) (z * x). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x), @eq (GRing.Ring.sort (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) y z) x) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) y x) (@GRing.mul (RealDomain.ringType R) z x)) *) by move=> *; rewrite mulrC minr_pmulr // ![_ * x]mulrC. Qed. Lemma minr_nmull x y z : x <= 0 -> min y z * x = max (y * x) (z * x). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))), @eq (GRing.Ring.sort (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) y z) x) (@maxr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) y x) (@GRing.mul (RealDomain.ringType R) z x)) *) by move=> *; rewrite mulrC minr_nmulr // ![_ * x]mulrC. Qed. Lemma maxr_pmull x y z : 0 <= x -> max y z * x = max (y * x) (z * x). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R))) x), @eq (GRing.Ring.sort (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) y z) x) (@maxr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) y x) (@GRing.mul (RealDomain.ringType R) z x)) *) by move=> *; rewrite mulrC maxr_pmulr // ![_ * x]mulrC. Qed. Lemma maxr_nmull x y z : x <= 0 -> max y z * x = min (y * x) (z * x). Proof. (* Goal: forall _ : is_true (@ler (RealDomain.numDomainType R) x (GRing.zero (NumDomain.zmodType (RealDomain.numDomainType R)))), @eq (GRing.Ring.sort (NumDomain.ringType (RealDomain.numDomainType R))) (@GRing.mul (NumDomain.ringType (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) y z) x) (@minr (RealDomain.numDomainType R) (@GRing.mul (RealDomain.ringType R) y x) (@GRing.mul (RealDomain.ringType R) z x)) *) by move=> *; rewrite mulrC maxr_nmulr // ![_ * x]mulrC. Qed. Lemma maxrN x : max x (- x) = `|x|. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x (@GRing.opp (RealDomain.zmodType R) x)) (@normr (RealDomain.numDomainType R) x) *) case: ger0P=> hx; first by rewrite maxr_l // ge0_cp //. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) x (@GRing.opp (RealDomain.zmodType R) x)) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) x) *) by rewrite maxr_r // le0_cp // ltrW. Qed. Lemma maxNr x : max (- x) x = `|x|. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@maxr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) x) (@normr (RealDomain.numDomainType R) x) *) by rewrite maxrC maxrN. Qed. Lemma minrN x : min x (- x) = - `|x|. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) x (@GRing.opp (RealDomain.zmodType R) x)) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@normr (RealDomain.numDomainType R) x)) *) by rewrite -[minr _ _]opprK oppr_min opprK maxNr. Qed. Lemma minNr x : min (- x) x = - `|x|. Proof. (* Goal: @eq (NumDomain.sort (RealDomain.numDomainType R)) (@minr (RealDomain.numDomainType R) (@GRing.opp (RealDomain.zmodType R) x) x) (@GRing.opp (NumDomain.zmodType (RealDomain.numDomainType R)) (@normr (RealDomain.numDomainType R) x)) *) by rewrite -[minr _ _]opprK oppr_min opprK maxrN. Qed. End MinMax. Section PolyBounds. Variable p : {poly R}. Lemma poly_itv_bound a b : {ub | forall x, a <= x <= b -> `|p.[x]| <= ub}. Proof. (* Goal: @sig (NumDomain.sort (RealDomain.numDomainType R)) (fun ub : NumDomain.sort (RealDomain.numDomainType R) => forall (x : RealDomain.sort R) (_ : is_true (andb (@ler (RealDomain.numDomainType R) a x) (@ler (RealDomain.numDomainType R) x b))), is_true (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) (@horner (RealDomain.ringType R) p x)) ub)) *) have [ub le_p_ub] := poly_disk_bound p (Num.max `|a| `|b|). (* Goal: @sig (NumDomain.sort (RealDomain.numDomainType R)) (fun ub : NumDomain.sort (RealDomain.numDomainType R) => forall (x : RealDomain.sort R) (_ : is_true (andb (@ler (RealDomain.numDomainType R) a x) (@ler (RealDomain.numDomainType R) x b))), is_true (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) (@horner (RealDomain.ringType R) p x)) ub)) *) exists ub => x /andP[le_a_x le_x_b]; rewrite le_p_ub // ler_maxr !ler_normr. (* Goal: is_true (orb (orb (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) a) (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) (@GRing.opp (RealDomain.zmodType R) a))) (orb (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) b) (@ler (RealDomain.numDomainType R) (@normr (RealDomain.numDomainType R) x) (@GRing.opp (RealDomain.zmodType R) b)))) *) by have [_|_] := ler0P x; rewrite ?ler_opp2 ?le_a_x ?le_x_b orbT. Qed. Lemma monic_Cauchy_bound : p \is monic -> {b | forall x, x >= b -> p.[x] > 0}. End PolyBounds. End RealDomainOperations. Section RealField. Variables (F : realFieldType) (x y : F). Lemma lerif_mean_square : x * y <= (x ^+ 2 + y ^+ 2) / 2%:R ?= iff (x == y). Proof. (* Goal: @lerif (RealField.numDomainType F) (@GRing.mul (RealField.ringType F) x y) (@GRing.mul (RealField.ringType F) (@GRing.add (GRing.Ring.zmodType (RealField.ringType F)) (@GRing.exp (RealField.ringType F) x (S (S O))) (@GRing.exp (RealField.ringType F) y (S (S O)))) (@GRing.inv (RealField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (RealField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (RealField.unitRingType F))) (S (S O))))) (@eq_op (RealField.eqType F) x y) *) by apply: real_lerif_mean_square; apply: num_real. Qed. Lemma lerif_AGM2 : x * y <= ((x + y) / 2%:R)^+ 2 ?= iff (x == y). Proof. (* Goal: @lerif (RealField.numDomainType F) (@GRing.mul (RealField.ringType F) x y) (@GRing.exp (RealField.ringType F) (@GRing.mul (RealField.ringType F) (@GRing.add (RealField.zmodType F) x y) (@GRing.inv (RealField.unitRingType F) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (RealField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (RealField.unitRingType F))) (S (S O))))) (S (S O))) (@eq_op (RealField.eqType F) x y) *) by apply: real_lerif_AGM2; apply: num_real. Qed. End RealField. Section ArchimedeanFieldTheory. Variables (F : archiFieldType) (x : F). Lemma archi_boundP : 0 <= x -> x < (bound x)%:R. Proof. (* Goal: forall _ : is_true (@ler (ArchimedeanField.numDomainType F) (GRing.zero (NumDomain.zmodType (ArchimedeanField.numDomainType F))) x), is_true (@ltr (ArchimedeanField.numDomainType F) x (@GRing.natmul (GRing.Ring.zmodType (NumDomain.ringType (ArchimedeanField.numDomainType F))) (GRing.one (NumDomain.ringType (ArchimedeanField.numDomainType F))) (@archi_bound F x))) *) by move/ger0_norm=> {1}<-; rewrite /bound; case: (sigW _). Qed. Lemma upper_nthrootP i : (bound x <= i)%N -> x < 2%:R ^+ i. Lemma sqrtr_ge0 a : 0 <= sqrt a. Proof. (* Goal: is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) (@sqrtr R a)) *) by rewrite /sqrt; case: (sig2W _). Qed. Hint Resolve sqrtr_ge0 : core. Lemma sqr_sqrtr a : 0 <= a -> sqrt a ^+ 2 = a. Proof. (* Goal: forall _ : is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) a), @eq (GRing.Ring.sort (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@sqrtr R a) (S (S O))) a *) by rewrite /sqrt => a_ge0; case: (sig2W _) => /= x _; rewrite a_ge0 => /eqP. Qed. Lemma ler0_sqrtr a : a <= 0 -> sqrt a = 0. Proof. (* Goal: forall _ : is_true (@ler (RealClosedField.numDomainType R) a (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))), @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R a) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) *) rewrite /sqrtr; case: (sig2W _) => x /= _. (* Goal: forall (_ : is_true (if @ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) a then @eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) x (S (S O))) a else @eq_op (NumDomain.eqType (RealClosedField.numDomainType R)) x (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))))) (_ : is_true (@ler (RealClosedField.numDomainType R) a (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))))), @eq (RealClosedField.sort R) x (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) *) by have [//|_ /eqP//|->] := ltrgt0P a; rewrite mulf_eq0 orbb => /eqP. Qed. Lemma ltr0_sqrtr a : a < 0 -> sqrt a = 0. Proof. (* Goal: forall _ : is_true (@ltr (RealClosedField.numDomainType R) a (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))), @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R a) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) *) by move=> /ltrW; apply: ler0_sqrtr. Qed. Variant sqrtr_spec a : R -> bool -> bool -> R -> Type := | IsNoSqrtr of a < 0 : sqrtr_spec a a false true 0 | IsSqrtr b of 0 <= b : sqrtr_spec a (b ^+ 2) true false b. Lemma sqrtrP a : sqrtr_spec a a (0 <= a) (a < 0) (sqrt a). Proof. (* Goal: sqrtr_spec a a (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) a) (@ltr (RealClosedField.numDomainType R) a (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) (@sqrtr R a) *) have [a_ge0|a_lt0] := ger0P a. (* Goal: sqrtr_spec a a false true (@sqrtr R a) *) (* Goal: sqrtr_spec a a true false (@sqrtr R a) *) by rewrite -{1 2}[a]sqr_sqrtr //; constructor. (* Goal: sqrtr_spec a a false true (@sqrtr R a) *) by rewrite ltr0_sqrtr //; constructor. Qed. Lemma sqrtr_sqr a : sqrt (a ^+ 2) = `|a|. Proof. (* Goal: @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.exp (RealClosedField.ringType R) a (S (S O)))) (@normr (RealClosedField.numDomainType R) a) *) have /eqP : sqrt (a ^+ 2) ^+ 2 = `|a| ^+ 2. (* Goal: forall _ : is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@sqrtr R (@GRing.exp (RealClosedField.ringType R) a (S (S O)))) (S (S O))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@normr (RealClosedField.numDomainType R) a) (S (S O)))), @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.exp (RealClosedField.ringType R) a (S (S O)))) (@normr (RealClosedField.numDomainType R) a) *) (* Goal: @eq (GRing.Ring.sort (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@sqrtr R (@GRing.exp (RealClosedField.ringType R) a (S (S O)))) (S (S O))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@normr (RealClosedField.numDomainType R) a) (S (S O))) *) by rewrite -normrX ger0_norm ?sqr_sqrtr ?sqr_ge0. (* Goal: forall _ : is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (RealClosedField.numDomainType R))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@sqrtr R (@GRing.exp (RealClosedField.ringType R) a (S (S O)))) (S (S O))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@normr (RealClosedField.numDomainType R) a) (S (S O)))), @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.exp (RealClosedField.ringType R) a (S (S O)))) (@normr (RealClosedField.numDomainType R) a) *) rewrite eqf_sqr => /predU1P[-> //|ha]. (* Goal: @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.exp (RealClosedField.ringType R) a (S (S O)))) (@normr (RealClosedField.numDomainType R) a) *) have := sqrtr_ge0 (a ^+ 2); rewrite (eqP ha) oppr_ge0 normr_le0 => /eqP ->. (* Goal: @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@GRing.opp (GRing.IntegralDomain.zmodType (NumDomain.idomainType (RealClosedField.numDomainType R))) (@normr (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))))) (@normr (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) *) by rewrite normr0 oppr0. Qed. Lemma sqrtrM a b : 0 <= a -> sqrt (a * b) = sqrt a * sqrt b. Proof. (* Goal: forall _ : is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) a), @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.mul (RealClosedField.ringType R) a b)) (@GRing.mul (NumDomain.ringType (RealClosedField.numDomainType R)) (@sqrtr R a) (@sqrtr R b)) *) case: (sqrtrP a) => // {a} a a_ge0 _; case: (sqrtrP b) => [b_lt0 | {b} b b_ge0]. (* Goal: @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.mul (RealClosedField.ringType R) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) a (S (S O))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) b (S (S O))))) (@GRing.mul (NumDomain.ringType (RealClosedField.numDomainType R)) a b) *) (* Goal: @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.mul (RealClosedField.ringType R) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) a (S (S O))) b)) (@GRing.mul (NumDomain.ringType (RealClosedField.numDomainType R)) a (GRing.zero (RealClosedField.zmodType R))) *) by rewrite mulr0 ler0_sqrtr // nmulr_lle0 ?mulr_ge0. (* Goal: @eq (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R (@GRing.mul (RealClosedField.ringType R) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) a (S (S O))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) b (S (S O))))) (@GRing.mul (NumDomain.ringType (RealClosedField.numDomainType R)) a b) *) by rewrite mulrACA sqrtr_sqr ger0_norm ?mulr_ge0. Qed. Lemma sqrtr0 : sqrt 0 = 0 :> R. Proof. (* Goal: @eq (RealClosedField.sort R) (@sqrtr R (GRing.zero (RealClosedField.zmodType R))) (GRing.zero (RealClosedField.zmodType R)) *) by move: (sqrtr_sqr 0); rewrite exprS mul0r => ->; rewrite normr0. Qed. Lemma sqrtr1 : sqrt 1 = 1 :> R. Proof. (* Goal: @eq (RealClosedField.sort R) (@sqrtr R (GRing.one (RealClosedField.ringType R))) (GRing.one (RealClosedField.ringType R)) *) by move: (sqrtr_sqr 1); rewrite expr1n => ->; rewrite normr1. Qed. Lemma sqrtr_eq0 a : (sqrt a == 0) = (a <= 0). Proof. (* Goal: @eq bool (@eq_op (Choice.eqType (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R a) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) (@ler (RealClosedField.numDomainType R) a (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) *) case: sqrtrP => [/ltrW ->|b]; first by rewrite eqxx. (* Goal: forall _ : is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) b), @eq bool (@eq_op (Choice.eqType (NumDomain.choiceType (RealClosedField.numDomainType R))) b (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) (@ler (RealClosedField.numDomainType R) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) b (S (S O))) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) *) case: ltrgt0P => [b_gt0|//|->]; last by rewrite exprS mul0r lerr. (* Goal: forall _ : is_true true, @eq bool false (@ler (RealClosedField.numDomainType R) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) b (S (S O))) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R)))) *) by rewrite ltr_geF ?pmulr_rgt0. Qed. Lemma sqrtr_gt0 a : (0 < sqrt a) = (0 < a). Proof. (* Goal: @eq bool (@ltr (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) (@sqrtr R a)) (@ltr (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) a) *) by rewrite lt0r sqrtr_ge0 sqrtr_eq0 -ltrNge andbT. Qed. Lemma eqr_sqrt a b : 0 <= a -> 0 <= b -> (sqrt a == sqrt b) = (a == b). Proof. (* Goal: forall (_ : is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) a)) (_ : is_true (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) b)), @eq bool (@eq_op (Choice.eqType (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R a) (@sqrtr R b)) (@eq_op (RealClosedField.eqType R) a b) *) move=> a_ge0 b_ge0; apply/eqP/eqP=> [HS|->] //. (* Goal: @eq (Equality.sort (RealClosedField.eqType R)) a b *) by move: (sqr_sqrtr a_ge0); rewrite HS (sqr_sqrtr b_ge0). Qed. Lemma ler_wsqrtr : {homo @sqrt R : a b / a <= b}. Proof. (* Goal: @homomorphism_2 (RealClosedField.sort R) (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) (@sqrtr R) (fun a b : RealClosedField.sort R => is_true (@ler (RealClosedField.numDomainType R) a b)) (fun a b : Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R)) => is_true (@ler (RealClosedField.numDomainType R) a b)) *) move=> a b /= le_ab; case: (boolP (0 <= a))=> [pa|]; last first. (* Goal: is_true (@ler (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) *) (* Goal: forall _ : is_true (negb (@ler (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) a)), is_true (@ler (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) *) by rewrite -ltrNge; move/ltrW; rewrite -sqrtr_eq0; move/eqP->. (* Goal: is_true (@ler (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) *) rewrite -(@ler_pexpn2r R 2) ?nnegrE ?sqrtr_ge0 //. (* Goal: is_true (@ler (RealClosedField.numDomainType R) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@sqrtr R a) (S (S O))) (@GRing.exp (NumDomain.ringType (RealClosedField.numDomainType R)) (@sqrtr R b) (S (S O)))) *) by rewrite !sqr_sqrtr // (ler_trans pa). Qed. Lemma ler_psqrt : {in @pos R &, {mono sqrt : a b / a <= b}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (RealClosedField.numDomainType R)) (@mem (NumDomain.sort (RealClosedField.numDomainType R)) (predPredType (NumDomain.sort (RealClosedField.numDomainType R))) (@has_quality O (NumDomain.sort (RealClosedField.numDomainType R)) (@Rpos (RealClosedField.numDomainType R)))) (fun x y : RealClosedField.sort R => @eq bool ((fun a b : Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R)) => @ler (RealClosedField.numDomainType R) a b) (@sqrtr R x) (@sqrtr R y)) ((fun a b : RealClosedField.sort R => @ler (RealClosedField.numDomainType R) a b) x y)) (inPhantom (@monomorphism_2 (RealClosedField.sort R) (Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R))) bool (@sqrtr R) (fun a b : RealClosedField.sort R => @ler (RealClosedField.numDomainType R) a b) (fun a b : Choice.sort (NumDomain.choiceType (RealClosedField.numDomainType R)) => @ler (RealClosedField.numDomainType R) a b))) *) apply: ler_mono_in => x y x_gt0 y_gt0. (* Goal: forall _ : is_true (@ltr (RealDomain.numDomainType (RealClosedField.realDomainType R)) x y), is_true (@ltr (RealClosedField.numDomainType R) (@sqrtr R x) (@sqrtr R y)) *) rewrite !ltr_neqAle => /andP[neq_xy le_xy]. (* Goal: is_true (andb (negb (@eq_op (NumDomain.eqType (RealClosedField.numDomainType R)) (@sqrtr R x) (@sqrtr R y))) (@ler (RealClosedField.numDomainType R) (@sqrtr R x) (@sqrtr R y))) *) by rewrite ler_wsqrtr // eqr_sqrt ?ltrW // neq_xy. Qed. Lemma ler_sqrt a b : 0 < b -> (sqrt a <= sqrt b) = (a <= b). Proof. (* Goal: forall _ : is_true (@ltr (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) b), @eq bool (@ler (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) (@ler (RealClosedField.numDomainType R) a b) *) move=> b_gt0; have [a_le0|a_gt0] := ler0P a; last by rewrite ler_psqrt. (* Goal: @eq bool (@ler (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) (@ler (RealClosedField.numDomainType R) a b) *) by rewrite ler0_sqrtr // sqrtr_ge0 (ler_trans a_le0) ?ltrW. Qed. Lemma ltr_sqrt a b : 0 < b -> (sqrt a < sqrt b) = (a < b). Proof. (* Goal: forall _ : is_true (@ltr (RealClosedField.numDomainType R) (GRing.zero (NumDomain.zmodType (RealClosedField.numDomainType R))) b), @eq bool (@ltr (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) (@ltr (RealClosedField.numDomainType R) a b) *) move=> b_gt0; have [a_le0|a_gt0] := ler0P a; last first. (* Goal: @eq bool (@ltr (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) (@ltr (RealClosedField.numDomainType R) a b) *) (* Goal: @eq bool (@ltr (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) (@ltr (RealClosedField.numDomainType R) a b) *) by rewrite (lerW_mono_in ler_psqrt). (* Goal: @eq bool (@ltr (RealClosedField.numDomainType R) (@sqrtr R a) (@sqrtr R b)) (@ltr (RealClosedField.numDomainType R) a b) *) by rewrite ler0_sqrtr // sqrtr_gt0 b_gt0 (ler_lt_trans a_le0). Qed. End RealClosedFieldTheory. Definition conjC {C : numClosedFieldType} : {rmorphism C -> C} := ClosedField.conj_op (ClosedField.conj_mixin (ClosedField.class C)). Notation "z ^*" := (@conjC _ z) (at level 2, format "z ^*") : ring_scope. Definition imaginaryC {C : numClosedFieldType} : C := ClosedField.imaginary (ClosedField.conj_mixin (ClosedField.class C)). Notation "'i" := (@imaginaryC _) (at level 0) : ring_scope. Section ClosedFieldTheory. Variable C : numClosedFieldType. Implicit Types a x y z : C. Definition normCK x : `|x| ^+ 2 = x * x^*. Proof. (* Goal: @eq (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O))) (@GRing.mul (ClosedField.ringType C) x (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) *) by case: C x => ? [? ? []]. Qed. Lemma sqrCi : 'i ^+ 2 = -1 :> C. Proof. (* Goal: @eq (ClosedField.sort C) (@GRing.exp (ClosedField.ringType C) (@imaginaryC C) (S (S O))) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C))) *) by case: C => ? [? ? []]. Qed. Lemma conjCK : involutive (@conjC C). Proof. (* Goal: @involutive (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C)) *) have JE x : x^* = `|x|^+2 / x. (* Goal: @involutive (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C)) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O))) (@GRing.inv (ClosedField.unitRingType C) x)) *) have [->|x_neq0] := eqVneq x 0; first by rewrite rmorph0 invr0 mulr0. (* Goal: @involutive (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C)) *) (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O))) (@GRing.inv (ClosedField.unitRingType C) x)) *) by apply: (canRL (mulfK _)) => //; rewrite mulrC -normCK. (* Goal: @involutive (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C)) *) move=> x; have [->|x_neq0] := eqVneq x 0; first by rewrite !rmorph0. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) x *) rewrite !JE normrM normfV exprMn normrX normr_id. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.mul (GRing.ComRing.ringType (NumDomain.comRingType (ClosedField.numDomainType C))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O))) (S (S O))) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType (ClosedField.numDomainType C))) (@GRing.inv (NumDomain.unitRingType (NumField.numDomainType (ClosedField.numFieldType C))) (@normr (NumField.numDomainType (ClosedField.numFieldType C)) x)) (S (S O)))) (@GRing.inv (ClosedField.unitRingType C) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O))) (@GRing.inv (ClosedField.unitRingType C) x)))) x *) rewrite invfM exprVn mulrA -[X in X * _]mulrA -invfM -exprMn. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.exp (GRing.ComRing.ringType (NumDomain.comRingType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O))) (S (S O))) (@GRing.inv (GRing.Field.unitRingType (ClosedField.fieldType C)) (@GRing.exp (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType (GRing.Field.comUnitRingType (ClosedField.fieldType C)))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType (GRing.Field.comUnitRingType (ClosedField.fieldType C)))) (@normr (NumField.numDomainType (ClosedField.numFieldType C)) x) (@normr (ClosedField.numDomainType C) x)) (S (S O))))) (@GRing.inv (GRing.Field.unitRingType (ClosedField.fieldType C)) (@GRing.inv (ClosedField.unitRingType C) x))) x *) by rewrite divff ?mul1r ?invrK // !expf_eq0 normr_eq0 //. Qed. Let Re2 z := z + z^*. Definition nnegIm z := (0 <= imaginaryC * (z^* - z)). Definition argCle y z := nnegIm z ==> nnegIm y && (Re2 z <= Re2 y). Variant rootC_spec n (x : C) : Type := RootCspec (y : C) of if (n > 0)%N then y ^+ n = x else y = 0 & forall z, (n > 0)%N -> z ^+ n = x -> argCle y z. Fact rootC_subproof n x : rootC_spec n x. Definition nthroot n x := let: RootCspec y _ _ := rootC_subproof n x in y. Notation "n .-root" := (nthroot n) (at level 2, format "n .-root") : ring_core_scope. Notation "n .-root" := (nthroot n) (only parsing) : ring_scope. Notation sqrtC := 2.-root. Definition Re x := (x + x^*) / 2%:R. Definition Im x := 'i * (x^* - x) / 2%:R. Notation "'Re z" := (Re z) (at level 10, z at level 8) : ring_scope. Notation "'Im z" := (Im z) (at level 10, z at level 8) : ring_scope. Let nz2 : 2%:R != 0 :> C. Proof. by rewrite pnatr_eq0. Qed. Proof. (* Goal: is_true (negb (@eq_op (ClosedField.eqType C) (@GRing.natmul (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C)) (S (S O)) : ClosedField.sort C) (GRing.zero (ClosedField.zmodType C) : ClosedField.sort C))) *) by rewrite pnatr_eq0. Qed. Lemma mul_conjC_ge0 x : 0 <= x * x^*. Proof. (* Goal: is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.mul (ClosedField.ringType C) x (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x))) *) by rewrite -normCK exprn_ge0 ?normr_ge0. Qed. Lemma mul_conjC_gt0 x : (0 < x * x^*) = (x != 0). Proof. (* Goal: @eq bool (@ltr (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.mul (ClosedField.ringType C) x (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x))) (negb (@eq_op (ClosedField.eqType C) x (GRing.zero (ClosedField.zmodType C)))) *) have [->|x_neq0] := altP eqP; first by rewrite rmorph0 mulr0. (* Goal: @eq bool (@ltr (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.mul (ClosedField.ringType C) x (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x))) (negb false) *) by rewrite -normCK exprn_gt0 ?normr_gt0. Qed. Lemma mul_conjC_eq0 x : (x * x^* == 0) = (x == 0). Proof. (* Goal: @eq bool (@eq_op (GRing.Ring.eqType (ClosedField.ringType C)) (@GRing.mul (ClosedField.ringType C) x (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) (GRing.zero (GRing.Ring.zmodType (ClosedField.ringType C)))) (@eq_op (ClosedField.eqType C) x (GRing.zero (ClosedField.zmodType C))) *) by rewrite -normCK expf_eq0 normr_eq0. Qed. Lemma conjC_ge0 x : (0 <= x^*) = (0 <= x). Proof. (* Goal: @eq bool (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x) *) wlog suffices: x / 0 <= x -> 0 <= x^*. (* Goal: forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x), is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) *) (* Goal: forall _ : forall (x : ClosedField.sort C) (_ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x)), is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)), @eq bool (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x) *) by move=> IH; apply/idP/idP=> /IH; rewrite ?conjCK. (* Goal: forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x), is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) *) rewrite le0r => /predU1P[-> | x_gt0]; first by rewrite rmorph0. (* Goal: is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) *) by rewrite -(pmulr_rge0 _ x_gt0) mul_conjC_ge0. Qed. Lemma conjC_nat n : (n%:R)^* = n%:R :> C. Proof. exact: rmorph_nat. Qed. Proof. (* Goal: @eq (ClosedField.sort C) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) (@GRing.natmul (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C)) n)) (@GRing.natmul (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C)) n) *) exact: rmorph_nat. Qed. Lemma conjC1 : 1^* = 1 :> C. Proof. exact: rmorph1. Qed. Proof. (* Goal: @eq (ClosedField.sort C) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) (GRing.one (ClosedField.ringType C))) (GRing.one (ClosedField.ringType C)) *) exact: rmorph1. Qed. Lemma invC_norm x : x^-1 = `|x| ^- 2 * x^*. Proof. (* Goal: @eq (GRing.UnitRing.sort (ClosedField.unitRingType C)) (@GRing.inv (ClosedField.unitRingType C) x) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O)))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) *) have [-> | nx_x] := eqVneq x 0; first by rewrite conjC0 mulr0 invr0. (* Goal: @eq (GRing.UnitRing.sort (ClosedField.unitRingType C)) (@GRing.inv (ClosedField.unitRingType C) x) (@GRing.mul (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (S (S O)))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) *) by rewrite normCK invfM divfK ?conjC_eq0. Qed. Lemma CrealE x : (x \is real) = (x^* == x). Proof. (* Goal: @eq bool (@in_mem (ClosedField.sort C) x (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x) x) *) rewrite realEsqr ger0_def normrX normCK. (* Goal: @eq bool (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@GRing.mul (ClosedField.ringType C) x (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) x (S (S O)))) (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x) x) *) by have [-> | /mulfI/inj_eq-> //] := eqVneq x 0; rewrite rmorph0 !eqxx. Qed. Lemma CrealP {x} : reflect (x^* = x) (x \is real). Proof. (* Goal: Bool.reflect (@eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x) x) (@in_mem (ClosedField.sort C) x (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) by rewrite CrealE; apply: eqP. Qed. Lemma conj_Creal x : x \is real -> x^* = x. Proof. (* Goal: forall _ : is_true (@in_mem (ClosedField.sort C) x (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x) x *) by move/CrealP. Qed. Lemma conj_normC z : `|z|^* = `|z|. Proof. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) (@normr (ClosedField.numDomainType C) z)) (@normr (ClosedField.numDomainType C) z) *) by rewrite conj_Creal ?normr_real. Qed. Lemma geC0_conj x : 0 <= x -> x^* = x. Proof. (* Goal: forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x) x *) by move=> /ger0_real/CrealP. Qed. Lemma geC0_unit_exp x n : 0 <= x -> (x ^+ n.+1 == 1) = (x == 1). Proof. (* Goal: forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x), @eq bool (@eq_op (GRing.Ring.eqType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S n)) (GRing.one (ClosedField.ringType C))) (@eq_op (ClosedField.eqType C) x (GRing.one (ClosedField.ringType C))) *) by move=> x_ge0; rewrite pexpr_eq1. Qed. Lemma rootCK n : (n > 0)%N -> cancel n.-root (fun x => x ^+ n). Proof. (* Goal: forall _ : is_true (leq (S O) n), @cancel (ClosedField.sort C) (ClosedField.sort C) (nthroot n) (fun x : ClosedField.sort C => @GRing.exp (ClosedField.ringType C) x n) *) by case: n => //= n _ x; case_rootC. Qed. Lemma rootC0 n : n.-root 0 = 0. Proof. (* Goal: @eq (ClosedField.sort C) (nthroot n (GRing.zero (ClosedField.zmodType C))) (GRing.zero (ClosedField.zmodType C)) *) have [-> | n_gt0] := posnP n; first by rewrite root0C. (* Goal: @eq (ClosedField.sort C) (nthroot n (GRing.zero (ClosedField.zmodType C))) (GRing.zero (ClosedField.zmodType C)) *) by have /eqP := rootCK n_gt0 0; rewrite expf_eq0 n_gt0 /= => /eqP. Qed. Lemma rootC_inj n : (n > 0)%N -> injective n.-root. Proof. (* Goal: forall _ : is_true (leq (S O) n), @injective (ClosedField.sort C) (ClosedField.sort C) (nthroot n) *) by move/rootCK/can_inj. Qed. Lemma eqr_rootC n : (n > 0)%N -> {mono n.-root : x y / x == y}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot n) (fun x y : ClosedField.sort C => @eq_op (ClosedField.eqType C) x y) (fun x y : ClosedField.sort C => @eq_op (ClosedField.eqType C) x y) *) by move/rootC_inj/inj_eq. Qed. Lemma rootC_eq0 n x : (n > 0)%N -> (n.-root x == 0) = (x == 0). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@eq_op (ClosedField.eqType C) (nthroot n x) (GRing.zero (ClosedField.zmodType C))) (@eq_op (ClosedField.eqType C) x (GRing.zero (ClosedField.zmodType C))) *) by move=> n_gt0; rewrite -{1}(rootC0 n) eqr_rootC. Qed. Lemma nonRealCi : ('i : C) \isn't real. Proof. (* Goal: is_true (negb (@in_mem (ClosedField.sort C) (@imaginaryC C : ClosedField.sort C) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))))) *) by rewrite realEsqr sqrCi oppr_ge0 ltr_geF ?ltr01. Qed. Lemma neq0Ci : 'i != 0 :> C. Proof. (* Goal: is_true (negb (@eq_op (ClosedField.eqType C) (@imaginaryC C : ClosedField.sort C) (GRing.zero (ClosedField.zmodType C) : ClosedField.sort C))) *) by apply: contraNneq nonRealCi => ->; apply: real0. Qed. Lemma normCi : `|'i| = 1 :> C. Proof. (* Goal: @eq (ClosedField.sort C) (@normr (ClosedField.numDomainType C) (@imaginaryC C)) (GRing.one (ClosedField.ringType C)) *) apply/eqP; rewrite -(@pexpr_eq1 _ _ 2) ?normr_ge0 //. (* Goal: is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@imaginaryC C)) (S (S O))) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C)))) *) by rewrite -normrX sqrCi normrN1. Qed. Lemma invCi : 'i^-1 = - 'i :> C. Proof. (* Goal: @eq (ClosedField.sort C) (@GRing.inv (ClosedField.unitRingType C) (@imaginaryC C)) (@GRing.opp (ClosedField.zmodType C) (@imaginaryC C)) *) by rewrite -div1r -[1]opprK -sqrCi mulNr mulfK ?neq0Ci. Qed. Lemma conjCi : 'i^* = - 'i :> C. Proof. (* Goal: @eq (ClosedField.sort C) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) (@imaginaryC C)) (@GRing.opp (ClosedField.zmodType C) (@imaginaryC C)) *) by rewrite -invCi invC_norm normCi expr1n invr1 mul1r. Qed. Lemma Crect x : x = 'Re x + 'i * 'Im x. Proof. (* Goal: @eq (ClosedField.sort C) x (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (Re x) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) (Im x))) *) rewrite 2!mulrA -expr2 sqrCi mulN1r opprB -mulrDl addrACA subrr addr0. (* Goal: @eq (ClosedField.sort C) x (@GRing.mul (ClosedField.ringType C) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) x x) (@GRing.inv (ClosedField.unitRingType C) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (ClosedField.unitRingType C))) (GRing.one (GRing.UnitRing.ringType (ClosedField.unitRingType C))) (S (S O))))) *) by rewrite -mulr2n -mulr_natr mulfK. Qed. Lemma Creal_Re x : 'Re x \is real. Proof. (* Goal: is_true (@in_mem (GRing.Ring.sort (ClosedField.ringType C)) (Re x) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) by rewrite CrealE fmorph_div rmorph_nat rmorphD conjCK addrC. Qed. Lemma Creal_Im x : 'Im x \is real. Proof. (* Goal: is_true (@in_mem (GRing.Ring.sort (ClosedField.ringType C)) (Im x) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) rewrite CrealE fmorph_div rmorph_nat rmorphM rmorphB conjCK. (* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.mul (GRing.UnitRing.ringType (ClosedField.unitRingType C)) (@GRing.mul (GRing.UnitRing.ringType (ClosedField.unitRingType C)) (@GRing.RMorphism.apply (GRing.Field.ringType (ClosedField.fieldType C)) (GRing.UnitRing.ringType (ClosedField.unitRingType C)) (Phant (forall _ : GRing.Ring.sort (GRing.Field.ringType (ClosedField.fieldType C)), GRing.Ring.sort (GRing.UnitRing.ringType (ClosedField.unitRingType C)))) (@conjC C) (@imaginaryC C)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (ClosedField.unitRingType C))) x (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType (ClosedField.unitRingType C))) (@GRing.RMorphism.apply (GRing.Field.ringType (ClosedField.fieldType C)) (GRing.UnitRing.ringType (ClosedField.unitRingType C)) (Phant (forall _ : GRing.Ring.sort (GRing.Field.ringType (ClosedField.fieldType C)), GRing.Ring.sort (GRing.UnitRing.ringType (ClosedField.unitRingType C)))) (@conjC C) x)))) (@GRing.inv (ClosedField.unitRingType C) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (ClosedField.unitRingType C))) (GRing.one (GRing.UnitRing.ringType (ClosedField.unitRingType C))) (S (S O))))) (Im x)) *) by rewrite conjCi -opprB mulrNN. Qed. Hint Resolve Creal_Re Creal_Im : core. Fact Re_is_additive : additive Re. Proof. (* Goal: @GRing.Additive.axiom (ClosedField.zmodType C) (GRing.Ring.zmodType (ClosedField.ringType C)) Re *) by move=> x y; rewrite /Re rmorphB addrACA -opprD mulrBl. Qed. Canonical Re_additive := Additive Re_is_additive. Fact Im_is_additive : additive Im. Proof. (* Goal: @GRing.Additive.axiom (ClosedField.zmodType C) (GRing.Ring.zmodType (ClosedField.ringType C)) Im *) by move=> x y; rewrite /Im rmorphB opprD addrACA -opprD mulrBr mulrBl. Qed. Canonical Im_additive := Additive Im_is_additive. Lemma Creal_ImP z : reflect ('Im z = 0) (z \is real). Proof. (* Goal: Bool.reflect (@eq (GRing.Ring.sort (ClosedField.ringType C)) (Im z) (GRing.zero (GRing.Ring.zmodType (ClosedField.ringType C)))) (@in_mem (ClosedField.sort C) z (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) rewrite CrealE -subr_eq0 -(can_eq (mulKf neq0Ci)) mulr0. (* Goal: Bool.reflect (@eq (GRing.Ring.sort (ClosedField.ringType C)) (Im z) (GRing.zero (GRing.Ring.zmodType (ClosedField.ringType C)))) (@eq_op (GRing.Ring.eqType (GRing.Field.ringType (ClosedField.fieldType C))) (@GRing.mul (GRing.Field.ringType (ClosedField.fieldType C)) (@imaginaryC C) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) z) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) z))) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType (ClosedField.fieldType C))))) *) by rewrite -(can_eq (divfK nz2)) mul0r; apply: eqP. Qed. Lemma Creal_ReP z : reflect ('Re z = z) (z \in real). Proof. (* Goal: Bool.reflect (@eq (GRing.Ring.sort (ClosedField.ringType C)) (Re z) z) (@in_mem (ClosedField.sort C) z (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) rewrite (sameP (Creal_ImP z) eqP) -(can_eq (mulKf neq0Ci)) mulr0. (* Goal: Bool.reflect (@eq (GRing.Ring.sort (ClosedField.ringType C)) (Re z) z) (@eq_op (GRing.Ring.eqType (GRing.Field.ringType (ClosedField.fieldType C))) (@GRing.mul (GRing.Field.ringType (ClosedField.fieldType C)) (@imaginaryC C) (Im z)) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType (ClosedField.fieldType C))))) *) by rewrite -(inj_eq (addrI ('Re z))) addr0 -Crect eq_sym; apply: eqP. Qed. Lemma ReMl : {in real, forall x, {morph Re : z / x * z}}. Proof. (* Goal: @prop_in1 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x : ClosedField.sort C => @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Re (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x z) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) x z)) (inPhantom (forall x : ClosedField.sort C, @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Re (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x z) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) x z))) *) by move=> x Rx z /=; rewrite /Re rmorphM (conj_Creal Rx) -mulrDr -mulrA. Qed. Lemma ReMr : {in real, forall x, {morph Re : z / z * x}}. Proof. (* Goal: @prop_in1 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x : ClosedField.sort C => @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Re (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) z x) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) z x)) (inPhantom (forall x : ClosedField.sort C, @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Re (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) z x) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) z x))) *) by move=> x Rx z /=; rewrite mulrC ReMl // mulrC. Qed. Lemma ImMl : {in real, forall x, {morph Im : z / x * z}}. Proof. (* Goal: @prop_in1 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x : ClosedField.sort C => @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Im (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x z) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) x z)) (inPhantom (forall x : ClosedField.sort C, @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Im (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x z) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) x z))) *) by move=> x Rx z; rewrite /Im rmorphM (conj_Creal Rx) -mulrBr mulrCA !mulrA. Qed. Lemma ImMr : {in real, forall x, {morph Im : z / z * x}}. Proof. (* Goal: @prop_in1 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x : ClosedField.sort C => @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Im (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) z x) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) z x)) (inPhantom (forall x : ClosedField.sort C, @morphism_1 (ClosedField.sort C) (GRing.Ring.sort (ClosedField.ringType C)) Im (fun z : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) z x) (fun z : GRing.Ring.sort (ClosedField.ringType C) => @GRing.mul (ClosedField.ringType C) z x))) *) by move=> x Rx z /=; rewrite mulrC ImMl // mulrC. Qed. Lemma Im_i : 'Im 'i = 1. Proof. (* Goal: @eq (GRing.Ring.sort (ClosedField.ringType C)) (Im (@imaginaryC C)) (GRing.one (ClosedField.ringType C)) *) rewrite /Im conjCi -opprD mulrN -mulr2n mulrnAr ['i * _]sqrCi. (* Goal: @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.mul (ClosedField.ringType C) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.natmul (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C))) (S (S O)))) (@GRing.inv (ClosedField.unitRingType C) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (ClosedField.unitRingType C))) (GRing.one (GRing.UnitRing.ringType (ClosedField.unitRingType C))) (S (S O))))) (GRing.one (ClosedField.ringType C)) *) by rewrite mulNrn opprK divff. Qed. Lemma Re_conj z : 'Re z^* = 'Re z. Proof. (* Goal: @eq (GRing.Ring.sort (ClosedField.ringType C)) (Re (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) z)) (Re z) *) by rewrite /Re addrC conjCK. Qed. Lemma Im_conj z : 'Im z^* = - 'Im z. Proof. (* Goal: @eq (GRing.Ring.sort (ClosedField.ringType C)) (Im (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) z)) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (Im z)) *) by rewrite /Im -mulNr -mulrN opprB conjCK. Qed. Lemma Re_rect : {in real &, forall x y, 'Re (x + 'i * y) = x}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (Re (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) x) (inPhantom (forall x y : ClosedField.sort C, @eq (GRing.Ring.sort (ClosedField.ringType C)) (Re (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) x)) *) move=> x y Rx Ry; rewrite /= raddfD /= (Creal_ReP x Rx). (* Goal: @eq (ClosedField.sort C) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) x (Re (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) x *) by rewrite ReMr // Re_i mul0r addr0. Qed. Lemma Im_rect : {in real &, forall x y, 'Im (x + 'i * y) = y}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (Im (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) y) (inPhantom (forall x y : ClosedField.sort C, @eq (GRing.Ring.sort (ClosedField.ringType C)) (Im (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) y)) *) move=> x y Rx Ry; rewrite /= raddfD /= (Creal_ImP x Rx) add0r. (* Goal: @eq (ClosedField.sort C) (Im (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y)) y *) by rewrite ImMr // Im_i mul1r. Qed. Lemma conjC_rect : {in real &, forall x y, (x + 'i * y)^* = x - 'i * y}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (@GRing.add (ClosedField.zmodType C) x (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y)))) (inPhantom (forall x y : ClosedField.sort C, @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (@GRing.add (ClosedField.zmodType C) x (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))))) *) by move=> x y Rx Ry; rewrite /= rmorphD rmorphM conjCi mulNr !conj_Creal. Qed. Lemma addC_rect x1 y1 x2 y2 : (x1 + 'i * y1) + (x2 + 'i * y2) = x1 + x2 + 'i * (y1 + y2). Proof. (* Goal: @eq (GRing.Zmodule.sort (ClosedField.zmodType C)) (@GRing.add (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) x1 (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y1)) (@GRing.add (ClosedField.zmodType C) x2 (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y2))) (@GRing.add (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) x1 x2) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) (@GRing.add (ClosedField.zmodType C) y1 y2))) *) by rewrite addrACA -mulrDr. Qed. Lemma oppC_rect x y : - (x + 'i * y) = - x + 'i * (- y). Proof. (* Goal: @eq (GRing.Zmodule.sort (ClosedField.zmodType C)) (@GRing.opp (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (@GRing.add (ClosedField.zmodType C) (@GRing.opp (ClosedField.zmodType C) x) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) (@GRing.opp (ClosedField.zmodType C) y))) *) by rewrite mulrN -opprD. Qed. Lemma subC_rect x1 y1 x2 y2 : (x1 + 'i * y1) - (x2 + 'i * y2) = x1 - x2 + 'i * (y1 - y2). Proof. (* Goal: @eq (GRing.Zmodule.sort (ClosedField.zmodType C)) (@GRing.add (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) x1 (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y1)) (@GRing.opp (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) x2 (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y2)))) (@GRing.add (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) x1 (@GRing.opp (ClosedField.zmodType C) x2)) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) (@GRing.add (ClosedField.zmodType C) y1 (@GRing.opp (ClosedField.zmodType C) y2)))) *) by rewrite oppC_rect addC_rect. Qed. Lemma mulC_rect x1 y1 x2 y2 : (x1 + 'i * y1) * (x2 + 'i * y2) = x1 * x2 - y1 * y2 + 'i * (x1 * y2 + x2 * y1). Lemma normC2_rect : {in real &, forall x y, `|x + 'i * y| ^+ 2 = x ^+ 2 + y ^+ 2}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (S (S O))) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S (S O))) (@GRing.exp (ClosedField.ringType C) y (S (S O))))) (inPhantom (forall x y : ClosedField.sort C, @eq (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (S (S O))) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S (S O))) (@GRing.exp (ClosedField.ringType C) y (S (S O)))))) *) move=> x y Rx Ry; rewrite /= normCK rmorphD rmorphM conjCi !conj_Creal //. (* Goal: @eq (ClosedField.sort C) (@GRing.mul (ClosedField.ringType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y)) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) x (@GRing.mul (ClosedField.ringType C) (@GRing.opp (ClosedField.zmodType C) (@imaginaryC C)) y))) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S (S O))) (@GRing.exp (ClosedField.ringType C) y (S (S O)))) *) by rewrite mulrC mulNr -subr_sqr exprMn sqrCi mulN1r opprK. Qed. Lemma normC2_Re_Im z : `|z| ^+ 2 = 'Re z ^+ 2 + 'Im z ^+ 2. Proof. (* Goal: @eq (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) z) (S (S O))) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) (Re z) (S (S O))) (@GRing.exp (ClosedField.ringType C) (Im z) (S (S O)))) *) by rewrite -normC2_rect -?Crect. Qed. Lemma invC_rect : {in real &, forall x y, (x + 'i * y)^-1 = (x - 'i * y) / (x ^+ 2 + y ^+ 2)}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq (GRing.UnitRing.sort (ClosedField.unitRingType C)) (@GRing.inv (ClosedField.unitRingType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (@GRing.mul (ClosedField.ringType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (@GRing.inv (ClosedField.unitRingType C) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S (S O))) (@GRing.exp (ClosedField.ringType C) y (S (S O))))))) (inPhantom (forall x y : ClosedField.sort C, @eq (GRing.UnitRing.sort (ClosedField.unitRingType C)) (@GRing.inv (ClosedField.unitRingType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (@GRing.mul (ClosedField.ringType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (@GRing.inv (ClosedField.unitRingType C) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S (S O))) (@GRing.exp (ClosedField.ringType C) y (S (S O)))))))) *) by move=> x y Rx Ry; rewrite /= invC_norm conjC_rect // mulrC normC2_rect. Qed. Lemma lerif_normC_Re_Creal z : `|'Re z| <= `|z| ?= iff (z \is real). Proof. (* Goal: @lerif (ClosedField.numDomainType C) (@normr (ClosedField.numDomainType C) (Re z)) (@normr (ClosedField.numDomainType C) z) (@in_mem (ClosedField.sort C) z (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) rewrite -(mono_in_lerif ler_sqr); try by rewrite qualifE normr_ge0. (* Goal: @lerif (ClosedField.numDomainType C) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (Re z)) (S (S O))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) z) (S (S O))) (@in_mem (ClosedField.sort C) z (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) rewrite normCK conj_Creal // normC2_Re_Im -expr2. (* Goal: @lerif (ClosedField.numDomainType C) (@GRing.exp (ClosedField.ringType C) (Re z) (S (S O))) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) (Re z) (S (S O))) (@GRing.exp (ClosedField.ringType C) (Im z) (S (S O)))) (@in_mem (ClosedField.sort C) z (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C))))) *) rewrite addrC -lerif_subLR subrr (sameP (Creal_ImP _) eqP) -sqrf_eq0 eq_sym. (* Goal: @lerif (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.exp (ClosedField.ringType C) (Im z) (S (S O))) (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType (ClosedField.idomainType C))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType (ClosedField.idomainType C)))) (@GRing.exp (GRing.IntegralDomain.ringType (ClosedField.idomainType C)) (Im z) (S (S O)))) *) by apply: lerif_eq; rewrite -realEsqr. Qed. Lemma lerif_Re_Creal z : 'Re z <= `|z| ?= iff (0 <= z). Lemma eqC_semipolar x y : `|x| = `|y| -> 'Re x = 'Re y -> 0 <= 'Im x * 'Im y -> x = y. Let argCleP y z : reflect (0 <= 'Im z -> 0 <= 'Im y /\ 'Re z <= 'Re y) (argCle y z). Proof. (* Goal: Bool.reflect (forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im z)), and (is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im y))) (is_true (@ler (ClosedField.numDomainType C) (Re z) (Re y)))) (argCle y z) *) suffices dIm x: nnegIm x = (0 <= 'Im x). (* Goal: @eq bool (nnegIm x) (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im x)) *) (* Goal: Bool.reflect (forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im z)), and (is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im y))) (is_true (@ler (ClosedField.numDomainType C) (Re z) (Re y)))) (argCle y z) *) rewrite /argCle !dIm ler_pmul2r ?invr_gt0 ?ltr0n //. (* Goal: @eq bool (nnegIm x) (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im x)) *) (* Goal: Bool.reflect (forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im z)), and (is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im y))) (is_true (@ler (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) z (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) z)) (@GRing.add (ClosedField.zmodType C) y (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) y))))) (implb (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im z)) (andb (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im y)) (@ler (ClosedField.numDomainType C) (Re2 z) (Re2 y)))) *) by apply: (iffP implyP) => geZyz /geZyz/andP. (* Goal: @eq bool (nnegIm x) (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im x)) *) by rewrite /('Im x) pmulr_lge0 ?invr_gt0 ?ltr0n //; congr (0 <= _ * _). Qed. Lemma rootC_Re_max n x y : (n > 0)%N -> y ^+ n = x -> 0 <= 'Im y -> 'Re y <= 'Re (n.-root x). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) y n) x) (_ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im y))), is_true (@ler (ClosedField.numDomainType C) (Re y) (Re (nthroot n x))) *) by move=> n_gt0 yn_x leI0y; case_rootC=> z /= _ /(_ y n_gt0 yn_x)/argCleP[]. Qed. Let neg_unity_root n : (n > 1)%N -> exists2 w : C, w ^+ n = 1 & 'Re w < 0. Proof. (* Goal: forall _ : is_true (leq (S (S O)) n), @ex2 (ClosedField.sort C) (fun w : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) w n) (GRing.one (ClosedField.ringType C))) (fun w : ClosedField.sort C => is_true (@ltr (ClosedField.numDomainType C) (Re w) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) *) move=> n_gt1; have [|w /eqP pw_0] := closed_rootP (\poly_(i < n) (1 : C)) _. (* Goal: @ex2 (ClosedField.sort C) (fun w : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) w n) (GRing.one (ClosedField.ringType C))) (fun w : ClosedField.sort C => is_true (@ltr (ClosedField.numDomainType C) (Re w) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) *) (* Goal: is_true (negb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.ClosedField.ringType (ClosedField.closedFieldType C))) (@polyseq (GRing.ClosedField.ringType (ClosedField.closedFieldType C)) (@poly (ClosedField.ringType C) n (fun _ : nat => GRing.one (ClosedField.ringType C))))) (S O))) *) by rewrite size_poly_eq ?oner_eq0 // -(subnKC n_gt1). (* Goal: @ex2 (ClosedField.sort C) (fun w : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) w n) (GRing.one (ClosedField.ringType C))) (fun w : ClosedField.sort C => is_true (@ltr (ClosedField.numDomainType C) (Re w) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) *) rewrite horner_poly (eq_bigr _ (fun _ _ => mul1r _)) in pw_0. (* Goal: @ex2 (ClosedField.sort C) (fun w : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) w n) (GRing.one (ClosedField.ringType C))) (fun w : ClosedField.sort C => is_true (@ltr (ClosedField.numDomainType C) (Re w) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) *) have wn1: w ^+ n = 1 by apply/eqP; rewrite -subr_eq0 subrX1 pw_0 mulr0. (* Goal: @ex2 (ClosedField.sort C) (fun w : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) w n) (GRing.one (ClosedField.ringType C))) (fun w : ClosedField.sort C => is_true (@ltr (ClosedField.numDomainType C) (Re w) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) *) suffices /existsP[i ltRwi0]: [exists i : 'I_n, 'Re (w ^+ i) < 0]. (* Goal: is_true (negb (@FiniteQuant.quant0b (ordinal_finType n) (fun i : ordinal n => @FiniteQuant.ex (ordinal_finType n) (FiniteQuant.Quantified (@ltr (ClosedField.numDomainType C) (Re (@GRing.exp (GRing.ClosedField.ringType (ClosedField.closedFieldType C)) w (@nat_of_ord n i))) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) i))) *) (* Goal: @ex2 (ClosedField.sort C) (fun w : ClosedField.sort C => @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) w n) (GRing.one (ClosedField.ringType C))) (fun w : ClosedField.sort C => is_true (@ltr (ClosedField.numDomainType C) (Re w) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) *) by exists (w ^+ i) => //; rewrite exprAC wn1 expr1n. (* Goal: is_true (negb (@FiniteQuant.quant0b (ordinal_finType n) (fun i : ordinal n => @FiniteQuant.ex (ordinal_finType n) (FiniteQuant.Quantified (@ltr (ClosedField.numDomainType C) (Re (@GRing.exp (GRing.ClosedField.ringType (ClosedField.closedFieldType C)) w (@nat_of_ord n i))) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))))) i))) *) apply: contra_eqT (congr1 Re pw_0); rewrite negb_exists => /forallP geRw0. (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (ClosedField.ringType C)) (Re (@BigOp.bigop (GRing.Ring.sort (GRing.ClosedField.ringType (ClosedField.closedFieldType C))) (Finite.sort (ordinal_finType n)) (GRing.zero (GRing.Ring.zmodType (GRing.ClosedField.ringType (ClosedField.closedFieldType C)))) (index_enum (ordinal_finType n)) (fun i : Finite.sort (ordinal_finType n) => @BigBody (GRing.Ring.sort (GRing.ClosedField.ringType (ClosedField.closedFieldType C))) (Finite.sort (ordinal_finType n)) i (@GRing.add (GRing.Ring.zmodType (GRing.ClosedField.ringType (ClosedField.closedFieldType C)))) true (@GRing.exp (GRing.ClosedField.ringType (ClosedField.closedFieldType C)) w (@nat_of_ord n i))))) (Re (GRing.zero (GRing.Ring.zmodType (GRing.ClosedField.ringType (ClosedField.closedFieldType C))))))) *) rewrite raddf_sum raddf0 /= (bigD1 (Ordinal (ltnW n_gt1))) //=. (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType (ClosedField.ringType C)) (@GRing.add (ClosedField.zmodType C) (Re (@GRing.exp (GRing.ClosedField.ringType (ClosedField.closedFieldType C)) w O)) (@BigOp.bigop (ClosedField.sort C) (ordinal n) (GRing.zero (GRing.Ring.zmodType (ClosedField.ringType C))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (ClosedField.sort C) (ordinal n) i (@GRing.add (ClosedField.zmodType C)) (negb (@eq_op (Finite.eqType (ordinal_finType n)) i (@Ordinal n O (@ltnW (S O) n n_gt1)))) (Re (@GRing.exp (GRing.ClosedField.ringType (ClosedField.closedFieldType C)) w (@nat_of_ord n i)))))) (GRing.zero (GRing.Ring.zmodType (ClosedField.ringType C))))) *) rewrite (Creal_ReP _ _) ?rpred1 // gtr_eqF ?ltr_paddr ?ltr01 //=. (* Goal: is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@BigOp.bigop (ClosedField.sort C) (ordinal n) (GRing.zero (GRing.Ring.zmodType (ClosedField.ringType C))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (ClosedField.sort C) (ordinal n) i (@GRing.add (ClosedField.zmodType C)) (negb (@eq_op (Finite.eqType (ordinal_finType n)) i (@Ordinal n O (@ltnW (S O) n n_gt1)))) (Re (@GRing.exp (GRing.ClosedField.ringType (ClosedField.closedFieldType C)) w (@nat_of_ord n i)))))) *) by apply: sumr_ge0 => i _; rewrite real_lerNgt ?rpred0. Qed. Lemma Im_rootC_ge0 n x : (n > 1)%N -> 0 <= 'Im (n.-root x). Lemma rootC_lt0 n x : (1 < n)%N -> (n.-root x < 0) = false. Lemma rootC_ge0 n x : (n > 0)%N -> (0 <= n.-root x) = (0 <= x). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (nthroot n x)) (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x) *) set y := n.-root x => n_gt0. (* Goal: @eq bool (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) y) (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x) *) apply/idP/idP=> [/(exprn_ge0 n) | x_ge0]; first by rewrite rootCK. (* Goal: is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) y) *) rewrite -(ger_lerif (lerif_Re_Creal y)). (* Goal: is_true (@ler (ClosedField.numDomainType C) (@normr (ClosedField.numDomainType C) y) (Re y)) *) have Ray: `|y| \is real by apply: normr_real. (* Goal: is_true (@ler (ClosedField.numDomainType C) (@normr (ClosedField.numDomainType C) y) (Re y)) *) rewrite -(Creal_ReP _ Ray) rootC_Re_max ?(Creal_ImP _ Ray) //. (* Goal: @eq (GRing.Ring.sort (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) (@normr (ClosedField.numDomainType C) y) n) x *) by rewrite -normrX rootCK // ger0_norm. Qed. Lemma rootC_gt0 n x : (n > 0)%N -> (n.-root x > 0) = (x > 0). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ltr (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (nthroot n x)) (@ltr (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x) *) by move=> n_gt0; rewrite !lt0r rootC_ge0 ?rootC_eq0. Qed. Lemma rootC_le0 n x : (1 < n)%N -> (n.-root x <= 0) = (x == 0). Proof. (* Goal: forall _ : is_true (leq (S (S O)) n), @eq bool (@ler (ClosedField.numDomainType C) (nthroot n x) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C)))) (@eq_op (ClosedField.eqType C) x (GRing.zero (ClosedField.zmodType C))) *) by move=> n_gt1; rewrite ler_eqVlt rootC_lt0 // orbF rootC_eq0 1?ltnW. Qed. Lemma ler_rootCl n : (n > 0)%N -> {in Num.nneg, {mono n.-root : x y / x <= y}}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in1 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rnneg (ClosedField.numDomainType C)))) (fun x : ClosedField.sort C => forall y : ClosedField.sort C, @eq bool ((fun x0 y0 : ClosedField.sort C => @ler (ClosedField.numDomainType C) x0 y0) (nthroot n x) (nthroot n y)) ((fun x0 y0 : ClosedField.sort C => @ler (ClosedField.numDomainType C) x0 y0) x y)) (inPhantom (@monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot n) (fun x y : ClosedField.sort C => @ler (ClosedField.numDomainType C) x y) (fun x y : ClosedField.sort C => @ler (ClosedField.numDomainType C) x y))) *) move=> n_gt0 x x_ge0 y; have [y_ge0 | not_y_ge0] := boolP (0 <= y). (* Goal: @eq bool (@ler (ClosedField.numDomainType C) (nthroot n x) (nthroot n y)) (@ler (ClosedField.numDomainType C) x y) *) (* Goal: @eq bool (@ler (ClosedField.numDomainType C) (nthroot n x) (nthroot n y)) (@ler (ClosedField.numDomainType C) x y) *) by rewrite -(ler_pexpn2r n_gt0) ?qualifE ?rootC_ge0 ?rootCK. (* Goal: @eq bool (@ler (ClosedField.numDomainType C) (nthroot n x) (nthroot n y)) (@ler (ClosedField.numDomainType C) x y) *) rewrite (contraNF (@ler_trans _ _ 0 _ _)) ?rootC_ge0 //. (* Goal: @eq bool false (@ler (ClosedField.numDomainType C) x y) *) by rewrite (contraNF (ler_trans x_ge0)). Qed. Lemma ler_rootC n : (n > 0)%N -> {in Num.nneg &, {mono n.-root : x y / x <= y}}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rnneg (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq bool ((fun x0 y0 : ClosedField.sort C => @ler (ClosedField.numDomainType C) x0 y0) (nthroot n x) (nthroot n y)) ((fun x0 y0 : ClosedField.sort C => @ler (ClosedField.numDomainType C) x0 y0) x y)) (inPhantom (@monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot n) (fun x y : ClosedField.sort C => @ler (ClosedField.numDomainType C) x y) (fun x y : ClosedField.sort C => @ler (ClosedField.numDomainType C) x y))) *) by move=> n_gt0 x y x_ge0 _; apply: ler_rootCl. Qed. Lemma ltr_rootCl n : (n > 0)%N -> {in Num.nneg, {mono n.-root : x y / x < y}}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in1 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rnneg (ClosedField.numDomainType C)))) (fun x : ClosedField.sort C => forall y : ClosedField.sort C, @eq bool ((fun x0 y0 : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x0 y0) (nthroot n x) (nthroot n y)) ((fun x0 y0 : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x0 y0) x y)) (inPhantom (@monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot n) (fun x y : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x y) (fun x y : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x y))) *) by move=> n_gt0 x x_ge0 y; rewrite !ltr_def ler_rootCl ?eqr_rootC. Qed. Lemma ltr_rootC n : (n > 0)%N -> {in Num.nneg &, {mono n.-root : x y / x < y}}. Proof. (* Goal: forall _ : is_true (leq (S O) n), @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rnneg (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq bool ((fun x0 y0 : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x0 y0) (nthroot n x) (nthroot n y)) ((fun x0 y0 : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x0 y0) x y)) (inPhantom (@monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot n) (fun x y : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x y) (fun x y : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x y))) *) by move/ler_rootC/lerW_mono_in. Qed. Lemma exprCK n x : (0 < n)%N -> 0 <= x -> n.-root (x ^+ n) = x. Lemma norm_rootC n x : `|n.-root x| = n.-root `|x|. Proof. (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (nthroot n x)) (nthroot n (@normr (ClosedField.numDomainType C) x)) *) have [-> | n_gt0] := posnP n; first by rewrite !root0C normr0. (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (nthroot n x)) (nthroot n (@normr (ClosedField.numDomainType C) x)) *) apply/eqP; rewrite -(eqr_expn2 n_gt0) ?rootC_ge0 ?normr_ge0 //. (* Goal: is_true (@eq_op (GRing.Ring.eqType (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (nthroot n x)) n) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (nthroot n (@normr (ClosedField.numDomainType C) x)) n)) *) by rewrite -normrX !rootCK. Qed. Lemma rootCX n x k : (n > 0)%N -> 0 <= x -> n.-root (x ^+ k) = n.-root x ^+ k. Lemma rootC1 n : (n > 0)%N -> n.-root 1 = 1. Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq (ClosedField.sort C) (nthroot n (GRing.one (ClosedField.ringType C))) (GRing.one (ClosedField.ringType C)) *) by move/(rootCX 0)/(_ ler01). Qed. Lemma rootCpX n x k : (k > 0)%N -> 0 <= x -> n.-root (x ^+ k) = n.-root x ^+ k. Proof. (* Goal: forall (_ : is_true (leq (S O) k)) (_ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x)), @eq (ClosedField.sort C) (nthroot n (@GRing.exp (ClosedField.ringType C) x k)) (@GRing.exp (ClosedField.ringType C) (nthroot n x) k) *) by case: n => [|n] k_gt0; [rewrite !root0C expr0n gtn_eqF | apply: rootCX]. Qed. Lemma rootCV n x : (n > 0)%N -> 0 <= x -> n.-root x^-1 = (n.-root x)^-1. Lemma rootC_eq1 n x : (n > 0)%N -> (n.-root x == 1) = (x == 1). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@eq_op (ClosedField.eqType C) (nthroot n x) (GRing.one (ClosedField.ringType C))) (@eq_op (ClosedField.eqType C) x (GRing.one (ClosedField.ringType C))) *) by move=> n_gt0; rewrite -{1}(rootC1 n_gt0) eqr_rootC. Qed. Lemma rootC_ge1 n x : (n > 0)%N -> (n.-root x >= 1) = (x >= 1). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ler (ClosedField.numDomainType C) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (nthroot n x)) (@ler (ClosedField.numDomainType C) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) x) *) by move=> n_gt0; rewrite -{1}(rootC1 n_gt0) ler_rootCl // qualifE ler01. Qed. Lemma rootC_gt1 n x : (n > 0)%N -> (n.-root x > 1) = (x > 1). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@ltr (ClosedField.numDomainType C) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (nthroot n x)) (@ltr (ClosedField.numDomainType C) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) x) *) by move=> n_gt0; rewrite !ltr_def rootC_eq1 ?rootC_ge1. Qed. Lemma rootC_le1 n x : (n > 0)%N -> 0 <= x -> (n.-root x <= 1) = (x <= 1). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x)), @eq bool (@ler (ClosedField.numDomainType C) (nthroot n x) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C)))) (@ler (ClosedField.numDomainType C) x (GRing.one (NumDomain.ringType (ClosedField.numDomainType C)))) *) by move=> n_gt0 x_ge0; rewrite -{1}(rootC1 n_gt0) ler_rootCl. Qed. Lemma rootC_lt1 n x : (n > 0)%N -> 0 <= x -> (n.-root x < 1) = (x < 1). Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x)), @eq bool (@ltr (ClosedField.numDomainType C) (nthroot n x) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C)))) (@ltr (ClosedField.numDomainType C) x (GRing.one (NumDomain.ringType (ClosedField.numDomainType C)))) *) by move=> n_gt0 x_ge0; rewrite !ltr_neqAle rootC_eq1 ?rootC_le1. Qed. Lemma rootCMl n x z : 0 <= x -> n.-root (x * z) = n.-root x * n.-root z. Lemma rootCMr n x z : 0 <= x -> n.-root (z * x) = n.-root z * n.-root x. Proof. (* Goal: forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x), @eq (ClosedField.sort C) (nthroot n (@GRing.mul (ClosedField.ringType C) z x)) (@GRing.mul (ClosedField.ringType C) (nthroot n z) (nthroot n x)) *) by move=> x_ge0; rewrite mulrC rootCMl // mulrC. Qed. Lemma imaginaryCE : 'i = sqrtC (-1). Proof. (* Goal: @eq (ClosedField.sort C) (@imaginaryC C) (nthroot (S (S O)) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C)))) *) have : sqrtC (-1) ^+ 2 - 'i ^+ 2 == 0 by rewrite sqrCi rootCK // subrr. (* Goal: forall _ : is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (ClosedField.ringType C))) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) (nthroot (S (S O)) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C)))) (S (S O))) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) (@imaginaryC C) (S (S O))))) (GRing.zero (GRing.Ring.zmodType (ClosedField.ringType C)))), @eq (ClosedField.sort C) (@imaginaryC C) (nthroot (S (S O)) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C)))) *) rewrite subr_sqr mulf_eq0 subr_eq0 addr_eq0; have [//|_/= /eqP sCN1E] := eqP. (* Goal: @eq (ClosedField.sort C) (@imaginaryC C) (nthroot (S (S O)) (@GRing.opp (GRing.Ring.zmodType (ClosedField.ringType C)) (GRing.one (ClosedField.ringType C)))) *) by have := @Im_rootC_ge0 2 (-1) isT; rewrite sCN1E raddfN /= Im_i ler0N1. Qed. Lemma lerif_rootC_AGM (I : finType) (A : pred I) (n := #|A|) E : {in A, forall i, 0 <= E i} -> n.-root (\prod_(i in A) E i) <= (\sum_(i in A) E i) / n%:R Proof. (* Goal: forall _ : @prop_in1 (Finite.sort I) (@mem (Finite.sort I) (predPredType (Finite.sort I)) A) (fun i : Finite.sort I => is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (E i))) (inPhantom (forall i : Finite.sort I, is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (E i)))), @lerif (ClosedField.numDomainType C) (nthroot n (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i)))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) move=> Ege0; have [n0 | n_gt0] := posnP n. (* Goal: @lerif (ClosedField.numDomainType C) (nthroot n (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i)))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) (* Goal: @lerif (ClosedField.numDomainType C) (nthroot n (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i)))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) rewrite n0 root0C invr0 mulr0; apply/lerif_refl/forall_inP=> i. (* Goal: @lerif (ClosedField.numDomainType C) (nthroot n (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i)))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) (* Goal: forall _ : is_true (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)), is_true (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j)) *) by rewrite (card0_eq n0). (* Goal: @lerif (ClosedField.numDomainType C) (nthroot n (@BigOp.bigop (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i)))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) rewrite -(mono_in_lerif (ler_pexpn2r n_gt0)) ?rootCK //=; first 1 last. (* Goal: @lerif (ClosedField.numDomainType C) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) n) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) (* Goal: is_true (@in_mem (ClosedField.sort C) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@mem (ClosedField.sort C) (predPredType (ClosedField.sort C)) (@has_quality O (ClosedField.sort C) (@Rnneg (ClosedField.numDomainType C))))) *) (* Goal: is_true (@in_mem (ClosedField.sort C) (nthroot n (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i)))) (@mem (ClosedField.sort C) (predPredType (ClosedField.sort C)) (@has_quality O (ClosedField.sort C) (@Rnneg (ClosedField.numDomainType C))))) *) - (* Goal: @lerif (ClosedField.numDomainType C) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) n) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) (* Goal: is_true (@in_mem (ClosedField.sort C) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@mem (ClosedField.sort C) (predPredType (ClosedField.sort C)) (@has_quality O (ClosedField.sort C) (@Rnneg (ClosedField.numDomainType C))))) *) (* Goal: is_true (@in_mem (ClosedField.sort C) (nthroot n (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i)))) (@mem (ClosedField.sort C) (predPredType (ClosedField.sort C)) (@has_quality O (ClosedField.sort C) (@Rnneg (ClosedField.numDomainType C))))) *) by rewrite qualifE rootC_ge0 // prodr_ge0. (* Goal: @lerif (ClosedField.numDomainType C) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) n) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) (* Goal: is_true (@in_mem (ClosedField.sort C) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@mem (ClosedField.sort C) (predPredType (ClosedField.sort C)) (@has_quality O (ClosedField.sort C) (@Rnneg (ClosedField.numDomainType C))))) *) - (* Goal: @lerif (ClosedField.numDomainType C) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) n) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) (* Goal: is_true (@in_mem (ClosedField.sort C) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) (@mem (ClosedField.sort C) (predPredType (ClosedField.sort C)) (@has_quality O (ClosedField.sort C) (@Rnneg (ClosedField.numDomainType C))))) *) by rewrite rpred_div ?rpred_nat ?rpred_sum. (* Goal: @lerif (ClosedField.numDomainType C) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.exp (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (E i))) (@GRing.inv (NumDomain.unitRingType (ClosedField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) (GRing.one (GRing.UnitRing.ringType (NumDomain.unitRingType (ClosedField.numDomainType C)))) n))) n) (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@FiniteQuant.quant0b I (fun j : Finite.sort I => @FiniteQuant.all_in I (@in_mem (Finite.sort I) j (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (FiniteQuant.Quantified (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (E i) (E j))) j))) i)) *) exact: lerif_AGM. Qed. Lemma sqrtC1 : sqrtC 1 = 1. Proof. exact: rootC1. Qed. Proof. (* Goal: @eq (ClosedField.sort C) (nthroot (S (S O)) (GRing.one (ClosedField.ringType C))) (GRing.one (ClosedField.ringType C)) *) exact: rootC1. Qed. Lemma sqrCK x : 0 <= x -> sqrtC (x ^+ 2) = x. Proof. exact: exprCK. Qed. Proof. (* Goal: forall _ : is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) x), @eq (ClosedField.sort C) (nthroot (S (S O)) (@GRing.exp (ClosedField.ringType C) x (S (S O)))) x *) exact: exprCK. Qed. Lemma sqrtC_eq0 x : (sqrtC x == 0) = (x == 0). Proof. exact: rootC_eq0. Qed. Proof. (* Goal: @eq bool (@eq_op (ClosedField.eqType C) (nthroot (S (S O)) x) (GRing.zero (ClosedField.zmodType C))) (@eq_op (ClosedField.eqType C) x (GRing.zero (ClosedField.zmodType C))) *) exact: rootC_eq0. Qed. Lemma sqrtC_lt0 x : (sqrtC x < 0) = false. Proof. exact: rootC_lt0. Qed. Proof. (* Goal: @eq bool (@ltr (ClosedField.numDomainType C) (nthroot (S (S O)) x) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C)))) false *) exact: rootC_lt0. Qed. Lemma ler_sqrtC : {in Num.nneg &, {mono sqrtC : x y / x <= y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rnneg (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq bool ((fun x0 y0 : ClosedField.sort C => @ler (ClosedField.numDomainType C) x0 y0) (nthroot (S (S O)) x) (nthroot (S (S O)) y)) ((fun x0 y0 : ClosedField.sort C => @ler (ClosedField.numDomainType C) x0 y0) x y)) (inPhantom (@monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot (S (S O))) (fun x y : ClosedField.sort C => @ler (ClosedField.numDomainType C) x y) (fun x y : ClosedField.sort C => @ler (ClosedField.numDomainType C) x y))) *) exact: ler_rootC. Qed. Lemma ltr_sqrtC : {in Num.nneg &, {mono sqrtC : x y / x < y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rnneg (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq bool ((fun x0 y0 : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x0 y0) (nthroot (S (S O)) x) (nthroot (S (S O)) y)) ((fun x0 y0 : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x0 y0) x y)) (inPhantom (@monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot (S (S O))) (fun x y : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x y) (fun x y : ClosedField.sort C => @ltr (ClosedField.numDomainType C) x y))) *) exact: ltr_rootC. Qed. Lemma eqr_sqrtC : {mono sqrtC : x y / x == y}. Proof. (* Goal: @monomorphism_2 (ClosedField.sort C) (ClosedField.sort C) bool (nthroot (S (S O))) (fun x y : ClosedField.sort C => @eq_op (ClosedField.eqType C) x y) (fun x y : ClosedField.sort C => @eq_op (ClosedField.eqType C) x y) *) exact: eqr_rootC. Qed. Lemma sqrtC_inj : injective sqrtC. Proof. (* Goal: @injective (ClosedField.sort C) (ClosedField.sort C) (nthroot (S (S O))) *) exact: rootC_inj. Qed. Lemma sqrtCM : {in Num.nneg &, {morph sqrtC : x y / x * y}}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rnneg (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq (ClosedField.sort C) (nthroot (S (S O)) ((fun x0 y0 : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x0 y0) x y)) ((fun x0 y0 : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x0 y0) (nthroot (S (S O)) x) (nthroot (S (S O)) y))) (inPhantom (@morphism_2 (ClosedField.sort C) (ClosedField.sort C) (nthroot (S (S O))) (fun x y : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x y) (fun x y : ClosedField.sort C => @GRing.mul (ClosedField.ringType C) x y))) *) by move=> x y _; apply: rootCMr. Qed. Lemma sqrCK_P x : reflect (sqrtC (x ^+ 2) = x) ((0 <= 'Im x) && ~~ (x < 0)). Proof. (* Goal: Bool.reflect (@eq (ClosedField.sort C) (nthroot (S (S O)) (@GRing.exp (ClosedField.ringType C) x (S (S O)))) x) (andb (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im x)) (negb (@ltr (ClosedField.numDomainType C) x (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C)))))) *) apply: (iffP andP) => [[leI0x not_gt0x] | <-]; last first. (* Goal: @eq (ClosedField.sort C) (nthroot (S (S O)) (@GRing.exp (ClosedField.ringType C) x (S (S O)))) x *) (* Goal: and (is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (Im (nthroot (S (S O)) (@GRing.exp (ClosedField.ringType C) x (S (S O))))))) (is_true (negb (@ltr (ClosedField.numDomainType C) (nthroot (S (S O)) (@GRing.exp (ClosedField.ringType C) x (S (S O)))) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C)))))) *) by rewrite sqrtC_lt0 Im_rootC_ge0. (* Goal: @eq (ClosedField.sort C) (nthroot (S (S O)) (@GRing.exp (ClosedField.ringType C) x (S (S O)))) x *) have /eqP := sqrtCK (x ^+ 2); rewrite eqf_sqr => /pred2P[] // defNx. (* Goal: @eq (ClosedField.sort C) (nthroot (S (S O)) (@GRing.exp (ClosedField.ringType C) x (S (S O)))) x *) apply: sqrCK; rewrite -real_lerNgt ?rpred0 // in not_gt0x; apply/Creal_ImP/ler_anti; by rewrite leI0x -oppr_ge0 -raddfN -defNx Im_rootC_ge0. Qed. Lemma normC_def x : `|x| = sqrtC (x * x^*). Proof. (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (nthroot (S (S O)) (@GRing.mul (ClosedField.ringType C) x (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x))) *) by rewrite -normCK sqrCK ?normr_ge0. Qed. Lemma norm_conjC x : `|x^*| = `|x|. Proof. (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.RMorphism.apply (ClosedField.ringType C) (ClosedField.ringType C) (Phant (forall _ : ClosedField.sort C, ClosedField.sort C)) (@conjC C) x)) (@normr (ClosedField.numDomainType C) x) *) by rewrite !normC_def conjCK mulrC. Qed. Lemma normC_rect : {in real &, forall x y, `|x + 'i * y| = sqrtC (x ^+ 2 + y ^+ 2)}. Proof. (* Goal: @prop_in2 (NumDomain.sort (ClosedField.numDomainType C)) (@mem (NumDomain.sort (ClosedField.numDomainType C)) (predPredType (NumDomain.sort (ClosedField.numDomainType C))) (@has_quality O (NumDomain.sort (ClosedField.numDomainType C)) (@Rreal (ClosedField.numDomainType C)))) (fun x y : ClosedField.sort C => @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (nthroot (S (S O)) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S (S O))) (@GRing.exp (ClosedField.ringType C) y (S (S O)))))) (inPhantom (forall x y : ClosedField.sort C, @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.mul (ClosedField.ringType C) (@imaginaryC C) y))) (nthroot (S (S O)) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) x (S (S O))) (@GRing.exp (ClosedField.ringType C) y (S (S O))))))) *) by move=> x y Rx Ry; rewrite /= normC_def -normCK normC2_rect. Qed. Lemma normC_Re_Im z : `|z| = sqrtC ('Re z ^+ 2 + 'Im z ^+ 2). Proof. (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) z) (nthroot (S (S O)) (@GRing.add (GRing.Ring.zmodType (ClosedField.ringType C)) (@GRing.exp (ClosedField.ringType C) (Re z) (S (S O))) (@GRing.exp (ClosedField.ringType C) (Im z) (S (S O))))) *) by rewrite normC_def -normCK normC2_Re_Im. Qed. Lemma normC_add_eq x y : `|x + y| = `|x| + `|y| -> {t : C | `|t| == 1 & (x, y) = (`|x| * t, `|y| * t)}. Lemma normC_sum_eq (I : finType) (P : pred I) (F : I -> C) : `|\sum_(i | P i) F i| = \sum_(i | P i) `|F i| -> {t : C | `|t| == 1 & forall i, P i -> F i = `|F i| * t}. Proof. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (F i)))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i)))), @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) t)) *) have [i /andP[Pi nzFi] | F0] := pickP [pred i | P i & F i != 0]; last first. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (F i)))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i)))), @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) t)) *) (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (F i)))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i)))), @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) t)) *) exists 1 => [|i Pi]; first by rewrite normr1. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (F i)))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i)))), @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) t)) *) (* Goal: @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (GRing.one (ClosedField.ringType C))) *) by case/nandP: (F0 i) => [/negP[]// | /negbNE/eqP->]; rewrite normr0 mul0r. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (F i)))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i)))), @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) t)) *) rewrite !(bigD1 i Pi) /= => norm_sumF; pose Q j := P j && (j != i). (* Goal: @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) t)) *) rewrite -normr_eq0 in nzFi; set c := F i / `|F i|; exists c => [|j Pj]. (* Goal: @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) (* Goal: is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) c) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C)))) *) by rewrite normrM normfV normr_id divff. (* Goal: @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) have [Qj | /nandP[/negP[]// | /negbNE/eqP->]] := boolP (Q j); last first. (* Goal: @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) (* Goal: @eq (ClosedField.sort C) (F i) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) c) *) by rewrite mulrC divfK. (* Goal: @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) have: `|F i + F j| = `|F i| + `|F j|. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (@normr (ClosedField.numDomainType C) (F j))), @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (@normr (ClosedField.numDomainType C) (F j))) *) do [rewrite !(bigD1 j Qj) /=; set z := \sum_(k | _) `|_|] in norm_sumF. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (@normr (ClosedField.numDomainType C) (F j))), @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (@normr (ClosedField.numDomainType C) (F j))) *) apply/eqP; rewrite eqr_le ler_norm_add -(ler_add2r z) -addrA -norm_sumF addrA. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (@normr (ClosedField.numDomainType C) (F j))), @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) (* Goal: is_true (andb true (@ler (ClosedField.numDomainType C) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j)) (@BigOp.bigop (ClosedField.sort C) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (ClosedField.sort C) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (andb (Q i) (negb (@eq_op (Finite.eqType I) i j))) (F i))))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j))) z))) *) by rewrite (ler_trans (ler_norm_add _ _)) // ler_add2l ler_norm_sum. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) (F i) (F j))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (@normr (ClosedField.numDomainType C) (F j))), @eq (ClosedField.sort C) (F j) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F j)) c) *) by case/normC_add_eq=> k _ [/(canLR (mulKf nzFi)) <-]; rewrite -(mulrC (F i)). Qed. Lemma normC_sum_eq1 (I : finType) (P : pred I) (F : I -> C) : `|\sum_(i | P i) F i| = (\sum_(i | P i) `|F i|) -> (forall i, P i -> `|F i| = 1) -> {t : C | `|t| == 1 & forall i, P i -> F i = t}. Proof. (* Goal: forall (_ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (F i)))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i))))) (_ : forall (i : Finite.sort I) (_ : is_true (P i)), @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C)))), @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) t) *) case/normC_sum_eq=> t t1 defF normF. (* Goal: @sig2 (ClosedField.sort C) (fun t : ClosedField.sort C => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : ClosedField.sort C => forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) t) *) by exists t => // i Pi; rewrite defF // normF // mul1r. Qed. Lemma normC_sum_upper (I : finType) (P : pred I) (F G : I -> C) : (forall i, P i -> `|F i| <= G i) -> \sum_(i | P i) F i = \sum_(i | P i) G i -> forall i, P i -> F i = G i. Proof. (* Goal: forall (_ : forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@ler (ClosedField.numDomainType C) (@normr (ClosedField.numDomainType C) (F i)) (G i))) (_ : @eq (GRing.Zmodule.sort (ClosedField.zmodType C)) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (F i))) (@BigOp.bigop (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) (GRing.zero (ClosedField.zmodType C)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (ClosedField.zmodType C)) (Finite.sort I) i (@GRing.add (ClosedField.zmodType C)) (P i) (G i)))) (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) set sumF := \sum_(i | _) _; set sumG := \sum_(i | _) _ => leFG eq_sumFG. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) have posG i: P i -> 0 <= G i by move/leFG; apply: ler_trans; apply: normr_ge0. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) have norm_sumG: `|sumG| = sumG by rewrite ger0_norm ?sumr_ge0. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) have norm_sumF: `|sumF| = \sum_(i | P i) `|F i|. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) (* Goal: @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) sumF) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i)))) *) apply/eqP; rewrite eqr_le ler_norm_sum eq_sumFG norm_sumG -subr_ge0 -sumrB. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) (* Goal: is_true (andb true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (G i) (@GRing.opp (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (F i)))))))) *) by rewrite sumr_ge0 // => i Pi; rewrite subr_ge0 ?leFG. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) have [t _ defF] := normC_sum_eq norm_sumF. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) have [/(psumr_eq0P posG) G0 i Pi | nz_sumG] := eqVneq sumG 0. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) (* Goal: @eq (ClosedField.sort C) (F i) (G i) *) by apply/eqP; rewrite G0 // -normr_eq0 eqr_le normr_ge0 -(G0 i Pi) leFG. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) have t1: t = 1. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) (* Goal: @eq (ClosedField.sort C) t (GRing.one (ClosedField.ringType C)) *) apply: (mulfI nz_sumG); rewrite mulr1 -{1}norm_sumG -eq_sumFG norm_sumF. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) (* Goal: @eq (GRing.Ring.sort (GRing.IntegralDomain.ringType (ClosedField.idomainType C))) (@GRing.mul (GRing.IntegralDomain.ringType (ClosedField.idomainType C)) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@normr (ClosedField.numDomainType C) (F i)))) t) sumF *) by rewrite mulr_suml -(eq_bigr _ defF). (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) have /psumr_eq0P eqFG i: P i -> 0 <= G i - F i. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) (* Goal: forall _ : is_true (P i), is_true (@ler (ClosedField.numDomainType C) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (@GRing.add (ClosedField.zmodType C) (G i) (@GRing.opp (ClosedField.zmodType C) (F i)))) *) by move=> Pi; rewrite subr_ge0 defF // t1 mulr1 leFG. (* Goal: forall (i : Finite.sort I) (_ : is_true (P i)), @eq (ClosedField.sort C) (F i) (G i) *) move=> i /eqFG/(canRL (subrK _))->; rewrite ?add0r //. (* Goal: @eq (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (@BigOp.bigop (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Zmodule.sort (NumDomain.zmodType (ClosedField.numDomainType C))) (Finite.sort I) i (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C))) (P i) (@GRing.add (ClosedField.zmodType C) (G i) (@GRing.opp (ClosedField.zmodType C) (F i))))) (GRing.zero (NumDomain.zmodType (ClosedField.numDomainType C))) *) by rewrite sumrB -/sumF eq_sumFG subrr. Qed. Lemma normC_sub_eq x y : `|x - y| = `|x| - `|y| -> {t | `|t| == 1 & (x, y) = (`|x| * t, `|y| * t)}. Proof. (* Goal: forall _ : @eq (NumDomain.sort (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.opp (ClosedField.zmodType C) y))) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) (@GRing.opp (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) y))), @sig2 (NumDomain.sort (ClosedField.numDomainType C)) (fun t : NumDomain.sort (ClosedField.numDomainType C) => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : NumDomain.sort (ClosedField.numDomainType C) => @eq (prod (ClosedField.sort C) (ClosedField.sort C)) (@pair (ClosedField.sort C) (ClosedField.sort C) x y) (@pair (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) x) t) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) y) t))) *) rewrite -{-1}(subrK y x) => /(canLR (subrK _))/esym-Dx; rewrite Dx. (* Goal: @sig2 (NumDomain.sort (ClosedField.numDomainType C)) (fun t : NumDomain.sort (ClosedField.numDomainType C) => is_true (@eq_op (NumDomain.eqType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) t) (GRing.one (NumDomain.ringType (ClosedField.numDomainType C))))) (fun t : NumDomain.sort (ClosedField.numDomainType C) => @eq (prod (ClosedField.sort C) (ClosedField.sort C)) (@pair (ClosedField.sort C) (ClosedField.sort C) (@GRing.add (ClosedField.zmodType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.opp (ClosedField.zmodType C) y)) y) y) (@pair (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (GRing.Ring.sort (NumDomain.ringType (ClosedField.numDomainType C))) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@GRing.add (NumDomain.zmodType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) (@GRing.add (ClosedField.zmodType C) x (@GRing.opp (ClosedField.zmodType C) y))) (@normr (ClosedField.numDomainType C) y)) t) (@GRing.mul (NumDomain.ringType (ClosedField.numDomainType C)) (@normr (ClosedField.numDomainType C) y) t))) *) by have [t ? [Dxy Dy]] := normC_add_eq Dx; exists t; rewrite // mulrDl -Dxy -Dy. Qed. Let leN_total x : 0 <= x \/ 0 <= - x. Proof. (* Goal: or (is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) x)) (is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.opp (GRing.IntegralDomain.zmodType R) x))) *) by apply/orP; rewrite le0N le0_total. Qed. Let le01 : (0 <= 1). Proof. (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (GRing.one (GRing.IntegralDomain.ringType R))) *) by case/orP: (le0_total 1)=> // ?; rewrite -[1]mul1r -mulrNN le0_mul ?le0N. Qed. Fact lt0_add x y : 0 < x -> 0 < y -> 0 < x + y. Proof. (* Goal: forall (_ : is_true (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) x)) (_ : is_true (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) y)), is_true (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) x y)) *) rewrite !lt_def => /andP[x_neq0 l0x] /andP[y_neq0 l0y]; rewrite le0_add //. (* Goal: is_true (andb (negb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x y) (GRing.zero (GRing.IntegralDomain.zmodType R)))) true) *) rewrite andbT addr_eq0; apply: contraNneq x_neq0 => hxy. (* Goal: is_true (@eq_op (GRing.IntegralDomain.eqType R) x (GRing.zero (GRing.IntegralDomain.zmodType R))) *) by rewrite [x]le0_anti // hxy -le0N opprK. Qed. Fact eq0_norm x : `|x| = 0 -> x = 0. Proof. (* Goal: forall _ : @eq (GRing.IntegralDomain.sort R) (norm x) (GRing.zero (GRing.IntegralDomain.zmodType R)), @eq (GRing.IntegralDomain.sort R) x (GRing.zero (GRing.IntegralDomain.zmodType R)) *) case: (leN_total x) => /ge0_norm => [-> // | Dnx nx0]. (* Goal: @eq (GRing.IntegralDomain.sort R) x (GRing.zero (GRing.IntegralDomain.zmodType R)) *) by rewrite -[x]opprK -Dnx normN nx0 oppr0. Qed. Fact le_def x y : (x <= y) = (`|y - x| == y - x). Proof. (* Goal: @eq bool (le x y) (@eq_op (GRing.IntegralDomain.eqType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) y (@GRing.opp (GRing.IntegralDomain.zmodType R) x))) (@GRing.add (GRing.IntegralDomain.zmodType R) y (@GRing.opp (GRing.IntegralDomain.zmodType R) x))) *) wlog ->: x y / x = 0 by move/(_ 0 (y - x)); rewrite subr0 sub_ge0 => ->. (* Goal: @eq bool (le (GRing.zero (GRing.IntegralDomain.zmodType R)) y) (@eq_op (GRing.IntegralDomain.eqType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) y (@GRing.opp (GRing.IntegralDomain.zmodType R) (GRing.zero (GRing.IntegralDomain.zmodType R))))) (@GRing.add (GRing.IntegralDomain.zmodType R) y (@GRing.opp (GRing.IntegralDomain.zmodType R) (GRing.zero (GRing.IntegralDomain.zmodType R))))) *) rewrite {x}subr0; apply/idP/eqP=> [/ge0_norm// | Dy]. (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) y) *) by have [//| ny_ge0] := leN_total y; rewrite -Dy -normN ge0_norm. Qed. Fact normM : {morph norm : x y / x * y}. Proof. (* Goal: @morphism_2 (GRing.IntegralDomain.sort R) (GRing.IntegralDomain.sort R) norm (fun x y : GRing.IntegralDomain.sort R => @GRing.mul (GRing.IntegralDomain.ringType R) x y) (fun x y : GRing.IntegralDomain.sort R => @GRing.mul (GRing.IntegralDomain.ringType R) x y) *) move=> x y /=; wlog x_ge0 : x / 0 <= x. (* Goal: @eq (GRing.IntegralDomain.sort R) (norm (@GRing.mul (GRing.IntegralDomain.ringType R) x y)) (@GRing.mul (GRing.IntegralDomain.ringType R) (norm x) (norm y)) *) (* Goal: forall _ : forall (x : GRing.IntegralDomain.sort R) (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) x)), @eq (GRing.IntegralDomain.sort R) (norm (@GRing.mul (GRing.IntegralDomain.ringType R) x y)) (@GRing.mul (GRing.IntegralDomain.ringType R) (norm x) (norm y)), @eq (GRing.IntegralDomain.sort R) (norm (@GRing.mul (GRing.IntegralDomain.ringType R) x y)) (@GRing.mul (GRing.IntegralDomain.ringType R) (norm x) (norm y)) *) by move=> IHx; case: (leN_total x) => /IHx//; rewrite mulNr !normN. (* Goal: @eq (GRing.IntegralDomain.sort R) (norm (@GRing.mul (GRing.IntegralDomain.ringType R) x y)) (@GRing.mul (GRing.IntegralDomain.ringType R) (norm x) (norm y)) *) wlog y_ge0 : y / 0 <= y; last by rewrite ?ge0_norm ?le0_mul. (* Goal: forall _ : forall (y : GRing.IntegralDomain.sort R) (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) y)), @eq (GRing.IntegralDomain.sort R) (norm (@GRing.mul (GRing.IntegralDomain.ringType R) x y)) (@GRing.mul (GRing.IntegralDomain.ringType R) (norm x) (norm y)), @eq (GRing.IntegralDomain.sort R) (norm (@GRing.mul (GRing.IntegralDomain.ringType R) x y)) (@GRing.mul (GRing.IntegralDomain.ringType R) (norm x) (norm y)) *) by move=> IHy; case: (leN_total y) => /IHy//; rewrite mulrN !normN. Qed. Fact le_normD x y : `|x + y| <= `|x| + `|y|. Proof. (* Goal: is_true (le (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y)) (@GRing.add (GRing.IntegralDomain.zmodType R) (norm x) (norm y))) *) wlog x_ge0 : x y / 0 <= x. (* Goal: is_true (le (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y)) (@GRing.add (GRing.IntegralDomain.zmodType R) (norm x) (norm y))) *) (* Goal: forall _ : forall (x y : GRing.Zmodule.sort (GRing.IntegralDomain.zmodType R)) (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) x)), is_true (le (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y)) (@GRing.add (GRing.IntegralDomain.zmodType R) (norm x) (norm y))), is_true (le (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y)) (@GRing.add (GRing.IntegralDomain.zmodType R) (norm x) (norm y))) *) by move=> IH; case: (leN_total x) => /IH// /(_ (- y)); rewrite -opprD !normN. (* Goal: is_true (le (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y)) (@GRing.add (GRing.IntegralDomain.zmodType R) (norm x) (norm y))) *) rewrite -sub_ge0 ge0_norm //; have [y_ge0 | ny_ge0] := leN_total y. (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x (norm y)) (@GRing.opp (GRing.IntegralDomain.zmodType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y))))) *) (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x (norm y)) (@GRing.opp (GRing.IntegralDomain.zmodType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y))))) *) by rewrite !ge0_norm ?subrr ?le0_add. (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x (norm y)) (@GRing.opp (GRing.IntegralDomain.zmodType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y))))) *) rewrite -normN ge0_norm //; have [hxy|hxy] := leN_total (x + y). (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x (@GRing.opp (GRing.IntegralDomain.zmodType R) y)) (@GRing.opp (GRing.IntegralDomain.zmodType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y))))) *) (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x (@GRing.opp (GRing.IntegralDomain.zmodType R) y)) (@GRing.opp (GRing.IntegralDomain.zmodType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y))))) *) by rewrite ge0_norm // opprD addrCA -addrA addKr le0_add. (* Goal: is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x (@GRing.opp (GRing.IntegralDomain.zmodType R) y)) (@GRing.opp (GRing.IntegralDomain.zmodType R) (norm (@GRing.add (GRing.IntegralDomain.zmodType R) x y))))) *) by rewrite -normN ge0_norm // opprK addrCA addrNK le0_add. Qed. Lemma le_total x y : (x <= y) || (y <= x). Proof. (* Goal: is_true (orb (le x y) (le y x)) *) by rewrite -sub_ge0 -opprB le0N orbC -sub_ge0 le0_total. Qed. Definition Le := Mixin le_normD lt0_add eq0_norm (in2W le_total) normM le_def lt_def. Lemma Real (R' : numDomainType) & phant R' : R' = NumDomainType R Le -> real_axiom R'. Proof. (* Goal: forall _ : @eq NumDomain.type R' (@NumDomain.pack (GRing.IntegralDomain.sort R) (@GRing.ComRing.base (let '@GRing.IntegralDomain.Pack T c := R in T) (@GRing.ComUnitRing.base (let '@GRing.IntegralDomain.Pack T c := R in T) (@GRing.IntegralDomain.base (let '@GRing.IntegralDomain.Pack T c := R in T) (GRing.IntegralDomain.class R : GRing.IntegralDomain.class_of (let '@GRing.IntegralDomain.Pack T c := R in T))))) Le R (GRing.IntegralDomain.class R) (fun x : phantom (GRing.IntegralDomain.class_of (GRing.IntegralDomain.sort R)) (GRing.IntegralDomain.class R) => x) Le (fun x : phantom (mixin_of (@GRing.Ring.Pack (GRing.IntegralDomain.sort R) (@GRing.ComRing.base (let '@GRing.IntegralDomain.Pack T c := R in T) (@GRing.ComUnitRing.base (let '@GRing.IntegralDomain.Pack T c := R in T) (@GRing.IntegralDomain.base (let '@GRing.IntegralDomain.Pack T c := R in T) (GRing.IntegralDomain.class R : GRing.IntegralDomain.class_of (let '@GRing.IntegralDomain.Pack T c := R in T))))))) Le => x)), real_axiom R' *) by move->. Qed. End LeMixin. Section LtMixin. Hypothesis lt0_add : forall x y, 0 < x -> 0 < y -> 0 < x + y. Hypothesis lt0_mul : forall x y, 0 < x -> 0 < y -> 0 < x * y. Hypothesis lt0_ngt0 : forall x, 0 < x -> ~~ (x < 0). Hypothesis sub_gt0 : forall x y, (0 < y - x) = (x < y). Hypothesis lt0_total : forall x, x != 0 -> (0 < x) || (x < 0). Hypothesis normN : forall x, `|- x| = `|x|. Hypothesis ge0_norm : forall x, 0 <= x -> `|x| = x. Hypothesis le_def : forall x y, (x <= y) = (y == x) || (x < y). Fact le0_add x y : 0 <= x -> 0 <= y -> 0 <= x + y. Proof. (* Goal: forall (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) x)) (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) y)), is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) x y)) *) rewrite !le_def => /predU1P[->|x_gt0]; first by rewrite add0r. (* Goal: forall _ : is_true (orb (@eq_op (GRing.IntegralDomain.eqType R) y (GRing.zero (GRing.IntegralDomain.zmodType R))) (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) y)), is_true (orb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.add (GRing.IntegralDomain.zmodType R) x y) (GRing.zero (GRing.IntegralDomain.zmodType R))) (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) x y))) *) by case/predU1P=> [->|y_gt0]; rewrite ?addr0 ?x_gt0 ?lt0_add // orbT. Qed. Fact le0_mul x y : 0 <= x -> 0 <= y -> 0 <= x * y. Proof. (* Goal: forall (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) x)) (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) y)), is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) x y)) *) rewrite !le_def => /predU1P[->|x_gt0]; first by rewrite mul0r eqxx. (* Goal: forall _ : is_true (orb (@eq_op (GRing.IntegralDomain.eqType R) y (GRing.zero (GRing.IntegralDomain.zmodType R))) (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) y)), is_true (orb (@eq_op (GRing.IntegralDomain.eqType R) (@GRing.mul (GRing.IntegralDomain.ringType R) x y) (GRing.zero (GRing.IntegralDomain.zmodType R))) (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.mul (GRing.IntegralDomain.ringType R) x y))) *) by case/predU1P=> [->|y_gt0]; rewrite ?mulr0 ?eqxx // orbC lt0_mul. Qed. Fact le0_anti x : 0 <= x -> x <= 0 -> x = 0. Proof. (* Goal: forall (_ : is_true (le (GRing.zero (GRing.IntegralDomain.zmodType R)) x)) (_ : is_true (le x (GRing.zero (GRing.IntegralDomain.zmodType R)))), @eq (GRing.IntegralDomain.sort R) x (GRing.zero (GRing.IntegralDomain.zmodType R)) *) by rewrite !le_def => /predU1P[] // /lt0_ngt0/negPf-> /predU1P[]. Qed. Fact sub_ge0 x y : (0 <= y - x) = (x <= y). Proof. (* Goal: @eq bool (le (GRing.zero (GRing.IntegralDomain.zmodType R)) (@GRing.add (GRing.IntegralDomain.zmodType R) y (@GRing.opp (GRing.IntegralDomain.zmodType R) x))) (le x y) *) by rewrite !le_def subr_eq0 sub_gt0. Qed. Fact lt_def x y : (x < y) = (y != x) && (x <= y). Proof. (* Goal: @eq bool (lt x y) (andb (negb (@eq_op (GRing.IntegralDomain.eqType R) y x)) (le x y)) *) rewrite le_def; case: eqP => //= ->; rewrite -sub_gt0 subrr. (* Goal: @eq bool (lt (GRing.zero (GRing.IntegralDomain.zmodType R)) (GRing.zero (GRing.IntegralDomain.zmodType R))) false *) by apply/idP=> lt00; case/negP: (lt0_ngt0 lt00). Qed. Fact le0_total x : (0 <= x) || (x <= 0). Proof. (* Goal: is_true (orb (le (GRing.zero (GRing.IntegralDomain.zmodType R)) x) (le x (GRing.zero (GRing.IntegralDomain.zmodType R)))) *) by rewrite !le_def [0 == _]eq_sym; have [|/lt0_total] := altP eqP. Qed. Definition Lt := Le le0_add le0_mul le0_anti sub_ge0 le0_total normN ge0_norm lt_def. End LtMixin. End RealMixins. End RealMixin. End Num. Export Num.NumDomain.Exports Num.NumField.Exports Num.ClosedField.Exports. Export Num.RealDomain.Exports Num.RealField.Exports. Export Num.ArchimedeanField.Exports Num.RealClosedField.Exports. Export Num.Syntax Num.PredInstances. Notation RealLeMixin := Num.RealMixin.Le. Notation RealLtMixin := Num.RealMixin.Lt. Notation RealLeAxiom R := (Num.RealMixin.Real (Phant R) (erefl _)). Notation ImaginaryMixin := Num.ClosedField.ImaginaryMixin.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinear4. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_rayimpliescollinear : forall A B C, Out A B C -> Col A B C. Proof. (* Goal: forall (A B C : @Point Ax0) (_ : @Out Ax0 A B C), @Col Ax0 A B C *) intros. (* Goal: @Col Ax0 A B C *) let Tf:=fresh in assert (Tf:exists J, (BetS J A C /\ BetS J A B)) by (conclude_def Out );destruct Tf as [J];spliter. (* Goal: @Col Ax0 A B C *) assert (neq J A) by (forward_using lemma_betweennotequal). (* Goal: @Col Ax0 A B C *) assert (Col J A B) by (conclude_def Col ). (* Goal: @Col Ax0 A B C *) assert (Col J A C) by (conclude_def Col ). (* Goal: @Col Ax0 A B C *) assert (Col A B C) by (conclude lemma_collinear4). (* Goal: @Col Ax0 A B C *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.proposition_46. Require Export GeoCoq.Elements.OriginalProofs.lemma_oppositesideflip. Require Export GeoCoq.Elements.OriginalProofs.lemma_righttogether. Require Export GeoCoq.Elements.OriginalProofs.lemma_diagonalsbisect. Section Euclid. Context `{Ax:euclidean_euclidean}. Lemma lemma_squareparallelogram : forall A B C D, SQ A B C D -> PG A B C D. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @SQ Ax0 A B C D), @PG Ax0 A B C D *) intros. (* Goal: @PG Ax0 A B C D *) assert ((Cong A B C D /\ Cong A B B C /\ Cong A B D A /\ Per D A B /\ Per A B C /\ Per B C D /\ Per C D A)) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (nCol D A B) by (conclude lemma_rightangleNC). (* Goal: @PG Ax0 A B C D *) assert (neq D A) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists R, (BetS D A R /\ Cong A R D A)) by (conclude lemma_extension);destruct Tf as [R];spliter. (* Goal: @PG Ax0 A B C D *) assert (BetS R A D) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 A B C D *) assert (neq A B) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (Col D A R) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Col D A A) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (neq R A) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 A B C D *) assert (nCol R A B) by (conclude lemma_NChelper). (* Goal: @PG Ax0 A B C D *) assert (nCol A B R) by (forward_using lemma_NCorder). (* Goal: @PG Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists c E, (SQ A B c E /\ TS E A B R /\ PG A B c E)) by (conclude proposition_46);destruct Tf as [c[E]];spliter. (* Goal: @PG Ax0 A B C D *) assert ((Cong A B c E /\ Cong A B B c /\ Cong A B E A /\ Per E A B /\ Per A B c /\ Per B c E /\ Per c E A)) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (Col R A D) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (Col D A R) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 A B C D *) assert (Per R A B) by (conclude lemma_collinearright). (* Goal: @PG Ax0 A B C D *) assert (Per B A R) by (conclude lemma_8_2). (* Goal: @PG Ax0 A B C D *) assert (TS E B A R) by (conclude lemma_oppositesideflip). (* Goal: @PG Ax0 A B C D *) assert (BetS E A R) by (conclude lemma_righttogether). (* Goal: @PG Ax0 A B C D *) assert (BetS R A E) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 A B C D *) assert (Out A D E) by (conclude_def Out ). (* Goal: @PG Ax0 A B C D *) assert (Cong A B E A) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (Cong E A A B) by (conclude lemma_congruencesymmetric). (* Goal: @PG Ax0 A B C D *) assert (Cong E A D A) by (conclude lemma_congruencetransitive). (* Goal: @PG Ax0 A B C D *) assert (Cong A E A D) by (forward_using lemma_congruenceflip). (* Goal: @PG Ax0 A B C D *) assert (neq A D) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 A B C D *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Out A D D) by (conclude lemma_ray4). (* Goal: @PG Ax0 A B C D *) assert (eq E D) by (conclude lemma_layoffunique). (* Goal: @PG Ax0 A B C D *) assert (PG A B c D) by (conclude cn_equalitysub). (* Goal: @PG Ax0 A B C D *) assert (Cong A B C D) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (SQ A B c D) by (conclude cn_equalitysub). (* Goal: @PG Ax0 A B C D *) assert (Cong A B c D) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (Cong c D A B) by (conclude lemma_congruencesymmetric). (* Goal: @PG Ax0 A B C D *) assert (Cong c D C D) by (conclude lemma_congruencetransitive). (* Goal: @PG Ax0 A B C D *) assert (Cong A B B C) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (Cong A B B c) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (Cong B c A B) by (conclude lemma_congruencesymmetric). (* Goal: @PG Ax0 A B C D *) assert (Cong B c B C) by (conclude lemma_congruencetransitive). (* Goal: @PG Ax0 A B C D *) assert (Cong c B C B) by (forward_using lemma_congruenceflip). (* Goal: @PG Ax0 A B C D *) assert (Per B C D) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (Per B c D) by (conclude_def SQ ). (* Goal: @PG Ax0 A B C D *) assert (CongA B c D B C D) by (conclude lemma_Euclid4). (* Goal: @PG Ax0 A B C D *) assert ((Cong B D B D /\ CongA c B D C B D /\ CongA c D B C D B)) by (conclude proposition_04). (* Goal: @PG Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists m, (Midpoint A m c /\ Midpoint B m D)) by (conclude lemma_diagonalsbisect);destruct Tf as [m];spliter. (* Goal: @PG Ax0 A B C D *) assert ((BetS A m c /\ Cong A m m c)) by (conclude_def Midpoint ). (* Goal: @PG Ax0 A B C D *) assert ((BetS B m D /\ Cong B m m D)) by (conclude_def Midpoint ). (* Goal: @PG Ax0 A B C D *) assert (CongA C D B c D B) by (conclude lemma_equalanglessymmetric). (* Goal: @PG Ax0 A B C D *) assert (Cong D m D m) by (conclude cn_congruencereflexive). (* Goal: @PG Ax0 A B C D *) assert (Cong D c D C) by (forward_using lemma_congruenceflip). (* Goal: @PG Ax0 A B C D *) assert (nCol C D A) by (conclude lemma_rightangleNC). (* Goal: @PG Ax0 A B C D *) assert (Per c D A) by (conclude cn_equalitysub). (* Goal: @PG Ax0 A B C D *) assert (nCol c D A) by (conclude lemma_rightangleNC). (* Goal: @PG Ax0 A B C D *) assert (nCol A c D) by (forward_using lemma_NCorder). (* Goal: @PG Ax0 A B C D *) assert (eq c c) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (Col A c c) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (Col A m c) by (conclude_def Col ). (* Goal: @PG Ax0 A B C D *) assert (Col A c m) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 A B C D *) assert (neq m c) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 A B C D *) assert (nCol m c D) by (conclude lemma_NChelper). (* Goal: @PG Ax0 A B C D *) assert (nCol c D m) by (forward_using lemma_NCorder). (* Goal: @PG Ax0 A B C D *) assert (~ Col C D m). (* Goal: @PG Ax0 A B C D *) (* Goal: not (@Col Ax0 C D m) *) { (* Goal: not (@Col Ax0 C D m) *) intro. (* Goal: False *) assert (Col B m D) by (conclude_def Col ). (* Goal: False *) assert (Col m D B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col m D C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq m D) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col D B C) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (nCol B C D) by (conclude lemma_rightangleNC). (* Goal: False *) contradict. (* BG Goal: @PG Ax0 A B C D *) } (* Goal: @PG Ax0 A B C D *) assert (CongA c D B C D B) by (conclude lemma_equalanglessymmetric). (* Goal: @PG Ax0 A B C D *) assert (BetS D m B) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 A B C D *) assert (neq D B) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 A B C D *) assert (Out D B m) by (conclude lemma_ray4). (* Goal: @PG Ax0 A B C D *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (neq D C) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (Out D C C) by (conclude lemma_ray4). (* Goal: @PG Ax0 A B C D *) assert (CongA c D B C D m) by (conclude lemma_equalangleshelper). (* Goal: @PG Ax0 A B C D *) assert (CongA C D m c D B) by (conclude lemma_equalanglessymmetric). (* Goal: @PG Ax0 A B C D *) assert (eq c c) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 A B C D *) assert (neq D c) by (forward_using lemma_NCdistinct). (* Goal: @PG Ax0 A B C D *) assert (Out D c c) by (conclude lemma_ray4). (* Goal: @PG Ax0 A B C D *) assert (CongA C D m c D m) by (conclude lemma_equalangleshelper). (* Goal: @PG Ax0 A B C D *) assert (CongA c D m C D m) by (conclude lemma_equalanglessymmetric). (* Goal: @PG Ax0 A B C D *) assert (Cong c m C m) by (conclude proposition_04). (* Goal: @PG Ax0 A B C D *) assert (Cong m c m C) by (forward_using lemma_congruenceflip). (* Goal: @PG Ax0 A B C D *) assert (Cong A m A m) by (conclude cn_congruencereflexive). (* Goal: @PG Ax0 A B C D *) assert (Cong D A D A) by (conclude cn_congruencereflexive). (* Goal: @PG Ax0 A B C D *) assert (Per c D A) by (conclude cn_equalitysub). (* Goal: @PG Ax0 A B C D *) assert (Per A D c) by (conclude lemma_8_2). (* Goal: @PG Ax0 A B C D *) assert (Per A D C) by (conclude lemma_8_2). (* Goal: @PG Ax0 A B C D *) assert (CongA A D C A D c) by (conclude lemma_Euclid4). (* Goal: @PG Ax0 A B C D *) assert (Cong D C D c) by (conclude lemma_congruencesymmetric). (* Goal: @PG Ax0 A B C D *) assert (Cong A C A c) by (conclude proposition_04). (* Goal: @PG Ax0 A B C D *) assert (Cong A c A C) by (conclude lemma_congruencesymmetric). (* Goal: @PG Ax0 A B C D *) assert (BetS A m C) by (conclude lemma_betweennesspreserved). (* Goal: @PG Ax0 A B C D *) assert (neq A m) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 A B C D *) assert (Out A m c) by (conclude lemma_ray4). (* Goal: @PG Ax0 A B C D *) assert (Out A m C) by (conclude lemma_ray4). (* Goal: @PG Ax0 A B C D *) assert (eq c C) by (conclude lemma_layoffunique). (* Goal: @PG Ax0 A B C D *) assert (PG A B C D) by (conclude cn_equalitysub). (* Goal: @PG Ax0 A B C D *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthanbetween. Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthanadditive. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_21helper : forall A B C E, TG B A A E B E -> BetS A E C -> TT B A A C B E E C. Proof. (* Goal: forall (A B C E : @Point Ax0) (_ : @TG Ax0 B A A E B E) (_ : @BetS Ax0 A E C), @TT Ax0 B A A C B E E C *) intros. (* Goal: @TT Ax0 B A A C B E E C *) rename_H H;let Tf:=fresh in assert (Tf:exists H, (BetS B A H /\ Cong A H A E /\ Lt B E B H)) by (conclude_def TG );destruct Tf as [H];spliter. (* Goal: @TT Ax0 B A A C B E E C *) assert (neq B A) by (forward_using lemma_betweennotequal). (* Goal: @TT Ax0 B A A C B E E C *) assert (~ eq B E). (* Goal: @TT Ax0 B A A C B E E C *) (* Goal: not (@eq Ax0 B E) *) { (* Goal: not (@eq Ax0 B E) *) intro. (* Goal: False *) assert (Lt B B B H) by (conclude cn_equalitysub). (* Goal: False *) let Tf:=fresh in assert (Tf:exists K, (BetS B K H /\ Cong B K B B)) by (conclude_def Lt );destruct Tf as [K];spliter. (* Goal: False *) assert (~ neq B K). (* Goal: False *) (* Goal: not (@neq Ax0 B K) *) { (* Goal: not (@neq Ax0 B K) *) intro. (* Goal: False *) assert (neq B B) by (conclude axiom_nocollapse). (* Goal: False *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: False *) contradict. (* BG Goal: @TT Ax0 B A A C B E E C *) (* BG Goal: False *) } (* Goal: False *) assert (BetS B B H) by (conclude cn_equalitysub). (* Goal: False *) assert (neq B B) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: False *) contradict. (* BG Goal: @TT Ax0 B A A C B E E C *) } (* Goal: @TT Ax0 B A A C B E E C *) assert (neq A C) by (forward_using lemma_betweennotequal). (* Goal: @TT Ax0 B A A C B E E C *) let Tf:=fresh in assert (Tf:exists F, (BetS B A F /\ Cong A F A C)) by (conclude lemma_extension);destruct Tf as [F];spliter. (* Goal: @TT Ax0 B A A C B E E C *) assert (neq E C) by (forward_using lemma_betweennotequal). (* Goal: @TT Ax0 B A A C B E E C *) let Tf:=fresh in assert (Tf:exists G, (BetS B E G /\ Cong E G E C)) by (conclude lemma_extension);destruct Tf as [G];spliter. (* Goal: @TT Ax0 B A A C B E E C *) assert (Cong A C A F) by (conclude lemma_congruencesymmetric). (* Goal: @TT Ax0 B A A C B E E C *) assert (Cong A E A H) by (conclude lemma_congruencesymmetric). (* Goal: @TT Ax0 B A A C B E E C *) assert (Cong A E A E) by (conclude cn_congruencereflexive). (* Goal: @TT Ax0 B A A C B E E C *) assert (Lt A E A C) by (conclude_def Lt ). (* Goal: @TT Ax0 B A A C B E E C *) assert (Lt A E A F) by (conclude lemma_lessthancongruence). (* Goal: @TT Ax0 B A A C B E E C *) assert (Lt A H A F) by (conclude lemma_lessthancongruence2). (* Goal: @TT Ax0 B A A C B E E C *) assert (Out A H F) by (conclude_def Out ). (* Goal: @TT Ax0 B A A C B E E C *) assert (BetS A H F) by (conclude lemma_lessthanbetween). (* Goal: @TT Ax0 B A A C B E E C *) assert (Cong E C H F) by (conclude lemma_differenceofparts). (* Goal: @TT Ax0 B A A C B E E C *) assert (Cong E G H F) by (conclude lemma_congruencetransitive). (* Goal: @TT Ax0 B A A C B E E C *) assert (BetS B H F) by (conclude lemma_3_7a). (* Goal: @TT Ax0 B A A C B E E C *) assert (Lt B G B F) by (conclude lemma_lessthanadditive). (* Goal: @TT Ax0 B A A C B E E C *) assert (TG B A A C B G) by (conclude_def TG ). (* Goal: @TT Ax0 B A A C B E E C *) assert (TT B A A C B E E C) by (conclude_def TT ). (* Goal: @TT Ax0 B A A C B E E C *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_ABCequalsCBA. Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglestransitive. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_equalanglesreflexive : forall A B C, nCol A B C -> CongA A B C A B C. Proof. (* Goal: forall (A B C : @Point Ax0) (_ : @nCol Ax0 A B C), @CongA Ax0 A B C A B C *) intros. (* Goal: @CongA Ax0 A B C A B C *) assert (CongA A B C C B A) by (conclude lemma_ABCequalsCBA). (* Goal: @CongA Ax0 A B C A B C *) assert (nCol C B A) by (conclude lemma_equalanglesNC). (* Goal: @CongA Ax0 A B C A B C *) assert (CongA C B A A B C) by (conclude lemma_ABCequalsCBA). (* Goal: @CongA Ax0 A B C A B C *) assert (CongA A B C A B C) by (conclude lemma_equalanglestransitive). (* Goal: @CongA Ax0 A B C A B C *) close. Qed. End Euclid.
Set Implicit Arguments. Unset Strict Implicit. Require Export Abelian_group_cat. Require Export Group_facts. Section Sgroup. Variable S : ABELIAN_SGROUP. Lemma ABELIAN_SGROUP_com : forall x y : S, Equal (sgroup_law _ x y) (sgroup_law _ y x). Proof. (* Goal: forall x y : Carrier (sgroup_set (abelian_sgroup_sgroup S)), @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x y) (sgroup_law (abelian_sgroup_sgroup S) y x) *) exact (abelian_sgroup_com_prf S). Qed. Lemma ABELIAN_SGROUP_permute : forall x y z : S, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (abelian_sgroup_sgroup S)), @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) y z)) (sgroup_law (abelian_sgroup_sgroup S) y (sgroup_law (abelian_sgroup_sgroup S) x z)) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) y z)) (sgroup_law (abelian_sgroup_sgroup S) y (sgroup_law (abelian_sgroup_sgroup S) x z)) *) apply Trans with (sgroup_law S (sgroup_law S x y) z); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x y) z) (sgroup_law (abelian_sgroup_sgroup S) y (sgroup_law (abelian_sgroup_sgroup S) x z)) *) apply Trans with (sgroup_law S (sgroup_law S y x) z); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x y) z) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) y x) z) *) apply SGROUP_comp; auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x y) (sgroup_law (abelian_sgroup_sgroup S) y x) *) apply ABELIAN_SGROUP_com. Qed. Lemma ABELIAN_SGROUP4 : forall x y z t : S, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t)). Proof. (* Goal: forall x y z t : Carrier (sgroup_set (abelian_sgroup_sgroup S)), @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x y) (sgroup_law (abelian_sgroup_sgroup S) z t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) intros x y z t; try assumption. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x y) (sgroup_law (abelian_sgroup_sgroup S) z t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply Trans with (sgroup_law S x (sgroup_law S y (sgroup_law S z t))); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) y (sgroup_law (abelian_sgroup_sgroup S) z t))) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply Trans with (sgroup_law S x (sgroup_law S (sgroup_law S y z) t)); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) y z) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply Trans with (sgroup_law S x (sgroup_law S (sgroup_law S z y) t)); auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) y z) t)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) *) apply SGROUP_comp; auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) y z) t) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t) *) apply SGROUP_comp; auto with algebra. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) y z) (sgroup_law (abelian_sgroup_sgroup S) z y) *) apply ABELIAN_SGROUP_com. (* Goal: @Equal (sgroup_set (abelian_sgroup_sgroup S)) (sgroup_law (abelian_sgroup_sgroup S) x (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) z y) t)) (sgroup_law (abelian_sgroup_sgroup S) (sgroup_law (abelian_sgroup_sgroup S) x z) (sgroup_law (abelian_sgroup_sgroup S) y t)) *) apply Trans with (sgroup_law S x (sgroup_law S z (sgroup_law S y t))); auto with algebra. Qed. End Sgroup. Hint Immediate ABELIAN_SGROUP_com ABELIAN_SGROUP_permute ABELIAN_SGROUP4: algebra. Section Monoid. Variable M : ABELIAN_MONOID. Lemma ABELIAN_MONOID_com : forall x y : M, Equal (sgroup_law _ x y) (sgroup_law _ y x). Proof. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) x y) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) y x) *) change (forall x y : M:ABELIAN_SGROUP, Equal (sgroup_law _ x y) (sgroup_law _ y x)) in |- *; auto with algebra. Qed. Lemma ABELIAN_MONOID_permute : forall x y z : M, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) x (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) y z)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) y (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) x z)) *) change (forall x y z : M:ABELIAN_SGROUP, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z))) in |- *; auto with algebra. Qed. Lemma ABELIAN_MONOID4 : forall x y z t : M, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t)). Proof. (* Goal: forall x y z t : Carrier (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))), @Equal (sgroup_set (monoid_sgroup (abelian_monoid_monoid M))) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) x y) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) z t)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) x z) (sgroup_law (monoid_sgroup (abelian_monoid_monoid M)) y t)) *) change (forall x y z t : M:ABELIAN_SGROUP, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t))) in |- *; auto with algebra. Qed. End Monoid. Hint Immediate ABELIAN_MONOID_com ABELIAN_MONOID_permute ABELIAN_MONOID4: algebra. Section Group. Variable G : ABELIAN_GROUP. Lemma ABELIAN_GROUP_com : forall x y : G, Equal (sgroup_law _ x y) (sgroup_law _ y x). Proof. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) y x) *) change (forall x y : G:ABELIAN_SGROUP, Equal (sgroup_law _ x y) (sgroup_law _ y x)) in |- *; auto with algebra. Qed. Lemma ABELIAN_GROUP_permute : forall x y z : G, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) y (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) x z)) *) change (forall x y z : G:ABELIAN_SGROUP, Equal (sgroup_law _ x (sgroup_law _ y z)) (sgroup_law _ y (sgroup_law _ x z))) in |- *; auto with algebra. Qed. Lemma ABELIAN_GROUP4 : forall x y z t : G, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t)). Proof. (* Goal: forall x y z t : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group G)))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) x y) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) z t)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) x z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group G))) y t)) *) change (forall x y z t : G:ABELIAN_SGROUP, Equal (sgroup_law _ (sgroup_law _ x y) (sgroup_law _ z t)) (sgroup_law _ (sgroup_law _ x z) (sgroup_law _ y t))) in |- *; auto with algebra. Qed. End Group. Hint Immediate ABELIAN_GROUP_com ABELIAN_GROUP_permute ABELIAN_GROUP4: algebra.
Lemma neq0CiG G B : (#|G : B|)%:R != 0 :> algC. Proof. (* Goal: is_true (negb (@eq_op Algebraics.Implementation.eqType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@indexg gT (@gval gT G) B) : Algebraics.Implementation.type) (GRing.zero Algebraics.Implementation.zmodType : Algebraics.Implementation.type))) *) exact: natr_indexg_neq0. Qed. Lemma gt0CG G : 0 < #|G|%:R :> algC. Proof. exact: natrG_gt0. Qed. Proof. (* Goal: is_true (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero Algebraics.Implementation.zmodType : Algebraics.Implementation.type) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) : Algebraics.Implementation.type)) *) exact: natrG_gt0. Qed. Lemma algC'G G : [char algC]^'.-group G. Proof. (* Goal: is_true (@pgroup gT (negn (@GRing.char Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type))) (@gval gT G)) *) by apply/pgroupP=> p _; rewrite inE /= char_num. Qed. End AlgC. Section Defs. Variable gT : finGroupType. Definition is_class_fun (B : {set gT}) (f : {ffun gT -> algC}) := [forall x, forall y in B, f (x ^ y) == f x] && (support f \subset B). Lemma intro_class_fun (G : {group gT}) f : {in G &, forall x y, f (x ^ y) = f x} -> (forall x, x \notin G -> f x = 0) -> is_class_fun G (finfun f). Proof. (* Goal: forall (_ : @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (f (@conjg gT x y)) (f x)) (inPhantom (forall x y : FinGroup.arg_sort (FinGroup.base gT), @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (f (@conjg gT x y)) (f x)))) (_ : forall (x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (_ : is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))), @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (f x) (GRing.zero Algebraics.Implementation.zmodType)), is_true (is_class_fun (@gval gT G) (@FunFinfun.finfun (FinGroup.finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) f)) *) move=> fJ Gf; apply/andP; split; last first. (* Goal: is_true (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all_in (FinGroup.arg_finType (FinGroup.base gT)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.type (@FunFinfun.finfun (FinGroup.finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) f) (@conjg gT x y)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.type (@FunFinfun.finfun (FinGroup.finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) f) x))) y))) x)) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (simplPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@support_for (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.Zmodule.eqType Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.type (@FunFinfun.finfun (FinGroup.finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) f)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by apply/supportP=> x notAf; rewrite ffunE Gf. (* Goal: is_true (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all_in (FinGroup.arg_finType (FinGroup.base gT)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.type (@FunFinfun.finfun (FinGroup.finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) f) (@conjg gT x y)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.type (@FunFinfun.finfun (FinGroup.finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) f) x))) y))) x)) *) apply/'forall_eqfun_inP=> x y Gy; rewrite !ffunE. (* Goal: @eq (Equality.sort Algebraics.Implementation.eqType) (f (@conjg gT x y)) (f x) *) by have [/fJ-> // | notGx] := boolP (x \in G); rewrite !Gf ?groupJr. Qed. Definition Cfun := locked_with classfun_key (fun flag : nat => Classfun). Canonical cfun_subType := Eval hnf in [subType for cfun_val]. Definition cfun_eqMixin := Eval hnf in [eqMixin of classfun by <:]. Canonical cfun_eqType := Eval hnf in EqType classfun cfun_eqMixin. Definition cfun_choiceMixin := Eval hnf in [choiceMixin of classfun by <:]. Canonical cfun_choiceType := Eval hnf in ChoiceType classfun cfun_choiceMixin. Definition fun_of_cfun phi := cfun_val phi : gT -> algC. Coercion fun_of_cfun : classfun >-> Funclass. Lemma cfunElock k f fP : @Cfun k (finfun f) fP =1 f. Proof. (* Goal: @eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (fun_of_cfun (@Cfun k (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.type f) fP)) f *) by rewrite locked_withE; apply: ffunE. Qed. Lemma cfunE f fP : @Cfun 0 (finfun f) fP =1 f. Proof. (* Goal: @eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (fun_of_cfun (@Cfun O (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.type f) fP)) f *) exact: cfunElock. Qed. Lemma cfunP phi psi : phi =1 psi <-> phi = psi. Proof. (* Goal: iff (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (fun_of_cfun phi) (fun_of_cfun psi)) (@eq classfun phi psi) *) by split=> [/ffunP/val_inj | ->]. Qed. Lemma cfun0gen phi x : x \notin G -> phi x = 0. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))), @eq Algebraics.Implementation.type (fun_of_cfun phi x) (GRing.zero Algebraics.Implementation.zmodType) *) by case: phi => f fP; case: (andP fP) => _ /supportP; apply. Qed. Lemma cfun_in_genP phi psi : {in G, phi =1 psi} -> phi = psi. Proof. (* Goal: forall _ : @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (fun_of_cfun phi x) (fun_of_cfun psi x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (fun_of_cfun phi) (fun_of_cfun psi))), @eq classfun phi psi *) move=> eq_phi; apply/cfunP=> x. (* Goal: @eq Algebraics.Implementation.type (fun_of_cfun phi x) (fun_of_cfun psi x) *) by have [/eq_phi-> // | notAx] := boolP (x \in G); rewrite !cfun0gen. Qed. Lemma cfunJgen phi x y : y \in G -> phi (x ^ y) = phi x. Fact cfun_zero_subproof : is_class_fun G (0 : {ffun _}). Proof. (* Goal: is_true (is_class_fun (@generated gT B) (GRing.zero (ffun_zmodType (FinGroup.arg_finType (FinGroup.base gT)) Algebraics.Implementation.zmodType) : @finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), GRing.Zmodule.sort Algebraics.Implementation.zmodType)))) *) exact: intro_class_fun. Qed. Definition cfun_zero := Cfun 0 cfun_zero_subproof. Fact cfun_comp_subproof f phi : f 0 = 0 -> is_class_fun G [ffun x => f (phi x)]. Proof. (* Goal: forall _ : @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (f (GRing.zero Algebraics.Implementation.zmodType)) (GRing.zero Algebraics.Implementation.zmodType), is_true (is_class_fun (@generated gT B) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => f (fun_of_cfun phi x)))) *) by move=> f0; apply: intro_class_fun => [x y _ /cfunJgen | x /cfun0gen] ->. Qed. Definition cfun_comp f f0 phi := Cfun 0 (@cfun_comp_subproof f phi f0). Definition cfun_opp := cfun_comp (oppr0 _). Fact cfun_add_subproof phi psi : is_class_fun G [ffun x => phi x + psi x]. Proof. (* Goal: is_true (is_class_fun (@generated gT B) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.add Algebraics.Implementation.zmodType (fun_of_cfun phi x) (fun_of_cfun psi x)))) *) apply: intro_class_fun => [x y Gx Gy | x notGx]; rewrite ?cfunJgen //. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (fun_of_cfun phi x) (fun_of_cfun psi x)) (GRing.zero Algebraics.Implementation.zmodType) *) by rewrite !cfun0gen ?add0r. Qed. Definition cfun_add phi psi := Cfun 0 (cfun_add_subproof phi psi). Fact cfun_indicator_subproof (A : {set gT}) : is_class_fun G [ffun x => ((x \in G) && (x ^: G \subset A))%:R]. Proof. (* Goal: is_true (is_class_fun (@generated gT B) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@generated gT B)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))))) *) apply: intro_class_fun => [x y Gx Gy | x /negbTE/= -> //]. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT (@conjg gT x y) (@generated gT B)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@generated gT B)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))) *) by rewrite groupJr ?classGidl. Qed. Definition cfun_indicator A := Cfun 1 (cfun_indicator_subproof A). Local Notation "''1_' A" := (cfun_indicator A) : ring_scope. Lemma cfun1Egen x : '1_G x = (x \in G)%:R. Proof. (* Goal: @eq Algebraics.Implementation.type (fun_of_cfun (cfun_indicator (@generated gT B)) x) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))))) *) by rewrite cfunElock andb_idr // => /class_subG->. Qed. Fact cfun_mul_subproof phi psi : is_class_fun G [ffun x => phi x * psi x]. Proof. (* Goal: is_true (is_class_fun (@generated gT B) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Ring.sort Algebraics.Implementation.ringType) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.mul Algebraics.Implementation.ringType (fun_of_cfun phi x) (fun_of_cfun psi x)))) *) apply: intro_class_fun => [x y Gx Gy | x notGx]; rewrite ?cfunJgen //. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.mul Algebraics.Implementation.ringType (fun_of_cfun phi x) (fun_of_cfun psi x)) (GRing.zero Algebraics.Implementation.zmodType) *) by rewrite cfun0gen ?mul0r. Qed. Definition cfun_mul phi psi := Cfun 0 (cfun_mul_subproof phi psi). Definition cfun_unit := [pred phi : classfun | [forall x in G, phi x != 0]]. Definition cfun_inv phi := if phi \in cfun_unit then cfun_comp (invr0 _) phi else phi. Definition cfun_scale a := cfun_comp (mulr0 a). Fact cfun_addA : associative cfun_add. Proof. (* Goal: @associative classfun cfun_add *) by move=> phi psi xi; apply/cfunP=> x; rewrite !cfunE addrA. Qed. Fact cfun_addC : commutative cfun_add. Proof. (* Goal: @commutative classfun classfun cfun_add *) by move=> phi psi; apply/cfunP=> x; rewrite !cfunE addrC. Qed. Fact cfun_add0 : left_id cfun_zero cfun_add. Proof. (* Goal: @left_id classfun classfun cfun_zero cfun_add *) by move=> phi; apply/cfunP=> x; rewrite !cfunE add0r. Qed. Fact cfun_addN : left_inverse cfun_zero cfun_opp cfun_add. Proof. (* Goal: @left_inverse classfun classfun classfun cfun_zero cfun_opp cfun_add *) by move=> phi; apply/cfunP=> x; rewrite !cfunE addNr. Qed. Definition cfun_zmodMixin := ZmodMixin cfun_addA cfun_addC cfun_add0 cfun_addN. Canonical cfun_zmodType := ZmodType classfun cfun_zmodMixin. Lemma muln_cfunE phi n x : (phi *+ n) x = phi x *+ n. Proof. (* Goal: @eq Algebraics.Implementation.type (fun_of_cfun (@GRing.natmul cfun_zmodType phi n) x) (@GRing.natmul Algebraics.Implementation.zmodType (fun_of_cfun phi x) n) *) by elim: n => [|n IHn]; rewrite ?mulrS !cfunE ?IHn. Qed. Lemma sum_cfunE I r (P : pred I) (phi : I -> classfun) x : (\sum_(i <- r | P i) phi i) x = \sum_(i <- r | P i) (phi i) x. Proof. (* Goal: @eq Algebraics.Implementation.type (fun_of_cfun (@BigOp.bigop (GRing.Zmodule.sort cfun_zmodType) I (GRing.zero cfun_zmodType) r (fun i : I => @BigBody (GRing.Zmodule.sort cfun_zmodType) I i (@GRing.add cfun_zmodType) (P i) (phi i))) x) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) I (GRing.zero Algebraics.Implementation.zmodType) r (fun i : I => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) I i (@GRing.add Algebraics.Implementation.zmodType) (P i) (fun_of_cfun (phi i) x))) *) by elim/big_rec2: _ => [|i _ psi _ <-]; rewrite cfunE. Qed. Fact cfun_mulA : associative cfun_mul. Proof. (* Goal: @associative classfun cfun_mul *) by move=> phi psi xi; apply/cfunP=> x; rewrite !cfunE mulrA. Qed. Fact cfun_mulC : commutative cfun_mul. Proof. (* Goal: @commutative classfun classfun cfun_mul *) by move=> phi psi; apply/cfunP=> x; rewrite !cfunE mulrC. Qed. Fact cfun_mul1 : left_id '1_G cfun_mul. Proof. (* Goal: @left_id classfun classfun (cfun_indicator (@generated gT B)) cfun_mul *) by move=> phi; apply: cfun_in_genP => x Gx; rewrite !cfunE cfun1Egen Gx mul1r. Qed. Fact cfun_mulD : left_distributive cfun_mul cfun_add. Proof. (* Goal: @left_distributive classfun classfun cfun_mul cfun_add *) by move=> phi psi xi; apply/cfunP=> x; rewrite !cfunE mulrDl. Qed. Fact cfun_nz1 : '1_G != 0. Proof. (* Goal: is_true (negb (@eq_op cfun_eqType (cfun_indicator (@generated gT B)) (GRing.zero cfun_zmodType))) *) by apply/eqP=> /cfunP/(_ 1%g)/eqP; rewrite cfun1Egen cfunE group1 oner_eq0. Qed. Definition cfun_ringMixin := ComRingMixin cfun_mulA cfun_mulC cfun_mul1 cfun_mulD cfun_nz1. Canonical cfun_ringType := RingType classfun cfun_ringMixin. Canonical cfun_comRingType := ComRingType classfun cfun_mulC. Lemma expS_cfunE phi n x : (phi ^+ n.+1) x = phi x ^+ n.+1. Proof. (* Goal: @eq Algebraics.Implementation.type (fun_of_cfun (@GRing.exp cfun_ringType phi (S n)) x) (@GRing.exp Algebraics.Implementation.ringType (fun_of_cfun phi x) (S n)) *) by elim: n => //= n IHn; rewrite !cfunE IHn. Qed. Fact cfun_mulV : {in cfun_unit, left_inverse 1 cfun_inv *%R}. Proof. (* Goal: @prop_in1 classfun (@mem classfun (simplPredType classfun) cfun_unit) (fun x : classfun => @eq (GRing.Ring.sort cfun_ringType) (@GRing.mul cfun_ringType (cfun_inv x) x) (GRing.one cfun_ringType)) (inPhantom (@left_inverse classfun classfun (GRing.Ring.sort cfun_ringType) (GRing.one cfun_ringType) cfun_inv (@GRing.mul cfun_ringType))) *) move=> phi Uphi; rewrite /cfun_inv Uphi; apply/cfun_in_genP=> x Gx. (* Goal: @eq Algebraics.Implementation.type (fun_of_cfun (@GRing.mul cfun_ringType (@cfun_comp (@GRing.inv Algebraics.Implementation.unitRingType) (invr0 Algebraics.Implementation.unitRingType) phi) phi) x) (fun_of_cfun (GRing.one cfun_ringType) x) *) by rewrite !cfunE cfun1Egen Gx mulVf ?(forall_inP Uphi). Qed. Fact cfun_unitP phi psi : psi * phi = 1 -> phi \in cfun_unit. Fact cfun_inv0id : {in [predC cfun_unit], cfun_inv =1 id}. Proof. (* Goal: @prop_in1 classfun (@mem classfun (simplPredType classfun) (@predC classfun (@pred_of_simpl classfun (@pred_of_mem_pred classfun (@mem classfun (simplPredType classfun) cfun_unit))))) (fun x : classfun => @eq classfun (cfun_inv x) ((fun x0 : classfun => x0) x)) (inPhantom (@eqfun classfun classfun cfun_inv (fun x : classfun => x))) *) by rewrite /cfun_inv => phi /negbTE/= ->. Qed. Definition cfun_unitMixin := ComUnitRingMixin cfun_mulV cfun_unitP cfun_inv0id. Canonical cfun_unitRingType := UnitRingType classfun cfun_unitMixin. Canonical cfun_comUnitRingType := [comUnitRingType of classfun]. Fact cfun_scaleA a b phi : cfun_scale a (cfun_scale b phi) = cfun_scale (a * b) phi. Proof. (* Goal: @eq classfun (cfun_scale a (cfun_scale b phi)) (cfun_scale (@GRing.mul Algebraics.Implementation.ringType a b) phi) *) by apply/cfunP=> x; rewrite !cfunE mulrA. Qed. Fact cfun_scale1 : left_id 1 cfun_scale. Proof. (* Goal: @left_id (GRing.Ring.sort Algebraics.Implementation.ringType) classfun (GRing.one Algebraics.Implementation.ringType) cfun_scale *) by move=> phi; apply/cfunP=> x; rewrite !cfunE mul1r. Qed. Fact cfun_scaleDr : right_distributive cfun_scale +%R. Proof. (* Goal: @right_distributive (GRing.Ring.sort Algebraics.Implementation.ringType) classfun cfun_scale (@GRing.add cfun_zmodType) *) by move=> a phi psi; apply/cfunP=> x; rewrite !cfunE mulrDr. Qed. Fact cfun_scaleDl phi : {morph cfun_scale^~ phi : a b / a + b}. Proof. (* Goal: @morphism_2 (GRing.Ring.sort Algebraics.Implementation.ringType) classfun (fun x : GRing.Ring.sort Algebraics.Implementation.ringType => cfun_scale x phi) (fun a b : GRing.Ring.sort Algebraics.Implementation.ringType => @GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) a b) (fun a b : classfun => @GRing.add cfun_zmodType a b) *) by move=> a b; apply/cfunP=> x; rewrite !cfunE mulrDl. Qed. Definition cfun_lmodMixin := LmodMixin cfun_scaleA cfun_scale1 cfun_scaleDr cfun_scaleDl. Canonical cfun_lmodType := LmodType algC classfun cfun_lmodMixin. Fact cfun_scaleAl a phi psi : a *: (phi * psi) = (a *: phi) * psi. Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType)))) (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType a (@GRing.mul cfun_ringType phi psi)) (@GRing.mul cfun_ringType (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType a phi) psi) *) by apply/cfunP=> x; rewrite !cfunE mulrA. Qed. Fact cfun_scaleAr a phi psi : a *: (phi * psi) = phi * (a *: psi). Proof. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType)))) (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType a (@GRing.mul cfun_ringType phi psi)) (@GRing.mul cfun_ringType phi (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType a psi)) *) by rewrite !(mulrC phi) cfun_scaleAl. Qed. Canonical cfun_lalgType := LalgType algC classfun cfun_scaleAl. Canonical cfun_algType := AlgType algC classfun cfun_scaleAr. Canonical cfun_unitAlgType := [unitAlgType algC of classfun]. Section Automorphism. Variable u : {rmorphism algC -> algC}. Definition cfAut := cfun_comp (rmorph0 u). Lemma cfAut_cfun1i A : cfAut '1_A = '1_A. Proof. (* Goal: @eq classfun (cfAut (cfun_indicator A)) (cfun_indicator A) *) by apply/cfunP=> x; rewrite !cfunElock rmorph_nat. Qed. Lemma cfAutZ a phi : cfAut (a *: phi) = u a *: cfAut phi. Proof. (* Goal: @eq classfun (cfAut (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType a phi)) (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u a) (cfAut phi)) *) by apply/cfunP=> x; rewrite !cfunE rmorphM. Qed. Lemma cfAut_is_rmorphism : rmorphism cfAut. Proof. (* Goal: @GRing.RMorphism.class_of cfun_ringType cfun_ringType cfAut *) by do 2?split=> [phi psi|]; apply/cfunP=> x; rewrite ?cfAut_cfun1i // !cfunE (rmorphB, rmorphM). Qed. Lemma cfAut_scalable : scalable_for (u \; *:%R) cfAut. Proof. (* Goal: @GRing.Linear.mixin_of Algebraics.Implementation.ringType cfun_lmodType (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType))) (@catcomp (forall _ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType)))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) tt (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u) (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType)) cfAut *) by move=> a phi; apply/cfunP=> x; rewrite !cfunE rmorphM. Qed. Canonical cfAut_linear := AddLinear cfAut_scalable. Canonical cfAut_lrmorphism := [lrmorphism of cfAut]. Definition cfAut_closed (S : seq classfun) := {in S, forall phi, cfAut phi \in S}. End Automorphism. Definition cfReal phi := cfAut conjC phi == phi. Definition cfConjC_subset (S1 S2 : seq classfun) := [/\ uniq S1, {subset S1 <= S2} & cfAut_closed conjC S1]. Fact cfun_vect_iso : Vector.axiom #|classes G| classfun. Proof. (* Goal: @Vector.axiom_def Algebraics.Implementation.ringType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))))) cfun_lmodType (Phant classfun) *) exists (fun phi => \row_i phi (repr (enum_val i))) => [a phi psi|]. (* Goal: @bijective (matrix (GRing.Ring.sort Algebraics.Implementation.ringType) (S O) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)))))) (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (fun phi : classfun => @matrix_of_fun Algebraics.Implementation.type (S O) (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x))) matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x0 : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x0))))) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) *) (* Goal: @eq (GRing.Zmodule.sort (matrix_zmodType (GRing.Ring.zmodType Algebraics.Implementation.ringType) (S O) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))))))) (@matrix_of_fun Algebraics.Implementation.type (S O) (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x))) matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x0 : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x0))))) => fun_of_cfun (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType))) (@GRing.scale Algebraics.Implementation.ringType cfun_lmodType a phi) psi) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) (@GRing.add (matrix_zmodType (GRing.Ring.zmodType Algebraics.Implementation.ringType) (S O) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)))))) (@GRing.scale Algebraics.Implementation.ringType (matrix_lmodType Algebraics.Implementation.ringType (S O) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)))))) a (@matrix_of_fun Algebraics.Implementation.type (S O) (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x))) matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x0 : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x0))))) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i))))) (@matrix_of_fun Algebraics.Implementation.type (S O) (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x))) matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x0 : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x0))))) => fun_of_cfun psi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i))))) *) by apply/rowP=> i; rewrite !(mxE, cfunE). (* Goal: @bijective (matrix (GRing.Ring.sort Algebraics.Implementation.ringType) (S O) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)))))) (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (fun phi : classfun => @matrix_of_fun Algebraics.Implementation.type (S O) (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x))) matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (fun x0 : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B)) x0))))) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) *) set n := #|_|; pose eK x : 'I_n := enum_rank_in (classes1 _) (x ^: G). (* Goal: @bijective (matrix (GRing.Ring.sort Algebraics.Implementation.ringType) (S O) n) (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (fun phi : classfun => @matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) *) have rV2vP v : is_class_fun G [ffun x => v (eK x) *+ (x \in G)]. (* Goal: @bijective (matrix (GRing.Ring.sort Algebraics.Implementation.ringType) (S O) n) (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (fun phi : classfun => @matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) *) (* Goal: is_true (is_class_fun (@generated gT B) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.natmul Algebraics.Implementation.zmodType (v (eK x)) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))))))) *) apply: intro_class_fun => [x y Gx Gy | x /negbTE/=-> //]. (* Goal: @bijective (matrix (GRing.Ring.sort Algebraics.Implementation.ringType) (S O) n) (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (fun phi : classfun => @matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) *) (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.natmul Algebraics.Implementation.zmodType (v (eK (@conjg gT x y))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))))) (@GRing.natmul Algebraics.Implementation.zmodType (v (eK x)) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))))) *) by rewrite groupJr // /eK classGidl. (* Goal: @bijective (matrix (GRing.Ring.sort Algebraics.Implementation.ringType) (S O) n) (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) cfun_lmodType) (fun phi : classfun => @matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) *) exists (fun v : 'rV_n => Cfun 0 (rV2vP (v 0))) => [phi | v]. (* Goal: @eq (matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n) (@matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun (@Cfun O (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.natmul Algebraics.Implementation.zmodType (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O)) (eK x0)) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x0 (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))))) (rV2vP (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O))))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) v *) (* Goal: @eq classfun (@Cfun O (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.natmul Algebraics.Implementation.zmodType (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n (@matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) (GRing.zero (Zp_zmodType O)) (eK x)) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))))) (rV2vP (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n (@matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun phi (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) (GRing.zero (Zp_zmodType O))))) phi *) apply/cfun_in_genP=> x Gx; rewrite cfunE Gx mxE enum_rankK_in ?mem_classes //. (* Goal: @eq (matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n) (@matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun (@Cfun O (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.natmul Algebraics.Implementation.zmodType (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O)) (eK x0)) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x0 (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))))) (rV2vP (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O))))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) v *) (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (fun_of_cfun phi (@repr (FinGroup.base gT) (@class gT x (@generated gT B)))) (nat_of_bool true)) (fun_of_cfun phi x) *) by have [y Gy ->] := repr_class <<B>> x; rewrite cfunJgen. (* Goal: @eq (matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n) (@matrix_of_fun Algebraics.Implementation.type (S O) n matrix_key (fun (_ : Finite.sort (ordinal_finType (S O))) (i : Finite.sort (ordinal_finType n)) => fun_of_cfun (@Cfun O (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @GRing.natmul Algebraics.Implementation.zmodType (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O)) (eK x0)) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x0 (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))))) (rV2vP (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O))))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) v *) apply/rowP=> i; rewrite mxE cfunE; have /imsetP[x Gx def_i] := enum_valP i. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O)) (eK (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@generated gT B))) i)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))))) (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O)) i) *) rewrite def_i; have [y Gy ->] := repr_class <<B>> x. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O)) (eK (@conjg gT x y))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@conjg gT x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))))) (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) n v (GRing.zero (Zp_zmodType O)) i) *) by rewrite groupJ // /eK classGidl // -def_i enum_valK_in. Qed. Definition cfun_vectMixin := VectMixin cfun_vect_iso. Canonical cfun_vectType := VectType algC classfun cfun_vectMixin. Canonical cfun_FalgType := [FalgType algC of classfun]. Definition cfun_base A : #|classes B ::&: A|.-tuple classfun := [tuple of [seq '1_xB | xB in classes B ::&: A]]. Definition classfun_on A := <<cfun_base A>>%VS. Definition cfdot phi psi := #|B|%:R^-1 * \sum_(x in B) phi x * (psi x)^*. Definition cfdotr_head k psi phi := let: tt := k in cfdot phi psi. Definition cfnorm_head k phi := let: tt := k in cfdot phi phi. Coercion seq_of_cfun phi := [:: phi]. Definition cforder phi := \big[lcmn/1%N]_(x in <<B>>) #[phi x]%C. End Defs. Bind Scope cfun_scope with classfun. Arguments classfun {gT} B%g. Arguments classfun_on {gT} B%g A%g. Arguments cfun_indicator {gT} B%g. Arguments cfAut {gT B%g} u phi%CF. Arguments cfReal {gT B%g} phi%CF. Arguments cfdot {gT B%g} phi%CF psi%CF. Arguments cfdotr_head {gT B%g} k psi%CF phi%CF. Notation "''CF' ( G )" := (classfun G) : type_scope. Notation "''CF' ( G )" := (@fullv _ (cfun_vectType G)) : vspace_scope. Notation "''1_' A" := (cfun_indicator _ A) : ring_scope. Notation "''CF' ( G , A )" := (classfun_on G A) : ring_scope. Notation "1" := (@GRing.one (cfun_ringType _)) (only parsing) : cfun_scope. Notation "phi ^*" := (cfAut conjC phi) : cfun_scope. Notation cfConjC_closed := (cfAut_closed conjC). Prenex Implicits cfReal. Notation eqcfP := (@eqP (cfun_eqType _) _ _) (only parsing). Notation "#[ phi ]" := (cforder phi) : cfun_scope. Notation "''[' u , v ]_ G":= (@cfdot _ G u v) (only parsing) : ring_scope. Notation "''[' u , v ]" := (cfdot u v) : ring_scope. Notation "''[' u ]_ G" := '[u, u]_G (only parsing) : ring_scope. Notation "''[' u ]" := '[u, u] : ring_scope. Notation cfdotr := (cfdotr_head tt). Notation cfnorm := (cfnorm_head tt). Section Predicates. Variables (gT rT : finGroupType) (D : {set gT}) (R : {set rT}). Implicit Types (phi psi : 'CF(D)) (S : seq 'CF(D)) (tau : 'CF(D) -> 'CF(R)). Definition cfker phi := [set x in D | [forall y, phi (x * y)%g == phi y]]. Definition cfaithful phi := cfker phi \subset [1]. Definition ortho_rec S1 S2 := all [pred phi | all [pred psi | '[phi, psi] == 0] S2] S1. Fixpoint pair_ortho_rec S := if S is psi :: S' then ortho_rec psi S' && pair_ortho_rec S' else true. Definition pairwise_orthogonal S := (0 \notin S) && pair_ortho_rec S. Definition orthonormal S := all [pred psi | '[psi] == 1] S && pair_ortho_rec S. Definition isometry tau := forall phi psi, '[tau phi, tau psi] = '[phi, psi]. Definition isometry_from_to mCFD tau mCFR := prop_in2 mCFD (inPhantom (isometry tau)) /\ prop_in1 mCFD (inPhantom (forall phi, in_mem (tau phi) mCFR)). End Predicates. Definition orthogonal gT D S1 S2 := nosimpl (@ortho_rec gT D S1 S2). Arguments cfker {gT D%g} phi%CF. Arguments cfaithful {gT D%g} phi%CF. Arguments orthogonal {gT D%g} S1%CF S2%CF. Arguments pairwise_orthogonal {gT D%g} S%CF. Arguments orthonormal {gT D%g} S%CF. Arguments isometry {gT rT D%g R%g} tau%CF. Notation "{ 'in' CFD , 'isometry' tau , 'to' CFR }" := (isometry_from_to (mem CFD) tau (mem CFR)) (at level 0, format "{ 'in' CFD , 'isometry' tau , 'to' CFR }") : type_scope. Section ClassFun. Variables (gT : finGroupType) (G : {group gT}). Implicit Types (A B : {set gT}) (H K : {group gT}) (phi psi xi : 'CF(G)). Local Notation "''1_' A" := (cfun_indicator G A). Lemma cfun0 phi x : x \notin G -> phi x = 0. Proof. (* Goal: forall _ : is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi x) (GRing.zero Algebraics.Implementation.zmodType) *) by rewrite -{1}(genGid G) => /(cfun0gen phi). Qed. Lemma support_cfun phi : support phi \subset G. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (simplPredType (FinGroup.arg_sort (FinGroup.base gT))) (@support_for (FinGroup.arg_sort (FinGroup.base gT)) (GRing.Zmodule.eqType Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@fun_of_cfun gT (@gval gT G) phi))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by apply/subsetP=> g; apply: contraR => /cfun0->. Qed. Lemma cfunJ phi x y : y \in G -> phi (x ^ y) = phi x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi (@conjg gT x y)) (@fun_of_cfun gT (@gval gT G) phi x) *) by rewrite -{1}(genGid G) => /(cfunJgen phi)->. Qed. Lemma cfun_repr phi x : phi (repr (x ^: G)) = phi x. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi (@repr (FinGroup.base gT) (@class gT x (@gval gT G)))) (@fun_of_cfun gT (@gval gT G) phi x) *) by have [y Gy ->] := repr_class G x; apply: cfunJ. Qed. Lemma cfun_inP phi psi : {in G, phi =1 psi} -> phi = psi. Proof. (* Goal: forall _ : @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi x) (@fun_of_cfun gT (@gval gT G) psi x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) phi) (@fun_of_cfun gT (@gval gT G) psi))), @eq (@classfun gT (@gval gT G)) phi psi *) by rewrite -{1}genGid => /cfun_in_genP. Qed. Lemma cfuniE A x : A <| G -> '1_A x = (x \in A)%:R. Proof. (* Goal: forall _ : is_true (@normal gT A (@gval gT G)), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) A) x) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) *) case/andP=> sAG nAG; rewrite cfunElock genGid. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) *) by rewrite class_sub_norm // andb_idl // => /(subsetP sAG). Qed. Lemma support_cfuni A : A <| G -> support '1_A =i A. Proof. (* Goal: forall _ : is_true (@normal gT A (@gval gT G)), @eq_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (simplPredType (FinGroup.arg_sort (FinGroup.base gT))) (@support_for (FinGroup.arg_sort (FinGroup.base gT)) (GRing.Zmodule.eqType Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) *) by move=> nsAG x; rewrite !inE cfuniE // pnatr_eq0 -lt0n lt0b. Qed. Lemma eq_mul_cfuni A phi : A <| G -> {in A, phi * '1_A =1 phi}. Proof. (* Goal: forall _ : is_true (@normal gT A (@gval gT G)), @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.mul (@cfun_ringType gT (@gval gT G)) phi (@cfun_indicator gT (@gval gT G) A)) x) (@fun_of_cfun gT (@gval gT G) phi x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@GRing.mul (@cfun_ringType gT (@gval gT G)) phi (@cfun_indicator gT (@gval gT G) A))) (@fun_of_cfun gT (@gval gT G) phi))) *) by move=> nsAG x Ax; rewrite cfunE cfuniE // Ax mulr1. Qed. Lemma eq_cfuni A : A <| G -> {in A, '1_A =1 (1 : 'CF(G))}. Proof. (* Goal: forall _ : is_true (@normal gT A (@gval gT G)), @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) A) x) (@fun_of_cfun gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G)) : @classfun gT (@gval gT G)) x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) A)) (@fun_of_cfun gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G)) : @classfun gT (@gval gT G))))) *) by rewrite -['1_A]mul1r; apply: eq_mul_cfuni. Qed. Lemma cfuniG : '1_G = 1. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) (@gval gT G)) (GRing.one (@cfun_ringType gT (@gval gT G))) *) by rewrite -[G in '1_G]genGid. Qed. Lemma cfun1E g : (1 : 'CF(G)) g = (g \in G)%:R. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G)) : @classfun gT (@gval gT G)) g) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) *) by rewrite -cfuniG cfuniE. Qed. Lemma cfun11 : (1 : 'CF(G)) 1%g = 1. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G)) : @classfun gT (@gval gT G)) (oneg (FinGroup.base gT))) (GRing.one Algebraics.Implementation.ringType) *) by rewrite cfun1E group1. Qed. Lemma prod_cfunE I r (P : pred I) (phi : I -> 'CF(G)) x : x \in G -> (\prod_(i <- r | P i) phi i) x = \prod_(i <- r | P i) (phi i) x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@BigOp.bigop (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) I (GRing.one (@cfun_ringType gT (@gval gT G))) r (fun i : I => @BigBody (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) I i (@GRing.mul (@cfun_ringType gT (@gval gT G))) (P i) (phi i))) x) (@BigOp.bigop (GRing.Ring.sort Algebraics.Implementation.ringType) I (GRing.one Algebraics.Implementation.ringType) r (fun i : I => @BigBody (GRing.Ring.sort Algebraics.Implementation.ringType) I i (@GRing.mul Algebraics.Implementation.ringType) (P i) (@fun_of_cfun gT (@gval gT G) (phi i) x))) *) by move=> Gx; elim/big_rec2: _ => [|i _ psi _ <-]; rewrite ?cfunE ?cfun1E ?Gx. Qed. Lemma exp_cfunE phi n x : x \in G -> (phi ^+ n) x = phi x ^+ n. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.exp (@cfun_ringType gT (@gval gT G)) phi n) x) (@GRing.exp Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) n) *) by rewrite -[n]card_ord -!prodr_const; apply: prod_cfunE. Qed. Lemma mul_cfuni A B : '1_A * '1_B = '1_(A :&: B) :> 'CF(G). Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@GRing.mul (@cfun_ringType gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) A) (@cfun_indicator gT (@gval gT G) B)) (@cfun_indicator gT (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B)) *) apply/cfunP=> g; rewrite !cfunElock -natrM mulnb subsetI. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT g (@generated gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT g (@generated gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))))))) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@gval gT G))))) (andb (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT g (@generated gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT g (@generated gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) B))))))) *) by rewrite andbCA !andbA andbb. Qed. Lemma cfun_classE x y : '1_(x ^: G) y = ((x \in G) && (y \in x ^: G))%:R. Lemma cfun_on_sum A : 'CF(G, A) = (\sum_(xG in classes G | xG \subset A) <['1_xG]>)%VS. Proof. (* Goal: @eq (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (@classfun_on gT (@gval gT G) A) (@BigOp.bigop (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun xG : Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))) => @BigBody (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) (andb (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) xG)))) *) rewrite ['CF(G, A)]span_def big_map big_filter. (* Goal: @eq (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (@BigOp.bigop (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.EnumDef.enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun i : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) => @BigBody (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) i (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@pred_of_mem_pred (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) i) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) i)))) (@BigOp.bigop (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun xG : Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))) => @BigBody (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) (andb (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) xG)))) *) by apply: eq_bigl => xG; rewrite !inE. Qed. Lemma cfun_onP A phi : reflect (forall x, x \notin A -> phi x = 0) (phi \in 'CF(G, A)). Arguments cfun_onP {A phi}. Lemma cfun_on0 A phi x : phi \in 'CF(G, A) -> x \notin A -> phi x = 0. Proof. (* Goal: forall (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A))))) (_ : is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi x) (GRing.zero Algebraics.Implementation.zmodType) *) by move/cfun_onP; apply. Qed. Lemma sum_by_classes (R : ringType) (F : gT -> R) : {in G &, forall g h, F (g ^ h) = F g} -> \sum_(g in G) F g = \sum_(xG in classes G) #|xG|%:R * F (repr xG). Proof. (* Goal: forall _ : @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun g h : FinGroup.arg_sort (FinGroup.base gT) => @eq (GRing.Ring.sort R) (F (@conjg gT g h)) (F g)) (inPhantom (forall g h : FinGroup.arg_sort (FinGroup.base gT), @eq (GRing.Ring.sort R) (F (@conjg gT g h)) (F g))), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType R)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun g : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@GRing.add (GRing.Ring.zmodType R)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (F g))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType R)) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun xG : Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType R)) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@GRing.add (GRing.Ring.zmodType R)) (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@GRing.mul R (@GRing.natmul (GRing.Ring.zmodType R) (GRing.one R) (@card (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)))) (F (@repr (FinGroup.base gT) xG))))) *) move=> FJ; rewrite {1}(partition_big _ _ ((@mem_classes gT)^~ G)) /=. (* Goal: @eq (GRing.Ring.sort R) (@BigOp.bigop (GRing.Ring.sort R) (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType R)) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun j : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @BigBody (GRing.Ring.sort R) (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) j (@GRing.add (GRing.Ring.zmodType R)) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) j) (@BigOp.bigop (GRing.Ring.sort R) (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType R)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (GRing.Ring.sort R) (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType R)) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@class gT i (@gval gT G)) j)) (F i))))) (@BigOp.bigop (GRing.Ring.sort R) (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType R)) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun xG : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @BigBody (GRing.Ring.sort R) (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@GRing.add (GRing.Ring.zmodType R)) (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@GRing.mul R (@GRing.natmul (GRing.Ring.zmodType R) (GRing.one R) (@card (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)))) (F (@repr (FinGroup.base gT) xG))))) *) apply: eq_bigr => _ /imsetP[x Gx ->]; have [y Gy ->] := repr_class G x. (* Goal: @eq (GRing.Ring.sort R) (@BigOp.bigop (GRing.Ring.sort R) (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType R)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (GRing.Ring.sort R) (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType R)) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@class gT i (@gval gT G)) (@class gT x (@gval gT G)))) (F i))) (@GRing.mul R (@GRing.natmul (GRing.Ring.zmodType R) (GRing.one R) (@card (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G)))))) (F (@conjg gT x y))) *) rewrite mulr_natl -sumr_const FJ {y Gy}//; apply/esym/eq_big=> y /=. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) y (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G))))), @eq (GRing.Ring.sort R) (F x) (F y) *) (* Goal: @eq bool (@in_mem (FinGroup.sort (FinGroup.base gT)) y (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G))))) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@class gT y (@gval gT G)) (@class gT x (@gval gT G)))) *) apply/idP/andP=> [xGy | [Gy /eqP<-]]; last exact: class_refl. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) y (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G))))), @eq (GRing.Ring.sort R) (F x) (F y) *) (* Goal: and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (is_true (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@class gT y (@gval gT G)) (@class gT x (@gval gT G)))) *) by rewrite (class_eqP xGy) (subsetP (class_subG Gx (subxx _))). (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) y (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G))))), @eq (GRing.Ring.sort R) (F x) (F y) *) by case/imsetP=> z Gz ->; rewrite FJ. Qed. Lemma cfun_base_free A : free (cfun_base G A). Proof. (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@classfun gT (@gval gT G)) (@cfun_base gT (@gval gT G) A))) *) have b_i (i : 'I_#|classes G ::&: A|) : (cfun_base G A)`_i = '1_(enum_val i). (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@classfun gT (@gval gT G)) (@cfun_base gT (@gval gT G) A))) *) (* Goal: @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@classfun gT (@gval gT G)) (@cfun_base gT (@gval gT G) A)) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) i)) (@cfun_indicator gT (@gval gT G) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i)) *) by rewrite /enum_val -!tnth_nth tnth_map. (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@classfun gT (@gval gT G)) (@cfun_base gT (@gval gT G) A))) *) apply/freeP => s S0 i; move/cfunP/(_ (repr (enum_val i))): S0. (* Goal: forall _ : @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))))) (fun i : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A))))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))) (s i) (@nth (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@cfun_base gT (@gval gT G) A)) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) i))))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))) (@fun_of_cfun gT (@gval gT G) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))), @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (s i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) rewrite sum_cfunE (bigD1 i) //= big1 ?addr0 => [|j]. (* Goal: forall _ : is_true (negb (@eq_op (Finite.eqType (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))))) j i)), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (s j) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (@image_mem (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@classfun gT (@gval gT G)) (fun xB : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @cfun_indicator gT (@gval gT G) xB) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) j))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))) (GRing.zero Algebraics.Implementation.zmodType) *) (* Goal: forall _ : @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (s i) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (@image_mem (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@classfun gT (@gval gT G)) (fun xB : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @cfun_indicator gT (@gval gT G) xB) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) i))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))) (@fun_of_cfun gT (@gval gT G) (GRing.zero (@GRing.Zmodule.Pack (@classfun gT (@gval gT G)) (@GRing.Zmodule.Class (@classfun gT (@gval gT G)) (@Choice.Class (@classfun gT (@gval gT G)) (@cfun_eqMixin gT (@gval gT G)) (@cfun_choiceMixin gT (@gval gT G))) (@cfun_zmodMixin gT (@gval gT G))))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))), @eq Algebraics.Implementation.type (s i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) rewrite b_i !cfunE; have /setIdP[/imsetP[x Gx ->] _] := enum_valP i. (* Goal: forall _ : is_true (negb (@eq_op (Finite.eqType (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))))) j i)), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (s j) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (@image_mem (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@classfun gT (@gval gT G)) (fun xB : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @cfun_indicator gT (@gval gT G) xB) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) j))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))) (GRing.zero Algebraics.Implementation.zmodType) *) (* Goal: forall _ : @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (s i) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) (@class gT x (@gval gT G))) (@repr (FinGroup.base gT) (@class gT x (@gval gT G))))) (GRing.zero Algebraics.Implementation.zmodType), @eq Algebraics.Implementation.type (s i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) by rewrite cfun_repr cfun_classE Gx class_refl mulr1. (* Goal: forall _ : is_true (negb (@eq_op (Finite.eqType (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))))) j i)), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (s j) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) (@image_mem (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@classfun gT (@gval gT G)) (fun xB : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @cfun_indicator gT (@gval gT G) xB) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) j))) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))) (GRing.zero Algebraics.Implementation.zmodType) *) apply: contraNeq; rewrite b_i !cfunE mulf_eq0 => /norP[_]. (* Goal: forall _ : is_true (negb (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) j)) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))) (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType)))), is_true (@eq_op (Finite.eqType (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))))) j i) *) rewrite -(inj_eq enum_val_inj). (* Goal: forall _ : is_true (negb (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) j)) (@repr (FinGroup.base gT) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i))) (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType)))), is_true (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) j) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) i)) *) have /setIdP[/imsetP[x _ ->] _] := enum_valP i; rewrite cfun_repr. (* Goal: forall _ : is_true (negb (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) j)) x) (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType)))), is_true (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)) j) (@class gT x (@gval gT G))) *) have /setIdP[/imsetP[y Gy ->] _] := enum_valP j; rewrite cfun_classE Gy. (* Goal: forall _ : is_true (negb (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT y (@gval gT G)))))))) (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType)))), is_true (@eq_op (Finite.eqType (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@class gT y (@gval gT G)) (@class gT x (@gval gT G))) *) by rewrite pnatr_eq0 -lt0n lt0b => /class_eqP->. Qed. Lemma dim_cfun : \dim 'CF(G) = #|classes G|. Proof. (* Goal: @eq nat (@dimv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@fullv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)))) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) *) by rewrite dimvf /Vector.dim /= genGid. Qed. Lemma dim_cfun_on A : \dim 'CF(G, A) = #|classes G ::&: A|. Proof. (* Goal: @eq nat (@dimv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@classfun_on gT (@gval gT G) A)) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) *) by rewrite (eqnP (cfun_base_free A)) size_tuple. Qed. Lemma dim_cfun_on_abelian A : abelian G -> A \subset G -> \dim 'CF(G, A) = #|A|. Proof. (* Goal: forall (_ : is_true (@abelian gT (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq nat (@dimv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@classfun_on gT (@gval gT G) A)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) *) move/abelian_classP=> cGG sAG; rewrite -(card_imset _ set1_inj) dim_cfun_on. (* Goal: @eq nat (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@ssetI (FinGroup.finType (FinGroup.base gT)) (@classes gT (@gval gT G)) A)))) (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@set1 (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))) *) apply/eq_card=> xG; rewrite !inE. (* Goal: @eq bool (andb (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A)))) (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@set1 (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))) *) apply/andP/imsetP=> [[/imsetP[x Gx ->] Ax] | [x Ax ->]] {xG}. (* Goal: and (is_true (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) (is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A)))) *) (* Goal: @ex2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (fun x0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@class gT x (@gval gT G)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x0)) *) by rewrite cGG ?sub1set // in Ax *; exists x. (* Goal: and (is_true (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) (is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A)))) *) by rewrite -{1}(cGG x) ?mem_classes ?(subsetP sAG) ?sub1set. Qed. Lemma cfuni_on A : '1_A \in 'CF(G, A). Proof. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) A) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) *) apply/cfun_onP=> x notAx; rewrite cfunElock genGid. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))) (GRing.zero Algebraics.Implementation.zmodType) *) by case: andP => // [[_ s_xG_A]]; rewrite (subsetP s_xG_A) ?class_refl in notAx. Qed. Lemma mul_cfuni_on A phi : phi * '1_A \in 'CF(G, A). Proof. (* Goal: is_true (@in_mem (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@GRing.mul (@cfun_ringType gT (@gval gT G)) phi (@cfun_indicator gT (@gval gT G) A)) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) *) by apply/cfun_onP=> x /(cfun_onP (cfuni_on A)) Ax0; rewrite cfunE Ax0 mulr0. Qed. Lemma cfun_onE phi A : (phi \in 'CF(G, A)) = (support phi \subset A). Proof. (* Goal: @eq bool (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (simplPredType (FinGroup.arg_sort (FinGroup.base gT))) (@support_for (FinGroup.arg_sort (FinGroup.base gT)) (GRing.Zmodule.eqType Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@fun_of_cfun gT (@gval gT G) phi))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) *) exact: (sameP cfun_onP supportP). Qed. Lemma cfun_onT phi : phi \in 'CF(G, [set: gT]). Proof. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))))) *) by rewrite cfun_onE. Qed. Lemma cfun_onD1 phi A : (phi \in 'CF(G, A^#)) = (phi \in 'CF(G, A)) && (phi 1%g == 0). Proof. (* Goal: @eq bool (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) (@setD (FinGroup.arg_finType (FinGroup.base gT)) A (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))))))) (andb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType))) *) by rewrite !cfun_onE -!(eq_subset (in_set (support _))) subsetD1 !inE negbK. Qed. Lemma cfun_onG phi : phi \in 'CF(G, G). Proof. (* Goal: is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) (@gval gT G))))) *) by rewrite cfun_onE support_cfun. Qed. Lemma cfunD1E phi : (phi \in 'CF(G, G^#)) = (phi 1%g == 0). Proof. (* Goal: @eq bool (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))))))) (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType)) *) by rewrite cfun_onD1 cfun_onG. Qed. Lemma cfunGid : 'CF(G, G) = 'CF(G)%VS. Proof. (* Goal: @eq (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (@classfun_on gT (@gval gT G) (@gval gT G)) (@fullv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) *) by apply/vspaceP=> phi; rewrite cfun_onG memvf. Qed. Lemma cfun_onS A B phi : B \subset A -> phi \in 'CF(G, B) -> phi \in 'CF(G, A). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) B))))), is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) *) by rewrite !cfun_onE => sBA /subset_trans->. Qed. Lemma cfun_complement A : A <| G -> ('CF(G, A) + 'CF(G, G :\: A)%SET = 'CF(G))%VS. Proof. (* Goal: forall _ : is_true (@normal gT A (@gval gT G)), @eq (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@classfun_on gT (@gval gT G) A) (@classfun_on gT (@gval gT G) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A))) (@fullv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) *) case/andP=> sAG nAG; rewrite -cfunGid [rhs in _ = rhs]cfun_on_sum. (* Goal: @eq (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@classfun_on gT (@gval gT G) A) (@classfun_on gT (@gval gT G) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A))) (@BigOp.bigop (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun xG : Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))) => @BigBody (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))))) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) (andb (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) xG)))) *) rewrite (bigID (fun B => B \subset A)) /=. (* Goal: @eq (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@classfun gT (@gval gT G)))) (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@classfun_on gT (@gval gT G) A) (@classfun_on gT (@gval gT G) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A))) (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@BigOp.bigop (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@classfun gT (@gval gT G)))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))))) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun i : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@classfun gT (@gval gT G)))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) i (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) (andb (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) i (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) i)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) i)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) i)))) (@BigOp.bigop (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@classfun gT (@gval gT G)))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))))) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun i : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@Vector.space Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@classfun gT (@gval gT G)))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) i (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G))) (andb (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) i (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) i)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) i)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cfun_indicator gT (@gval gT G) i))))) *) congr (_ + _)%VS; rewrite cfun_on_sum; apply: eq_bigl => /= xG. (* Goal: @eq bool (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A))))) (andb (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) *) (* Goal: @eq bool (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (andb (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) *) rewrite andbAC; apply/esym/andb_idr=> /andP[/imsetP[x Gx ->] _]. (* Goal: @eq bool (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A))))) (andb (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) *) (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by rewrite class_subG. (* Goal: @eq bool (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A))))) (andb (andb (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) xG (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) xG)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) *) rewrite -andbA; apply: andb_id2l => /imsetP[x Gx ->]. (* Goal: @eq bool (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A)))) (andb (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT x (@gval gT G)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@class gT x (@gval gT G)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) *) by rewrite !class_sub_norm ?normsD ?normG // inE andbC. Qed. Lemma cfConjCE phi x : (phi^*)%CF x = (phi x)^*. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) phi x)) *) by rewrite cfunE. Qed. Lemma cfConjCK : involutive (fun phi => phi^*)%CF. Proof. (* Goal: @involutive (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) *) by move=> phi; apply/cfunP=> x; rewrite !cfunE conjCK. Qed. Lemma cfConjC_cfun1 : (1^*)%CF = 1 :> 'CF(G). Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) (GRing.one (@cfun_ringType gT (@gval gT G)))) (GRing.one (@cfun_ringType gT (@gval gT G))) *) exact: rmorph1. Qed. Fact cfker_is_group phi : group_set (cfker phi). Proof. (* Goal: is_true (@group_set gT (@cfker gT (@gval gT G) phi)) *) apply/group_setP; split=> [|x y]; rewrite !inE ?group1. (* Goal: forall (_ : is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) phi y))) y)))) (_ : is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) y y0)) (@fun_of_cfun gT (@gval gT G) phi y0))) y0)))), is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) y0)) (@fun_of_cfun gT (@gval gT G) phi y0))) y0))) *) (* Goal: is_true (andb true (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) (oneg (FinGroup.base gT)) y)) (@fun_of_cfun gT (@gval gT G) phi y))) y))) *) by apply/forallP=> y; rewrite mul1g. (* Goal: forall (_ : is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) phi y))) y)))) (_ : is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) y y0)) (@fun_of_cfun gT (@gval gT G) phi y0))) y0)))), is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) y0)) (@fun_of_cfun gT (@gval gT G) phi y0))) y0))) *) case/andP=> Gx /forallP-Kx /andP[Gy /forallP-Ky]; rewrite groupM //. (* Goal: is_true (andb true (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) y0)) (@fun_of_cfun gT (@gval gT G) phi y0))) y0))) *) by apply/forallP=> z; rewrite -mulgA (eqP (Kx _)) Ky. Qed. Canonical cfker_group phi := Group (cfker_is_group phi). Lemma cfker_sub phi : cfker phi \subset G. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by rewrite /cfker setIdE subsetIl. Qed. Lemma cfker_norm phi : G \subset 'N(cfker phi). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@cfker gT (@gval gT G) phi))))) *) apply/subsetP=> z Gz; have phiJz := cfunJ phi _ (groupVr Gz). (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@cfker gT (@gval gT G) phi))))) *) rewrite inE; apply/subsetP=> _ /imsetP[x /setIdP[Gx /forallP-Kx] ->]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (@conjg gT x z) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))) *) rewrite inE groupJ //; apply/forallP=> y. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) (@conjg gT x z) y)) (@fun_of_cfun gT (@gval gT G) phi y)) *) by rewrite -(phiJz y) -phiJz conjMg conjgK Kx. Qed. Lemma cfker_normal phi : cfker phi <| G. Proof. (* Goal: is_true (@normal gT (@cfker gT (@gval gT G) phi) (@gval gT G)) *) by rewrite /normal cfker_sub cfker_norm. Qed. Lemma cfkerMl phi x y : x \in cfker phi -> phi (x * y)%g = phi y. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) phi y) *) by case/setIdP=> _ /eqfunP->. Qed. Lemma cfkerMr phi x y : x \in cfker phi -> phi (y * x)%g = phi y. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) y x)) (@fun_of_cfun gT (@gval gT G) phi y) *) by move=> Kx; rewrite conjgC cfkerMl ?cfunJ ?(subsetP (cfker_sub phi)). Qed. Lemma cfker1 phi x : x \in cfker phi -> phi x = phi 1%g. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) phi x) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) *) by move=> Kx; rewrite -[x]mulg1 cfkerMl. Qed. Lemma cfker_cfun0 : @cfker _ G 0 = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cfker gT (@gval gT G) (GRing.zero (@cfun_zmodType gT (@gval gT G)))) (@gval gT G) *) apply/setP=> x; rewrite !inE andb_idr // => Gx; apply/forallP=> y. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) (GRing.zero (@cfun_zmodType gT (@gval gT G))) y)) *) by rewrite !cfunE. Qed. Lemma cfker_add phi psi : cfker phi :&: cfker psi \subset cfker (phi + psi). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi) (@cfker gT (@gval gT G) psi)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi psi))))) *) apply/subsetP=> x /setIP[Kphi_x Kpsi_x]; have [Gx _] := setIdP Kphi_x. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi psi))))) *) by rewrite inE Gx; apply/forallP=> y; rewrite !cfunE !cfkerMl. Qed. Lemma cfker_sum I r (P : pred I) (Phi : I -> 'CF(G)) : G :&: \bigcap_(i <- r | P i) cfker (Phi i) \subset cfker (\sum_(i <- r | P i) Phi i). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) I (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) I i (@setI (FinGroup.arg_finType (FinGroup.base gT))) (P i) (@cfker gT (@gval gT G) (Phi i))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) I (GRing.zero (@cfun_zmodType gT (@gval gT G))) r (fun i : I => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) I i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (P i) (Phi i))))))) *) elim/big_rec2: _ => [|i K psi Pi sK_psi]; first by rewrite setIT cfker_cfun0. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (Phi i)) psi)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) (Phi i) K))))) *) by rewrite setICA; apply: subset_trans (setIS _ sK_psi) (cfker_add _ _). Qed. Lemma cfker_scale a phi : cfker phi \subset cfker (a *: phi). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) a phi))))) *) apply/subsetP=> x Kphi_x; have [Gx _] := setIdP Kphi_x. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) a phi))))) *) by rewrite inE Gx; apply/forallP=> y; rewrite !cfunE cfkerMl. Qed. Lemma cfker_scale_nz a phi : a != 0 -> cfker (a *: phi) = cfker phi. Lemma cfker_opp phi : cfker (- phi) = cfker phi. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cfker gT (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi)) (@cfker gT (@gval gT G) phi) *) by rewrite -scaleN1r cfker_scale_nz // oppr_eq0 oner_eq0. Qed. Lemma cfker_cfun1 : @cfker _ G 1 = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cfker gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G)))) (@gval gT G) *) apply/setP=> x; rewrite !inE andb_idr // => Gx; apply/forallP=> y. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G))) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G))) y)) *) by rewrite !cfun1E groupMl. Qed. Lemma cfker_mul phi psi : cfker phi :&: cfker psi \subset cfker (phi * psi). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi) (@cfker gT (@gval gT G) psi)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.mul (@cfun_ringType gT (@gval gT G)) phi psi))))) *) apply/subsetP=> x /setIP[Kphi_x Kpsi_x]; have [Gx _] := setIdP Kphi_x. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.mul (@cfun_ringType gT (@gval gT G)) phi psi))))) *) by rewrite inE Gx; apply/forallP=> y; rewrite !cfunE !cfkerMl. Qed. Lemma cfker_prod I r (P : pred I) (Phi : I -> 'CF(G)) : G :&: \bigcap_(i <- r | P i) cfker (Phi i) \subset cfker (\prod_(i <- r | P i) Phi i). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) I (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) I i (@setI (FinGroup.arg_finType (FinGroup.base gT))) (P i) (@cfker gT (@gval gT G) (Phi i))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@BigOp.bigop (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) I (GRing.one (@cfun_ringType gT (@gval gT G))) r (fun i : I => @BigBody (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) I i (@GRing.mul (@cfun_ringType gT (@gval gT G))) (P i) (Phi i))))))) *) elim/big_rec2: _ => [|i K psi Pi sK_psi]; first by rewrite setIT cfker_cfun1. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (Phi i)) psi)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@GRing.mul (@cfun_ringType gT (@gval gT G)) (Phi i) K))))) *) by rewrite setICA; apply: subset_trans (setIS _ sK_psi) (cfker_mul _ _). Qed. Lemma cfaithfulE phi : cfaithful phi = (cfker phi \subset [1]). Proof. (* Goal: @eq bool (@cfaithful gT (@gval gT G) phi) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))))) *) by []. Qed. End ClassFun. Arguments classfun_on {gT} B%g A%g. Notation "''CF' ( G , A )" := (classfun_on G A) : ring_scope. Arguments cfun_onP {gT G A phi}. Arguments cfConjCK {gT G} phi : rename. Hint Resolve cfun_onT : core. Section DotProduct. Variable (gT : finGroupType) (G : {group gT}). Implicit Types (M : {group gT}) (phi psi xi : 'CF(G)) (R S : seq 'CF(G)). Lemma cfdotE phi psi : '[phi, psi] = #|G|%:R^-1 * \sum_(x in G) phi x * (psi x)^*. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x)))))) *) by []. Qed. Lemma cfdotElr A B phi psi : phi \in 'CF(G, A) -> psi \in 'CF(G, B) -> '[phi, psi] = #|G|%:R^-1 * \sum_(x in A :&: B) phi x * (psi x)^*. Proof. (* Goal: forall (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A))))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) psi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) B))))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A B)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x)))))) *) move=> Aphi Bpsi; rewrite (big_setID G) cfdotE (big_setID (A :&: B)) setIC /=. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun i : FinGroup.sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.sort (FinGroup.base gT)) i (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A B) (@gval gT G))))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi i) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi i))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun i : FinGroup.sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.sort (FinGroup.base gT)) i (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setD (FinGroup.finType (FinGroup.base gT)) (@gval gT G) (@setI (FinGroup.finType (FinGroup.base gT)) A B))))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi i) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi i))))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A B) (@gval gT G))))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi i) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi i))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A B) (@gval gT G))))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi i) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi i))))))) *) congr (_ * (_ + _)); rewrite !big1 // => x /setDP[_]. (* Goal: forall _ : is_true (negb (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A B))))), @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) *) (* Goal: forall _ : is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) *) by move/cfun0->; rewrite mul0r. (* Goal: forall _ : is_true (negb (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A B))))), @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) *) rewrite inE; case/nandP=> notABx; first by rewrite (cfun_on0 Aphi) ?mul0r. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) *) by rewrite (cfun_on0 Bpsi) // rmorph0 mulr0. Qed. Lemma cfdotEl A phi psi : phi \in 'CF(G, A) -> '[phi, psi] = #|G|%:R^-1 * \sum_(x in A) phi x * (psi x)^*. Proof. (* Goal: forall _ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x)))))) *) by move=> Aphi; rewrite (cfdotElr Aphi (cfun_onT psi)) setIT. Qed. Lemma cfdotEr A phi psi : psi \in 'CF(G, A) -> '[phi, psi] = #|G|%:R^-1 * \sum_(x in A) phi x * (psi x)^*. Proof. (* Goal: forall _ : is_true (@in_mem (@classfun gT (@gval gT G)) psi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x)))))) *) by move=> Apsi; rewrite (cfdotElr (cfun_onT phi) Apsi) setTI. Qed. Lemma cfdot_complement A phi psi : phi \in 'CF(G, A) -> psi \in 'CF(G, G :\: A) -> '[phi, psi] = 0. Proof. (* Goal: forall (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A))))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) psi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A)))))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) move=> Aphi A'psi; rewrite (cfdotElr Aphi A'psi). (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A))))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) psi x)))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite setDE setICA setICr setI0 big_set0 mulr0. Qed. Lemma cfnormE A phi : phi \in 'CF(G, A) -> '[phi] = #|G|%:R^-1 * (\sum_(x in A) `|phi x| ^+ 2). Proof. (* Goal: forall _ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@GRing.mul (GRing.UnitRing.ringType (Num.NumDomain.unitRingType Algebraics.Implementation.numDomainType)) (@GRing.inv (Num.NumDomain.unitRingType Algebraics.Implementation.numDomainType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumDomain.unitRingType Algebraics.Implementation.numDomainType))) (GRing.one (GRing.UnitRing.ringType (Num.NumDomain.unitRingType Algebraics.Implementation.numDomainType))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@Num.Def.normr Algebraics.Implementation.numDomainType (@fun_of_cfun gT (@gval gT G) phi x)) (S (S O)))))) *) by move/cfdotEl->; rewrite (eq_bigr _ (fun _ _ => normCK _)). Qed. Lemma eq_cfdotl A phi1 phi2 psi : psi \in 'CF(G, A) -> {in A, phi1 =1 phi2} -> '[phi1, psi] = '[phi2, psi]. Lemma cfdot_cfuni A B : A <| G -> B <| G -> '['1_A, '1_B]_G = #|A :&: B|%:R / #|G|%:R. Proof. (* Goal: forall (_ : is_true (@normal gT A (@gval gT G))) (_ : is_true (@normal gT B (@gval gT G))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfun_indicator gT (@gval gT G) A) (@cfun_indicator gT (@gval gT G) B)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B))))) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) *) move=> nsAG nsBG; rewrite (cfdotElr (cfuni_on G A) (cfuni_on G B)) mulrC. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType Algebraics.Implementation.comUnitRingType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@setI (FinGroup.finType (FinGroup.base gT)) A B)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) A) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) B) x))))) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B))))) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) *) congr (_ / _); rewrite -sumr_const; apply: eq_bigr => x /setIP[Ax Bx]. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) A) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (@cfun_indicator gT (@gval gT G) B) x))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) by rewrite !cfuniE // Ax Bx rmorph1 mulr1. Qed. Lemma cfnorm1 : '[1]_G = 1. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (GRing.one (@cfun_ringType gT (@gval gT G))) (GRing.one (@cfun_ringType gT (@gval gT G)))) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) *) by rewrite cfdot_cfuni ?genGid // setIid divff ?neq0CG. Qed. Lemma cfdotr_is_linear xi : linear (cfdotr xi : 'CF(G) -> algC^o). Canonical cfdotr_additive xi := Additive (cfdotr_is_linear xi). Canonical cfdotr_linear xi := Linear (cfdotr_is_linear xi). Lemma cfdot0l xi : '[0, xi] = 0. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (GRing.zero (@cfun_zmodType gT (@gval gT G))) xi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite -cfdotrE linear0. Qed. Lemma cfdotNl xi phi : '[- phi, xi] = - '[phi, xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi) xi) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi xi)) *) by rewrite -!cfdotrE linearN. Qed. Lemma cfdotDl xi phi psi : '[phi + psi, xi] = '[phi, xi] + '[psi, xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi psi) xi) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi xi) (@cfdot gT (@gval gT G) psi xi)) *) by rewrite -!cfdotrE linearD. Qed. Lemma cfdotBl xi phi psi : '[phi - psi, xi] = '[phi, xi] - '[psi, xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) psi)) xi) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi xi) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) psi xi))) *) by rewrite -!cfdotrE linearB. Qed. Lemma cfdotMnl xi phi n : '[phi *+ n, xi] = '[phi, xi] *+ n. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.natmul (@cfun_zmodType gT (@gval gT G)) phi n) xi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi xi) n) *) by rewrite -!cfdotrE linearMn. Qed. Lemma cfdot_suml xi I r (P : pred I) (phi : I -> 'CF(G)) : '[\sum_(i <- r | P i) phi i, xi] = \sum_(i <- r | P i) '[phi i, xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) I (GRing.zero (@cfun_zmodType gT (@gval gT G))) r (fun i : I => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) I i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (P i) (phi i))) xi) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) I (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) r (fun i : I => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) I i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (P i) (@cfdot gT (@gval gT G) (phi i) xi))) *) by rewrite -!cfdotrE linear_sum. Qed. Lemma cfdotZl xi a phi : '[a *: phi, xi] = a * '[phi, xi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) a phi) xi) (@GRing.mul Algebraics.Implementation.ringType a (@cfdot gT (@gval gT G) phi xi)) *) by rewrite -!cfdotrE linearZ. Qed. Lemma cfdotC phi psi : '[phi, psi] = ('[psi, phi])^*. Lemma eq_cfdotr A phi psi1 psi2 : phi \in 'CF(G, A) -> {in A, psi1 =1 psi2} -> '[phi, psi1] = '[phi, psi2]. Proof. (* Goal: forall (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A))))) (_ : @prop_in1 (Finite.sort (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) psi1 x) (@fun_of_cfun gT (@gval gT G) psi2 x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) psi1) (@fun_of_cfun gT (@gval gT G) psi2)))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi1) (@cfdot gT (@gval gT G) phi psi2) *) by move=> Aphi /eq_cfdotl eq_dot; rewrite cfdotC eq_dot // -cfdotC. Qed. Lemma cfdotBr xi phi psi : '[xi, phi - psi] = '[xi, phi] - '[xi, psi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) psi))) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi phi) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi psi))) *) by rewrite !(cfdotC xi) -rmorphB cfdotBl. Qed. Lemma cfdotNr xi phi : '[xi, - phi] = - '[xi, phi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi)) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi phi)) *) exact: raddfN. Qed. Lemma cfdotDr xi phi psi : '[xi, phi + psi] = '[xi, phi] + '[xi, psi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi psi)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi phi) (@cfdot gT (@gval gT G) xi psi)) *) exact: raddfD. Qed. Lemma cfdotMnr xi phi n : '[xi, phi *+ n] = '[xi, phi] *+ n. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi (@GRing.natmul (@cfun_zmodType gT (@gval gT G)) phi n)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi phi) n) *) exact: raddfMn. Qed. Lemma cfdot_sumr xi I r (P : pred I) (phi : I -> 'CF(G)) : '[xi, \sum_(i <- r | P i) phi i] = \sum_(i <- r | P i) '[xi, phi i]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi (@BigOp.bigop (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) I (GRing.zero (@cfun_zmodType gT (@gval gT G))) r (fun i : I => @BigBody (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) I i (@GRing.add (@cfun_zmodType gT (@gval gT G))) (P i) (phi i)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) I (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) r (fun i : I => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) I i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (P i) (@cfdot gT (@gval gT G) xi (phi i)))) *) exact: raddf_sum. Qed. Lemma cfdotZr a xi phi : '[xi, a *: phi] = a^* * '[xi, phi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) a phi)) (@GRing.mul (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) a) (@cfdot gT (@gval gT G) xi phi)) *) by rewrite !(cfdotC xi) cfdotZl rmorphM. Qed. Lemma cfdot_cfAut (u : {rmorphism algC -> algC}) phi psi : {in image psi G, {morph u : x / x^*}} -> '[cfAut u phi, cfAut u psi] = u '[phi, psi]. Lemma cfdot_conjC phi psi : '[phi^*, psi^*] = '[phi, psi]^*. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) psi)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) phi psi)) *) by rewrite cfdot_cfAut. Qed. Lemma cfdot_conjCl phi psi : '[phi^*, psi] = '[phi, psi^*]^*. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) psi) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) phi (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) psi))) *) by rewrite -cfdot_conjC cfConjCK. Qed. Lemma cfdot_conjCr phi psi : '[phi, psi^*] = '[phi^*, psi]^*. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) psi)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) psi)) *) by rewrite -cfdot_conjC cfConjCK. Qed. Lemma cfnorm_ge0 phi : 0 <= '[phi]. Proof. (* Goal: is_true (@Num.Def.ler Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@cfdot gT (@gval gT G) phi phi)) *) by rewrite mulr_ge0 ?invr_ge0 ?ler0n ?sumr_ge0 // => x _; apply: mul_conjC_ge0. Qed. Lemma cfnorm_eq0 phi : ('[phi] == 0) = (phi == 0). Lemma cfnorm_gt0 phi : ('[phi] > 0) = (phi != 0). Proof. (* Goal: @eq bool (@Num.Def.ltr Algebraics.Implementation.numDomainType (GRing.zero (Num.NumDomain.zmodType Algebraics.Implementation.numDomainType)) (@cfdot gT (@gval gT G) phi phi)) (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi (GRing.zero (@cfun_zmodType gT (@gval gT G))))) *) by rewrite ltr_def cfnorm_ge0 cfnorm_eq0 andbT. Qed. Lemma sqrt_cfnorm_ge0 phi : 0 <= sqrtC '[phi]. Proof. (* Goal: is_true (@Num.Def.ler (Num.ClosedField.numDomainType Algebraics.Implementation.numClosedFieldType) (GRing.zero (Num.NumDomain.zmodType (Num.ClosedField.numDomainType Algebraics.Implementation.numClosedFieldType))) (@nthroot Algebraics.Implementation.numClosedFieldType (S (S O)) (@cfdot gT (@gval gT G) phi phi))) *) by rewrite sqrtC_ge0 cfnorm_ge0. Qed. Lemma sqrt_cfnorm_eq0 phi : (sqrtC '[phi] == 0) = (phi == 0). Proof. (* Goal: @eq bool (@eq_op (Num.ClosedField.eqType Algebraics.Implementation.numClosedFieldType) (@nthroot Algebraics.Implementation.numClosedFieldType (S (S O)) (@cfdot gT (@gval gT G) phi phi)) (GRing.zero (Num.ClosedField.zmodType Algebraics.Implementation.numClosedFieldType))) (@eq_op (@cfun_eqType gT (@gval gT G)) phi (GRing.zero (@cfun_zmodType gT (@gval gT G)))) *) by rewrite sqrtC_eq0 cfnorm_eq0. Qed. Lemma sqrt_cfnorm_gt0 phi : (sqrtC '[phi] > 0) = (phi != 0). Proof. (* Goal: @eq bool (@Num.Def.ltr (Num.ClosedField.numDomainType Algebraics.Implementation.numClosedFieldType) (GRing.zero (Num.NumDomain.zmodType (Num.ClosedField.numDomainType Algebraics.Implementation.numClosedFieldType))) (@nthroot Algebraics.Implementation.numClosedFieldType (S (S O)) (@cfdot gT (@gval gT G) phi phi))) (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi (GRing.zero (@cfun_zmodType gT (@gval gT G))))) *) by rewrite sqrtC_gt0 cfnorm_gt0. Qed. Lemma cfnormZ a phi : '[a *: phi]= `|a| ^+ 2 * '[phi]_G. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) a phi) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) a phi)) (@GRing.mul (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@Num.Def.normr Algebraics.Implementation.numDomainType a) (S (S O))) (@cfdot gT (@gval gT G) phi phi)) *) by rewrite cfdotZl cfdotZr mulrA normCK. Qed. Lemma cfnormN phi : '[- phi] = '[phi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi) (@GRing.opp (@cfun_zmodType gT (@gval gT G)) phi)) (@cfdot gT (@gval gT G) phi phi) *) by rewrite cfdotNl raddfN opprK. Qed. Lemma cfnorm_sign n phi : '[(-1) ^+ n *: phi] = '[phi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) n) phi) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (@GRing.exp Algebraics.Implementation.ringType (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) n) phi)) (@cfdot gT (@gval gT G) phi phi) *) by rewrite -signr_odd scaler_sign; case: (odd n); rewrite ?cfnormN. Qed. Lemma cfnormD phi psi : let d := '[phi, psi] in '[phi + psi] = '[phi] + '[psi] + (d + d^*). Proof. (* Goal: let d := @cfdot gT (@gval gT G) phi psi in @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi psi) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi psi)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@cfdot gT (@gval gT G) psi psi)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) d (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) d))) *) by rewrite /= addrAC -cfdotC cfdotDl !cfdotDr !addrA. Qed. Lemma cfnormB phi psi : let d := '[phi, psi] in '[phi - psi] = '[phi] + '[psi] - (d + d^*). Proof. (* Goal: let d := @cfdot gT (@gval gT G) phi psi in @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) psi)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) psi))) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@cfdot gT (@gval gT G) psi psi)) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) d (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) d)))) *) by rewrite /= cfnormD cfnormN cfdotNr rmorphN -opprD. Qed. Lemma cfnormDd phi psi : '[phi, psi] = 0 -> '[phi + psi] = '[phi] + '[psi]. Lemma cfnormBd phi psi : '[phi, psi] = 0 -> '[phi - psi] = '[phi] + '[psi]. Proof. (* Goal: forall _ : @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) psi)) (@GRing.add (@cfun_zmodType gT (@gval gT G)) phi (@GRing.opp (@cfun_zmodType gT (@gval gT G)) psi))) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (@cfdot gT (@gval gT G) psi psi)) *) by move=> ophipsi; rewrite cfnormDd ?cfnormN // cfdotNr ophipsi oppr0. Qed. Lemma cfnorm_conjC phi : '[phi^*] = '[phi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi)) (@cfdot gT (@gval gT G) phi phi) *) by rewrite cfdot_conjC geC0_conj // cfnorm_ge0. Qed. Lemma cfCauchySchwarz phi psi : `|'[phi, psi]| ^+ 2 <= '[phi] * '[psi] ?= iff ~~ free (phi :: psi). Lemma cfCauchySchwarz_sqrt phi psi : `|'[phi, psi]| <= sqrtC '[phi] * sqrtC '[psi] ?= iff ~~ free (phi :: psi). Proof. (* Goal: @Num.Def.lerif Algebraics.Implementation.numDomainType (@Num.Def.normr Algebraics.Implementation.numDomainType (@cfdot gT (@gval gT G) phi psi)) (@GRing.mul (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@nthroot Algebraics.Implementation.numClosedFieldType (S (S O)) (@cfdot gT (@gval gT G) phi phi)) (@nthroot Algebraics.Implementation.numClosedFieldType (S (S O)) (@cfdot gT (@gval gT G) psi psi))) (negb (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) phi (@seq_of_cfun gT (@gval gT G) psi)))) *) rewrite -(sqrCK (normr_ge0 _)) -sqrtCM ?qualifE ?cfnorm_ge0 //. (* Goal: @Num.Def.lerif Algebraics.Implementation.numDomainType (@nthroot Algebraics.Implementation.numClosedFieldType (S (S O)) (@GRing.exp (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@Num.Def.normr (Num.ClosedField.numDomainType Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) phi psi)) (S (S O)))) (@nthroot Algebraics.Implementation.numClosedFieldType (S (S O)) (@GRing.mul (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) phi phi) (@cfdot gT (@gval gT G) psi psi))) (negb (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) phi (@seq_of_cfun gT (@gval gT G) psi)))) *) rewrite (mono_in_lerif (@ler_sqrtC _)) 1?rpredM ?qualifE; rewrite ?normr_ge0 ?cfnorm_ge0 //. (* Goal: @Num.Def.lerif (Num.ClosedField.numDomainType Algebraics.Implementation.numClosedFieldType) (@GRing.exp (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@Num.Def.normr (Num.ClosedField.numDomainType Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) phi psi)) (S (S O))) (@GRing.mul (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) phi phi) (@cfdot gT (@gval gT G) psi psi)) (negb (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) phi (@seq_of_cfun gT (@gval gT G) psi)))) *) exact: cfCauchySchwarz. Qed. Lemma cf_triangle_lerif phi psi : sqrtC '[phi + psi] <= sqrtC '[phi] + sqrtC '[psi] ?= iff ~~ free (phi :: psi) && (0 <= coord [tuple psi] 0 phi). Lemma orthogonal_cons phi R S : orthogonal (phi :: R) S = orthogonal phi S && orthogonal R S. Proof. (* Goal: @eq bool (@orthogonal gT (@gval gT G) (@cons (@classfun gT (@gval gT G)) phi R) S) (andb (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) phi) S) (@orthogonal gT (@gval gT G) R S)) *) by rewrite /orthogonal /= andbT. Qed. Lemma orthoP phi psi : reflect ('[phi, psi] = 0) (orthogonal phi psi). Proof. (* Goal: Bool.reflect (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) phi) (@seq_of_cfun gT (@gval gT G) psi)) *) by rewrite /orthogonal /= !andbT; apply: eqP. Qed. Lemma orthogonalP S R : reflect {in S & R, forall phi psi, '[phi, psi] = 0} (orthogonal S R). Proof. (* Goal: Bool.reflect (@prop_in11 (Equality.sort (@cfun_eqType gT (@gval gT G))) (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R) (fun phi psi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall phi psi : @classfun gT (@gval gT G), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) (@orthogonal gT (@gval gT G) S R) *) apply: (iffP allP) => oSR phi => [psi /oSR/allP opS /opS/eqP // | /oSR opS]. (* Goal: is_true (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) R)) phi) *) by apply/allP=> psi /= /opS->. Qed. Lemma orthoPl phi S : reflect {in S, forall psi, '[phi, psi] = 0} (orthogonal phi S). Proof. (* Goal: Bool.reflect (@prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun psi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall psi : @classfun gT (@gval gT G), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) phi) S) *) by rewrite [orthogonal _ S]andbT /=; apply: (iffP allP) => ophiS ? /ophiS/eqP. Qed. Arguments orthoPl {phi S}. Lemma orthogonal_sym : symmetric (@orthogonal _ G). Proof. (* Goal: @symmetric (list (@classfun gT (@gval gT G))) (@orthogonal gT (@gval gT G)) *) apply: symmetric_from_pre => R S /orthogonalP oRS. (* Goal: is_true (@orthogonal gT (@gval gT G) S R) *) by apply/orthogonalP=> phi psi Rpsi Sphi; rewrite cfdotC oRS ?rmorph0. Qed. Lemma orthoPr S psi : reflect {in S, forall phi, '[phi, psi] = 0} (orthogonal S psi). Proof. (* Goal: Bool.reflect (@prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall phi : @classfun gT (@gval gT G), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) (@orthogonal gT (@gval gT G) S (@seq_of_cfun gT (@gval gT G) psi)) *) rewrite orthogonal_sym. (* Goal: Bool.reflect (@prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall phi : @classfun gT (@gval gT G), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) psi) S) *) by apply: (iffP orthoPl) => oSpsi phi Sphi; rewrite cfdotC oSpsi ?conjC0. Qed. Lemma eq_orthogonal R1 R2 S1 S2 : R1 =i R2 -> S1 =i S2 -> orthogonal R1 S1 = orthogonal R2 S2. Proof. (* Goal: forall (_ : @eq_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R1) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R2)) (_ : @eq_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S1) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S2)), @eq bool (@orthogonal gT (@gval gT G) R1 S1) (@orthogonal gT (@gval gT G) R2 S2) *) move=> eqR eqS; rewrite [orthogonal _ _](eq_all_r eqR). (* Goal: @eq bool (@all (Equality.sort (@cfun_eqType gT (@gval gT G))) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) S1))) R2) (@orthogonal gT (@gval gT G) R2 S2) *) by apply: eq_all => psi /=; apply: eq_all_r. Qed. Lemma orthogonal_catl R1 R2 S : orthogonal (R1 ++ R2) S = orthogonal R1 S && orthogonal R2 S. Proof. (* Goal: @eq bool (@orthogonal gT (@gval gT G) (@cat (@classfun gT (@gval gT G)) R1 R2) S) (andb (@orthogonal gT (@gval gT G) R1 S) (@orthogonal gT (@gval gT G) R2 S)) *) exact: all_cat. Qed. Lemma orthogonal_catr R S1 S2 : orthogonal R (S1 ++ S2) = orthogonal R S1 && orthogonal R S2. Proof. (* Goal: @eq bool (@orthogonal gT (@gval gT G) R (@cat (@classfun gT (@gval gT G)) S1 S2)) (andb (@orthogonal gT (@gval gT G) R S1) (@orthogonal gT (@gval gT G) R S2)) *) by rewrite !(orthogonal_sym R) orthogonal_catl. Qed. Lemma span_orthogonal S1 S2 phi1 phi2 : orthogonal S1 S2 -> phi1 \in <<S1>>%VS -> phi2 \in <<S2>>%VS -> '[phi1, phi2] = 0. Proof. (* Goal: forall (_ : is_true (@orthogonal gT (@gval gT G) S1 S2)) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi1 (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S1))))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi2 (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S2))))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi1 phi2) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) move/orthogonalP=> oS12; do 2!move/(@coord_span _ _ _ (in_tuple _))->. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (Finite.sort (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (index_enum (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1))) (fun i : Finite.sort (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (Finite.sort (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))) (@coord Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) i phi1) (@nth (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@tval (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1)) (@nat_of_ord (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) i))))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (Finite.sort (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (index_enum (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2))) (fun i : Finite.sort (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) (Finite.sort (ordinal_finType (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))) (@coord Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) i phi2) (@nth (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@tval (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2)) (@nat_of_ord (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) i)))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) rewrite cfdot_suml big1 // => i _; rewrite cfdot_sumr big1 // => j _. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfdot gT (@gval gT G) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))) (@coord Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) i phi1) (@nth (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@tval (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1)) (@nat_of_ord (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S1) i))) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT G))) (@coord Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) j phi2) (@nth (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@tval (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@in_tuple (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2)) (@nat_of_ord (@size (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) S2) j)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite cfdotZl cfdotZr oS12 ?mem_nth ?mulr0. Qed. Lemma orthogonal_split S beta : {X : 'CF(G) & X \in <<S>>%VS & {Y | [/\ beta = X + Y, '[X, Y] = 0 & orthogonal Y S]}}. Proof. (* Goal: @sigT2 (@classfun gT (@gval gT G)) (fun X : @classfun gT (@gval gT G) => is_true (@in_mem (@classfun gT (@gval gT G)) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) (fun X : @classfun gT (@gval gT G) => @sig (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (fun Y : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G)) => and3 (@eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@cfun_zmodType gT (@gval gT G)) X Y)) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) X Y) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) S)))) *) suffices [X S_X [Y -> oYS]]: {X : _ & X \in <<S>>%VS & {Y | beta = X + Y & orthogonal Y S}}. (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) S))) *) (* Goal: @sigT2 (@classfun gT (@gval gT G)) (fun X : @classfun gT (@gval gT G) => is_true (@in_mem (@classfun gT (@gval gT G)) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) (fun X0 : @classfun gT (@gval gT G) => @sig (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (fun Y0 : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G)) => and3 (@eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y) (@GRing.add (@cfun_zmodType gT (@gval gT G)) X0 Y0)) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) X0 Y0) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y0) S)))) *) - (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) S))) *) (* Goal: @sigT2 (@classfun gT (@gval gT G)) (fun X : @classfun gT (@gval gT G) => is_true (@in_mem (@classfun gT (@gval gT G)) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) (fun X0 : @classfun gT (@gval gT G) => @sig (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (fun Y0 : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G)) => and3 (@eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y) (@GRing.add (@cfun_zmodType gT (@gval gT G)) X0 Y0)) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) X0 Y0) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y0) S)))) *) exists X => //; exists Y. (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) S))) *) (* Goal: and3 (@eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y) (@GRing.add (@cfun_zmodType gT (@gval gT G)) X Y)) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) X Y) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) S)) *) by rewrite cfdotC (span_orthogonal oYS) ?memv_span1 ?conjC0. (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) S))) *) elim: S beta => [|phi S IHS] beta. (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) phi S)))))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) (@cons (@classfun gT (@gval gT G)) phi S)))) *) (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@nil (@classfun gT (@gval gT G)))))))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) (@nil (@classfun gT (@gval gT G)))))) *) by exists 0; last exists beta; rewrite ?mem0v ?add0r. (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) phi S)))))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) beta (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) (@cons (@classfun gT (@gval gT G)) phi S)))) *) have [[U S_U [V -> oVS]] [X S_X [Y -> oYS]]] := (IHS phi, IHS beta). (* Goal: @sigT2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (fun X : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V) S)))))) (fun X0 : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)) => @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y0 : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X0 Y0)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) (@cons (@classfun gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V) S)))) *) pose Z := '[Y, V] / '[V] *: V; exists (X + Z). (* Goal: @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y0 : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Z) Y0)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) (@cons (@classfun gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V) S))) *) (* Goal: is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Z) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@cons (@classfun gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V) S))))) *) rewrite /Z -{4}(addKr U V) scalerDr scalerN addrA addrC span_cons. (* Goal: @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y0 : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Z) Y0)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) (@cons (@classfun gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V) S))) *) (* Goal: is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) Y V) (@GRing.inv Algebraics.Implementation.unitRingType (@cfdot gT (@gval gT G) V V))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) Y V) (@GRing.inv Algebraics.Implementation.unitRingType (@cfdot gT (@gval gT G) V V))) U)))) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@addv Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@vline Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V)) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S))))) *) by rewrite memv_add ?memvB ?memvZ ?memv_line. (* Goal: @sig2 (GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (fun Y0 : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Y) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) X Z) Y0)) (fun Y : GRing.Zmodule.sort (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) => is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) Y) (@cons (@classfun gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V) S))) *) exists (Y - Z); first by rewrite addrCA !addrA addrK addrC. (* Goal: is_true (@orthogonal gT (@gval gT G) (@seq_of_cfun gT (@gval gT G) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) Y (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))))) Z))) (@cons (@classfun gT (@gval gT G)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V) S)) *) apply/orthoPl=> psi; rewrite !inE => /predU1P[-> | Spsi]; last first. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) Y (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))))) Z)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) Y (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))))) Z)) psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite cfdotBl cfdotZl (orthoPl oVS _ Spsi) mulr0 subr0 (orthoPl oYS). (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) Y (@GRing.opp (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.base (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.Lmodule.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))) (@GRing.Lmodule.class (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Vector.lmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfun_vectType gT (@gval gT G)))))) Z)) (@GRing.add (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) U V)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) rewrite cfdotBl !cfdotDr (span_orthogonal oYS) // ?memv_span ?mem_head //. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfdot gT (@gval gT G) Y V)) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) Z U) (@cfdot gT (@gval gT G) Z V)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) rewrite !cfdotZl (span_orthogonal oVS _ S_U) ?mulr0 ?memv_span ?mem_head //. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfdot gT (@gval gT G) Y V)) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) Y V) (@GRing.inv Algebraics.Implementation.unitRingType (@cfdot gT (@gval gT G) V V))) (@cfdot gT (@gval gT G) V V))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) have [-> | nzV] := eqVneq V 0; first by rewrite cfdot0r !mul0r subrr. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@cfdot gT (@gval gT G) Y V)) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT G) Y V) (@GRing.inv Algebraics.Implementation.unitRingType (@cfdot gT (@gval gT G) V V))) (@cfdot gT (@gval gT G) V V))))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite divfK ?cfnorm_eq0 ?subrr. Qed. Lemma map_orthogonal M (nu : 'CF(G) -> 'CF(M)) S R (A : pred 'CF(G)) : {in A &, isometry nu} -> {subset S <= A} -> {subset R <= A} -> orthogonal (map nu S) (map nu R) = orthogonal S R. Proof. (* Goal: forall (_ : @prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) A) (fun phi psi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (nu phi) (nu psi)) (@cfdot gT (@gval gT G) phi psi)) (inPhantom (@isometry gT gT (@gval gT G) (@gval gT M) nu))) (_ : @sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) A)) (_ : @sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) A)), @eq bool (@orthogonal gT (@gval gT M) (@map (@classfun gT (@gval gT G)) (@classfun gT (@gval gT M)) nu S) (@map (@classfun gT (@gval gT G)) (@classfun gT (@gval gT M)) nu R)) (@orthogonal gT (@gval gT G) S R) *) move=> Inu sSA sRA; rewrite [orthogonal _ _]all_map. (* Goal: @eq bool (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@preim (@classfun gT (@gval gT G)) (@classfun gT (@gval gT M)) nu (@pred_of_simpl (@classfun gT (@gval gT M)) (@SimplPred (@classfun gT (@gval gT M)) (fun phi : @classfun gT (@gval gT M) => @all (@classfun gT (@gval gT M)) (@pred_of_simpl (@classfun gT (@gval gT M)) (@SimplPred (@classfun gT (@gval gT M)) (fun psi : @classfun gT (@gval gT M) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) (@map (@classfun gT (@gval gT G)) (@classfun gT (@gval gT M)) nu R)))))) S) (@orthogonal gT (@gval gT G) S R) *) apply: eq_in_all => phi Sphi; rewrite /= all_map. (* Goal: @eq bool (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@preim (@classfun gT (@gval gT G)) (@classfun gT (@gval gT M)) nu (@pred_of_simpl (@classfun gT (@gval gT M)) (@SimplPred (@classfun gT (@gval gT M)) (fun psi : @classfun gT (@gval gT M) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT M) (nu phi) psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))))) R) (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) R) *) by apply: eq_in_all => psi Rpsi; rewrite /= Inu ?(sSA phi) ?(sRA psi). Qed. Lemma orthogonal_oppr S R : orthogonal S (map -%R R) = orthogonal S R. Proof. (* Goal: @eq bool (@orthogonal gT (@gval gT G) S (@map (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.opp (@cfun_zmodType gT (@gval gT G))) R)) (@orthogonal gT (@gval gT G) S R) *) wlog suffices IH: S R / orthogonal S R -> orthogonal S (map -%R R). (* Goal: forall _ : is_true (@orthogonal gT (@gval gT G) S R), is_true (@orthogonal gT (@gval gT G) S (@map (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.opp (@cfun_zmodType gT (@gval gT G))) R)) *) (* Goal: @eq bool (@orthogonal gT (@gval gT G) S (@map (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.opp (@cfun_zmodType gT (@gval gT G))) R)) (@orthogonal gT (@gval gT G) S R) *) by apply/idP/idP=> /IH; rewrite ?mapK //; apply: opprK. (* Goal: forall _ : is_true (@orthogonal gT (@gval gT G) S R), is_true (@orthogonal gT (@gval gT G) S (@map (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.opp (@cfun_zmodType gT (@gval gT G))) R)) *) move/orthogonalP=> oSR; apply/orthogonalP=> xi1 _ Sxi1 /mapP[xi2 Rxi2 ->]. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) xi1 (@GRing.opp (@cfun_zmodType gT (@gval gT G)) xi2)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite cfdotNr oSR ?oppr0. Qed. Lemma orthogonal_oppl S R : orthogonal (map -%R S) R = orthogonal S R. Proof. (* Goal: @eq bool (@orthogonal gT (@gval gT G) (@map (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.opp (@cfun_zmodType gT (@gval gT G))) S) R) (@orthogonal gT (@gval gT G) S R) *) by rewrite -!(orthogonal_sym R) orthogonal_oppr. Qed. Lemma pairwise_orthogonalP S : reflect (uniq (0 :: S) /\ {in S &, forall phi psi, phi != psi -> '[phi, psi] = 0}) (pairwise_orthogonal S). Proof. (* Goal: Bool.reflect (and (is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) (@cons (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (@pairwise_orthogonal gT (@gval gT G) S) *) rewrite /pairwise_orthogonal /=; case notS0: (~~ _); last by right; case. (* Goal: Bool.reflect (and (is_true (andb true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (andb true (@pair_ortho_rec gT (@gval gT G) S)) *) elim: S notS0 => [|phi S IH] /=; first by left. (* Goal: forall _ : @eq bool (negb (@in_mem (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (@classfun gT (@gval gT G)) (seq_predType (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G)))) (@cons (@classfun gT (@gval gT G)) phi S)))) true, Bool.reflect (and (is_true (andb (negb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G)))) S))) (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (andb (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) S) true) (@pair_ortho_rec gT (@gval gT G) S)) *) rewrite inE eq_sym andbT => /norP[nz_phi /IH{IH}IH]. (* Goal: Bool.reflect (and (is_true (andb (negb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G)))) S))) (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) S) (@pair_ortho_rec gT (@gval gT G) S)) *) have [opS | not_opS] := allP; last first. (* Goal: Bool.reflect (and (is_true (andb (negb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G)))) S))) (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (andb true (@pair_ortho_rec gT (@gval gT G) S)) *) (* Goal: Bool.reflect (and (is_true (andb (negb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G)))) S))) (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (andb false (@pair_ortho_rec gT (@gval gT G) S)) *) right=> [[/andP[notSp _] opS]]; case: not_opS => psi Spsi /=. (* Goal: Bool.reflect (and (is_true (andb (negb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G)))) S))) (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (andb true (@pair_ortho_rec gT (@gval gT G) S)) *) (* Goal: is_true (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) *) by rewrite opS ?mem_head 1?mem_behead // (memPnC notSp). (* Goal: Bool.reflect (and (is_true (andb (negb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G)))) S))) (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (andb true (@pair_ortho_rec gT (@gval gT G) S)) *) rewrite (contra (opS _)) /= ?cfnorm_eq0 //. (* Goal: Bool.reflect (and (is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S)) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))))) (@pair_ortho_rec gT (@gval gT G) S) *) apply: (iffP IH) => [] [uniqS oSS]; last first. (* Goal: and (is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S)) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) *) (* Goal: and (is_true (andb true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) *) by split=> //; apply: sub_in2 oSS => psi Spsi; apply: mem_behead. (* Goal: and (is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S)) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi S)) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) *) split=> // psi xi; rewrite !inE => /predU1P[-> // | Spsi]. (* Goal: forall (_ : is_true (orb (@eq_op (@cfun_eqType gT (@gval gT G)) xi phi) (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) xi (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S)))) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) psi xi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) psi xi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) (* Goal: forall (_ : is_true (orb (@eq_op (@cfun_eqType gT (@gval gT G)) xi phi) (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) xi (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S)))) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi xi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi xi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by case/predU1P=> [-> | /opS] /eqP. (* Goal: forall (_ : is_true (orb (@eq_op (@cfun_eqType gT (@gval gT G)) xi phi) (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) xi (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S)))) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) psi xi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) psi xi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) case/predU1P=> [-> _ | Sxi /oSS-> //]. (* Goal: @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) psi phi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by apply/eqP; rewrite cfdotC conjC_eq0 [_ == 0]opS. Qed. Lemma pairwise_orthogonal_cat R S : pairwise_orthogonal (R ++ S) = [&& pairwise_orthogonal R, pairwise_orthogonal S & orthogonal R S]. Proof. (* Goal: @eq bool (@pairwise_orthogonal gT (@gval gT G) (@cat (@classfun gT (@gval gT G)) R S)) (andb (@pairwise_orthogonal gT (@gval gT G) R) (andb (@pairwise_orthogonal gT (@gval gT G) S) (@orthogonal gT (@gval gT G) R S))) *) rewrite /pairwise_orthogonal mem_cat negb_or -!andbA; do !bool_congr. (* Goal: @eq bool (@pair_ortho_rec gT (@gval gT G) (@cat (@classfun gT (@gval gT G)) R S)) (andb (@pair_ortho_rec gT (@gval gT G) R) (andb (@pair_ortho_rec gT (@gval gT G) S) (@orthogonal gT (@gval gT G) R S))) *) elim: R => [|phi R /= ->]; rewrite ?andbT // orthogonal_cons all_cat -!andbA /=. (* Goal: @eq bool (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) R) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) S) (andb (@pair_ortho_rec gT (@gval gT G) R) (andb (@pair_ortho_rec gT (@gval gT G) S) (@orthogonal gT (@gval gT G) R S))))) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) R) (andb (@pair_ortho_rec gT (@gval gT G) R) (andb (@pair_ortho_rec gT (@gval gT G) S) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun psi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) S) (@orthogonal gT (@gval gT G) R S))))) *) by do !bool_congr. Qed. Lemma eq_pairwise_orthogonal R S : perm_eq R S -> pairwise_orthogonal R = pairwise_orthogonal S. Proof. (* Goal: forall _ : is_true (@perm_eq (@cfun_eqType gT (@gval gT G)) R S), @eq bool (@pairwise_orthogonal gT (@gval gT G) R) (@pairwise_orthogonal gT (@gval gT G) S) *) apply: catCA_perm_subst R S => R S S'. (* Goal: @eq bool (@pairwise_orthogonal gT (@gval gT G) (@cat (Equality.sort (@cfun_eqType gT (@gval gT G))) R (@cat (Equality.sort (@cfun_eqType gT (@gval gT G))) S S'))) (@pairwise_orthogonal gT (@gval gT G) (@cat (Equality.sort (@cfun_eqType gT (@gval gT G))) S (@cat (Equality.sort (@cfun_eqType gT (@gval gT G))) R S'))) *) rewrite !pairwise_orthogonal_cat !orthogonal_catr (orthogonal_sym R S) -!andbA. (* Goal: @eq bool (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R))) (andb (@pair_ortho_rec gT (@gval gT G) R) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))) (andb (@pair_ortho_rec gT (@gval gT G) S) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S'))) (andb (@pair_ortho_rec gT (@gval gT G) S') (andb (@orthogonal gT (@gval gT G) S S') (andb (@orthogonal gT (@gval gT G) S R) (@orthogonal gT (@gval gT G) R S'))))))))) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))) (andb (@pair_ortho_rec gT (@gval gT G) S) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R))) (andb (@pair_ortho_rec gT (@gval gT G) R) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S'))) (andb (@pair_ortho_rec gT (@gval gT G) S') (andb (@orthogonal gT (@gval gT G) R S') (andb (@orthogonal gT (@gval gT G) S R) (@orthogonal gT (@gval gT G) S S'))))))))) *) by do !bool_congr. Qed. Lemma sub_pairwise_orthogonal S1 S2 : {subset S1 <= S2} -> uniq S1 -> pairwise_orthogonal S2 -> pairwise_orthogonal S1. Proof. (* Goal: forall (_ : @sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S1) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S2)) (_ : is_true (@uniq (@cfun_eqType gT (@gval gT G)) S1)) (_ : is_true (@pairwise_orthogonal gT (@gval gT G) S2)), is_true (@pairwise_orthogonal gT (@gval gT G) S1) *) move=> sS12 uniqS1 /pairwise_orthogonalP[/andP[notS2_0 _] oS2]. (* Goal: is_true (@pairwise_orthogonal gT (@gval gT G) S1) *) apply/pairwise_orthogonalP; rewrite /= (contra (sS12 0)) //. (* Goal: and (is_true (andb true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) S1))) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S1) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) *) by split=> //; apply: sub_in2 oS2. Qed. Lemma orthogonal_free S : pairwise_orthogonal S -> free S. Proof. (* Goal: forall _ : is_true (@pairwise_orthogonal gT (@gval gT G) S), is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S) *) case/pairwise_orthogonalP=> [/=/andP[notS0 uniqS] oSS]. (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S) *) rewrite -(in_tupleE S); apply/freeP => a aS0 i. (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (a i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) have S_i: S`_i \in S by apply: mem_nth. (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (a i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) have /eqP: '[S`_i, 0]_G = 0 := cfdot0r _. (* Goal: forall _ : is_true (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@nth (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)) (GRing.zero (@cfun_zmodType gT (@gval gT G)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))), @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (a i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) rewrite -{2}aS0 raddf_sum /= (bigD1 i) //= big1 => [|j neq_ji]; last 1 first. (* Goal: forall _ : is_true (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add Algebraics.Implementation.zmodType (@cfdot gT (@gval gT G) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (a i) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))), @eq Algebraics.Implementation.type (a i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) (* Goal: @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (a j) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) j)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) *) by rewrite cfdotZr oSS ?mulr0 ?mem_nth // eq_sym nth_uniq. (* Goal: forall _ : is_true (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.add Algebraics.Implementation.zmodType (@cfdot gT (@gval gT G) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G))) (a i) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@Vector.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant Algebraics.Implementation.type) (@cfun_vectType gT (@gval gT G)))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))), @eq Algebraics.Implementation.type (a i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) rewrite addr0 cfdotZr mulf_eq0 conjC_eq0 cfnorm_eq0. (* Goal: forall _ : is_true (orb (@eq_op (Num.ClosedField.eqType Algebraics.Implementation.numClosedFieldType) (a i) (GRing.zero (Num.ClosedField.zmodType Algebraics.Implementation.numClosedFieldType))) (@eq_op (@cfun_eqType gT (@gval gT G)) (@nth (@classfun gT (@gval gT G)) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S (@nat_of_ord (@size (@classfun gT (@gval gT G)) S) i)) (GRing.zero (@cfun_zmodType gT (@gval gT G))))), @eq Algebraics.Implementation.type (a i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) *) by case/pred2P=> // Si0; rewrite -Si0 S_i in notS0. Qed. Lemma filter_pairwise_orthogonal S p : pairwise_orthogonal S -> pairwise_orthogonal (filter p S). Lemma orthonormal_not0 S : orthonormal S -> 0 \notin S. Proof. (* Goal: forall _ : is_true (@orthonormal gT (@gval gT G) S), is_true (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))) *) by case/andP=> /allP S1 _; rewrite (contra (S1 _)) //= cfdot0r eq_sym oner_eq0. Qed. Lemma orthonormalE S : orthonormal S = all [pred phi | '[phi] == 1] S && pairwise_orthogonal S. Proof. (* Goal: @eq bool (@orthonormal gT (@gval gT G) S) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) S) (@pairwise_orthogonal gT (@gval gT G) S)) *) by rewrite -(andb_idl (@orthonormal_not0 S)) andbCA. Qed. Lemma orthonormal_orthogonal S : orthonormal S -> pairwise_orthogonal S. Proof. (* Goal: forall _ : is_true (@orthonormal gT (@gval gT G) S), is_true (@pairwise_orthogonal gT (@gval gT G) S) *) by rewrite orthonormalE => /andP[_]. Qed. Lemma orthonormal_cat R S : orthonormal (R ++ S) = [&& orthonormal R, orthonormal S & orthogonal R S]. Proof. (* Goal: @eq bool (@orthonormal gT (@gval gT G) (@cat (@classfun gT (@gval gT G)) R S)) (andb (@orthonormal gT (@gval gT G) R) (andb (@orthonormal gT (@gval gT G) S) (@orthogonal gT (@gval gT G) R S))) *) rewrite !orthonormalE pairwise_orthogonal_cat all_cat -!andbA. (* Goal: @eq bool (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) R) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) S) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R))) (andb (@pair_ortho_rec gT (@gval gT G) R) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))) (andb (@pair_ortho_rec gT (@gval gT G) S) (@orthogonal gT (@gval gT G) R S))))))) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) R) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) R))) (andb (@pair_ortho_rec gT (@gval gT G) R) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) S) (andb (negb (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))) (andb (@pair_ortho_rec gT (@gval gT G) S) (@orthogonal gT (@gval gT G) R S))))))) *) by do !bool_congr. Qed. Lemma eq_orthonormal R S : perm_eq R S -> orthonormal R = orthonormal S. Proof. (* Goal: forall _ : is_true (@perm_eq (@cfun_eqType gT (@gval gT G)) R S), @eq bool (@orthonormal gT (@gval gT G) R) (@orthonormal gT (@gval gT G) S) *) move=> eqRS; rewrite !orthonormalE (eq_all_r (perm_eq_mem eqRS)). (* Goal: @eq bool (andb (@all (Equality.sort (@cfun_eqType gT (@gval gT G))) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) S) (@pairwise_orthogonal gT (@gval gT G) R)) (andb (@all (@classfun gT (@gval gT G)) (@pred_of_simpl (@classfun gT (@gval gT G)) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) S) (@pairwise_orthogonal gT (@gval gT G) S)) *) by rewrite (eq_pairwise_orthogonal eqRS). Qed. Lemma orthonormal_free S : orthonormal S -> free S. Proof. (* Goal: forall _ : is_true (@orthonormal gT (@gval gT G) S), is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S) *) by move/orthonormal_orthogonal/orthogonal_free. Qed. Lemma orthonormalP S : reflect (uniq S /\ {in S &, forall phi psi, '[phi, psi]_G = (phi == psi)%:R}) (orthonormal S). Proof. (* Goal: Bool.reflect (and (is_true (@uniq (@cfun_eqType gT (@gval gT G)) S)) (@prop_in2 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)))) (inPhantom (forall phi psi : @classfun gT (@gval gT G), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))))))) (@orthonormal gT (@gval gT G) S) *) rewrite orthonormalE; have [/= normS | not_normS] := allP; last first. (* Goal: Bool.reflect (and (is_true (@uniq (@cfun_eqType gT (@gval gT G)) S)) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)))) (inPhantom (forall phi psi : @classfun gT (@gval gT G), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))))))) (@pairwise_orthogonal gT (@gval gT G) S) *) (* Goal: Bool.reflect (and (is_true (@uniq (@cfun_eqType gT (@gval gT G)) S)) (@prop_in2 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)))) (inPhantom (forall phi psi : @classfun gT (@gval gT G), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))))))) (andb false (@pairwise_orthogonal gT (@gval gT G) S)) *) by right=> [[_ o1S]]; case: not_normS => phi Sphi; rewrite /= o1S ?eqxx. (* Goal: Bool.reflect (and (is_true (@uniq (@cfun_eqType gT (@gval gT G)) S)) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)))) (inPhantom (forall phi psi : @classfun gT (@gval gT G), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))))))) (@pairwise_orthogonal gT (@gval gT G) S) *) apply: (iffP (pairwise_orthogonalP S)) => [] [uniqS oSS]. (* Goal: and (is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) (@cons (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) *) (* Goal: and (is_true (@uniq (@cfun_eqType gT (@gval gT G)) S)) (@prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)))) (inPhantom (forall phi psi : @classfun gT (@gval gT G), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)))))) *) split=> // [|phi psi]; first by case/andP: uniqS. (* Goal: and (is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) (@cons (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) *) (* Goal: forall (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) psi (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) S))), @eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (nat_of_bool (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))) *) by have [-> _ /normS/eqP | /oSS] := altP eqP. (* Goal: and (is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) (@cons (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S))) (@prop_in2 (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) (fun phi psi : @classfun gT (@gval gT G) => forall _ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi)), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (inPhantom (forall (phi psi : @classfun gT (@gval gT G)) (_ : is_true (negb (@eq_op (@cfun_eqType gT (@gval gT G)) phi psi))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))))) *) split=> // [|phi psi Sphi Spsi /negbTE]; last by rewrite oSS // => ->. (* Goal: is_true (@uniq (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) (@cons (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.zero (@cfun_zmodType gT (@gval gT G))) S)) *) by rewrite /= (contra (normS _)) // cfdot0r eq_sym oner_eq0. Qed. Lemma sub_orthonormal S1 S2 : {subset S1 <= S2} -> uniq S1 -> orthonormal S2 -> orthonormal S1. Proof. (* Goal: forall (_ : @sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S1) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S2)) (_ : is_true (@uniq (@cfun_eqType gT (@gval gT G)) S1)) (_ : is_true (@orthonormal gT (@gval gT G) S2)), is_true (@orthonormal gT (@gval gT G) S1) *) move=> sS12 uniqS1 /orthonormalP[_ oS1]. (* Goal: is_true (@orthonormal gT (@gval gT G) S1) *) by apply/orthonormalP; split; last apply: sub_in2 sS12 _ _. Qed. Lemma orthonormal2P phi psi : reflect [/\ '[phi, psi] = 0, '[phi] = 1 & '[psi] = 1] (orthonormal [:: phi; psi]). Proof. (* Goal: Bool.reflect (and3 (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) psi psi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (@orthonormal gT (@gval gT G) (@cons (@classfun gT (@gval gT G)) phi (@cons (@classfun gT (@gval gT G)) psi (@nil (@classfun gT (@gval gT G)))))) *) rewrite /orthonormal /= !andbT andbC. (* Goal: Bool.reflect (and3 (@eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (@eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@eq Algebraics.Implementation.type (@cfdot gT (@gval gT G) psi psi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (andb (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi psi) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (andb (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi phi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@eq_op (GRing.Ring.eqType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) psi psi) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))))) *) by apply: (iffP and3P) => [] []; do 3!move/eqP->. Qed. Lemma conjC_pair_orthogonal S chi : cfConjC_closed S -> ~~ has cfReal S -> pairwise_orthogonal S -> chi \in S -> pairwise_orthogonal (chi :: chi^*%CF). Proof. (* Goal: forall (_ : @cfAut_closed gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) S) (_ : is_true (negb (@has (@classfun gT (@gval gT G)) (@cfReal gT (@gval gT G)) S))) (_ : is_true (@pairwise_orthogonal gT (@gval gT G) S)) (_ : is_true (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) chi (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))), is_true (@pairwise_orthogonal gT (@gval gT G) (@cons (Equality.sort (@cfun_eqType gT (@gval gT G))) chi (@seq_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) chi)))) *) move=> ccS /hasPn nrS oSS Schi; apply: sub_pairwise_orthogonal oSS. (* Goal: is_true (@uniq (@cfun_eqType gT (@gval gT G)) (@cons (Equality.sort (@cfun_eqType gT (@gval gT G))) chi (@seq_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) chi)))) *) (* Goal: @sub_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (Equality.sort (@cfun_eqType gT (@gval gT G))) chi (@seq_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) chi)))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S) *) by apply/allP; rewrite /= Schi ccS. (* Goal: is_true (@uniq (@cfun_eqType gT (@gval gT G)) (@cons (Equality.sort (@cfun_eqType gT (@gval gT G))) chi (@seq_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) chi)))) *) by rewrite /= inE eq_sym nrS. Qed. Lemma cfdot_real_conjC phi psi : cfReal phi -> '[phi, psi^*]_G = '[phi, psi]^*. Proof. (* Goal: forall _ : is_true (@cfReal gT (@gval gT G) phi), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) phi (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) psi)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@cfdot gT (@gval gT G) phi psi)) *) by rewrite -cfdot_conjC => /eqcfP->. Qed. Lemma extend_cfConjC_subset S X phi : cfConjC_closed S -> ~~ has cfReal S -> phi \in S -> phi \notin X -> cfConjC_subset X S -> cfConjC_subset [:: phi, phi^* & X]%CF S. Proof. (* Goal: forall (_ : @cfAut_closed gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) S) (_ : is_true (negb (@has (@classfun gT (@gval gT G)) (@cfReal gT (@gval gT G)) S))) (_ : is_true (@in_mem (@classfun gT (@gval gT G)) phi (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) S))) (_ : is_true (negb (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) X)))) (_ : @cfConjC_subset gT (@gval gT G) X S), @cfConjC_subset gT (@gval gT G) (@cons (@classfun gT (@gval gT G)) phi (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)) S *) move=> ccS nrS Sphi X'phi [uniqX /allP-sXS ccX]. (* Goal: @cfConjC_subset gT (@gval gT G) (@cons (@classfun gT (@gval gT G)) phi (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)) S *) split; last 1 [by apply/allP; rewrite /= Sphi ccS | apply/allP]; rewrite /= inE. (* Goal: is_true (andb (orb (@eq_op (@cfun_eqType gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) phi) (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)))) (andb (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)))) (@all (@classfun gT (@gval gT G)) (fun x : @classfun gT (@gval gT G) => @in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) x) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)))) X))) *) (* Goal: is_true (andb (negb (orb (@eq_op (@cfun_eqType gT (@gval gT G)) phi (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi)) (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) phi (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) X)))) (andb (negb (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) X))) (@uniq (@cfun_eqType gT (@gval gT G)) X))) *) by rewrite negb_or X'phi eq_sym (hasPn nrS) // (contra (ccX _)) ?cfConjCK. (* Goal: is_true (andb (orb (@eq_op (@cfun_eqType gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) phi) (@in_mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) (@mem (Equality.sort (@cfun_eqType gT (@gval gT G))) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)))) (andb (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi)) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)))) (@all (@classfun gT (@gval gT G)) (fun x : @classfun gT (@gval gT G) => @in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) x) (@mem (@classfun gT (@gval gT G)) (seq_predType (@cfun_eqType gT (@gval gT G))) (@cons (@classfun gT (@gval gT G)) phi (@cons (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (@conjC Algebraics.Implementation.numClosedFieldType) phi) X)))) X))) *) by rewrite cfConjCK !mem_head orbT; apply/allP=> xi Xxi; rewrite !inE ccX ?orbT. Qed. End DotProduct. Arguments orthoP {gT G phi psi}. Arguments orthoPl {gT G phi S}. Arguments orthoPr {gT G S psi}. Arguments orthogonalP {gT G S R}. Arguments pairwise_orthogonalP {gT G S}. Arguments orthonormalP {gT G S}. Section CfunOrder. Variables (gT : finGroupType) (G : {group gT}) (phi : 'CF(G)). Lemma dvdn_cforderP n : reflect {in G, forall x, phi x ^+ n = 1} (#[phi]%CF %| n)%N. Proof. (* Goal: Bool.reflect (@prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.exp Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) n) (GRing.one Algebraics.Implementation.ringType)) (inPhantom (forall x : FinGroup.arg_sort (FinGroup.base gT), @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.exp Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) n) (GRing.one Algebraics.Implementation.ringType)))) (dvdn (@cforder gT (@gval gT G) phi) n) *) apply: (iffP (dvdn_biglcmP _ _ _)); rewrite genGid => phiG1 x Gx. (* Goal: is_true (dvdn (orderC (@fun_of_cfun gT (@gval gT G) phi x)) n) *) (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.exp Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) n) (GRing.one Algebraics.Implementation.ringType) *) by apply/eqP; rewrite -dvdn_orderC phiG1. (* Goal: is_true (dvdn (orderC (@fun_of_cfun gT (@gval gT G) phi x)) n) *) by rewrite dvdn_orderC phiG1. Qed. Lemma dvdn_cforder n : (#[phi]%CF %| n) = (phi ^+ n == 1). Proof. (* Goal: @eq bool (dvdn (@cforder gT (@gval gT G) phi) n) (@eq_op (GRing.Ring.eqType (@cfun_ringType gT (@gval gT G))) (@GRing.exp (@cfun_ringType gT (@gval gT G)) phi n) (GRing.one (@cfun_ringType gT (@gval gT G)))) *) apply/dvdn_cforderP/eqP=> phi_n_1 => [|x Gx]. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.exp Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) n) (GRing.one Algebraics.Implementation.ringType) *) (* Goal: @eq (Equality.sort (GRing.Ring.eqType (@cfun_ringType gT (@gval gT G)))) (@GRing.exp (@cfun_ringType gT (@gval gT G)) phi n) (GRing.one (@cfun_ringType gT (@gval gT G))) *) by apply/cfun_inP=> x Gx; rewrite exp_cfunE // cfun1E Gx phi_n_1. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.exp Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) phi x) n) (GRing.one Algebraics.Implementation.ringType) *) by rewrite -exp_cfunE // phi_n_1 // cfun1E Gx. Qed. Lemma exp_cforder : phi ^+ #[phi]%CF = 1. Proof. (* Goal: @eq (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@GRing.exp (@cfun_ringType gT (@gval gT G)) phi (@cforder gT (@gval gT G) phi)) (GRing.one (@cfun_ringType gT (@gval gT G))) *) by apply/eqP; rewrite -dvdn_cforder. Qed. End CfunOrder. Arguments dvdn_cforderP {gT G phi n}. Section MorphOrder. Variables (aT rT : finGroupType) (G : {group aT}) (R : {group rT}). Variable f : {rmorphism 'CF(G) -> 'CF(R)}. Lemma cforder_rmorph phi : #[f phi]%CF %| #[phi]%CF. Proof. (* Goal: is_true (dvdn (@cforder rT (@gval rT R) (@GRing.RMorphism.apply (@cfun_ringType aT (@gval aT G)) (@cfun_ringType rT (@gval rT R)) (Phant (forall _ : @classfun aT (@gval aT G), @classfun rT (@gval rT R))) f phi)) (@cforder aT (@gval aT G) phi)) *) by rewrite dvdn_cforder -rmorphX exp_cforder rmorph1. Qed. Lemma cforder_inj_rmorph phi : injective f -> #[f phi]%CF = #[phi]%CF. Proof. (* Goal: forall _ : @injective (GRing.Zmodule.sort (GRing.Ring.zmodType (@cfun_ringType rT (@gval rT R)))) (GRing.Zmodule.sort (GRing.Ring.zmodType (@cfun_ringType aT (@gval aT G)))) (@GRing.RMorphism.apply (@cfun_ringType aT (@gval aT G)) (@cfun_ringType rT (@gval rT R)) (Phant (forall _ : @classfun aT (@gval aT G), @classfun rT (@gval rT R))) f), @eq nat (@cforder rT (@gval rT R) (@GRing.RMorphism.apply (@cfun_ringType aT (@gval aT G)) (@cfun_ringType rT (@gval rT R)) (Phant (forall _ : @classfun aT (@gval aT G), @classfun rT (@gval rT R))) f phi)) (@cforder aT (@gval aT G) phi) *) move=> inj_f; apply/eqP; rewrite eqn_dvd cforder_rmorph dvdn_cforder /=. (* Goal: is_true (@eq_op (GRing.Ring.eqType (@cfun_ringType aT (@gval aT G))) (@GRing.exp (@cfun_ringType aT (@gval aT G)) phi (@cforder rT (@gval rT R) (@GRing.RMorphism.apply (@cfun_ringType aT (@gval aT G)) (@cfun_ringType rT (@gval rT R)) (Phant (forall _ : @classfun aT (@gval aT G), @classfun rT (@gval rT R))) f phi))) (GRing.one (@cfun_ringType aT (@gval aT G)))) *) by rewrite -(rmorph_eq1 _ inj_f) rmorphX exp_cforder. Qed. End MorphOrder. Section BuildIsometries. Variable (gT : finGroupType) (L G : {group gT}). Implicit Types (phi psi xi : 'CF(L)) (R S : seq 'CF(L)). Implicit Types (U : pred 'CF(L)) (W : pred 'CF(G)). Lemma sub_iso_to U1 U2 W1 W2 tau : {subset U2 <= U1} -> {subset W1 <= W2} -> {in U1, isometry tau, to W1} -> {in U2, isometry tau, to W2}. Proof. (* Goal: forall (_ : @sub_mem (@classfun gT (@gval gT L)) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U2) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U1)) (_ : @sub_mem (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) W1) (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) W2)) (_ : @isometry_from_to gT gT (@gval gT L) (@gval gT G) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U1) tau (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) W1)), @isometry_from_to gT gT (@gval gT L) (@gval gT G) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U2) tau (@mem (@classfun gT (@gval gT G)) (predPredType (@classfun gT (@gval gT G))) W2) *) by move=> sU sW [Itau Wtau]; split=> [|u /sU/Wtau/sW //]; apply: sub_in2 Itau. Qed. Lemma isometry_of_free S f : free S -> {in S &, isometry f} -> {tau : {linear 'CF(L) -> 'CF(G)} | {in S, tau =1 f} & {in <<S>>%VS &, isometry tau}}. Proof. (* Goal: forall (_ : is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) S)) (_ : @prop_in2 (Equality.sort (@cfun_eqType gT (@gval gT L))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) (fun phi psi : @classfun gT (@gval gT L) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (f phi) (f psi)) (@cfdot gT (@gval gT L) phi psi)) (inPhantom (@isometry gT gT (@gval gT L) (@gval gT G) f))), @sig2 (@GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G)))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT L))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) (fun x : GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau x) (f x)) (inPhantom (@eqfun (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau) f))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) S))) (fun phi psi : @classfun gT (@gval gT L) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau phi) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau psi)) (@cfdot gT (@gval gT L) phi psi)) (inPhantom (@isometry gT gT (@gval gT L) (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau)))) *) move=> freeS If; have defS := free_span freeS. (* Goal: @sig2 (@GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G)))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT L))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) (fun x : GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau x) (f x)) (inPhantom (@eqfun (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau) f))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) S))) (fun phi psi : @classfun gT (@gval gT L) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau phi) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau psi)) (@cfdot gT (@gval gT L) phi psi)) (inPhantom (@isometry gT gT (@gval gT L) (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau)))) *) have [tau /(_ freeS (size_map f S))Dtau] := linear_of_free S (map f S). (* Goal: @sig2 (@GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G)))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT L))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) (fun x : GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau x) (f x)) (inPhantom (@eqfun (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau) f))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) S))) (fun phi psi : @classfun gT (@gval gT L) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau phi) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau psi)) (@cfdot gT (@gval gT L) phi psi)) (inPhantom (@isometry gT gT (@gval gT L) (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau)))) *) have{Dtau} Dtau: {in S, tau =1 f}. (* Goal: @sig2 (@GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G)))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT L))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) (fun x : GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau x) (f x)) (inPhantom (@eqfun (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau) f))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) S))) (fun phi psi : @classfun gT (@gval gT L) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau phi) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau psi)) (@cfdot gT (@gval gT L) phi psi)) (inPhantom (@isometry gT gT (@gval gT L) (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau)))) *) (* Goal: @prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT L))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) (fun x : GRing.Zmodule.sort (@GRing.Lmodule.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G)))))) (@GRing.Linear.apply (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)), @GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_lmodType gT (@gval gT G)))) tau x) (f x)) (inPhantom (@eqfun (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Lmodule.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))) (@GRing.Linear.apply (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)), @GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_lmodType gT (@gval gT G)))) tau) f)) *) by move=> _ /(nthP 0)[i ltiS <-]; rewrite -!(nth_map 0 0) ?Dtau. (* Goal: @sig2 (@GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G)))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in1 (Equality.sort (@cfun_eqType gT (@gval gT L))) (@mem (Equality.sort (@cfun_eqType gT (@gval gT L))) (seq_predType (@cfun_eqType gT (@gval gT L))) S) (fun x : GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L))) => @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau x) (f x)) (inPhantom (@eqfun (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (GRing.Zmodule.sort (@GRing.Lmodule.zmodType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau) f))) (fun tau : @GRing.Linear.map Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) => @prop_in2 (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)))) (@span Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT L)) S))) (fun phi psi : @classfun gT (@gval gT L) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau phi) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau psi)) (@cfdot gT (@gval gT L) phi psi)) (inPhantom (@isometry gT gT (@gval gT L) (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau)))) *) exists tau => // _ _ /defS[a -> _] /defS[b -> _]. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) S (fun x : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) x (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (a x) x)))) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) S (fun x : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) x (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (b x) x))))) (@cfdot gT (@gval gT L) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) S (fun x : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) x (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (a x) x))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) S (fun x : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) x (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (b x) x)))) *) rewrite !{1}linear_sum !{1}cfdot_suml; apply/eq_big_seq=> xi1 Sxi1. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))))) tau (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (a xi1) xi1)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) S (fun i : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G)))))) true (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))))) tau (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (b i) i))))) (@cfdot gT (@gval gT L) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (a xi1) xi1) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) S (fun x : @Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L)) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT L))) x (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.base (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.Lmodule.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L)))) (@GRing.Lmodule.class (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))))))) true (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (b x) x)))) *) rewrite !{1}cfdot_sumr; apply/eq_big_seq=> xi2 Sxi2. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))))) tau (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (a xi1) xi1)) (@GRing.Linear.apply Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT L)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G))) (Phant (forall _ : @GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT L)), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT G))))))) tau (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (b xi2) xi2))) (@cfdot gT (@gval gT L) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (a xi1) xi1) (@GRing.scale (GRing.Field.ringType Algebraics.Implementation.fieldType) (@Vector.lmodType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@cfun_vectType gT (@gval gT L))) (b xi2) xi2)) *) by rewrite !linearZ /= !Dtau // !cfdotZl !cfdotZr If. Qed. Lemma isometry_of_cfnorm S tauS : pairwise_orthogonal S -> pairwise_orthogonal tauS -> map cfnorm tauS = map cfnorm S -> {tau : {linear 'CF(L) -> 'CF(G)} | map tau S = tauS & {in <<S>>%VS &, isometry tau}}. Lemma isometry_raddf_inj U (tau : {additive 'CF(L) -> 'CF(G)}) : {in U &, isometry tau} -> {in U &, forall u v, u - v \in U} -> {in U &, injective tau}. Proof. (* Goal: forall (_ : @prop_in2 (@classfun gT (@gval gT L)) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U) (fun phi psi : @classfun gT (@gval gT L) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@GRing.Additive.apply (@cfun_zmodType gT (@gval gT L)) (@cfun_zmodType gT (@gval gT G)) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau phi) (@GRing.Additive.apply (@cfun_zmodType gT (@gval gT L)) (@cfun_zmodType gT (@gval gT G)) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau psi)) (@cfdot gT (@gval gT L) phi psi)) (inPhantom (@isometry gT gT (@gval gT L) (@gval gT G) (@GRing.Additive.apply (@cfun_zmodType gT (@gval gT L)) (@cfun_zmodType gT (@gval gT G)) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau)))) (_ : @prop_in2 (@classfun gT (@gval gT L)) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U) (fun u v : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L)) => is_true (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (@GRing.add (@cfun_zmodType gT (@gval gT L)) u (@GRing.opp (@cfun_zmodType gT (@gval gT L)) v)) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U))) (inPhantom (forall u v : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L)), is_true (@in_mem (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (@GRing.add (@cfun_zmodType gT (@gval gT L)) u (@GRing.opp (@cfun_zmodType gT (@gval gT L)) v)) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U))))), @prop_in2 (@classfun gT (@gval gT L)) (@mem (@classfun gT (@gval gT L)) (predPredType (@classfun gT (@gval gT L))) U) (fun x1 x2 : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L)) => forall _ : @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (@GRing.Additive.apply (@cfun_zmodType gT (@gval gT L)) (@cfun_zmodType gT (@gval gT G)) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau x1) (@GRing.Additive.apply (@cfun_zmodType gT (@gval gT L)) (@cfun_zmodType gT (@gval gT G)) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau x2), @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) x1 x2) (inPhantom (@injective (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G))) (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) (@GRing.Additive.apply (@cfun_zmodType gT (@gval gT L)) (@cfun_zmodType gT (@gval gT G)) (Phant (forall _ : @classfun gT (@gval gT L), @classfun gT (@gval gT G))) tau))) *) move=> Itau linU phi psi Uphi Upsi /eqP; rewrite -subr_eq0 -raddfB. (* Goal: forall _ : is_true (@eq_op (GRing.Zmodule.eqType (@cfun_zmodType gT (@gval gT G))) (@GRing.Additive.apply (@cfun_zmodType gT (@gval gT L)) (@cfun_zmodType gT (@gval gT G)) (Phant (forall _ : GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L)), GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT G)))) tau (@GRing.add (@cfun_zmodType gT (@gval gT L)) phi (@GRing.opp (@cfun_zmodType gT (@gval gT L)) psi))) (GRing.zero (@cfun_zmodType gT (@gval gT G)))), @eq (GRing.Zmodule.sort (@cfun_zmodType gT (@gval gT L))) phi psi *) by rewrite -cfnorm_eq0 Itau ?linU // cfnorm_eq0 subr_eq0 => /eqP. Qed. Lemma opp_isometry : @isometry _ _ G G -%R. Proof. (* Goal: @isometry gT gT (@gval gT G) (@gval gT G) (@GRing.opp (@cfun_zmodType gT (@gval gT G))) *) by move=> x y; rewrite cfdotNl cfdotNr opprK. Qed. End BuildIsometries. Section Restrict. Variables (gT : finGroupType) (A B : {set gT}). Local Notation H := <<A>>. Local Notation G := <<B>>. Fact cfRes_subproof (phi : 'CF(B)) : is_class_fun H [ffun x => phi (if H \subset G then x else 1%g) *+ (x \in H)]. Proof. (* Goal: is_true (@is_class_fun gT (@generated gT A) (@FunFinfun.finfun (FinGroup.finType (FinGroup.base gT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT B phi (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))) then x else oneg (FinGroup.base gT))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A)))))))) *) apply: intro_class_fun => /= [x y Hx Hy | x /negbTE/=-> //]. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT B phi (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))) then @conjg gT x y else oneg (FinGroup.base gT))) (nat_of_bool (@in_mem (FinGroup.sort (FinGroup.base gT)) (@conjg gT x y) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A)))))) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT B phi (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))) then x else oneg (FinGroup.base gT))) (nat_of_bool (@in_mem (FinGroup.sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A)))))) *) by rewrite Hx (groupJ Hx) //; case: subsetP => // sHG; rewrite cfunJgen ?sHG. Qed. Definition cfRes phi := Cfun 1 (cfRes_subproof phi). Lemma cfResE phi : A \subset B -> {in A, cfRes phi =1 phi}. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))), @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT A (cfRes phi) x) (@fun_of_cfun gT B phi x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT A (cfRes phi)) (@fun_of_cfun gT B phi))) *) by move=> sAB x Ax; rewrite cfunElock mem_gen ?genS. Qed. Lemma cfRes1 phi : cfRes phi 1%g = phi 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT A (cfRes phi) (oneg (FinGroup.base gT))) (@fun_of_cfun gT B phi (oneg (FinGroup.base gT))) *) by rewrite cfunElock if_same group1. Qed. Lemma cfRes_is_linear : linear cfRes. Proof. (* Goal: @GRing.Linear.axiom Algebraics.Implementation.ringType (@cfun_lmodType gT B) (@cfun_zmodType gT A) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A)) cfRes (@GRing.Scale.scale_law Algebraics.Implementation.ringType (@cfun_lmodType gT A)) (@Logic.eq_refl (forall (_ : GRing.Ring.sort Algebraics.Implementation.ringType) (_ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A))))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A))) *) by move=> a phi psi; apply/cfunP=> x; rewrite !cfunElock mulrnAr mulrnDl. Qed. Canonical cfRes_additive := Additive cfRes_is_linear. Canonical cfRes_linear := Linear cfRes_is_linear. Lemma cfRes_cfun1 : cfRes 1 = 1. Proof. (* Goal: @eq (@classfun gT A) (cfRes (GRing.one (@cfun_ringType gT B))) (GRing.one (@cfun_ringType gT A)) *) apply: cfun_in_genP => x Hx; rewrite cfunElock Hx !cfun1Egen Hx. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))) then x else oneg (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))))) (nat_of_bool true)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool true)) *) by case: subsetP => [-> // | _]; rewrite group1. Qed. Lemma cfRes_is_multiplicative : multiplicative cfRes. Proof. (* Goal: @GRing.RMorphism.mixin_of (@cfun_ringType gT B) (@cfun_ringType gT A) cfRes *) split=> [phi psi|]; [apply/cfunP=> x | exact: cfRes_cfun1]. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT A (cfRes (@GRing.mul (@cfun_ringType gT B) phi psi)) x) (@fun_of_cfun gT A (@GRing.mul (@cfun_ringType gT A) (cfRes phi) (cfRes psi)) x) *) by rewrite !cfunElock mulrnAr mulrnAl -mulrnA mulnb andbb. Qed. Canonical cfRes_rmorphism := AddRMorphism cfRes_is_multiplicative. Canonical cfRes_lrmorphism := [lrmorphism of cfRes]. End Restrict. Arguments cfRes {gT} A%g {B%g} phi%CF. Notation "''Res[' H , G ]" := (@cfRes _ H G) (only parsing) : ring_scope. Notation "''Res[' H ]" := 'Res[H, _] : ring_scope. Notation "''Res'" := 'Res[_] (only parsing) : ring_scope. Section MoreRestrict. Variables (gT : finGroupType) (G H : {group gT}). Implicit Types (A : {set gT}) (phi : 'CF(G)). Lemma cfResEout phi : ~~ (H \subset G) -> 'Res[H] phi = (phi 1%g)%:A. Proof. (* Goal: forall _ : is_true (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@gval gT G) phi) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))))) *) move/negPf=> not_sHG; apply/cfunP=> x. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) phi) x) (@fun_of_cfun gT (@gval gT H) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))))) x) *) by rewrite cfunE cfun1E mulr_natr cfunElock !genGid not_sHG. Qed. Lemma cfResRes A phi : A \subset H -> H \subset G -> 'Res[A] ('Res[H] phi) = 'Res[A] phi. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq (@classfun gT A) (@cfRes gT A (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) phi)) (@cfRes gT A (@gval gT G) phi) *) move=> sAH sHG; apply/cfunP=> x; rewrite !cfunElock !genGid !gen_subG sAH sHG. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT G) phi x) (nat_of_bool (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A)))))) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT G) phi (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) then x else oneg (FinGroup.base gT))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT A)))))) *) by rewrite (subset_trans sAH) // -mulrnA mulnb -in_setI (setIidPr _) ?gen_subG. Qed. Lemma cfRes_id A psi : 'Res[A] psi = psi. Proof. (* Goal: @eq (@classfun gT A) (@cfRes gT A A psi) psi *) by apply/cfun_in_genP=> x Ax; rewrite cfunElock Ax subxx. Qed. Lemma sub_cfker_Res A phi : A \subset H -> A \subset cfker phi -> A \subset cfker ('Res[H, G] phi). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) phi))))) *) move=> sAH kerA; apply/subsetP=> x Ax; have Hx := subsetP sAH x Ax. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) phi))))) *) rewrite inE Hx; apply/forallP=> y; rewrite !cfunElock !genGid groupMl //. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT G) phi (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) then @mulg (FinGroup.base gT) x y else oneg (FinGroup.base gT))) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT G) phi (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) then y else oneg (FinGroup.base gT))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))))) *) by rewrite !(fun_if phi) cfkerMl // (subsetP kerA). Qed. Lemma eq_cfker_Res phi : H \subset cfker phi -> cfker ('Res[H, G] phi) = H. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cfker gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) phi)) (@gval gT H) *) by move=> kH; apply/eqP; rewrite eqEsubset cfker_sub sub_cfker_Res. Qed. Lemma cfRes_sub_ker phi : H \subset cfker phi -> 'Res[H, G] phi = (phi 1%g)%:A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))), @eq (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@gval gT G) phi) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))))) *) move=> kerHphi; have sHG := subset_trans kerHphi (cfker_sub phi). (* Goal: @eq (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@gval gT G) phi) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))))) *) apply/cfun_inP=> x Hx; have ker_x := subsetP kerHphi x Hx. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) phi) x) (@fun_of_cfun gT (@gval gT H) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType gT (@gval gT H))))) x) *) by rewrite cfResE // cfunE cfun1E Hx mulr1 cfker1. Qed. Lemma cforder_Res phi : #['Res[H] phi]%CF %| #[phi]%CF. Proof. (* Goal: is_true (dvdn (@cforder gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) phi)) (@cforder gT (@gval gT G) phi)) *) exact: cforder_rmorph. Qed. End MoreRestrict. Section Morphim. Variables (aT rT : finGroupType) (D : {group aT}) (f : {morphism D >-> rT}). Section Main. Variable G : {group aT}. Implicit Type phi : 'CF(f @* G). Fact cfMorph_subproof phi : is_class_fun <<G>> [ffun x => phi (if G \subset D then f x else 1%g) *+ (x \in G)]. Proof. (* Goal: is_true (@is_class_fun aT (@generated aT (@gval aT G)) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base aT)) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (if @subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) then @mfun aT rT (@gval aT D) f x else oneg (FinGroup.base rT))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))))) *) rewrite genGid; apply: intro_class_fun => [x y Gx Gy | x /negPf-> //]. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (if @subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) then @mfun aT rT (@gval aT D) f (@conjg aT x y) else oneg (FinGroup.base rT))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@conjg aT x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (if @subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) then @mfun aT rT (@gval aT D) f x else oneg (FinGroup.base rT))) (nat_of_bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))) *) rewrite Gx groupJ //; case subsetP => // sGD. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mfun aT rT (@gval aT D) f (@conjg aT x y))) (nat_of_bool true)) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mfun aT rT (@gval aT D) f x)) (nat_of_bool true)) *) by rewrite morphJ ?cfunJ ?mem_morphim ?sGD. Qed. Definition cfMorph phi := Cfun 1 (cfMorph_subproof phi). Lemma cfMorphE phi x : G \subset D -> x \in G -> cfMorph phi x = phi (f x). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))), @eq Algebraics.Implementation.type (@fun_of_cfun aT (@gval aT G) (cfMorph phi) x) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mfun aT rT (@gval aT D) f x)) *) by rewrite cfunElock => -> ->. Qed. Lemma cfMorph1 phi : cfMorph phi 1%g = phi 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (oneg (FinGroup.base aT))) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (oneg (FinGroup.base rT))) *) by rewrite cfunElock morph1 if_same group1. Qed. Lemma cfMorphEout phi : ~~ (G \subset D) -> cfMorph phi = (phi 1%g)%:A. Proof. (* Goal: forall _ : is_true (negb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@classfun aT (@gval aT G)) (cfMorph phi) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType aT (@gval aT G))) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (oneg (FinGroup.base rT))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType aT (@gval aT G))))) *) move/negPf=> not_sGD; apply/cfunP=> x; rewrite cfunE cfun1E mulr_natr. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun aT (@gval aT G) (cfMorph phi) x) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (oneg (FinGroup.base rT))) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))) *) by rewrite cfunElock not_sGD. Qed. Lemma cfMorph_cfun1 : cfMorph 1 = 1. Proof. (* Goal: @eq (@classfun aT (@gval aT G)) (cfMorph (GRing.one (@cfun_ringType rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (GRing.one (@cfun_ringType aT (@gval aT G))) *) apply/cfun_inP=> x Gx; rewrite cfunElock !cfun1E Gx. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) (if @subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) then @mfun aT rT (@gval aT D) f x else oneg (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G))))))) (nat_of_bool true)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool true)) *) by case: subsetP => [sGD | _]; rewrite ?group1 // mem_morphim ?sGD. Qed. Fact cfMorph_is_linear : linear cfMorph. Proof. (* Goal: @GRing.Linear.axiom Algebraics.Implementation.ringType (@cfun_lmodType rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@cfun_zmodType aT (@gval aT G)) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType aT (@gval aT G))) cfMorph (@GRing.Scale.scale_law Algebraics.Implementation.ringType (@cfun_lmodType aT (@gval aT G))) (@Logic.eq_refl (forall (_ : GRing.Ring.sort Algebraics.Implementation.ringType) (_ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType aT (@gval aT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType aT (@gval aT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType aT (@gval aT G)))))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType aT (@gval aT G))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType aT (@gval aT G))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType aT (@gval aT G)))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType aT (@gval aT G)))) *) by move=> a phi psi; apply/cfunP=> x; rewrite !cfunElock mulrnAr -mulrnDl. Qed. Canonical cfMorph_additive := Additive cfMorph_is_linear. Canonical cfMorph_linear := Linear cfMorph_is_linear. Fact cfMorph_is_multiplicative : multiplicative cfMorph. Proof. (* Goal: @GRing.RMorphism.mixin_of (@cfun_ringType rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@cfun_ringType aT (@gval aT G)) cfMorph *) split=> [phi psi|]; [apply/cfunP=> x | exact: cfMorph_cfun1]. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun aT (@gval aT G) (cfMorph (@GRing.mul (@cfun_ringType rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) phi psi)) x) (@fun_of_cfun aT (@gval aT G) (@GRing.mul (@cfun_ringType aT (@gval aT G)) (cfMorph phi) (cfMorph psi)) x) *) by rewrite !cfunElock mulrnAr mulrnAl -mulrnA mulnb andbb. Qed. Canonical cfMorph_rmorphism := AddRMorphism cfMorph_is_multiplicative. Canonical cfMorph_lrmorphism := [lrmorphism of cfMorph]. Hypothesis sGD : G \subset D. Lemma cfMorph_inj : injective cfMorph. Proof. (* Goal: @injective (@classfun aT (@gval aT G)) (@classfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) cfMorph *) move=> phi1 phi2 eq_phi; apply/cfun_inP=> _ /morphimP[x Dx Gx ->]. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) phi1 (@mfun aT rT (@gval aT D) f x)) (@fun_of_cfun rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) phi2 (@mfun aT rT (@gval aT D) f x)) *) by rewrite -!cfMorphE // eq_phi. Qed. Lemma cfMorph_eq1 phi : (cfMorph phi == 1) = (phi == 1). Proof. (* Goal: @eq bool (@eq_op (@cfun_eqType aT (@gval aT G)) (cfMorph phi) (GRing.one (@cfun_ringType aT (@gval aT G)))) (@eq_op (@cfun_eqType rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) phi (GRing.one (@cfun_ringType rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) by apply: rmorph_eq1; apply: cfMorph_inj. Qed. Lemma cfker_morph phi : cfker (cfMorph phi) = G :&: f @*^-1 (cfker phi). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@cfker aT (@gval aT G) (cfMorph phi)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@cfker rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi))) *) apply/setP=> x; rewrite !inE; apply: andb_id2l => Gx. (* Goal: @eq bool (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base aT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base aT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (@mulg (FinGroup.base aT) x y)) (@fun_of_cfun aT (@gval aT G) (cfMorph phi) y))) y)) (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base rT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base rT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) y)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi y))) y)))) *) have Dx := subsetP sGD x Gx; rewrite Dx mem_morphim //=. (* Goal: @eq bool (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base aT)) (fun y : FinGroup.arg_sort (FinGroup.base aT) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base aT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (@mulg (FinGroup.base aT) x y)) (@fun_of_cfun aT (@gval aT G) (cfMorph phi) y))) y)) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base rT)) (fun y : FinGroup.arg_sort (FinGroup.base rT) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base rT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) y)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi y))) y)) *) apply/forallP/forallP=> Kx y. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (@mulg (FinGroup.base aT) x y)) (@fun_of_cfun aT (@gval aT G) (cfMorph phi) y)) *) (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) y)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi y)) *) have [{y} /morphimP[y Dy Gy ->] | fG'y] := boolP (y \in f @* G). (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (@mulg (FinGroup.base aT) x y)) (@fun_of_cfun aT (@gval aT G) (cfMorph phi) y)) *) (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) y)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi y)) *) (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y))) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mfun aT rT (@gval aT D) f y))) *) by rewrite -morphM // -!(cfMorphE phi) ?groupM. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (@mulg (FinGroup.base aT) x y)) (@fun_of_cfun aT (@gval aT G) (cfMorph phi) y)) *) (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) y)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi y)) *) by rewrite !cfun0 ?groupMl // mem_morphim. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (@mulg (FinGroup.base aT) x y)) (@fun_of_cfun aT (@gval aT G) (cfMorph phi) y)) *) have [Gy | G'y] := boolP (y \in G); last by rewrite !cfun0 ?groupMl. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun aT (@gval aT G) (cfMorph phi) (@mulg (FinGroup.base aT) x y)) (@fun_of_cfun aT (@gval aT G) (cfMorph phi) y)) *) by rewrite !cfMorphE ?groupM ?morphM // (subsetP sGD). Qed. Lemma cfker_morph_im phi : f @* cfker (cfMorph phi) = cfker phi. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@cfker aT (@gval aT G) (cfMorph phi))) (@cfker rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi) *) by rewrite cfker_morph // morphim_setIpre (setIidPr (cfker_sub _)). Qed. Lemma sub_cfker_morph phi (A : {set aT}) : (A \subset cfker (cfMorph phi)) = (A \subset G) && (f @* A \subset cfker phi). Proof. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@cfker aT (@gval aT G) (cfMorph phi))))) (andb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@cfker rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi))))) *) rewrite cfker_morph // subsetI; apply: andb_id2l => sAG. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@cfker rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi))))) (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@cfker rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi)))) *) by rewrite sub_morphim_pre // (subset_trans sAG). Qed. Lemma sub_morphim_cfker phi (A : {set aT}) : A \subset G -> (f @* A \subset cfker phi) = (A \subset cfker (cfMorph phi)). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))), @eq bool (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@cfker rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@cfker aT (@gval aT G) (cfMorph phi))))) *) by move=> sAG; rewrite sub_cfker_morph ?sAG. Qed. Lemma cforder_morph phi : #[cfMorph phi]%CF = #[phi]%CF. Proof. (* Goal: @eq nat (@cforder aT (@gval aT G) (cfMorph phi)) (@cforder rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi) *) by apply: cforder_inj_rmorph; apply: cfMorph_inj. Qed. End Main. Lemma cfResMorph (G H : {group aT}) (phi : 'CF(f @* G)) : H \subset G -> G \subset D -> 'Res (cfMorph phi) = cfMorph ('Res[f @* H] phi). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@classfun aT (@gval aT H)) (@cfRes aT (@gval aT H) (@gval aT G) (@cfMorph G phi)) (@cfMorph H (@cfRes rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi)) *) move=> sHG sGD; have sHD := subset_trans sHG sGD. (* Goal: @eq (@classfun aT (@gval aT H)) (@cfRes aT (@gval aT H) (@gval aT G) (@cfMorph G phi)) (@cfMorph H (@cfRes rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi)) *) apply/cfun_inP=> x Hx; have [Gx Dx] := (subsetP sHG x Hx, subsetP sHD x Hx). (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun aT (@gval aT H) (@cfRes aT (@gval aT H) (@gval aT G) (@cfMorph G phi)) x) (@fun_of_cfun aT (@gval aT H) (@cfMorph H (@cfRes rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) phi)) x) *) by rewrite !(cfMorphE, cfResE) ?morphimS ?mem_morphim //. Qed. End Morphim. Prenex Implicits cfMorph. Section Isomorphism. Variables (aT rT : finGroupType) (G : {group aT}) (f : {morphism G >-> rT}). Variable R : {group rT}. Hypothesis isoGR : isom G R f. Let defR := isom_im isoGR. Local Notation G1 := (isom_inv isoGR @* R). Let defG : G1 = G := isom_im (isom_sym isoGR). Definition cfIsom := locked_with cfIsom_key (cfMorph \o 'Res[G1] : 'CF(G) -> 'CF(R)). Canonical cfIsom_unlockable := [unlockable of cfIsom]. Lemma cfIsomE phi x : x \in G -> cfIsom phi (f x) = phi x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))), @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT R) (cfIsom phi) (@mfun aT rT (@gval aT G) f x)) (@fun_of_cfun aT (@gval aT G) phi x) *) move=> Gx; rewrite unlock cfMorphE //= /restrm ?defG ?cfRes_id ?invmE //. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f x) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT R)))) *) by rewrite -defR mem_morphim. Qed. Lemma cfIsom1 phi : cfIsom phi 1%g = phi 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT R) (cfIsom phi) (oneg (FinGroup.base rT))) (@fun_of_cfun aT (@gval aT G) phi (oneg (FinGroup.base aT))) *) by rewrite -(morph1 f) cfIsomE. Qed. Lemma cfker_isom phi : cfker (cfIsom phi) = f @* cfker phi. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@cfker rT (@gval rT R) (cfIsom phi)) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@cfker aT (@gval aT G) phi)) *) rewrite unlock cfker_morph // defG cfRes_id morphpre_restrm morphpre_invm. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT R) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT R) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@cfker aT (@gval aT G) phi)))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@cfker aT (@gval aT G) phi)) *) by rewrite -defR !morphimIim. Qed. End Isomorphism. Prenex Implicits cfIsom. Section InvMorphism. Variables (aT rT : finGroupType) (G : {group aT}) (f : {morphism G >-> rT}). Variable R : {group rT}. Hypothesis isoGR : isom G R f. Lemma cfIsomK : cancel (cfIsom isoGR) (cfIsom (isom_sym isoGR)). Proof. (* Goal: @cancel (@classfun rT (@gval rT R)) (@classfun aT (@gval aT G)) (@cfIsom aT rT G f R isoGR) (@cfIsom rT aT R (@restrm_morphism rT aT (@gval rT R) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@isom_sub_im aT rT G R f isoGR) (@invm_morphism aT rT G f (@isom_inj aT rT G R f isoGR))) G (@isom_sym aT rT G R f isoGR)) *) move=> phi; apply/cfun_inP=> x Gx; rewrite -{1}(invmE (isom_inj isoGR) Gx). (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun aT (@gval aT G) (@cfIsom rT aT R (@restrm_morphism rT aT (@gval rT R) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@isom_sub_im aT rT G R f isoGR) (@invm_morphism aT rT G f (@isom_inj aT rT G R f isoGR))) G (@isom_sym aT rT G R f isoGR) (@cfIsom aT rT G f R isoGR phi)) (@invm aT rT G f (@isom_inj aT rT G R f isoGR) (@mfun aT rT (@gval aT G) f x))) (@fun_of_cfun aT (@gval aT G) phi x) *) by rewrite !cfIsomE // -(isom_im isoGR) mem_morphim. Qed. Lemma cfIsomKV : cancel (cfIsom (isom_sym isoGR)) (cfIsom isoGR). Proof. (* Goal: @cancel (@classfun aT (@gval aT G)) (@classfun rT (@gval rT R)) (@cfIsom rT aT R (@restrm_morphism rT aT (@gval rT R) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@isom_sub_im aT rT G R f isoGR) (@invm_morphism aT rT G f (@isom_inj aT rT G R f isoGR))) G (@isom_sym aT rT G R f isoGR)) (@cfIsom aT rT G f R isoGR) *) move=> phi; apply/cfun_inP=> y Ry; pose injGR := isom_inj isoGR. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT R) (@cfIsom aT rT G f R isoGR (@cfIsom rT aT R (@restrm_morphism rT aT (@gval rT R) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@isom_sub_im aT rT G R f isoGR) (@invm_morphism aT rT G f (@isom_inj aT rT G R f isoGR))) G (@isom_sym aT rT G R f isoGR) phi)) y) (@fun_of_cfun rT (@gval rT R) phi y) *) rewrite -{1}[y](invmK injGR) ?(isom_im isoGR) //. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT R) (@cfIsom aT rT G f R isoGR (@cfIsom rT aT R (@restrm_morphism rT aT (@gval rT R) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@isom_sub_im aT rT G R f isoGR) (@invm_morphism aT rT G f (@isom_inj aT rT G R f isoGR))) G (@isom_sym aT rT G R f isoGR) phi)) (@mfun aT rT (@gval aT G) f (@invm aT rT G f injGR y))) (@fun_of_cfun rT (@gval rT R) phi y) *) suffices /morphpreP[fGy Gf'y]: y \in invm injGR @*^-1 G by rewrite !cfIsomE. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphpre rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@invm_morphism aT rT G f injGR) (@MorPhantom rT aT (@invm aT rT G f injGR)) (@gval aT G))))) *) by rewrite morphpre_invm (isom_im isoGR). Qed. Lemma cfIsom_eq1 phi : (cfIsom isoGR phi == 1) = (phi == 1). Proof. (* Goal: @eq bool (@eq_op (@cfun_eqType rT (@gval rT R)) (@cfIsom aT rT G f R isoGR phi) (GRing.one (@cfun_ringType rT (@gval rT R)))) (@eq_op (@cfun_eqType aT (@gval aT G)) phi (GRing.one (@cfun_ringType aT (@gval aT G)))) *) by apply: rmorph_eq1; apply: cfIsom_inj. Qed. Lemma cforder_isom phi : #[cfIsom isoGR phi]%CF = #[phi]%CF. Proof. (* Goal: @eq nat (@cforder rT (@gval rT R) (@cfIsom aT rT G f R isoGR phi)) (@cforder aT (@gval aT G) phi) *) exact: cforder_inj_rmorph cfIsom_inj. Qed. End InvMorphism. Arguments cfIsom_inj {aT rT G f R} isoGR [phi1 phi2] : rename. Section Coset. Variables (gT : finGroupType) (G : {group gT}) (B : {set gT}). Implicit Type rT : finGroupType. Local Notation H := <<B>>%g. Definition cfMod : 'CF(G / B) -> 'CF(G) := cfMorph. Definition ffun_Quo (phi : 'CF(G)) := [ffun Hx : coset_of B => phi (if B \subset cfker phi then repr Hx else 1%g) *+ (Hx \in G / B)%g]. Fact cfQuo_subproof phi : is_class_fun <<G / B>> (ffun_Quo phi). Definition cfQuo phi := Cfun 1 (cfQuo_subproof phi). Local Notation "phi / 'B'" := (cfQuo phi) (at level 40) : cfun_scope. Local Notation "phi %% 'B'" := (cfMod phi) (at level 40) : cfun_scope. Lemma cfModE phi x : B <| G -> x \in G -> (phi %% B)%CF x = phi (coset B x). Proof. (* Goal: forall (_ : is_true (@normal gT B (@gval gT G))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfMod phi) x) (@fun_of_cfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B) phi (@coset gT B x)) *) by move/normal_norm=> nBG; apply: cfMorphE. Qed. Lemma cfMod1 phi : (phi %% B)%CF 1%g = phi 1%g. Proof. exact: cfMorph1. Qed. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfMod phi) (oneg (FinGroup.base gT))) (@fun_of_cfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B) phi (oneg (FinGroup.base (@coset_groupType gT B)))) *) exact: cfMorph1. Qed. Lemma cfker_mod phi : B <| G -> B \subset cfker (phi %% B). Proof. (* Goal: forall _ : is_true (@normal gT B (@gval gT G)), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (cfMod phi))))) *) case/andP=> sBG nBG; rewrite cfker_morph // subsetI sBG. (* Goal: is_true (andb true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@morphpre gT (@coset_groupType gT B) (@gval gT (@normaliser_group gT B)) (@coset_morphism gT B) (@MorPhantom gT (@coset_groupType gT B) (@mfun gT (@coset_groupType gT B) (@gval gT (@normaliser_group gT B)) (@coset_morphism gT B))) (@cfker (@coset_groupType gT B) (@morphim gT (@coset_groupType gT B) (@gval gT (@normaliser_group gT B)) (@coset_morphism gT B) (@MorPhantom gT (@coset_groupType gT B) (@mfun gT (@coset_groupType gT B) (@gval gT (@normaliser_group gT B)) (@coset_morphism gT B))) (@gval gT G)) phi)))))) *) apply: subset_trans _ (ker_sub_pre _ _); rewrite ker_coset_prim subsetI. (* Goal: is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT B))))) *) by rewrite (subset_trans sBG nBG) sub_gen. Qed. Lemma cfQuoEnorm (phi : 'CF(G)) x : B \subset cfker phi -> x \in 'N_G(B) -> (phi / B)%CF (coset B x) = phi x. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT B)))))), @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B) (cfQuo phi) (@coset gT B x)) (@fun_of_cfun gT (@gval gT G) phi x) *) rewrite cfunElock -gen_subG => sHK /setIP[Gx nHx]; rewrite sHK /=. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT G) phi (@repr (FinGroup.base gT) (@set_of_coset gT B (@coset gT B x)))) (nat_of_bool (@in_mem (@coset_of gT B) (@coset gT B x) (@mem (@coset_of gT B) (predPredType (@coset_of gT B)) (@SetDef.pred_of_set (@coset_finType gT B) (@quotient gT (@gval gT G) B)))))) (@fun_of_cfun gT (@gval gT G) phi x) *) rewrite mem_morphim // val_coset_prim //. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT G) phi (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@generated gT B) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) (nat_of_bool true)) (@fun_of_cfun gT (@gval gT G) phi x) *) by case: repr_rcosetP => _ /(subsetP sHK)/cfkerMl->. Qed. Lemma cfQuoE (phi : 'CF(G)) x : B <| G -> B \subset cfker phi -> x \in G -> (phi / B)%CF (coset B x) = phi x. Proof. (* Goal: forall (_ : is_true (@normal gT B (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B) (cfQuo phi) (@coset gT B x)) (@fun_of_cfun gT (@gval gT G) phi x) *) by case/andP=> _ nBG sBK Gx; rewrite cfQuoEnorm // (setIidPl _). Qed. Lemma cfQuo1 (phi : 'CF(G)) : (phi / B)%CF 1%g = phi 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B) (cfQuo phi) (oneg (FinGroup.base (@coset_groupType gT B)))) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) *) by rewrite cfunElock repr_coset1 group1 if_same. Qed. Lemma cfQuoEout (phi : 'CF(G)) : ~~ (B \subset cfker phi) -> (phi / B)%CF = (phi 1%g)%:A. Proof. (* Goal: forall _ : is_true (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))), @eq (@classfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B)) (cfQuo phi) (@GRing.scale Algebraics.Implementation.ringType (@GRing.Lalgebra.lmod_ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType (@coset_groupType gT B) (@quotient gT (@gval gT G) B))) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (GRing.one (@GRing.Lalgebra.ringType Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lalgType (@coset_groupType gT B) (@quotient gT (@gval gT G) B))))) *) move/negPf=> not_kerB; apply/cfunP=> x; rewrite cfunE cfun1E mulr_natr. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B) (cfQuo phi) x) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@fun_of_cfun gT (@gval gT G) phi (oneg (FinGroup.base gT))) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base (@coset_groupType gT B))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT B)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT B))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT B))) (@gval (@coset_groupType gT B) (@quotient_group gT G B))))))) *) by rewrite cfunElock not_kerB. Qed. Lemma cfQuo_cfun1 : (1 / B)%CF = 1. Proof. (* Goal: @eq (@classfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B)) (cfQuo (GRing.one (@cfun_ringType gT (@gval gT G)))) (GRing.one (@cfun_ringType (@coset_groupType gT B) (@quotient gT (@gval gT G) B))) *) apply/cfun_inP=> Hx G_Hx; rewrite cfunElock !cfun1E G_Hx cfker_cfun1 -gen_subG. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) then @repr (FinGroup.base gT) (@set_of_coset gT B Hx) else oneg (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (nat_of_bool true)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool true)) *) have [x nHx Gx ->] := morphimP G_Hx. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) then @repr (FinGroup.base gT) (@set_of_coset gT B (@mfun gT (@coset_groupType gT B) (@normaliser gT B) (@coset_morphism gT B) x)) else oneg (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (nat_of_bool true)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool true)) *) case: subsetP=> [sHG | _]; last by rewrite group1. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul Algebraics.Implementation.zmodType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@repr (FinGroup.base gT) (@set_of_coset gT B (@mfun gT (@coset_groupType gT B) (@normaliser gT B) (@coset_morphism gT B) x))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (nat_of_bool true)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool true)) *) by rewrite val_coset_prim //; case: repr_rcosetP => y /sHG/groupM->. Qed. Lemma cfModK : B <| G -> cancel cfMod cfQuo. Proof. (* Goal: forall _ : is_true (@normal gT B (@gval gT G)), @cancel (@classfun gT (@gval gT G)) (@classfun (@coset_groupType gT B) (@quotient gT (@gval gT G) B)) cfMod cfQuo *) move=> nsBG phi; apply/cfun_inP=> _ /morphimP[x Nx Gx ->] //. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT B) (@gval (@coset_groupType gT B) (@quotient_group gT G B)) (cfQuo (cfMod phi)) (@mfun gT (@coset_groupType gT B) (@normaliser gT B) (@coset_morphism gT B) x)) (@fun_of_cfun (@coset_groupType gT B) (@gval (@coset_groupType gT B) (@quotient_group gT G B)) phi (@mfun gT (@coset_groupType gT B) (@normaliser gT B) (@coset_morphism gT B) x)) *) by rewrite cfQuoE ?cfker_mod ?cfModE. Qed. Lemma cfQuoK : B <| G -> forall phi, B \subset cfker phi -> (phi / B %% B)%CF = phi. Proof. (* Goal: forall (_ : is_true (@normal gT B (@gval gT G))) (phi : @classfun gT (@gval gT G)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))), @eq (@classfun gT (@gval gT G)) (cfMod (cfQuo phi)) phi *) by move=> nsHG phi sHK; apply/cfun_inP=> x Gx; rewrite cfModE ?cfQuoE. Qed. Lemma cfMod_eq1 psi : B <| G -> (psi %% B == 1)%CF = (psi == 1). Proof. (* Goal: forall _ : is_true (@normal gT B (@gval gT G)), @eq bool (@eq_op (@cfun_eqType gT (@gval gT G)) (cfMod psi) (GRing.one (@cfun_ringType gT (@gval gT G)))) (@eq_op (@cfun_eqType (@coset_groupType gT B) (@quotient gT (@gval gT G) B)) psi (GRing.one (@cfun_ringType (@coset_groupType gT B) (@quotient gT (@gval gT G) B)))) *) by move/cfModK/can_eq <-; rewrite rmorph1. Qed. Lemma cfQuo_eq1 phi : B <| G -> B \subset cfker phi -> (phi / B == 1)%CF = (phi == 1). Proof. (* Goal: forall (_ : is_true (@normal gT B (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))), @eq bool (@eq_op (@cfun_eqType (@coset_groupType gT B) (@quotient gT (@gval gT G) B)) (cfQuo phi) (GRing.one (@cfun_ringType (@coset_groupType gT B) (@quotient gT (@gval gT G) B)))) (@eq_op (@cfun_eqType gT (@gval gT G)) phi (GRing.one (@cfun_ringType gT (@gval gT G)))) *) by move=> nsBG kerH; rewrite -cfMod_eq1 // cfQuoK. Qed. End Coset. Arguments cfQuo {gT G%G} B%g phi%CF. Arguments cfMod {gT G%G B%g} phi%CF. Notation "phi / H" := (cfQuo H phi) : cfun_scope. Notation "phi %% H" := (@cfMod _ _ H phi) : cfun_scope. Section MoreCoset. Variables (gT : finGroupType) (G : {group gT}). Implicit Types (H K : {group gT}) (phi : 'CF(G)). Lemma cfResMod H K (psi : 'CF(G / K)) : H \subset G -> K <| G -> ('Res (psi %% K) = 'Res[H / K] psi %% K)%CF. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : is_true (@normal gT (@gval gT K) (@gval gT G))), @eq (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@gval gT G) (@cfMod gT G (@gval gT K) psi)) (@cfMod gT H (@gval gT K) (@cfRes (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K)) psi)) *) by move=> sHG /andP[_]; apply: cfResMorph. Qed. Lemma quotient_cfker_mod (A : {set gT}) K (psi : 'CF(G / K)) : K <| G -> (cfker (psi %% K) / K)%g = cfker psi. Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT K) (@gval gT G)), @eq (@set_of (@coset_finType gT (@gval gT K)) (Phant (@coset_of gT (@gval gT K)))) (@quotient gT (@cfker gT (@gval gT G) (@cfMod gT G (@gval gT K) psi)) (@gval gT K)) (@cfker (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K)) psi) *) by case/andP=> _ /cfker_morph_im <-. Qed. Lemma sub_cfker_mod (A : {set gT}) K (psi : 'CF(G / K)) : K <| G -> A \subset 'N(K) -> (A \subset cfker (psi %% K)) = (A / K \subset cfker psi)%g. Proof. (* Goal: forall (_ : is_true (@normal gT (@gval gT K) (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT K)))))), @eq bool (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (@cfMod gT G (@gval gT K) psi))))) (@subset (@coset_finType gT (@gval gT K)) (@mem (Finite.sort (@coset_finType gT (@gval gT K))) (predPredType (Finite.sort (@coset_finType gT (@gval gT K)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT K)) (@quotient gT A (@gval gT K)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT K))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT K)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT K)))) (@cfker (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K)) psi)))) *) by move=> nsKG nKA; rewrite -(quotientSGK nKA) ?quotient_cfker_mod ?cfker_mod. Qed. Lemma cfker_quo H phi : H <| G -> H \subset cfker (phi) -> cfker (phi / H) = (cfker phi / H)%g. Proof. (* Goal: forall (_ : is_true (@normal gT (@gval gT H) (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H))))))) (@cfker (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@cfQuo gT G (@gval gT H) phi)) (@quotient gT (@cfker gT (@gval gT G) phi) (@gval gT H)) *) move=> nsHG /cfQuoK {2}<- //; have [sHG nHG] := andP nsHG. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT H))))))) (@cfker (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@cfQuo gT G (@gval gT H) phi)) (@quotient gT (@cfker gT (@gval gT G) (@cfMod gT G (@gval gT H) (@cfQuo gT G (@gval gT H) phi))) (@gval gT H)) *) by rewrite cfker_morph 1?quotientGI // cosetpreK (setIidPr _) ?cfker_sub. Qed. Lemma cfQuoEker phi x : x \in G -> (phi / cfker phi)%CF (coset (cfker phi) x) = phi x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT (@cfker gT (@gval gT G) phi)) (@quotient gT (@gval gT G) (@cfker gT (@gval gT G) phi)) (@cfQuo gT G (@cfker gT (@gval gT G) phi) phi) (@coset gT (@cfker gT (@gval gT G) phi) x)) (@fun_of_cfun gT (@gval gT G) phi x) *) by move/cfQuoE->; rewrite ?cfker_normal. Qed. Lemma cfaithful_quo phi : cfaithful (phi / cfker phi). Proof. (* Goal: is_true (@cfaithful (@coset_groupType gT (@cfker gT (@gval gT G) phi)) (@quotient gT (@gval gT G) (@cfker gT (@gval gT G) phi)) (@cfQuo gT G (@cfker gT (@gval gT G) phi) phi)) *) by rewrite cfaithfulE cfker_quo ?cfker_normal ?trivg_quotient. Qed. Lemma cfResQuo H K phi : K \subset cfker phi -> K \subset H -> H \subset G -> ('Res[H / K] (phi / K) = 'Res[H] phi / K)%CF. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq (@classfun (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@gval gT K))) (@cfRes (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT H) (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K)) (@cfQuo gT G (@gval gT K) phi)) (@cfQuo gT H (@gval gT K) (@cfRes gT (@gval gT H) (@gval gT G) phi)) *) move=> kerK sKH sHG; apply/cfun_inP=> xb Hxb; rewrite cfResE ?quotientS //. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K)) (@cfQuo gT G (@gval gT K) phi) xb) (@fun_of_cfun (@coset_groupType gT (@gval gT K)) (@gval (@coset_groupType gT (@gval gT K)) (@quotient_group gT H (@gval gT K))) (@cfQuo gT H (@gval gT K) (@cfRes gT (@gval gT H) (@gval gT G) phi)) xb) *) have{xb Hxb} [x nKx Hx ->] := morphimP Hxb. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K)) (@cfQuo gT G (@gval gT K) phi) (@mfun gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) x)) (@fun_of_cfun (@coset_groupType gT (@gval gT K)) (@gval (@coset_groupType gT (@gval gT K)) (@quotient_group gT H (@gval gT K))) (@cfQuo gT H (@gval gT K) (@cfRes gT (@gval gT H) (@gval gT G) phi)) (@mfun gT (@coset_groupType gT (@gval gT K)) (@normaliser gT (@gval gT K)) (@coset_morphism gT (@gval gT K)) x)) *) by rewrite !cfQuoEnorm ?cfResE ?sub_cfker_Res // inE ?Hx ?(subsetP sHG). Qed. Lemma cfQuoInorm K phi : K \subset cfker phi -> (phi / K)%CF = 'Res ('Res['N_G(K)] phi / K)%CF. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))), @eq (@classfun (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K))) (@cfQuo gT G (@gval gT K) phi) (@cfRes (@coset_groupType gT (@gval gT K)) (@quotient gT (@gval gT G) (@gval gT K)) (@quotient gT (@gval gT (@setI_group gT G (@normaliser_group gT (@gval gT K)))) (@gval gT K)) (@cfQuo gT (@setI_group gT G (@normaliser_group gT (@gval gT K))) (@gval gT K) (@cfRes gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@gval gT K))) (@gval gT G) phi))) *) move=> kerK; rewrite -cfResQuo ?subsetIl ?quotientInorm ?cfRes_id //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@setI_group gT G (@normaliser_group gT (@gval gT K))))))) *) by rewrite subsetI normG (subset_trans kerK) ?cfker_sub. Qed. Lemma cforder_mod H (psi : 'CF(G / H)) : H <| G -> #[psi %% H]%CF = #[psi]%CF. Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @eq nat (@cforder gT (@gval gT G) (@cfMod gT G (@gval gT H) psi)) (@cforder (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) psi) *) by move/cfModK/can_inj/cforder_inj_rmorph->. Qed. Lemma cforder_quo H phi : H <| G -> H \subset cfker phi -> #[phi / H]%CF = #[phi]%CF. Proof. (* Goal: forall (_ : is_true (@normal gT (@gval gT H) (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))), @eq nat (@cforder (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@cfQuo gT G (@gval gT H) phi)) (@cforder gT (@gval gT G) phi) *) by move=> nsHG kerHphi; rewrite -cforder_mod ?cfQuoK. Qed. End MoreCoset. Section Product. Variable (gT : finGroupType) (G : {group gT}). Lemma cfunM_onI A B phi psi : phi \in 'CF(G, A) -> psi \in 'CF(G, B) -> phi * psi \in 'CF(G, A :&: B). Proof. (* Goal: forall (_ : is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A))))) (_ : is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) psi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) B))))), is_true (@in_mem (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_FalgType gT (@gval gT G)))) (@GRing.mul (@Falgebra.vect_ringType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_FalgType gT (@gval gT G))) phi psi) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) (@setI (FinGroup.finType (FinGroup.base gT)) A B))))) *) rewrite !cfun_onE => Aphi Bpsi; apply/subsetP=> x; rewrite !inE cfunE mulf_eq0. (* Goal: forall _ : is_true (negb (orb (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) (@fun_of_cfun gT (@gval gT G) phi x) (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType))) (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) (@fun_of_cfun gT (@gval gT G) psi x) (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType))))), is_true (andb (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) B)))) *) by case/norP=> /(subsetP Aphi)-> /(subsetP Bpsi). Qed. Lemma cfunM_on A phi psi : phi \in 'CF(G, A) -> psi \in 'CF(G, A) -> phi * psi \in 'CF(G, A). Proof. (* Goal: forall (_ : is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A))))) (_ : is_true (@in_mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) psi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A))))), is_true (@in_mem (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_FalgType gT (@gval gT G)))) (@GRing.mul (@Falgebra.vect_ringType (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_FalgType gT (@gval gT G))) phi psi) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) *) by move=> Aphi Bpsi; rewrite -[A]setIid cfunM_onI. Qed. Definition cfSdprod := locked_with cfSdprodKey (cfMorph \o cfIsom (tagged (sdprod_isom defG)) : 'CF(H) -> 'CF(G)). Canonical cfSdprod_unlockable := [unlockable of cfSdprod]. Canonical cfSdprod_additive := [additive of cfSdprod]. Canonical cfSdprod_linear := [linear of cfSdprod]. Canonical cfSdprod_rmorphism := [rmorphism of cfSdprod]. Canonical cfSdprod_lrmorphism := [lrmorphism of cfSdprod]. Lemma cfSdprod1 phi : cfSdprod phi 1%g = phi 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfSdprod phi) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT H) phi (oneg (FinGroup.base gT))) *) by rewrite unlock /= cfMorph1 cfIsom1. Qed. Let sHG : H \subset G. Proof. by have [] := sdprod_context defG. Qed. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by have [] := sdprod_context defG. Qed. Lemma cfker_sdprod phi : K \subset cfker (cfSdprod phi). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (cfSdprod phi))))) *) by rewrite unlock_with cfker_mod. Qed. Lemma cfSdprodEr phi : {in H, cfSdprod phi =1 phi}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfSdprod phi) x) (@fun_of_cfun gT (@gval gT H) phi x)) (inPhantom (@eqfun Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (@fun_of_cfun gT (@gval gT G) (cfSdprod phi)) (@fun_of_cfun gT (@gval gT H) phi))) *) by move=> y Hy; rewrite unlock cfModE ?cfIsomE ?(subsetP sHG). Qed. Lemma cfSdprodE phi : {in K & H, forall x y, cfSdprod phi (x * y)%g = phi y}. Proof. (* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfSdprod phi) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT H) phi y)) (inPhantom (forall x y : FinGroup.arg_sort (FinGroup.base gT), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfSdprod phi) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT H) phi y))) *) by move=> x y Kx Hy; rewrite /= cfkerMl ?(subsetP (cfker_sdprod _)) ?cfSdprodEr. Qed. Lemma cfSdprodK : cancel cfSdprod 'Res[H]. Proof. (* Goal: @cancel (@classfun gT (@gval gT G)) (@classfun gT (@gval gT H)) cfSdprod (@cfRes gT (@gval gT H) (@gval gT G)) *) by move=> phi; apply/cfun_inP=> x Hx; rewrite cfResE ?cfSdprodEr. Qed. Lemma cfSdprod_eq1 phi : (cfSdprod phi == 1) = (phi == 1). Proof. (* Goal: @eq bool (@eq_op (@cfun_eqType gT (@gval gT G)) (cfSdprod phi) (GRing.one (@cfun_ringType gT (@gval gT G)))) (@eq_op (@cfun_eqType gT (@gval gT H)) phi (GRing.one (@cfun_ringType gT (@gval gT H)))) *) exact: rmorph_eq1 cfSdprod_inj. Qed. Lemma cfRes_sdprodK phi : K \subset cfker phi -> cfSdprod ('Res[H] phi) = phi. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))), @eq (@classfun gT (@gval gT G)) (cfSdprod (@cfRes gT (@gval gT H) (@gval gT G) phi)) phi *) move=> kerK; apply/cfun_inP=> _ /(mem_sdprod defG)[x [y [Kx Hy -> _]]]. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfSdprod (@cfRes gT (@gval gT H) (@gval gT G) phi)) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) x y)) *) by rewrite cfSdprodE // cfResE // cfkerMl ?(subsetP kerK). Qed. Lemma sdprod_cfker phi : K ><| cfker phi = cfker (cfSdprod phi). Lemma cforder_sdprod phi : #[cfSdprod phi]%CF = #[phi]%CF. Proof. (* Goal: @eq nat (@cforder gT (@gval gT G) (cfSdprod phi)) (@cforder gT (@gval gT H) phi) *) by apply: cforder_inj_rmorph cfSdprod_inj. Qed. End SDproduct. Section DProduct. Variables (gT : finGroupType) (G K H : {group gT}). Hypothesis KxH : K \x H = G. Lemma reindex_dprod R idx (op : Monoid.com_law idx) (F : gT -> R) : Proof. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) idx (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun g : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (F g))) (@BigOp.bigop R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) idx (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun k : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) k (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) k (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@BigOp.bigop R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) idx (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun h : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) h (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) h (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (F (@mulg (FinGroup.base gT) k h)))))) *) have /mulgmP/misomP[fM /isomP[injf im_f]] := KxH. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) idx (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun g : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (F g))) (@BigOp.bigop R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) idx (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun k : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) k (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) k (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@BigOp.bigop R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) idx (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun h : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody R (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) h (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) h (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (F (@mulg (FinGroup.base gT) k h)))))) *) rewrite pair_big_dep -im_f morphimEdom big_imset; last exact/injmP. (* Goal: @eq R (@BigOp.bigop R (Finite.sort (FinGroup.arg_finType (FinGroup.base (prod_group gT gT)))) idx (index_enum (FinGroup.arg_finType (FinGroup.base (prod_group gT gT)))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base (prod_group gT gT))) => @BigBody R (Finite.sort (FinGroup.arg_finType (FinGroup.base (prod_group gT gT)))) i (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (prod_group gT gT)))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (prod_group gT gT)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (prod_group gT gT))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (prod_group gT gT))) (@gval (prod_group gT gT) (@setX_group gT gT K H))))) (F (@mfun (prod_group gT gT) gT (@gval (prod_group gT gT) (@setX_group gT gT K H)) (@morphm_morphism (prod_group gT gT) gT (@gval (prod_group gT gT) (@setX_group gT gT K H)) (@mulgm gT) fM) i)))) (@BigOp.bigop R (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) idx (index_enum (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (fun p : Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT))) => @BigBody R (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) p (@Monoid.operator R idx (@Monoid.com_operator R idx op)) (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@fst (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) p) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@snd (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) p) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) (F (@mulg (FinGroup.base gT) (@fst (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) p) (@snd (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) p))))) *) by apply: eq_big => [][x y]; rewrite ?inE. Qed. Definition cfDprodr := cfSdprod (dprodWsd KxH). Definition cfDprodl := cfSdprod (dprodWsdC KxH). Definition cfDprod phi psi := cfDprodl phi * cfDprodr psi. Canonical cfDprodl_additive := [additive of cfDprodl]. Canonical cfDprodl_linear := [linear of cfDprodl]. Canonical cfDprodl_rmorphism := [rmorphism of cfDprodl]. Canonical cfDprodl_lrmorphism := [lrmorphism of cfDprodl]. Canonical cfDprodr_additive := [additive of cfDprodr]. Canonical cfDprodr_linear := [linear of cfDprodr]. Canonical cfDprodr_rmorphism := [rmorphism of cfDprodr]. Canonical cfDprodr_lrmorphism := [lrmorphism of cfDprodr]. Lemma cfDprodl1 phi : cfDprodl phi 1%g = phi 1%g. Proof. exact: cfSdprod1. Qed. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprodl phi) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT K) phi (oneg (FinGroup.base gT))) *) exact: cfSdprod1. Qed. Lemma cfDprod1 phi psi : cfDprod phi psi 1%g = phi 1%g * psi 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) (oneg (FinGroup.base gT))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT H) psi (oneg (FinGroup.base gT)))) *) by rewrite cfunE /= !cfSdprod1. Qed. Lemma cfDprodl_eq1 phi : (cfDprodl phi == 1) = (phi == 1). Proof. (* Goal: @eq bool (@eq_op (@cfun_eqType gT (@gval gT G)) (cfDprodl phi) (GRing.one (@cfun_ringType gT (@gval gT G)))) (@eq_op (@cfun_eqType gT (@gval gT K)) phi (GRing.one (@cfun_ringType gT (@gval gT K)))) *) exact: cfSdprod_eq1. Qed. Lemma cfDprodr_eq1 psi : (cfDprodr psi == 1) = (psi == 1). Proof. (* Goal: @eq bool (@eq_op (@cfun_eqType gT (@gval gT G)) (cfDprodr psi) (GRing.one (@cfun_ringType gT (@gval gT G)))) (@eq_op (@cfun_eqType gT (@gval gT H)) psi (GRing.one (@cfun_ringType gT (@gval gT H)))) *) exact: cfSdprod_eq1. Qed. Lemma cfDprod_cfun1r phi : cfDprod phi 1 = cfDprodl phi. Proof. (* Goal: @eq (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (cfDprod phi (GRing.one (@cfun_ringType gT (@gval gT H)))) (cfDprodl phi) *) by rewrite /cfDprod rmorph1 mulr1. Qed. Lemma cfDprod_cfun1l psi : cfDprod 1 psi = cfDprodr psi. Proof. (* Goal: @eq (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (cfDprod (GRing.one (@cfun_ringType gT (@gval gT K))) psi) (cfDprodr psi) *) by rewrite /cfDprod rmorph1 mul1r. Qed. Lemma cfDprod_cfun1 : cfDprod 1 1 = 1. Proof. (* Goal: @eq (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (cfDprod (GRing.one (@cfun_ringType gT (@gval gT K))) (GRing.one (@cfun_ringType gT (@gval gT H)))) (GRing.one (@cfun_ringType gT (@gval gT G))) *) by rewrite cfDprod_cfun1l rmorph1. Qed. Lemma cfDprod_split phi psi : cfDprod phi psi = cfDprod phi 1 * cfDprod 1 psi. Proof. (* Goal: @eq (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (cfDprod phi psi) (@GRing.mul (@cfun_ringType gT (@gval gT G)) (cfDprod phi (GRing.one (@cfun_ringType gT (@gval gT H)))) (cfDprod (GRing.one (@cfun_ringType gT (@gval gT K))) psi)) *) by rewrite cfDprod_cfun1l cfDprod_cfun1r. Qed. Let nsHG : H <| G. Proof. by have [] := dprod_normal2 KxH. Qed. Proof. (* Goal: is_true (@normal gT (@gval gT H) (@gval gT G)) *) by have [] := dprod_normal2 KxH. Qed. Let sKG := normal_sub nsKG. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by have [] := andP nsKG. Qed. Let sHG := normal_sub nsHG. Lemma cfDprodlK : cancel cfDprodl 'Res[K]. Proof. exact: cfSdprodK. Qed. Proof. (* Goal: @cancel (@classfun gT (@gval gT G)) (@classfun gT (@gval gT K)) cfDprodl (@cfRes gT (@gval gT K) (@gval gT G)) *) exact: cfSdprodK. Qed. Lemma cfker_dprodl phi : cfker phi \x H = cfker (cfDprodl phi). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@cfker gT (@gval gT K) phi) (@gval gT H)) (@cfker gT (@gval gT G) (cfDprodl phi)) *) by rewrite dprodC -sdprod_cfker dprodEsd // centsC (centsS (cfker_sub _)). Qed. Lemma cfker_dprodr psi : K \x cfker psi = cfker (cfDprodr psi). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@cfker gT (@gval gT H) psi)) (@cfker gT (@gval gT G) (cfDprodr psi)) *) by rewrite -sdprod_cfker dprodEsd // (subset_trans (cfker_sub _)). Qed. Lemma cfDprodEl phi : {in K & H, forall k h, cfDprodl phi (k * h)%g = phi k}. Proof. (* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun k h : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprodl phi) (@mulg (FinGroup.base gT) k h)) (@fun_of_cfun gT (@gval gT K) phi k)) (inPhantom (forall k h : FinGroup.arg_sort (FinGroup.base gT), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprodl phi) (@mulg (FinGroup.base gT) k h)) (@fun_of_cfun gT (@gval gT K) phi k))) *) by move=> k h Kk Hh /=; rewrite -(centsP cKH) // cfSdprodE. Qed. Lemma cfDprodEr psi : {in K & H, forall k h, cfDprodr psi (k * h)%g = psi h}. Proof. (* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun k h : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprodr psi) (@mulg (FinGroup.base gT) k h)) (@fun_of_cfun gT (@gval gT H) psi h)) (inPhantom (forall k h : FinGroup.arg_sort (FinGroup.base gT), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprodr psi) (@mulg (FinGroup.base gT) k h)) (@fun_of_cfun gT (@gval gT H) psi h))) *) exact: cfSdprodE. Qed. Lemma cfDprodE phi psi : {in K & H, forall h k, cfDprod phi psi (h * k)%g = phi h * psi k}. Proof. (* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun h k : FinGroup.arg_sort (FinGroup.base gT) => @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) (@mulg (FinGroup.base gT) h k)) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi h) (@fun_of_cfun gT (@gval gT H) psi k))) (inPhantom (forall h k : FinGroup.arg_sort (FinGroup.base gT), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) (@mulg (FinGroup.base gT) h k)) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi h) (@fun_of_cfun gT (@gval gT H) psi k)))) *) by move=> k h Kk Hh /=; rewrite cfunE cfDprodEl ?cfDprodEr. Qed. Lemma cfDprod_Resl phi psi : 'Res[K] (cfDprod phi psi) = psi 1%g *: phi. Proof. (* Goal: @eq (@classfun gT (@gval gT K)) (@cfRes gT (@gval gT K) (@gval gT G) (cfDprod phi psi)) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT K)) (@fun_of_cfun gT (@gval gT H) psi (oneg (FinGroup.base gT))) phi) *) by apply/cfun_inP=> x Kx; rewrite cfunE cfResE // -{1}[x]mulg1 mulrC cfDprodE. Qed. Lemma cfDprod_Resr phi psi : 'Res[H] (cfDprod phi psi) = phi 1%g *: psi. Proof. (* Goal: @eq (@classfun gT (@gval gT H)) (@cfRes gT (@gval gT H) (@gval gT G) (cfDprod phi psi)) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT H)) (@fun_of_cfun gT (@gval gT K) phi (oneg (FinGroup.base gT))) psi) *) by apply/cfun_inP=> y Hy; rewrite cfunE cfResE // -{1}[y]mul1g cfDprodE. Qed. Lemma cfDprodKl (psi : 'CF(H)) : psi 1%g = 1 -> cancel (cfDprod^~ psi) 'Res. Proof. (* Goal: forall _ : @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT H) psi (oneg (FinGroup.base gT))) (GRing.one Algebraics.Implementation.ringType), @cancel (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@classfun gT (@gval gT K)) (fun x : @classfun gT (@gval gT K) => cfDprod x psi) (@cfRes gT (@gval gT K) (@gval gT G)) *) by move=> psi1 phi; rewrite cfDprod_Resl psi1 scale1r. Qed. Lemma cfDprodKr (phi : 'CF(K)) : phi 1%g = 1 -> cancel (cfDprod phi) 'Res. Proof. (* Goal: forall _ : @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT K) phi (oneg (FinGroup.base gT))) (GRing.one Algebraics.Implementation.ringType), @cancel (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@classfun gT (@gval gT H)) (cfDprod phi) (@cfRes gT (@gval gT H) (@gval gT G)) *) by move=> phi1 psi; rewrite cfDprod_Resr phi1 scale1r. Qed. Lemma cfker_dprod phi psi : cfker phi <*> cfker psi \subset cfker (cfDprod phi psi). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@cfker gT (@gval gT K) phi) (@cfker gT (@gval gT H) psi)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (cfDprod phi psi))))) *) rewrite -genM_join gen_subG; apply/subsetP=> _ /mulsgP[x y kKx kHy ->] /=. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (cfDprod phi psi))))) *) have [[Kx _] [Hy _]] := (setIdP kKx, setIdP kHy). (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (cfDprod phi psi))))) *) have Gxy: (x * y)%g \in G by rewrite -(dprodW KxH) mem_mulg. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x y) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) (cfDprod phi psi))))) *) rewrite inE Gxy; apply/forallP=> g. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) g)) (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) g)) *) have [Gg | G'g] := boolP (g \in G); last by rewrite !cfun0 1?groupMl. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) g)) (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) g)) *) have{g Gg} [k [h [Kk Hh -> _]]] := mem_dprod KxH Gg. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) (@mulg (FinGroup.base gT) k h))) (@fun_of_cfun gT (@gval gT G) (cfDprod phi psi) (@mulg (FinGroup.base gT) k h))) *) rewrite mulgA -(mulgA x) (centsP cKH y) // mulgA -mulgA !cfDprodE ?groupM //. (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi (@mulg (FinGroup.base gT) x k)) (@fun_of_cfun gT (@gval gT H) psi (@mulg (FinGroup.base gT) y h))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi k) (@fun_of_cfun gT (@gval gT H) psi h))) *) by rewrite !cfkerMl. Qed. Lemma cfdot_dprod phi1 phi2 psi1 psi2 : '[cfDprod phi1 psi1, cfDprod phi2 psi2] = '[phi1, phi2] * '[psi1, psi2]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (cfDprod phi1 psi1) (cfDprod phi2 psi2)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfdot gT (@gval gT K) phi1 phi2) (@cfdot gT (@gval gT H) psi1 psi2)) *) rewrite !cfdotE mulrCA -mulrA mulrCA mulrA -invfM -natrM (dprod_card KxH). (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfDprod phi1 psi1) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfDprod phi2 psi2) x)))))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType Algebraics.Implementation.comUnitRingType)) (@GRing.inv (GRing.Field.unitRingType Algebraics.Implementation.fieldType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType Algebraics.Implementation.comUnitRingType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi1 x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT K) phi2 x))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT H) psi1 x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT H) psi2 x))))))) *) congr (_ * _); rewrite big_distrl reindex_dprod /=; apply: eq_bigr => k Kk. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun h : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) h (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) h (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfDprod phi1 psi1) (@mulg (FinGroup.base gT) k h)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfDprod phi2 psi2) (@mulg (FinGroup.base gT) k h)))))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType Algebraics.Implementation.comUnitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi1 k) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT K) phi2 k))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT H) psi1 x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT H) psi2 x)))))) *) rewrite big_distrr; apply: eq_bigr => h Hh /=. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfDprod phi1 psi1) (@mulg (FinGroup.base gT) k h)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfDprod phi2 psi2) (@mulg (FinGroup.base gT) k h)))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType Algebraics.Implementation.comUnitRingType)) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT K) phi1 k) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT K) phi2 k))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT H) psi1 h) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT H) psi2 h)))) *) by rewrite mulrCA -mulrA -rmorphM mulrCA mulrA !cfDprodE. Qed. Lemma cfDprodl_iso : isometry cfDprodl. Proof. (* Goal: @isometry gT gT (@gval gT K) (@gval gT G) cfDprodl *) by move=> phi1 phi2; rewrite -!cfDprod_cfun1r cfdot_dprod cfnorm1 mulr1. Qed. Lemma cfDprodr_iso : isometry cfDprodr. Proof. (* Goal: @isometry gT gT (@gval gT H) (@gval gT G) cfDprodr *) by move=> psi1 psi2; rewrite -!cfDprod_cfun1l cfdot_dprod cfnorm1 mul1r. Qed. Lemma cforder_dprodl phi : #[cfDprodl phi]%CF = #[phi]%CF. Proof. (* Goal: @eq nat (@cforder gT (@gval gT G) (cfDprodl phi)) (@cforder gT (@gval gT K) phi) *) exact: cforder_sdprod. Qed. Lemma cforder_dprodr psi : #[cfDprodr psi]%CF = #[psi]%CF. Proof. (* Goal: @eq nat (@cforder gT (@gval gT G) (cfDprodr psi)) (@cforder gT (@gval gT H) psi) *) exact: cforder_sdprod. Qed. End DProduct. Lemma cfDprodC (gT : finGroupType) (G K H : {group gT}) (KxH : K \x H = G) (HxK : H \x K = G) chi psi : cfDprod KxH chi psi = cfDprod HxK psi chi. Proof. (* Goal: @eq (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@cfDprod gT G K H KxH chi psi) (@cfDprod gT G H K HxK psi chi) *) rewrite /cfDprod mulrC. (* Goal: @eq (GRing.Ring.sort (@cfun_ringType gT (@gval gT G))) (@GRing.mul (GRing.ComRing.ringType (@cfun_comRingType gT (@gval gT G))) (@cfDprodr gT G K H KxH psi) (@cfDprodl gT G K H KxH chi)) (@GRing.mul (@cfun_ringType gT (@gval gT G)) (@cfDprodl gT G H K HxK psi) (@cfDprodr gT G H K HxK chi)) *) by congr (_ * _); congr (cfSdprod _ _); apply: eq_irrelevance. Qed. Section Bigdproduct. Variables (gT : finGroupType) (I : finType) (P : pred I). Variables (A : I -> {group gT}) (G : {group gT}). Hypothesis defG : \big[dprod/1%g]_(i | P i) A i = G. Let sAG i : P i -> A i \subset G. Proof. (* Goal: forall _ : is_true (P i), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by move=> Pi; rewrite -(bigdprodWY defG) (bigD1 i) ?joing_subl. Qed. Fact cfBigdprodi_subproof i : gval (if P i then A i else 1%G) \x <<\bigcup_(j | P j && (j != i)) A j>> = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT (if P i then A i else one_group gT)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j)))))) (@gval gT G) *) have:= defG; rewrite fun_if big_mkcond (bigD1 i) // -big_mkcondl /= => defGi. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (if P i then @gval gT (A i) else oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j)))))) (@gval gT G) *) by have [[_ Gi' _ defGi']] := dprodP defGi; rewrite (bigdprodWY defGi') -defGi'. Qed. Definition cfBigdprodi i := cfDprodl (cfBigdprodi_subproof i) \o 'Res[_, A i]. Canonical cfBigdprodi_additive i := [additive of @cfBigdprodi i]. Canonical cfBigdprodi_linear i := [linear of @cfBigdprodi i]. Canonical cfBigdprodi_rmorphism i := [rmorphism of @cfBigdprodi i]. Canonical cfBigdprodi_lrmorphism i := [lrmorphism of @cfBigdprodi i]. Lemma cfBigdprodi1 i (phi : 'CF(A i)) : cfBigdprodi phi 1%g = phi 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfBigdprodi i phi) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT (A i)) phi (oneg (FinGroup.base gT))) *) by rewrite cfDprodl1 cfRes1. Qed. Lemma cfBigdprodi_eq1 i (phi : 'CF(A i)) : P i -> (cfBigdprodi phi == 1) = (phi == 1). Proof. (* Goal: forall _ : is_true (P i), @eq bool (@eq_op (@cfun_eqType gT (@gval gT G)) (@cfBigdprodi i phi) (GRing.one (@cfun_ringType gT (@gval gT G)))) (@eq_op (@cfun_eqType gT (@gval gT (A i))) phi (GRing.one (@cfun_ringType gT (@gval gT (A i))))) *) by move=> Pi; rewrite cfSdprod_eq1 Pi cfRes_id. Qed. Lemma cfBigdprodiK i : P i -> cancel (@cfBigdprodi i) 'Res[A i]. Proof. (* Goal: forall _ : is_true (P i), @cancel (@classfun gT (@gval gT G)) (@classfun gT (@gval gT (A i))) (@cfBigdprodi i) (@cfRes gT (@gval gT (A i)) (@gval gT G)) *) move=> Pi phi; have:= cfDprodlK (cfBigdprodi_subproof i) ('Res phi). (* Goal: forall _ : @eq (@classfun gT (@gval gT (if P i then A i else one_group gT))) (@cfRes gT (@gval gT (if P i then A i else one_group gT)) (@gval gT G) (@cfDprodl gT G (if P i then A i else one_group gT) (@generated_group gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j))))) (cfBigdprodi_subproof i) (@cfRes gT (@gval gT (if P i then A i else one_group gT)) (@gval gT (A i)) phi))) (@cfRes gT (@gval gT (if P i then A i else one_group gT)) (@gval gT (A i)) phi), @eq (@classfun gT (@gval gT (A i))) (@cfRes gT (@gval gT (A i)) (@gval gT G) (@cfBigdprodi i phi)) phi *) by rewrite -[cfDprodl _ _]/(cfBigdprodi phi) Pi cfRes_id. Qed. Lemma cfBigdprodi_inj i : P i -> injective (@cfBigdprodi i). Proof. (* Goal: forall _ : is_true (P i), @injective (@classfun gT (@gval gT G)) (@classfun gT (@gval gT (A i))) (@cfBigdprodi i) *) by move/cfBigdprodiK; apply: can_inj. Qed. Lemma cfBigdprodEi i (phi : 'CF(A i)) x : P i -> (forall j, P j -> x j \in A j) -> cfBigdprodi phi (\prod_(j | P j) x j)%g = phi (x i). Proof. (* Goal: forall (_ : is_true (P i)) (_ : forall (j : Finite.sort I) (_ : is_true (P j)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x j) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A j)))))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfBigdprodi i phi) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun j : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (x j)))) (@fun_of_cfun gT (@gval gT (A i)) phi (x i)) *) set r := enum P => Pi /forall_inP; have r_i: i \in r by rewrite mem_enum. (* Goal: forall _ : is_true (@FiniteQuant.quant0b I (fun x0 : Finite.sort I => @FiniteQuant.all_in I (P x0) (FiniteQuant.Quantified (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x x0) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A x0)))))) x0)), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfBigdprodi i phi) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun j : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (x j)))) (@fun_of_cfun gT (@gval gT (A i)) phi (x i)) *) have:= bigdprodWcp defG; rewrite -big_andE -!(big_filter _ P) filter_index_enum. (* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) P)) (fun i : Finite.sort I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) i (central_product gT) true (@gval gT (A i)))) (@gval gT G)) (_ : is_true (@BigOp.bigop bool (Finite.sort I) true (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) P)) (fun i : Finite.sort I => @BigBody bool (Finite.sort I) i andb true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i)))))))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfBigdprodi i phi) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) P)) (fun i : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) true (x i)))) (@fun_of_cfun gT (@gval gT (A i)) phi (x i)) *) rewrite -/r big_all => defGr /allP Ax. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfBigdprodi i phi) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun i : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) true (x i)))) (@fun_of_cfun gT (@gval gT (A i)) phi (x i)) *) rewrite (perm_bigcprod defGr Ax (perm_to_rem r_i)) big_cons cfDprodEl ?Pi //. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) (oneg (FinGroup.base gT)) (@rem (Finite.eqType I) i r) (fun j : Equality.sort (Finite.eqType I) => @BigBody (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) j (@mulg (FinGroup.base gT)) true (x j))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@generated_group gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j))))))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i))))) *) (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT (A i)) (@cfRes gT (@gval gT (A i)) (@gval gT (A i)) phi) (x i)) (@fun_of_cfun gT (@gval gT (A i)) phi (x i)) *) - (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) (oneg (FinGroup.base gT)) (@rem (Finite.eqType I) i r) (fun j : Equality.sort (Finite.eqType I) => @BigBody (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) j (@mulg (FinGroup.base gT)) true (x j))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@generated_group gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j))))))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i))))) *) (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT (A i)) (@cfRes gT (@gval gT (A i)) (@gval gT (A i)) phi) (x i)) (@fun_of_cfun gT (@gval gT (A i)) phi (x i)) *) by rewrite cfRes_id. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) (oneg (FinGroup.base gT)) (@rem (Finite.eqType I) i r) (fun j : Equality.sort (Finite.eqType I) => @BigBody (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) j (@mulg (FinGroup.base gT)) true (x j))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@generated_group gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j))))))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i))))) *) - (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) (oneg (FinGroup.base gT)) (@rem (Finite.eqType I) i r) (fun j : Equality.sort (Finite.eqType I) => @BigBody (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) j (@mulg (FinGroup.base gT)) true (x j))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@generated_group gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j))))))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i))))) *) by rewrite Ax. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) (oneg (FinGroup.base gT)) (@rem (Finite.eqType I) i r) (fun j : Equality.sort (Finite.eqType I) => @BigBody (FinGroup.sort (FinGroup.base gT)) (Equality.sort (Finite.eqType I)) j (@mulg (FinGroup.base gT)) true (x j))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@generated_group gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j))))))))) *) rewrite big_seq group_prod // => j; rewrite mem_rem_uniq ?enum_uniq //. (* Goal: forall _ : is_true (@in_mem (Equality.sort (Finite.eqType I)) j (@mem (Equality.sort (Finite.eqType I)) (simplPredType (Equality.sort (Finite.eqType I))) (@predD1 (Finite.eqType I) (@pred_of_simpl (Equality.sort (Finite.eqType I)) (@pred_of_mem_pred (Equality.sort (Finite.eqType I)) (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) r))) i))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x j) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@generated_group gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum I) (fun j : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort I) j (@setU (FinGroup.arg_finType (FinGroup.base gT))) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (@gval gT (A j))))))))) *) case/andP=> i'j /= r_j; apply/mem_gen/bigcupP; exists j; last exact: Ax. (* Goal: is_true (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) *) by rewrite -[P j](mem_enum P) r_j. Qed. Lemma cfBigdprodi_iso i : P i -> isometry (@cfBigdprodi i). Proof. (* Goal: forall _ : is_true (P i), @isometry gT gT (@gval gT (A i)) (@gval gT G) (@cfBigdprodi i) *) by move=> Pi phi psi; rewrite cfDprodl_iso Pi !cfRes_id. Qed. Definition cfBigdprod (phi : forall i, 'CF(A i)) := \prod_(i | P i) cfBigdprodi (phi i). Lemma cfBigdprodE phi x : (forall i, P i -> x i \in A i) -> cfBigdprod phi (\prod_(i | P i) x i)%g = \prod_(i | P i) phi i (x i). Proof. (* Goal: forall _ : forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i))))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (x i)))) (@BigOp.bigop (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) (GRing.one Algebraics.Implementation.ringType) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) i (@GRing.mul Algebraics.Implementation.ringType) (P i) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (x i)))) *) move=> Ax; rewrite prod_cfunE; last by rewrite -(bigdprodW defG) mem_prodg. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) (GRing.one Algebraics.Implementation.ringType) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) i (@GRing.mul Algebraics.Implementation.ringType) (P i) (@fun_of_cfun gT (@gval gT G) (@cfBigdprodi i (phi i)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i0 : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i0 (@mulg (FinGroup.base gT)) (P i0) (x i0)))))) (@BigOp.bigop (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) (GRing.one Algebraics.Implementation.ringType) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) i (@GRing.mul Algebraics.Implementation.ringType) (P i) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (x i)))) *) by apply: eq_bigr => i Pi; rewrite cfBigdprodEi. Qed. Lemma cfBigdprod1 phi : cfBigdprod phi 1%g = \prod_(i | P i) phi i 1%g. Proof. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) (oneg (FinGroup.base gT))) (@BigOp.bigop (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) (GRing.one Algebraics.Implementation.ringType) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) i (@GRing.mul Algebraics.Implementation.ringType) (P i) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))))) *) by rewrite prod_cfunE //; apply/eq_bigr=> i _; apply: cfBigdprodi1. Qed. Lemma cfBigdprodK phi (Phi := cfBigdprod phi) i (a := phi i 1%g / Phi 1%g) : Phi 1%g != 0 -> P i -> a != 0 /\ a *: 'Res[A i] Phi = phi i. Proof. (* Goal: forall (_ : is_true (negb (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) Phi (oneg (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType)))) (_ : is_true (P i)), and (is_true (negb (@eq_op (GRing.Ring.eqType Algebraics.Implementation.ringType) a (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))))) (@eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i))))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT (A i))) a (@cfRes gT (@gval gT (A i)) (@gval gT G) Phi)) (phi i)) *) move=> nzPhi Pi; split. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i))))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT (A i))) a (@cfRes gT (@gval gT (A i)) (@gval gT G) Phi)) (phi i) *) (* Goal: is_true (negb (@eq_op (GRing.Ring.eqType Algebraics.Implementation.ringType) a (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)))) *) rewrite mulf_neq0 ?invr_eq0 // (contraNneq _ nzPhi) // => phi_i0. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i))))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT (A i))) a (@cfRes gT (@gval gT (A i)) (@gval gT G) Phi)) (phi i) *) (* Goal: is_true (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) Phi (oneg (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType)) *) by rewrite cfBigdprod1 (bigD1 i) //= phi_i0 mul0r. (* Goal: @eq (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i)))) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT (@gval gT (A i))))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT (A i))) a (@cfRes gT (@gval gT (A i)) (@gval gT G) Phi)) (phi i) *) apply/cfun_inP=> x Aix; rewrite cfunE cfResE ?sAG // mulrAC. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT G) Phi x)) (@GRing.inv Algebraics.Implementation.unitRingType (@fun_of_cfun gT (@gval gT G) Phi (oneg (FinGroup.base gT))))) (@fun_of_cfun gT (@gval gT (A i)) (phi i) x) *) have {1}->: x = (\prod_(j | P j) (if j == i then x else 1))%g. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT G) Phi (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun j : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (if @eq_op (Finite.eqType I) j i then x else oneg (FinGroup.base gT)))))) (@GRing.inv Algebraics.Implementation.unitRingType (@fun_of_cfun gT (@gval gT G) Phi (oneg (FinGroup.base gT))))) (@fun_of_cfun gT (@gval gT (A i)) (phi i) x) *) (* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun j : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (if @eq_op (Finite.eqType I) j i then x else oneg (FinGroup.base gT)))) *) rewrite -big_mkcondr (big_pred1 i) ?eqxx // => j /=. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT G) Phi (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun j : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (if @eq_op (Finite.eqType I) j i then x else oneg (FinGroup.base gT)))))) (@GRing.inv Algebraics.Implementation.unitRingType (@fun_of_cfun gT (@gval gT G) Phi (oneg (FinGroup.base gT))))) (@fun_of_cfun gT (@gval gT (A i)) (phi i) x) *) (* Goal: @eq bool (andb (P j) (@eq_op (Finite.eqType I) j i)) (@eq_op (Finite.eqType I) j i) *) by apply: andb_idl => /eqP->. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))) (@fun_of_cfun gT (@gval gT G) Phi (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun j : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (if @eq_op (Finite.eqType I) j i then x else oneg (FinGroup.base gT)))))) (@GRing.inv Algebraics.Implementation.unitRingType (@fun_of_cfun gT (@gval gT G) Phi (oneg (FinGroup.base gT))))) (@fun_of_cfun gT (@gval gT (A i)) (phi i) x) *) rewrite cfBigdprodE => [|j _]; last by case: eqP => // ->. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))) (@BigOp.bigop (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) (GRing.one Algebraics.Implementation.ringType) (index_enum I) (fun i0 : Finite.sort I => @BigBody (GRing.Ring.sort Algebraics.Implementation.ringType) (Finite.sort I) i0 (@GRing.mul Algebraics.Implementation.ringType) (P i0) (@fun_of_cfun gT (@gval gT (A i0)) (phi i0) (if @eq_op (Finite.eqType I) i0 i then x else oneg (FinGroup.base gT)))))) (@GRing.inv Algebraics.Implementation.unitRingType (@fun_of_cfun gT (@gval gT G) Phi (oneg (FinGroup.base gT))))) (@fun_of_cfun gT (@gval gT (A i)) (phi i) x) *) apply: canLR (mulfK nzPhi) _; rewrite cfBigdprod1 !(bigD1 i Pi) /= eqxx. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) x) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one Algebraics.Implementation.ringType) (index_enum I) (fun i0 : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i0 (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType)) (andb (P i0) (negb (@eq_op (Finite.eqType I) i0 i))) (@fun_of_cfun gT (@gval gT (A i0)) (phi i0) (if @eq_op (Finite.eqType I) i0 i then x else oneg (FinGroup.base gT))))))) (@GRing.mul (GRing.Field.ringType Algebraics.Implementation.fieldType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) x) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@fun_of_cfun gT (@gval gT (A i)) (phi i) (oneg (FinGroup.base gT))) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one Algebraics.Implementation.ringType) (index_enum I) (fun i0 : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i0 (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType)) (andb (P i0) (negb (@eq_op (Finite.eqType I) i0 i))) (@fun_of_cfun gT (@gval gT (A i0)) (phi i0) (oneg (FinGroup.base gT))))))) *) by rewrite mulrCA !mulrA; congr (_ * _); apply: eq_bigr => j /andP[_ /negPf->]. Qed. Lemma cfdot_bigdprod phi psi : '[cfBigdprod phi, cfBigdprod psi] = \prod_(i | P i) '[phi i, psi i]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (cfBigdprod phi) (cfBigdprod psi)) (@BigOp.bigop (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (Finite.sort I) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (P i) (@cfdot gT (@gval gT (A i)) (phi i) (psi i)))) *) apply: canLR (mulKf (neq0CG G)) _; rewrite -(bigdprod_card defG). (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@GRing.mul (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@BigOp.bigop nat (Finite.sort I) (S O) (index_enum I) (fun i : Finite.sort I => @BigBody nat (Finite.sort I) i muln (P i) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i)))))))) (@BigOp.bigop (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (Finite.sort I) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (index_enum I) (fun i : Finite.sort I => @BigBody (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (P i) (@cfdot gT (@gval gT (A i)) (phi i) (psi i))))) *) rewrite (big_morph _ (@natrM _) (erefl _)) -big_split /=. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.ComRing.ringType (GRing.Field.comRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul (GRing.ComRing.ringType (GRing.Field.comRingType Algebraics.Implementation.fieldType)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i)))))) (@cfdot gT (@gval gT (A i)) (phi i) (psi i))))) *) rewrite (eq_bigr _ (fun i _ => mulVKf (neq0CG _) _)) (big_distr_big_dep 1%g) /=. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) (@pfamily_mem I (Finite.eqType (FinGroup.finType (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@mem (Finite.sort I) (predPredType (Finite.sort I)) P) (@fun_of_simpl (Finite.sort I) (mem_pred (FinGroup.sort (FinGroup.base gT))) (@fmem (Finite.sort I) (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (fun (i : Finite.sort I) (j : FinGroup.sort (FinGroup.base gT)) => @in_mem (FinGroup.arg_sort (FinGroup.base gT)) j (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (A i)))))))))) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) set F := pfamily _ _ _; pose h (f : {ffun I -> gT}) := (\prod_(i | P i) f i)%g. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) pose is_hK x f := forall f1, (f1 \in F) && (h f1 == x) = (f == f1). (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) have /fin_all_exists[h1 Dh1] x: exists f, x \in G -> is_hK x f. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: @ex (Equality.sort (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT))))) (fun f : Equality.sort (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) => forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), is_hK x f) *) case Gx: (x \in G); last by exists [ffun _ => x]. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: @ex (Equality.sort (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT))))) (fun f : Equality.sort (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) => forall _ : is_true true, is_hK x f) *) have [f [Af fK Uf]] := mem_bigdprod defG Gx. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: @ex (Equality.sort (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT))))) (fun f : Equality.sort (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) => forall _ : is_true true, is_hK x f) *) exists [ffun i => if P i then f i else 1%g] => _ f1. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: @eq bool (andb (@in_mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) f1 (@mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT))))))) F)) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (h f1) x)) (@eq_op (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (@FunFinfun.finfun I (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort I => if P i then f i else oneg (FinGroup.base gT))) f1) *) apply/andP/eqP=> [[/pfamilyP[Pf1 Af1] /eqP Dx] | <-]. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: and (is_true (@in_mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (@FunFinfun.finfun I (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort I => if P i then f i else oneg (FinGroup.base gT))) (@mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT))))))) F))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (h (@FunFinfun.finfun I (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort I => if P i then f i else oneg (FinGroup.base gT)))) x)) *) (* Goal: @eq (Equality.sort (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT))))) (@FunFinfun.finfun I (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort I => if P i then f i else oneg (FinGroup.base gT))) f1 *) by apply/ffunP=> i; rewrite ffunE; case: ifPn => [/Uf-> | /(supportP Pf1)]. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: and (is_true (@in_mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (@FunFinfun.finfun I (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort I => if P i then f i else oneg (FinGroup.base gT))) (@mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT))))))) F))) (is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (h (@FunFinfun.finfun I (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort I => if P i then f i else oneg (FinGroup.base gT)))) x)) *) split; last by rewrite fK; apply/eqP/eq_bigr=> i Pi; rewrite ffunE Pi. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: is_true (@in_mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (@FunFinfun.finfun I (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort I => if P i then f i else oneg (FinGroup.base gT))) (@mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT))))))) F)) *) by apply/familyP=> i; rewrite ffunE !unfold_in; case: ifP => //= /Af. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) x) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) x))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) rewrite (reindex_onto h h1) /= => [|x /Dh1/(_ (h1 x))]; last first. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.arg_sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.arg_sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (finfun_of_finType I (FinGroup.arg_finType (FinGroup.base gT)))) (fun j : @finfun_of I (FinGroup.arg_sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.arg_sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.arg_sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.arg_sort (FinGroup.base gT)))) j (@GRing.add Algebraics.Implementation.zmodType) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (h j) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (finfun_of_finType I (FinGroup.arg_finType (FinGroup.base gT)))) (h1 (h j)) j)) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) (h j)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) (h j)))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) (* Goal: forall _ : @eq bool (andb (@in_mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (h1 x) (@mem (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))))) (simplPredType (@finfun_of I (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (Phant (forall _ : Finite.sort I, Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT))))))) F)) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (h (h1 x)) x)) (@eq_op (finfun_of_eqType I (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (h1 x) (h1 x)), @eq (FinGroup.sort (FinGroup.base gT)) (h (h1 x)) x *) by rewrite eqxx => /andP[_ /eqP]. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.arg_sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.arg_sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (finfun_of_finType I (FinGroup.arg_finType (FinGroup.base gT)))) (fun j : @finfun_of I (FinGroup.arg_sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.arg_sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.arg_sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.arg_sort (FinGroup.base gT)))) j (@GRing.add Algebraics.Implementation.zmodType) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (h j) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (finfun_of_finType I (FinGroup.arg_finType (FinGroup.base gT)))) (h1 (h j)) j)) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) (h j)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) (h j)))))) (@BigOp.bigop Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (index_enum (finfun_of_finType I (FinGroup.finType (FinGroup.base gT)))) (fun f : @finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))) => @BigBody Algebraics.Implementation.type (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType)))) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))))) *) apply/eq_big => [f | f /andP[/Dh1<- /andP[/pfamilyP[_ Af] _]]]; last first. (* Goal: @eq bool (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (h f) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (finfun_of_finType I (FinGroup.arg_finType (FinGroup.base gT)))) (h1 (h f)) f)) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) *) (* Goal: @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (cfBigdprod phi) (h f)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT G) (cfBigdprod psi) (h f)))) (@BigOp.bigop Algebraics.Implementation.type (Finite.sort I) (GRing.one (GRing.Field.ringType Algebraics.Implementation.fieldType)) (index_enum I) (fun i : Finite.sort I => @BigBody Algebraics.Implementation.type (Finite.sort I) i (@GRing.mul (GRing.UnitRing.ringType (GRing.Field.unitRingType Algebraics.Implementation.fieldType))) (P i) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT (A i)) (phi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT (A i)) (psi i) (@FunFinfun.fun_of_fin I (FinGroup.sort (FinGroup.base gT)) f i)))))) *) by rewrite !cfBigdprodE // rmorph_prod -big_split /=. (* Goal: @eq bool (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (h f) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (finfun_of_finType I (FinGroup.arg_finType (FinGroup.base gT)))) (h1 (h f)) f)) (@in_mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) f (@mem (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT)))) (simplPredType (@finfun_of I (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort I, FinGroup.sort (FinGroup.base gT))))) F)) *) apply/idP/idP=> [/andP[/Dh1<-] | Ff]; first by rewrite eqxx andbT. (* Goal: is_true (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (h f) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@eq_op (Finite.eqType (finfun_of_finType I (FinGroup.arg_finType (FinGroup.base gT)))) (h1 (h f)) f)) *) have /pfamilyP[_ Af] := Ff; suffices Ghf: h f \in G by rewrite -Dh1 ?Ghf ?Ff /=. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (h f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by apply/group_prod=> i Pi; rewrite (subsetP (sAG Pi)) ?Af. Qed. End Bigdproduct. Section MorphIsometry. Variable gT : finGroupType. Implicit Types (D G H K : {group gT}) (aT rT : finGroupType). Lemma cfMorph_iso aT rT (G D : {group aT}) (f : {morphism D >-> rT}) : G \subset D -> isometry (cfMorph : 'CF(f @* G) -> 'CF(G)). Lemma cfIsom_iso rT G (R : {group rT}) (f : {morphism G >-> rT}) : forall isoG : isom G R f, isometry (cfIsom isoG). Proof. (* Goal: forall isoG : is_true (@isom gT rT (@gval gT G) (@gval rT R) (@mfun gT rT (@gval gT G) f)), @isometry gT rT (@gval gT G) (@gval rT R) (@cfIsom gT rT G f R isoG) *) move=> isoG phi psi; rewrite unlock cfMorph_iso //; set G1 := _ @* R. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT G1 (@cfRes gT G1 (@gval gT G) phi) (@cfRes gT G1 (@gval gT G) psi)) (@cfdot gT (@gval gT G) phi psi) *) by rewrite -(isom_im (isom_sym isoG)) -/G1 in phi psi *; rewrite !cfRes_id. Qed. Lemma cfMod_iso H G : H <| G -> isometry (@cfMod _ G H). Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @isometry (@coset_groupType gT (@gval gT H)) gT (@quotient gT (@gval gT G) (@gval gT H)) (@gval gT G) (@cfMod gT G (@gval gT H)) *) by case/andP=> _; apply: cfMorph_iso. Qed. Lemma cfQuo_iso H G : H <| G -> {in [pred phi | H \subset cfker phi] &, isometry (@cfQuo _ G H)}. Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @prop_in2 (@classfun gT (@gval gT G)) (@mem (@classfun gT (@gval gT G)) (simplPredType (@classfun gT (@gval gT G))) (@SimplPred (@classfun gT (@gval gT G)) (fun phi : @classfun gT (@gval gT G) => @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi)))))) (fun phi psi : @classfun gT (@gval gT G) => @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@cfQuo gT G (@gval gT H) phi) (@cfQuo gT G (@gval gT H) psi)) (@cfdot gT (@gval gT G) phi psi)) (inPhantom (@isometry gT (@coset_groupType gT (@gval gT H)) (@gval gT G) (@quotient gT (@gval gT G) (@gval gT H)) (@cfQuo gT G (@gval gT H)))) *) by move=> nsHG phi psi sHkphi sHkpsi; rewrite -(cfMod_iso nsHG) !cfQuoK. Qed. Lemma cfnorm_quo H G phi : H <| G -> H \subset cfker phi -> '[phi / H] = '[phi]_G. Proof. (* Goal: forall (_ : is_true (@normal gT (@gval gT H) (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cfker gT (@gval gT G) phi))))), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) (@cfQuo gT G (@gval gT H) phi) (@cfQuo gT G (@gval gT H) phi)) (@cfdot gT (@gval gT G) phi phi) *) by move=> nsHG sHker; apply: cfQuo_iso. Qed. Lemma cfSdprod_iso K H G (defG : K ><| H = G) : isometry (cfSdprod defG). Proof. (* Goal: @isometry gT gT (@gval gT H) (@gval gT G) (@cfSdprod gT G K H defG) *) move=> phi psi; have [/andP[_ nKG] _ _ _ _] := sdprod_context defG. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfSdprod gT G K H defG phi) (@cfSdprod gT G K H defG psi)) (@cfdot gT (@gval gT H) phi psi) *) by rewrite [cfSdprod _]locked_withE cfMorph_iso ?cfIsom_iso. Qed. End MorphIsometry. Section Induced. Variable gT : finGroupType. Section Def. Variables B A : {set gT}. Local Notation G := <<B>>. Local Notation H := <<A>>. Definition ffun_cfInd (phi : 'CF(A)) := [ffun x => if H \subset G then #|A|%:R^-1 * (\sum_(y in G) phi (x ^ y)) else #|G|%:R * '[phi, 1] *+ (x == 1%g)]. Fact cfInd_subproof phi : is_class_fun G (ffun_cfInd phi). Definition cfInd phi := Cfun 1 (cfInd_subproof phi). Lemma cfInd_is_linear : linear cfInd. Proof. (* Goal: @GRing.Linear.axiom Algebraics.Implementation.ringType (@cfun_lmodType gT A) (@cfun_zmodType gT B) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT B)) cfInd (@GRing.Scale.scale_law Algebraics.Implementation.ringType (@cfun_lmodType gT B)) (@Logic.eq_refl (forall (_ : GRing.Ring.sort Algebraics.Implementation.ringType) (_ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT B)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT B)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT B))))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT B)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT B)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT B))))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT B))) *) move=> c phi psi; apply/cfunP=> x; rewrite !cfunElock; case: ifP => _. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A) c phi) psi) (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT))))) (@GRing.add Algebraics.Implementation.zmodType (@GRing.mul Algebraics.Implementation.ringType c (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A phi (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A psi (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) *) (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@fun_of_cfun gT A (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A) c phi) psi) (@conjg gT x y))))) (@GRing.add Algebraics.Implementation.zmodType (@GRing.mul Algebraics.Implementation.ringType c (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@fun_of_cfun gT A phi (@conjg gT x y)))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@fun_of_cfun gT A psi (@conjg gT x y)))))) *) rewrite mulrCA -mulrDr [c * _]mulr_sumr -big_split /=. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A) c phi) psi) (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT))))) (@GRing.add Algebraics.Implementation.zmodType (@GRing.mul Algebraics.Implementation.ringType c (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A phi (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A psi (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) *) (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@fun_of_cfun gT A (@GRing.add (@GRing.Zmodule.Pack (@classfun gT A) (@GRing.Zmodule.Class (@classfun gT A) (@Choice.Class (@classfun gT A) (@cfun_eqMixin gT A) (@cfun_choiceMixin gT A)) (@cfun_zmodMixin gT A))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A) c phi) psi) (@conjg gT x y))))) (@GRing.mul Algebraics.Implementation.ringType (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B)))) (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType c (@fun_of_cfun gT A phi (@conjg gT x i))) (@fun_of_cfun gT A psi (@conjg gT x i)))))) *) by congr (_ * _); apply: eq_bigr => y _; rewrite !cfunE. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.base Algebraics.Implementation.ringType (@GRing.Lmodule.sort Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)) (@GRing.Lmodule.class Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)) (@cfun_lmodType gT A)))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A) c phi) psi) (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT))))) (@GRing.add Algebraics.Implementation.zmodType (@GRing.mul Algebraics.Implementation.ringType c (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A phi (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A psi (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) *) rewrite mulrnAr -mulrnDl !(mulrCA c) -!mulrDr [c * _]mulr_sumr -big_split /=. (* Goal: @eq Algebraics.Implementation.type (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@cfdot gT A (@GRing.add (@GRing.Zmodule.Pack (@classfun gT A) (@GRing.Zmodule.Class (@classfun gT A) (@Choice.Class (@classfun gT A) (@cfun_eqMixin gT A) (@cfun_choiceMixin gT A)) (@cfun_zmodMixin gT A))) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT A) c phi) psi) (GRing.one (@cfun_ringType gT A)))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT))))) (@GRing.natmul Algebraics.Implementation.zmodType (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT B))))) (@GRing.mul Algebraics.Implementation.ringType (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType c (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT A phi i) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT A (GRing.one (@cfun_ringType gT A)) i)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT A psi i) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT A (GRing.one (@cfun_ringType gT A)) i)))))))) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) x (oneg (FinGroup.base gT))))) *) by congr (_ * (_ * _) *+ _); apply: eq_bigr => y; rewrite !cfunE mulrA mulrDl. Qed. Canonical cfInd_additive := Additive cfInd_is_linear. Canonical cfInd_linear := Linear cfInd_is_linear. End Def. Local Notation "''Ind[' B , A ]" := (@cfInd B A) : ring_scope. Local Notation "''Ind[' B ]" := 'Ind[B, _] : ring_scope. Lemma cfIndE (G H : {group gT}) phi x : H \subset G -> 'Ind[G, H] phi x = #|H|%:R^-1 * (\sum_(y in G) phi (x ^ y)). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfInd (@gval gT G) (@gval gT H) phi) x) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x y))))) *) by rewrite cfunElock !genGid => ->. Qed. Variables G K H : {group gT}. Implicit Types (phi : 'CF(H)) (psi : 'CF(G)). Lemma cfIndEout phi : ~~ (H \subset G) -> 'Ind[G] phi = (#|G|%:R * '[phi, 1]) *: '1_1%G. Proof. (* Goal: forall _ : is_true (negb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @eq (@classfun gT (@gval gT G)) (@cfInd (@gval gT G) (@gval gT H) phi) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@cfdot gT (@gval gT H) phi (GRing.one (@cfun_ringType gT (@gval gT H))))) (@cfun_indicator gT (@gval gT G) (@gval gT (one_group gT)))) *) move/negPf=> not_sHG; apply/cfunP=> x; rewrite cfunE cfuniE ?normal1 // inE. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfInd (@gval gT G) (@gval gT H) phi) x) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@cfdot gT (@gval gT H) phi (GRing.one (@cfun_ringType gT (@gval gT H))))) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base gT))) x (oneg (FinGroup.base gT)))))) *) by rewrite mulr_natr cfunElock !genGid not_sHG. Qed. Lemma cfIndEsdprod (phi : 'CF(K)) x : K ><| H = G -> 'Ind[G] phi x = \sum_(w in H) phi (x ^ w)%g. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G), @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfInd (@gval gT G) (@gval gT K) phi) x) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun w : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) w (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) w (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x w)))) *) move=> defG; have [/andP[sKG _] _ mulKH nKH _] := sdprod_context defG. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfInd (@gval gT G) (@gval gT K) phi) x) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun w : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) w (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) w (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x w)))) *) rewrite cfIndE //; apply: canLR (mulKf (neq0CG _)) _; rewrite -mulKH mulr_sumr. (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x y)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@GRing.add (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@GRing.mul (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x i))))) *) rewrite (set_partition_big _ (rcosets_partition_mul H K)) ?big_imset /=. (* Goal: @prop_in2 (FinGroup.arg_sort (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x1 x2 : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@rcoset gT (@gval gT K) x1) (@rcoset gT (@gval gT K) x2), @eq (FinGroup.arg_sort (FinGroup.base gT)) x1 x2) (inPhantom (@injective (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@rcoset gT (@gval gT K)))) *) (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x0 : FinGroup.sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) x0 (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.sort (FinGroup.base gT)) x0 (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@rcoset gT (@gval gT K) i)))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x x0)))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (@GRing.mul (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x i))))) *) apply: eq_bigr => y Hy; rewrite rcosetE norm_rlcoset ?(subsetP nKH) //. (* Goal: @prop_in2 (FinGroup.arg_sort (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x1 x2 : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@rcoset gT (@gval gT K) x1) (@rcoset gT (@gval gT K) x2), @eq (FinGroup.arg_sort (FinGroup.base gT)) x1 x2) (inPhantom (@injective (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@rcoset gT (@gval gT K)))) *) (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x0 : FinGroup.sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.sort (FinGroup.base gT)) x0 (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.sort (FinGroup.base gT)) x0 (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y) (@gval gT K))))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x x0)))) (@GRing.mul (GRing.Field.ringType Algebraics.Implementation.fieldType) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x y))) *) rewrite -lcosetE mulr_natl big_imset /=; last exact: in2W (mulgI _). (* Goal: @prop_in2 (FinGroup.arg_sort (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x1 x2 : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@rcoset gT (@gval gT K) x1) (@rcoset gT (@gval gT K) x2), @eq (FinGroup.arg_sort (FinGroup.base gT)) x1 x2) (inPhantom (@injective (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@rcoset gT (@gval gT K)))) *) (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x (@mulg (FinGroup.base gT) y i))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@fun_of_cfun gT (@gval gT K) phi (@conjg gT x y)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) *) by rewrite -sumr_const; apply: eq_bigr => z Kz; rewrite conjgM cfunJ. (* Goal: @prop_in2 (FinGroup.arg_sort (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x1 x2 : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@rcoset gT (@gval gT K) x1) (@rcoset gT (@gval gT K) x2), @eq (FinGroup.arg_sort (FinGroup.base gT)) x1 x2) (inPhantom (@injective (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@rcoset gT (@gval gT K)))) *) have [{nKH}nKH /isomP[injf _]] := sdprod_isom defG. (* Goal: @prop_in2 (FinGroup.arg_sort (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x1 x2 : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@rcoset gT (@gval gT K) x1) (@rcoset gT (@gval gT K) x2), @eq (FinGroup.arg_sort (FinGroup.base gT)) x1 x2) (inPhantom (@injective (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (FinGroup.arg_sort (FinGroup.base gT)) (@rcoset gT (@gval gT K)))) *) apply: can_in_inj (fun Ky => invm injf (coset K (repr Ky))) _ => y Hy. (* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@invm gT (@coset_groupType gT (@gval gT K)) H (@restrm_morphism gT (@coset_groupType gT (@gval gT K)) (@gval gT H) (@normaliser gT (@gval gT K)) nKH (@coset_morphism gT (@gval gT K))) injf (@coset gT (@gval gT K) (@repr (FinGroup.base gT) (@rcoset gT (@gval gT K) y)))) y *) by rewrite rcosetE -val_coset ?(subsetP nKH) // coset_reprK invmE. Qed. Lemma cfInd_on A phi : H \subset G -> phi \in 'CF(H, A) -> 'Ind[G] phi \in 'CF(G, class_support A G). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : is_true (@in_mem (@classfun gT (@gval gT H)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT H))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT H)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT H)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT H)))) (@classfun_on gT (@gval gT H) A))))), is_true (@in_mem (@classfun gT (@gval gT G)) (@cfInd (@gval gT G) (@gval gT H) phi) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) (@class_support gT A (@gval gT G)))))) *) move=> sHG Af; apply/cfun_onP=> g AG'g; rewrite cfIndE ?big1 ?mulr0 // => h Gh. (* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT g h)) (GRing.zero Algebraics.Implementation.zmodType) *) apply: (cfun_on0 Af); apply: contra AG'g => Agh. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) g (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@class_support gT A (@gval gT G))))) *) by rewrite -[g](conjgK h) memJ_class_support // groupV. Qed. Lemma cfInd_id phi : 'Ind[H] phi = phi. Proof. (* Goal: @eq (@classfun gT (@gval gT H)) (@cfInd (@gval gT H) (@gval gT H) phi) phi *) apply/cfun_inP=> x Hx; rewrite cfIndE // (eq_bigr _ (cfunJ phi x)) sumr_const. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@GRing.natmul Algebraics.Implementation.zmodType (@fun_of_cfun gT (@gval gT H) phi x) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi x) *) by rewrite -[phi x *+ _]mulr_natl mulKf ?neq0CG. Qed. Lemma cfInd_normal phi : H <| G -> 'Ind[G] phi \in 'CF(G, H). Lemma cfInd1 phi : H \subset G -> 'Ind[G] phi 1%g = #|G : H|%:R * phi 1%g. Lemma cfInd_cfun1 : H <| G -> 'Ind[G, H] 1 = #|G : H|%:R *: '1_H. Lemma cfnorm_Ind_cfun1 : H <| G -> '['Ind[G, H] 1] = #|G : H|%:R. Proof. (* Goal: forall _ : is_true (@normal gT (@gval gT H) (@gval gT G)), @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT G) (@cfInd (@gval gT G) (@gval gT H) (GRing.one (@cfun_ringType gT (@gval gT H)))) (@cfInd (@gval gT G) (@gval gT H) (GRing.one (@cfun_ringType gT (@gval gT H))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@indexg gT (@gval gT G) (@gval gT H))) *) move=> nsHG; rewrite cfInd_cfun1 // cfnormZ normr_nat cfdot_cfuni // setIid. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@GRing.exp (Num.NumDomain.ringType Algebraics.Implementation.numDomainType) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType Algebraics.Implementation.numDomainType)) (GRing.one (Num.NumDomain.ringType Algebraics.Implementation.numDomainType)) (@indexg gT (@gval gT G) (@gval gT H))) (S (S O))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@indexg gT (@gval gT G) (@gval gT H))) *) by rewrite expr2 {2}natf_indexg ?normal_sub // !mulrA divfK ?mulfK ?neq0CG. Qed. Lemma cfIndInd phi : K \subset G -> H \subset K -> 'Ind[G] ('Ind[K] phi) = 'Ind[G] phi. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))), @eq (@classfun gT (@gval gT G)) (@cfInd (@gval gT G) (@gval gT K) (@cfInd (@gval gT K) (@gval gT H) phi)) (@cfInd (@gval gT G) (@gval gT H) phi) *) move=> sKG sHK; apply/cfun_inP=> x Gx; rewrite !cfIndE ?(subset_trans sHK) //. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT K) (@cfInd (@gval gT K) (@gval gT H) phi) (@conjg gT x y))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x y))))) *) apply: canLR (mulKf (neq0CG K)) _; rewrite mulr_sumr mulr_natl. (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT K) (@cfInd (@gval gT K) (@gval gT H) phi) (@conjg gT x y)))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) *) transitivity (\sum_(y in G) \sum_(z in K) #|H|%:R^-1 * phi ((x ^ y) ^ z)). (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT (@conjg gT x y) z))))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) *) (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT K) (@cfInd (@gval gT K) (@gval gT H) phi) (@conjg gT x y)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT (@conjg gT x y) z))))))) *) by apply: eq_bigr => y Gy; rewrite cfIndE // -mulr_sumr. (* Goal: @eq (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT (@conjg gT x y) z))))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))))) *) symmetry; rewrite exchange_big /= -sumr_const; apply: eq_bigr => z Kz. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT (@conjg gT x i) z))))) *) rewrite (reindex_inj (mulIg z)). (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun j : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody Algebraics.Implementation.type (Finite.sort (FinGroup.finType (FinGroup.base gT))) j (@Monoid.operator Algebraics.Implementation.type (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@Monoid.com_operator Algebraics.Implementation.type (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (GRing.add_comoid Algebraics.Implementation.zmodType))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) j z) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x (@mulg (FinGroup.base gT) j z)))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun i : FinGroup.arg_sort (FinGroup.base gT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base gT)) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) i (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT (@conjg gT x i) z))))) *) by apply: eq_big => [y | y _]; rewrite ?conjgM // groupMr // (subsetP sKG). Qed. Lemma Frobenius_reciprocity phi psi : '[phi, 'Res[H] psi] = '['Ind[G] phi, psi]. Definition cfdot_Res_r := Frobenius_reciprocity. Lemma cfdot_Res_l psi phi : '['Res[H] psi, phi] = '[psi, 'Ind[G] phi]. Proof. (* Goal: @eq (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@cfdot gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) psi) phi) (@cfdot gT (@gval gT G) psi (@cfInd (@gval gT G) (@gval gT H) phi)) *) by rewrite cfdotC cfdot_Res_r -cfdotC. Qed. Lemma cfIndM phi psi: H \subset G -> 'Ind[G] (phi * ('Res[H] psi)) = 'Ind[G] phi * psi. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (@classfun gT (@gval gT G)) (@cfInd (@gval gT G) (@gval gT H) (@GRing.mul (@cfun_ringType gT (@gval gT H)) phi (@cfRes gT (@gval gT H) (@gval gT G) psi))) (@GRing.mul (@cfun_ringType gT (@gval gT G)) (@cfInd (@gval gT G) (@gval gT H) phi) psi) *) move=> HsG; apply/cfun_inP=> x Gx; rewrite !cfIndE // !cfunE !cfIndE // -mulrA. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT H) (@GRing.mul (@cfun_ringType gT (@gval gT H)) phi (@cfRes gT (@gval gT H) (@gval gT G) psi)) (@conjg gT x y))))) (@GRing.mul Algebraics.Implementation.ringType (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@GRing.mul Algebraics.Implementation.ringType (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x y)))) (@fun_of_cfun gT (@gval gT G) psi x))) *) congr (_ * _); rewrite mulr_suml; apply: eq_bigr=> i iG; rewrite !cfunE. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i)) (@fun_of_cfun gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) psi) (@conjg gT x i))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i)) (@fun_of_cfun gT (@gval gT G) psi x)) *) case: (boolP (x^i \in H))=> xJi; last by rewrite cfun0gen ?mul0r ?genGid. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i)) (@fun_of_cfun gT (@gval gT H) (@cfRes gT (@gval gT H) (@gval gT G) psi) (@conjg gT x i))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT H) phi (@conjg gT x i)) (@fun_of_cfun gT (@gval gT G) psi x)) *) by rewrite !cfResE //; congr (_*_); rewrite cfunJgen ?genGid. Qed. End Induced. Arguments cfInd {gT} B%g {A%g} phi%CF. Notation "''Ind[' G , H ]" := (@cfInd _ G H) (only parsing) : ring_scope. Notation "''Ind[' G ]" := 'Ind[G, _] : ring_scope. Notation "''Ind'" := 'Ind[_] (only parsing) : ring_scope. Section MorphInduced. Variables (aT rT : finGroupType) (D G H : {group aT}) (R S : {group rT}). Lemma cfIndMorph (f : {morphism D >-> rT}) (phi : 'CF(f @* H)) : 'ker f \subset H -> H \subset G -> G \subset D -> 'Ind[G] (cfMorph phi) = cfMorph ('Ind[f @* G] phi). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@classfun aT (@gval aT G)) (@cfInd aT (@gval aT G) (@gval aT H) (@cfMorph aT rT D f H phi)) (@cfMorph aT rT D f G (@cfInd rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi)) *) move=> sKH sHG sGD; have [sHD inD] := (subset_trans sHG sGD, subsetP sGD). (* Goal: @eq (@classfun aT (@gval aT G)) (@cfInd aT (@gval aT G) (@gval aT H) (@cfMorph aT rT D f H phi)) (@cfMorph aT rT D f G (@cfInd rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi)) *) apply/cfun_inP=> /= x Gx; have [Dx sKG] := (inD x Gx, subset_trans sKH sHG). (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun aT (@gval aT G) (@cfInd aT (@gval aT G) (@gval aT H) (@cfMorph aT rT D f H phi)) x) (@fun_of_cfun aT (@gval aT G) (@cfMorph aT rT D f G (@cfInd rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi)) x) *) rewrite cfMorphE ?cfIndE ?morphimS // (partition_big_imset f) -morphimEsub //=. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.sort (FinGroup.base rT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.finType (FinGroup.base rT))) (fun j : FinGroup.sort (FinGroup.base rT) => @BigBody Algebraics.Implementation.type (FinGroup.sort (FinGroup.base rT)) j (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.sort (FinGroup.base rT)) j (@mem (FinGroup.sort (FinGroup.base rT)) (predPredType (FinGroup.sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun i : FinGroup.arg_sort (FinGroup.base aT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) i (@GRing.add Algebraics.Implementation.zmodType) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) i (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f i) j)) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x i))))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H))))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base rT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base rT))) (fun y : FinGroup.arg_sort (FinGroup.base rT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base rT)) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) y (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) y))))) *) rewrite card_morphim (setIidPr sHD) natf_indexg // invfM invrK -mulrA. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.sort (FinGroup.base rT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.finType (FinGroup.base rT))) (fun j : FinGroup.sort (FinGroup.base rT) => @BigBody Algebraics.Implementation.type (FinGroup.sort (FinGroup.base rT)) j (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.sort (FinGroup.base rT)) j (@mem (FinGroup.sort (FinGroup.base rT)) (predPredType (FinGroup.sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun i : FinGroup.arg_sort (FinGroup.base aT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) i (@GRing.add Algebraics.Implementation.zmodType) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) i (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f i) j)) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x i))))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv (GRing.Field.unitRingType Algebraics.Implementation.fieldType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumField.unitRingType Algebraics.Implementation.numFieldType))) (GRing.one (GRing.UnitRing.ringType (Num.NumField.unitRingType Algebraics.Implementation.numFieldType))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumField.unitRingType Algebraics.Implementation.numFieldType))) (GRing.one (GRing.UnitRing.ringType (Num.NumField.unitRingType Algebraics.Implementation.numFieldType))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base rT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base rT))) (fun y : FinGroup.arg_sort (FinGroup.base rT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base rT)) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) y (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) y)))))) *) congr (_ * _); rewrite mulr_sumr; apply: eq_bigr => _ /morphimP[y Dy Gy ->]. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun i : FinGroup.arg_sort (FinGroup.base aT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) i (@GRing.add Algebraics.Implementation.zmodType) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) i (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f i) (@mfun aT rT (@gval aT D) f y))) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x i)))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumField.unitRingType Algebraics.Implementation.numFieldType))) (GRing.one (GRing.UnitRing.ringType (Num.NumField.unitRingType Algebraics.Implementation.numFieldType))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))))) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y)))) *) rewrite -(card_rcoset _ y) mulr_natl -sumr_const. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun i : FinGroup.arg_sort (FinGroup.base aT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) i (@GRing.add Algebraics.Implementation.zmodType) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) i (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f i) (@mfun aT rT (@gval aT D) f y))) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x i)))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun i : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) i (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) i (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@gval aT (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) y))))) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y))))) *) apply: eq_big => [z | z /andP[Gz /eqP <-]]. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x z)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f z))) *) (* Goal: @eq bool (andb (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) z (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f z) (@mfun aT rT (@gval aT D) f y))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@gval aT (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) y))))) *) have [Gz | G'z] := boolP (z \in G). (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x z)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f z))) *) (* Goal: @eq bool (andb false (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f z) (@mfun aT rT (@gval aT D) f y))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@gval aT (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) y))))) *) (* Goal: @eq bool (andb true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f z) (@mfun aT rT (@gval aT D) f y))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@gval aT (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) y))))) *) by rewrite (sameP eqP (rcoset_kerP _ _ _)) ?inD. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x z)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f z))) *) (* Goal: @eq bool (andb false (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f z) (@mfun aT rT (@gval aT D) f y))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@gval aT (@ker_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) y))))) *) by case: rcosetP G'z => // [[t Kt ->]]; rewrite groupM // (subsetP sKG). (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x z)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@conjg rT (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f z))) *) have [Dz Dxz] := (inD z Gz, inD (x ^ z) (groupJ Gx Gz)); rewrite -morphJ //. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x z)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@mfun aT rT (@gval aT D) f (@conjg aT x z))) *) have [Hxz | notHxz] := boolP (x ^ z \in H); first by rewrite cfMorphE. (* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@fun_of_cfun aT (@gval aT H) (@cfMorph aT rT D f H phi) (@conjg aT x z)) (@fun_of_cfun rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) phi (@mfun aT rT (@gval aT D) f (@conjg aT x z))) *) by rewrite !cfun0 // -sub1set -morphim_set1 // morphimSGK ?sub1set. Qed. Variables (g : {morphism G >-> rT}) (h : {morphism H >-> rT}). Hypotheses (isoG : isom G R g) (isoH : isom H S h) (eq_hg : {in H, h =1 g}). Hypothesis sHG : H \subset G. Lemma cfResIsom phi : 'Res[S] (cfIsom isoG phi) = cfIsom isoH ('Res[H] phi). Proof. (* Goal: @eq (@classfun rT (@gval rT S)) (@cfRes rT (@gval rT S) (@gval rT R) (@cfIsom aT rT G g R isoG phi)) (@cfIsom aT rT H h S isoH (@cfRes aT (@gval aT H) (@gval aT G) phi)) *) have [[injg defR] [injh defS]] := (isomP isoG, isomP isoH). (* Goal: @eq (@classfun rT (@gval rT S)) (@cfRes rT (@gval rT S) (@gval rT R) (@cfIsom aT rT G g R isoG phi)) (@cfIsom aT rT H h S isoH (@cfRes aT (@gval aT H) (@gval aT G) phi)) *) rewrite !morphimEdom in defS defR; apply/cfun_inP=> s. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) s (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT S)))), @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT S) (@cfRes rT (@gval rT S) (@gval rT R) (@cfIsom aT rT G g R isoG phi)) s) (@fun_of_cfun rT (@gval rT S) (@cfIsom aT rT H h S isoH (@cfRes aT (@gval aT H) (@gval aT G) phi)) s) *) rewrite -{1}defS => /imsetP[x Hx ->] {s}; have Gx := subsetP sHG x Hx. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT S) (@cfRes rT (@gval rT S) (@gval rT R) (@cfIsom aT rT G g R isoG phi)) (@mfun aT rT (@gval aT H) h x)) (@fun_of_cfun rT (@gval rT S) (@cfIsom aT rT H h S isoH (@cfRes aT (@gval aT H) (@gval aT G) phi)) (@mfun aT rT (@gval aT H) h x)) *) rewrite {1}eq_hg ?(cfResE, cfIsomE) // -defS -?eq_hg ?mem_imset // -defR. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT H) h) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT G) g) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))))) *) by rewrite (eq_in_imset eq_hg) imsetS. Qed. Lemma cfIndIsom phi : 'Ind[R] (cfIsom isoH phi) = cfIsom isoG ('Ind[G] phi). Proof. (* Goal: @eq (@classfun rT (@gval rT R)) (@cfInd rT (@gval rT R) (@gval rT S) (@cfIsom aT rT H h S isoH phi)) (@cfIsom aT rT G g R isoG (@cfInd aT (@gval aT G) (@gval aT H) phi)) *) have [[injg defR] [_ defS]] := (isomP isoG, isomP isoH). (* Goal: @eq (@classfun rT (@gval rT R)) (@cfInd rT (@gval rT R) (@gval rT S) (@cfIsom aT rT H h S isoH phi)) (@cfIsom aT rT G g R isoG (@cfInd aT (@gval aT G) (@gval aT H) phi)) *) rewrite morphimEdom (eq_in_imset eq_hg) -morphimEsub // in defS. (* Goal: @eq (@classfun rT (@gval rT R)) (@cfInd rT (@gval rT R) (@gval rT S) (@cfIsom aT rT H h S isoH phi)) (@cfIsom aT rT G g R isoG (@cfInd aT (@gval aT G) (@gval aT H) phi)) *) apply/cfun_inP=> s; rewrite -{1}defR => /morphimP[x _ Gx ->]{s}. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT R) (@cfInd rT (@gval rT R) (@gval rT S) (@cfIsom aT rT H h S isoH phi)) (@mfun aT rT (@gval aT G) g x)) (@fun_of_cfun rT (@gval rT R) (@cfIsom aT rT G g R isoG (@cfInd aT (@gval aT G) (@gval aT H) phi)) (@mfun aT rT (@gval aT G) g x)) *) rewrite cfIsomE ?cfIndE // -defR -{1}defS ?morphimS ?card_injm // morphimEdom. (* Goal: @eq Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base rT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT G) g) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))))) (@fun_of_cfun rT (@gval rT S) (@cfIsom aT rT H h S isoH phi) (@conjg rT (@mfun aT rT (@gval aT G) g x) y))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@fun_of_cfun aT (@gval aT H) phi (@conjg aT x y))))) *) congr (_ * _); rewrite big_imset //=; last exact/injmP. (* Goal: @eq Algebraics.Implementation.type (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun i : FinGroup.arg_sort (FinGroup.base aT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) i (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) i (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@fun_of_cfun rT (@gval rT S) (@cfIsom aT rT H h S isoH phi) (@conjg rT (@mfun aT rT (@gval aT G) g x) (@mfun aT rT (@gval aT G) g i))))) (@BigOp.bigop Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base aT))) (fun y : FinGroup.arg_sort (FinGroup.base aT) => @BigBody Algebraics.Implementation.type (FinGroup.arg_sort (FinGroup.base aT)) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) y (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@fun_of_cfun aT (@gval aT H) phi (@conjg aT x y)))) *) apply: eq_bigr => y Gy; rewrite -morphJ //. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT S) (@cfIsom aT rT H h S isoH phi) (@mfun aT rT (@gval aT G) g (@conjg aT x y))) (@fun_of_cfun aT (@gval aT H) phi (@conjg aT x y)) *) have [Hxy | H'xy] := boolP (x ^ y \in H); first by rewrite -eq_hg ?cfIsomE. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT S) (@cfIsom aT rT H h S isoH phi) (@mfun aT rT (@gval aT G) g (@conjg aT x y))) (@fun_of_cfun aT (@gval aT H) phi (@conjg aT x y)) *) by rewrite !cfun0 -?defS // -sub1set -morphim_set1 ?injmSK ?sub1set // groupJ. Qed. End MorphInduced. Section FieldAutomorphism. Variables (u : {rmorphism algC -> algC}) (gT rT : finGroupType). Variables (G K H : {group gT}) (f : {morphism G >-> rT}) (R : {group rT}). Implicit Types (phi : 'CF(G)) (S : seq 'CF(G)). Local Notation "phi ^u" := (cfAut u phi) (at level 3, format "phi ^u"). Lemma cfAutZ_nat n phi : (n%:R *: phi)^u = n%:R *: phi^u. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) n) phi)) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) n) (@cfAut gT (@gval gT G) u phi)) *) exact: raddfZnat. Qed. Lemma cfAutZ_Cnat z phi : z \in Cnat -> (z *: phi)^u = z *: phi^u. Proof. (* Goal: forall _ : is_true (@in_mem Algebraics.Implementation.type z (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cnat)), @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) z phi)) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) z (@cfAut gT (@gval gT G) u phi)) *) exact: raddfZ_Cnat. Qed. Lemma cfAutZ_Cint z phi : z \in Cint -> (z *: phi)^u = z *: phi^u. Proof. (* Goal: forall _ : is_true (@in_mem Algebraics.Implementation.type z (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)), @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) z phi)) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) z (@cfAut gT (@gval gT G) u phi)) *) exact: raddfZ_Cint. Qed. Lemma cfAutK : cancel (@cfAut gT G u) (cfAut (algC_invaut_rmorphism u)). Proof. (* Goal: @cancel (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u) (@cfAut gT (@gval gT G) (algC_invaut_rmorphism u)) *) by move=> phi; apply/cfunP=> x; rewrite !cfunE /= algC_autK. Qed. Lemma cfAutVK : cancel (cfAut (algC_invaut_rmorphism u)) (@cfAut gT G u). Proof. (* Goal: @cancel (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) (algC_invaut_rmorphism u)) (@cfAut gT (@gval gT G) u) *) by move=> phi; apply/cfunP=> x; rewrite !cfunE /= algC_invautK. Qed. Lemma cfAut_inj : injective (@cfAut gT G u). Proof. (* Goal: @injective (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u) *) exact: can_inj cfAutK. Qed. Lemma cfAut_eq1 phi : (cfAut u phi == 1) = (phi == 1). Proof. (* Goal: @eq bool (@eq_op (@cfun_eqType gT (@gval gT G)) (@cfAut gT (@gval gT G) u phi) (GRing.one (@cfun_ringType gT (@gval gT G)))) (@eq_op (@cfun_eqType gT (@gval gT G)) phi (GRing.one (@cfun_ringType gT (@gval gT G)))) *) by rewrite rmorph_eq1 //; apply: cfAut_inj. Qed. Lemma support_cfAut phi : support phi^u =i support phi. Proof. (* Goal: @eq_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (simplPredType (FinGroup.arg_sort (FinGroup.base gT))) (@support_for (FinGroup.arg_sort (FinGroup.base gT)) (GRing.Zmodule.eqType Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@fun_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) u phi)))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (simplPredType (FinGroup.arg_sort (FinGroup.base gT))) (@support_for (FinGroup.arg_sort (FinGroup.base gT)) (GRing.Zmodule.eqType Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@fun_of_cfun gT (@gval gT G) phi))) *) by move=> x; rewrite !inE cfunE fmorph_eq0. Qed. Lemma map_cfAut_free S : cfAut_closed u S -> free S -> free (map (cfAut u) S). Proof. (* Goal: forall (_ : @cfAut_closed gT (@gval gT G) u S) (_ : is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) S)), is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (@map (@classfun gT (@gval gT G)) (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u) S)) *) set Su := map _ S => sSuS freeS; have uniqS := free_uniq freeS. (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) Su) *) have uniqSu: uniq Su by rewrite (map_inj_uniq cfAut_inj). (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) Su) *) have{sSuS} sSuS: {subset Su <= S} by move=> _ /mapP[phi Sphi ->]; apply: sSuS. (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) Su) *) have [|eqSuS _] := leq_size_perm uniqSu sSuS; first by rewrite size_map. (* Goal: is_true (@free Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) Su) *) by rewrite (perm_free (uniq_perm_eq uniqSu uniqS eqSuS)). Qed. Lemma cfAut_on A phi : (phi^u \in 'CF(G, A)) = (phi \in 'CF(G, A)). Proof. (* Goal: @eq bool (@in_mem (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u phi) (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) (@in_mem (@classfun gT (@gval gT G)) phi (@mem (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G))) (predPredType (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@pred_of_vspace Algebraics.Implementation.fieldType (@cfun_vectType gT (@gval gT G)) (Phant (@Vector.sort (GRing.Field.ringType Algebraics.Implementation.fieldType) (Phant (GRing.Field.sort Algebraics.Implementation.fieldType)) (@cfun_vectType gT (@gval gT G)))) (@classfun_on gT (@gval gT G) A)))) *) by rewrite !cfun_onE (eq_subset (support_cfAut phi)). Qed. Lemma cfker_aut phi : cfker phi^u = cfker phi. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cfker gT (@gval gT G) (@cfAut gT (@gval gT G) u phi)) (@cfker gT (@gval gT G) phi) *) apply/setP=> x; rewrite !inE; apply: andb_id2l => Gx. (* Goal: @eq bool (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) u phi) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) u phi) y))) y)) (@FiniteQuant.quant0b (FinGroup.arg_finType (FinGroup.base gT)) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @FiniteQuant.all (FinGroup.arg_finType (FinGroup.base gT)) (FiniteQuant.Quantified (@eq_op Algebraics.Implementation.eqType (@fun_of_cfun gT (@gval gT G) phi (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) phi y))) y)) *) by apply/forallP/forallP=> Kx y; have:= Kx y; rewrite !cfunE (inj_eq (fmorph_inj u)). Qed. Lemma cfAut_cfuni A : ('1_A)^u = '1_A :> 'CF(G). Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfun_indicator gT (@gval gT G) A)) (@cfun_indicator gT (@gval gT G) A) *) by apply/cfunP=> x; rewrite !cfunElock rmorph_nat. Qed. Lemma cforder_aut phi : #[phi^u]%CF = #[phi]%CF. Proof. (* Goal: @eq nat (@cforder gT (@gval gT G) (@cfAut gT (@gval gT G) u phi)) (@cforder gT (@gval gT G) phi) *) exact: cforder_inj_rmorph cfAut_inj. Qed. Lemma cfAutRes phi : ('Res[H] phi)^u = 'Res phi^u. Proof. (* Goal: @eq (@classfun gT (@gval gT H)) (@cfAut gT (@gval gT H) u (@cfRes gT (@gval gT H) (@gval gT G) phi)) (@cfRes gT (@gval gT H) (@gval gT G) (@cfAut gT (@gval gT G) u phi)) *) by apply/cfunP=> x; rewrite !cfunElock rmorphMn. Qed. Lemma cfAutMorph (psi : 'CF(f @* H)) : (cfMorph psi)^u = cfMorph psi^u. Proof. (* Goal: @eq (@classfun gT (@gval gT H)) (@cfAut gT (@gval gT H) u (@cfMorph gT rT G f H psi)) (@cfMorph gT rT G f H (@cfAut rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT H)) u psi)) *) by apply/cfun_inP=> x Hx; rewrite !cfunElock Hx. Qed. Lemma cfAutIsom (isoGR : isom G R f) phi : (cfIsom isoGR phi)^u = cfIsom isoGR phi^u. Proof. (* Goal: @eq (@classfun rT (@gval rT R)) (@cfAut rT (@gval rT R) u (@cfIsom gT rT G f R isoGR phi)) (@cfIsom gT rT G f R isoGR (@cfAut gT (@gval gT G) u phi)) *) apply/cfun_inP=> y; have [_ {1}<-] := isomP isoGR => /morphimP[x _ Gx ->{y}]. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun rT (@gval rT R) (@cfAut rT (@gval rT R) u (@cfIsom gT rT G f R isoGR phi)) (@mfun gT rT (@gval gT G) f x)) (@fun_of_cfun rT (@gval rT R) (@cfIsom gT rT G f R isoGR (@cfAut gT (@gval gT G) u phi)) (@mfun gT rT (@gval gT G) f x)) *) by rewrite !(cfunE, cfIsomE). Qed. Lemma cfAutQuo phi : (phi / H)^u = (phi^u / H)%CF. Proof. (* Goal: @eq (@classfun (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) (@cfAut (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) u (@cfQuo gT G (@gval gT H) phi)) (@cfQuo gT G (@gval gT H) (@cfAut gT (@gval gT G) u phi)) *) by apply/cfunP=> Hx; rewrite !cfunElock cfker_aut rmorphMn. Qed. Lemma cfAutMod (psi : 'CF(G / H)) : (psi %% H)^u = (psi^u %% H)%CF. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfMod gT G (@gval gT H) psi)) (@cfMod gT G (@gval gT H) (@cfAut (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H)) u psi)) *) by apply/cfunP=> x; rewrite !cfunElock rmorphMn. Qed. Lemma cfAutInd (psi : 'CF(H)) : ('Ind[G] psi)^u = 'Ind psi^u. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfInd gT (@gval gT G) (@gval gT H) psi)) (@cfInd gT (@gval gT G) (@gval gT H) (@cfAut gT (@gval gT H) u psi)) *) have [sHG | not_sHG] := boolP (H \subset G). (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfInd gT (@gval gT G) (@gval gT H) psi)) (@cfInd gT (@gval gT G) (@gval gT H) (@cfAut gT (@gval gT H) u psi)) *) (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfInd gT (@gval gT G) (@gval gT H) psi)) (@cfInd gT (@gval gT G) (@gval gT H) (@cfAut gT (@gval gT H) u psi)) *) apply/cfunP=> x; rewrite !(cfunE, cfIndE) // rmorphM fmorphV rmorph_nat. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfInd gT (@gval gT G) (@gval gT H) psi)) (@cfInd gT (@gval gT G) (@gval gT H) (@cfAut gT (@gval gT H) u psi)) *) (* Goal: @eq Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : GRing.Ring.sort Algebraics.Implementation.ringType, GRing.Ring.sort Algebraics.Implementation.ringType)) u (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT H) psi (@conjg gT x y)))))) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.inv Algebraics.Implementation.unitRingType (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@GRing.add Algebraics.Implementation.zmodType) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@fun_of_cfun gT (@gval gT H) (@cfAut gT (@gval gT H) u psi) (@conjg gT x y))))) *) by congr (_ * _); rewrite rmorph_sum; apply: eq_bigr => y; rewrite !cfunE. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfInd gT (@gval gT G) (@gval gT H) psi)) (@cfInd gT (@gval gT G) (@gval gT H) (@cfAut gT (@gval gT H) u psi)) *) rewrite !cfIndEout // linearZ /= cfAut_cfuni rmorphM rmorph_nat. (* Goal: @eq (@classfun gT (@gval gT G)) (@GRing.scale Algebraics.Implementation.ringType (@cfun_lmodType gT (@gval gT G)) (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : GRing.Ring.sort Algebraics.Implementation.ringType, GRing.Ring.sort Algebraics.Implementation.ringType)) u (@cfdot gT (@gval gT H) psi (GRing.one (@cfun_ringType gT (@gval gT H)))))) (@cfun_indicator gT (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@GRing.scale (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@cfun_lmodType gT (@gval gT G)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (GRing.one (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@cfdot gT (@gval gT H) (@cfAut gT (@gval gT H) u psi) (GRing.one (@cfun_ringType gT (@gval gT H))))) (@cfun_indicator gT (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *) rewrite -cfdot_cfAut ?rmorph1 // => _ /imageP[x Hx ->]. (* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@fun_of_cfun gT (@gval gT H) (GRing.one (@cfun_ringType gT (@gval gT H))) x))) (@GRing.RMorphism.apply (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Num.ClosedField.ringType Algebraics.Implementation.numClosedFieldType) (Phant (forall _ : Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType, Num.ClosedField.sort Algebraics.Implementation.numClosedFieldType)) (@conjC Algebraics.Implementation.numClosedFieldType) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) u (@fun_of_cfun gT (@gval gT H) (GRing.one (@cfun_ringType gT (@gval gT H))) x))) *) by rewrite cfun1E Hx !rmorph1. Qed. Hypothesis KxH : K \x H = G. Lemma cfAutDprodl (phi : 'CF(K)) : (cfDprodl KxH phi)^u = cfDprodl KxH phi^u. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfDprodl gT G K H KxH phi)) (@cfDprodl gT G K H KxH (@cfAut gT (@gval gT K) u phi)) *) apply/cfun_inP=> _ /(mem_dprod KxH)[x [y [Kx Hy -> _]]]. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) u (@cfDprodl gT G K H KxH phi)) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) (@cfDprodl gT G K H KxH (@cfAut gT (@gval gT K) u phi)) (@mulg (FinGroup.base gT) x y)) *) by rewrite !(cfunE, cfDprodEl). Qed. Lemma cfAutDprodr (psi : 'CF(H)) : (cfDprodr KxH psi)^u = cfDprodr KxH psi^u. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfDprodr gT G K H KxH psi)) (@cfDprodr gT G K H KxH (@cfAut gT (@gval gT H) u psi)) *) apply/cfun_inP=> _ /(mem_dprod KxH)[x [y [Kx Hy -> _]]]. (* Goal: @eq Algebraics.Implementation.type (@fun_of_cfun gT (@gval gT G) (@cfAut gT (@gval gT G) u (@cfDprodr gT G K H KxH psi)) (@mulg (FinGroup.base gT) x y)) (@fun_of_cfun gT (@gval gT G) (@cfDprodr gT G K H KxH (@cfAut gT (@gval gT H) u psi)) (@mulg (FinGroup.base gT) x y)) *) by rewrite !(cfunE, cfDprodEr). Qed. Lemma cfAutDprod (phi : 'CF(K)) (psi : 'CF(H)) : (cfDprod KxH phi psi)^u = cfDprod KxH phi^u psi^u. Proof. (* Goal: @eq (@classfun gT (@gval gT G)) (@cfAut gT (@gval gT G) u (@cfDprod gT G K H KxH phi psi)) (@cfDprod gT G K H KxH (@cfAut gT (@gval gT K) u phi) (@cfAut gT (@gval gT H) u psi)) *) by rewrite rmorphM /= cfAutDprodl cfAutDprodr. Qed. End FieldAutomorphism. Arguments cfAutK u {gT G}. Arguments cfAutVK u {gT G}. Arguments cfAut_inj u {gT G} [phi1 phi2] : rename. Definition conj_cfRes := cfAutRes conjC. Definition cfker_conjC := cfker_aut conjC. Definition conj_cfQuo := cfAutQuo conjC. Definition conj_cfMod := cfAutMod conjC. Definition conj_cfInd := cfAutInd conjC. Definition cfconjC_eq1 := cfAut_eq1 conjC.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq path div choice. From mathcomp Require Import fintype tuple finfun bigop prime ssralg poly finset. From mathcomp Require Import fingroup morphism perm automorphism quotient gproduct action. From mathcomp Require Import finalg zmodp commutator cyclic center pgroup gseries nilpotent. From mathcomp Require Import sylow maximal abelian matrix mxalgebra mxrepresentation. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope GRing.Theory FinRing.Theory. Local Open Scope ring_scope. Section FinRingRepr. Variable (R : finComUnitRingType) (gT : finGroupType). Variables (G : {group gT}) (n : nat) (rG : mx_representation R G n). Definition mx_repr_act (u : 'rV_n) x := u *m rG (val (subg G x)). Lemma mx_repr_actE u x : x \in G -> mx_repr_act u x = u *m rG x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (FinRing.ComUnitRing.comUnitRingType R))) (S O) n) (mx_repr_act u x) (@mulmx (GRing.ComUnitRing.ringType (FinRing.ComUnitRing.comUnitRingType R)) (S O) n n u (@repr_mx (FinRing.ComUnitRing.comUnitRingType R) gT (@gval gT G) n rG x)) *) by move=> Gx; rewrite /mx_repr_act /= subgK. Qed. Fact mx_repr_is_action : is_action G mx_repr_act. Proof. (* Goal: @is_action gT (@gval gT G) (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (FinRing.ComUnitRing.comUnitRingType R))) (S O) n) mx_repr_act *) split=> [x | u x y Gx Gy]; first exact: can_inj (repr_mxK _ (subgP _)). (* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (FinRing.ComUnitRing.comUnitRingType R))) (S O) n) (mx_repr_act u (@mulg (FinGroup.base gT) x y)) (mx_repr_act (mx_repr_act u x) y) *) by rewrite !mx_repr_actE ?groupM // -mulmxA repr_mxM. Qed. Canonical Structure mx_repr_action := Action mx_repr_is_action. Fact mx_repr_is_groupAction : is_groupAction [set: 'rV[R]_n] mx_repr_action. Proof. (* Goal: @is_groupAction gT (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n) (@gval gT G) (@setTfor (matrix_finType (FinRing.ComUnitRing.finType R) (S O) n) (Phant (matrix (FinRing.ComUnitRing.sort R) (S O) n))) mx_repr_action *) move=> x Gx /=; rewrite !inE. (* Goal: is_true (andb (@perm_on (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n))) (@setTfor (matrix_finType (FinRing.ComUnitRing.finType R) (S O) n) (Phant (matrix (FinRing.ComUnitRing.sort R) (S O) n))) (@actperm gT (@gval gT G) (FinGroup.arg_finType (matrix_baseFinGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n)) mx_repr_action x)) (@morphic (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n) (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n) (@setTfor (matrix_finType (FinRing.ComUnitRing.finType R) (S O) n) (Phant (matrix (FinRing.ComUnitRing.sort R) (S O) n))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n))) (@actperm gT (@gval gT G) (FinGroup.arg_finType (matrix_baseFinGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n)) mx_repr_action x)))) *) apply/andP; split; first by apply/subsetP=> u; rewrite !inE. (* Goal: is_true (@morphic (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n) (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n) (@setTfor (matrix_finType (FinRing.ComUnitRing.finType R) (S O) n) (Phant (matrix (FinRing.ComUnitRing.sort R) (S O) n))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n))) (@actperm gT (@gval gT G) (FinGroup.arg_finType (matrix_baseFinGroupType (FinRing.ComUnitRing.finZmodType R) (S O) n)) mx_repr_action x))) *) by apply/morphicP=> /= u v _ _; rewrite !actpermE /= /mx_repr_act mulmxDl. Qed. Canonical Structure mx_repr_groupAction := GroupAction mx_repr_is_groupAction. End FinRingRepr. Notation "''MR' rG" := (mx_repr_action rG) (at level 10, rG at level 8) : action_scope. Notation "''MR' rG" := (mx_repr_groupAction rG) : groupAction_scope. Section FinFieldRepr. Variable F : finFieldType. Section ScaleAction. Variables m n : nat. Definition scale_act (A : 'M[F]_(m, n)) (a : {unit F}) := val a *: A. Fact scale_is_action : is_action setT scale_act. Proof. (* Goal: @is_action (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))))) (matrix (FinRing.Field.sort F) m n) scale_act *) apply: is_total_action=> [A | A a b]; rewrite /scale_act ?scale1r //. (* Goal: @eq (matrix (FinRing.Field.sort F) m n) (@GRing.scale (FinRing.UnitRing.ringType (FinRing.Field.finUnitRingType F)) (matrix_lmodType (FinRing.UnitRing.ringType (FinRing.Field.finUnitRingType F)) m n) (@val (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) (fun x : FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F) => @in_mem (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) x (@mem (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (predPredType (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))) (@has_quality (S O) (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (@GRing.unit (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))))) (FinRing.unit_subType (FinRing.Field.finUnitRingType F)) (@mulg (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))) a b)) A) (@GRing.scale (FinRing.UnitRing.ringType (FinRing.Field.finUnitRingType F)) (matrix_lmodType (FinRing.UnitRing.ringType (FinRing.Field.finUnitRingType F)) m n) (@val (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) (fun x : FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F) => @in_mem (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) x (@mem (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (predPredType (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))) (@has_quality (S O) (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (@GRing.unit (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))))) (FinRing.unit_subType (FinRing.Field.finUnitRingType F)) b) (@GRing.scale (FinRing.UnitRing.ringType (FinRing.Field.finUnitRingType F)) (matrix_lmodType (FinRing.UnitRing.ringType (FinRing.Field.finUnitRingType F)) m n) (@val (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) (fun x : FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F) => @in_mem (FinRing.UnitRing.sort (FinRing.Field.finUnitRingType F)) x (@mem (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (predPredType (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))) (@has_quality (S O) (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F))) (@GRing.unit (FinRing.UnitRing.unitRingType (FinRing.Field.finUnitRingType F)))))) (FinRing.unit_subType (FinRing.Field.finUnitRingType F)) a) A)) *) by rewrite ?scalerA mulrC. Qed. Canonical scale_action := Action scale_is_action. Fact scale_is_groupAction : is_groupAction setT scale_action. Canonical scale_groupAction := GroupAction scale_is_groupAction. Lemma astab1_scale_act A : A != 0 -> 'C[A | scale_action] = 1%g. End ScaleAction. Local Notation "'Zm" := (scale_action _ _) (at level 8) : action_scope. Section RowGroup. Variable n : nat. Local Notation rVn := 'rV[F]_n. Definition rowg m (A : 'M[F]_(m, n)) : {set rVn} := [set u | u <= A]%MS. Lemma mem_rowg m A v : (v \in @rowg m A) = (v <= A)%MS. Proof. (* Goal: @eq bool (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) v (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) (@submx (FinRing.Field.fieldType F) (S O) m n v A) *) by rewrite inE. Qed. Fact rowg_group_set m A : group_set (@rowg m A). Proof. (* Goal: is_true (@group_set (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) (@rowg m A)) *) by apply/group_setP; split=> [|u v]; rewrite !inE ?sub0mx //; apply: addmx_sub. Qed. Canonical rowg_group m A := Group (@rowg_group_set m A). Lemma rowg_stable m (A : 'M_(m, n)) : [acts setT, on rowg A | 'Zm]. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (@astabs (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))))) (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A) (scale_action (S O) n))))) *) by apply/actsP=> a _ v; rewrite !inE eqmx_scale // -unitfE (valP a). Qed. Lemma rowgS m1 m2 (A : 'M_(m1, n)) (B : 'M_(m2, n)) : (rowg A \subset rowg B) = (A <= B)%MS. Proof. (* Goal: @eq bool (@subset (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m1 A))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m2 B)))) (@submx (FinRing.Field.fieldType F) m1 m2 n A B) *) apply/subsetP/idP=> sAB => [| u]. (* Goal: forall _ : is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m1 A)))), is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m2 B)))) *) (* Goal: is_true (@submx (FinRing.Field.fieldType F) m1 m2 n A B) *) by apply/row_subP=> i; have:= sAB (row i A); rewrite !inE row_sub => ->. (* Goal: forall _ : is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m1 A)))), is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m2 B)))) *) by rewrite !inE => suA; apply: submx_trans sAB. Qed. Lemma eq_rowg m1 m2 (A : 'M_(m1, n)) (B : 'M_(m2, n)) : (A :=: B)%MS -> rowg A = rowg B. Proof. (* Goal: forall _ : @eqmx (FinRing.Field.fieldType F) m1 m2 n A B, @eq (@set_of (matrix_finType (FinRing.Field.finType F) (S O) n) (Phant (matrix (FinRing.Field.sort F) (S O) n))) (@rowg m1 A) (@rowg m2 B) *) by move=> eqAB; apply/eqP; rewrite eqEsubset !rowgS !eqAB andbb. Qed. Lemma rowg0 m : rowg (0 : 'M_(m, n)) = 1%g. Proof. (* Goal: @eq (@set_of (matrix_finType (FinRing.Field.finType F) (S O) n) (Phant (matrix (FinRing.Field.sort F) (S O) n))) (@rowg m (GRing.zero (matrix_zmodType (FinRing.Field.zmodType F) m n) : matrix (GRing.Zmodule.sort (FinRing.Field.zmodType F)) m n)) (oneg (group_set_of_baseGroupType (matrix_baseFinGroupType (FinRing.Field.finZmodType F) (S O) n))) *) by apply/trivgP/subsetP=> v; rewrite !inE eqmx0 submx0. Qed. Lemma rowg1 : rowg 1%:M = setT. Proof. (* Goal: @eq (@set_of (matrix_finType (FinRing.Field.finType F) (S O) n) (Phant (matrix (FinRing.Field.sort F) (S O) n))) (@rowg n (@scalar_mx (FinRing.Field.ringType F) n (GRing.one (FinRing.Field.ringType F)))) (@setTfor (matrix_finType (FinRing.Field.finType F) (S O) n) (Phant (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)))) *) by apply/setP=> x; rewrite !inE submx1. Qed. Lemma trivg_rowg m (A : 'M_(m, n)) : (rowg A == 1%g) = (A == 0). Proof. (* Goal: @eq bool (@eq_op (set_of_eqType (matrix_finType (FinRing.Field.finType F) (S O) n)) (@rowg m A) (oneg (group_set_of_baseGroupType (matrix_baseFinGroupType (FinRing.Field.finZmodType F) (S O) n)))) (@eq_op (matrix_eqType (FinRing.Field.eqType F) m n) A (GRing.zero (matrix_zmodType (FinRing.Field.zmodType F) m n))) *) by rewrite -submx0 -rowgS rowg0 (sameP trivgP eqP). Qed. Definition rowg_mx (L : {set rVn}) := <<\matrix_(i < #|L|) enum_val i>>%MS. Lemma rowgK m (A : 'M_(m, n)) : (rowg_mx (rowg A) :=: A)%MS. Proof. (* Goal: @eqmx (FinRing.Field.fieldType F) n m n (rowg_mx (@rowg m A)) A *) apply/eqmxP; rewrite !genmxE; apply/andP; split. (* Goal: is_true (@submx (FinRing.Field.fieldType F) m (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n A (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)) i) (GRing.zero (Zp_zmodType O)) j))) *) (* Goal: is_true (@submx (FinRing.Field.fieldType F) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) m n (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)) i) (GRing.zero (Zp_zmodType O)) j)) A) *) by apply/row_subP=> i; rewrite rowK; have:= enum_valP i; rewrite /= inE. (* Goal: is_true (@submx (FinRing.Field.fieldType F) m (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n A (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)) i) (GRing.zero (Zp_zmodType O)) j))) *) apply/row_subP=> i; set v := row i A. (* Goal: is_true (@submx (FinRing.Field.fieldType F) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n v (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)) i) (GRing.zero (Zp_zmodType O)) j))) *) have Av: v \in rowg A by rewrite inE row_sub. (* Goal: is_true (@submx (FinRing.Field.fieldType F) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n v (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)) i) (GRing.zero (Zp_zmodType O)) j))) *) by rewrite (eq_row_sub (enum_rank_in Av v)) // rowK enum_rankK_in. Qed. Lemma rowg_mxS (L M : {set 'rV[F]_n}) : L \subset M -> (rowg_mx L <= rowg_mx M)%MS. Proof. (* Goal: forall _ : is_true (@subset (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) L)) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M))), is_true (@submx (FinRing.Field.fieldType F) n n n (rowg_mx L) (rowg_mx M)) *) move/subsetP=> sLM; rewrite !genmxE; apply/row_subP=> i. (* Goal: is_true (@submx (FinRing.Field.fieldType F) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M))) n (@row (GRing.Field.sort (FinRing.Field.fieldType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) L))) n i (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) L))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) L))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) L) i) (GRing.zero (Zp_zmodType O)) j))) (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M) i) (GRing.zero (Zp_zmodType O)) j))) *) rewrite rowK; move: (enum_val i) (sLM _ (enum_valP i)) => v Mv. (* Goal: is_true (@submx (FinRing.Field.fieldType F) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M))) n v (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) M) i) (GRing.zero (Zp_zmodType O)) j))) *) by rewrite (eq_row_sub (enum_rank_in Mv v)) // rowK enum_rankK_in. Qed. Lemma sub_rowg_mx (L : {set rVn}) : L \subset rowg (rowg_mx L). Lemma stable_rowg_mxK (L : {group rVn}) : [acts setT, on L | 'Zm] -> rowg (rowg_mx L) = L. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (@astabs (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType F))))))) (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L) (scale_action (S O) n))))), @eq (@set_of (matrix_finType (FinRing.Field.finType F) (S O) n) (Phant (matrix (FinRing.Field.sort F) (S O) n))) (@rowg n (rowg_mx (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L))) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L) *) move=> linL; apply/eqP; rewrite eqEsubset sub_rowg_mx andbT. (* Goal: is_true (@subset (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg n (rowg_mx (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L))))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) *) apply/subsetP=> v; rewrite inE genmxE => /submxP[u ->{v}]. (* Goal: is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (@mulmx (GRing.Field.ringType (FinRing.Field.fieldType F)) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) n u (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)) i) (GRing.zero (Zp_zmodType O)) j))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) *) rewrite mulmx_sum_row group_prod // => i _. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (matrix_lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (S O) n) (@fun_of_matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) u (GRing.zero (Zp_zmodType O)) i) (@row (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) n i (@matrix_of_fun (Finite.sort (FinRing.Field.finType F)) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) n matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))))) (j : Finite.sort (ordinal_finType n)) => @fun_of_matrix (Finite.sort (FinRing.Field.finType F)) (S O) n (@enum_val (matrix_finType (FinRing.Field.finType F) (S O) n) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)) i) (GRing.zero (Zp_zmodType O)) j)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) *) rewrite rowK; move: (enum_val i) (enum_valP i) => v Lv. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (matrix_lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (S O) n) (@fun_of_matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) u (GRing.zero (Zp_zmodType O)) i) v) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) *) case: (eqVneq (u 0 i) 0) => [->|]; first by rewrite scale0r group1. (* Goal: forall _ : is_true (negb (@eq_op (GRing.Ring.eqType (GRing.Field.ringType (FinRing.Field.fieldType F))) (@fun_of_matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) u (GRing.zero (Zp_zmodType O)) i) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType (FinRing.Field.fieldType F)))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) (@GRing.scale (GRing.Field.ringType (FinRing.Field.fieldType F)) (matrix_lmodType (GRing.Field.ringType (FinRing.Field.fieldType F)) (S O) n) (@fun_of_matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) (S O) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) u (GRing.zero (Zp_zmodType O)) i) v) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (@gval (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) L)))) *) by rewrite -unitfE => aP; rewrite ((actsP linL) (FinRing.Unit _ aP)) ?inE. Qed. Lemma rowg_mx1 : rowg_mx 1%g = 0. Proof. (* Goal: @eq (matrix (GRing.Field.sort (FinRing.Field.fieldType F)) n n) (rowg_mx (oneg (group_set_of_baseGroupType (matrix_baseFinGroupType (FinRing.Field.finZmodType F) (S O) n)))) (GRing.zero (matrix_zmodType (GRing.Field.zmodType (FinRing.Field.fieldType F)) n n)) *) by apply/eqP; rewrite -submx0 -(rowg0 0) rowgK sub0mx. Qed. Lemma rowg_mx_eq0 (L : {group rVn}) : (rowg_mx L == 0) = (L :==: 1%g). Lemma rowgI m1 m2 (A : 'M_(m1, n)) (B : 'M_(m2, n)) : rowg (A :&: B)%MS = rowg A :&: rowg B. Proof. (* Goal: @eq (@set_of (matrix_finType (FinRing.Field.finType F) (S O) n) (Phant (matrix (FinRing.Field.sort F) (S O) n))) (@rowg n (@capmx (FinRing.Field.fieldType F) m1 m2 n A B)) (@setI (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m1 A) (@rowg m2 B)) *) by apply/setP=> u; rewrite !inE sub_capmx. Qed. Lemma card_rowg m (A : 'M_(m, n)) : #|rowg A| = (#|F| ^ \rank A)%N. Proof. (* Goal: @eq nat (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) (expn (@card (FinRing.Field.finType F) (@mem (Equality.sort (FinRing.Field.eqType F)) (predPredType (Equality.sort (FinRing.Field.eqType F))) (@sort_of_simpl_pred (Equality.sort (FinRing.Field.eqType F)) (pred_of_argType (Equality.sort (FinRing.Field.eqType F)))))) (@mxrank (FinRing.Field.fieldType F) m n A)) *) rewrite -[\rank A]mul1n -card_matrix. (* Goal: @eq nat (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) (@card (matrix_finType (FinRing.Field.finType F) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (@mem (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (predPredType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A))) (@sort_of_simpl_pred (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (pred_of_argType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)))))) *) have injA: injective (mulmxr (row_base A)). (* Goal: @eq nat (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) (@card (matrix_finType (FinRing.Field.finType F) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (@mem (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (predPredType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A))) (@sort_of_simpl_pred (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (pred_of_argType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)))))) *) (* Goal: forall n0 : nat, @injective (matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) n0 n) (matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) n0 (@mxrank (FinRing.Field.fieldType F) m n A)) (@mulmxr_head (GRing.Field.ringType (FinRing.Field.fieldType F)) n0 (@mxrank (FinRing.Field.fieldType F) m n A) n tt (@row_base (FinRing.Field.fieldType F) m n A)) *) have /row_freeP[A' A'K] := row_base_free A. (* Goal: @eq nat (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) (@card (matrix_finType (FinRing.Field.finType F) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (@mem (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (predPredType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A))) (@sort_of_simpl_pred (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (pred_of_argType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)))))) *) (* Goal: forall n0 : nat, @injective (matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) n0 n) (matrix (GRing.Ring.sort (GRing.Field.ringType (FinRing.Field.fieldType F))) n0 (@mxrank (FinRing.Field.fieldType F) m n A)) (@mulmxr_head (GRing.Field.ringType (FinRing.Field.fieldType F)) n0 (@mxrank (FinRing.Field.fieldType F) m n A) n tt (@row_base (FinRing.Field.fieldType F) m n A)) *) by move=> ?; apply: can_inj (mulmxr A') _ => u; rewrite /= -mulmxA A'K mulmx1. (* Goal: @eq nat (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) (@card (matrix_finType (FinRing.Field.finType F) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (@mem (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (predPredType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A))) (@sort_of_simpl_pred (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (pred_of_argType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)))))) *) rewrite -(card_image (injA _)); apply: eq_card => v. (* Goal: @eq bool (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) v (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m A)))) (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) v (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n)) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) n))) (@pred_of_eq_seq (Finite.eqType (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n)) (@image_mem (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) n)) (@mulmxr_head (GRing.Field.ringType (FinRing.Field.fieldType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A) n tt (@row_base (FinRing.Field.fieldType F) m n A)) (@mem (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A))) (predPredType (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.Field.join_finRingType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)))) (@sort_of_simpl_pred (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A)) (pred_of_argType (matrix (Finite.sort (FinRing.Field.finType F)) (S O) (@mxrank (FinRing.Field.fieldType F) m n A))))))))) *) by rewrite inE -(eq_row_base A) (sameP submxP codomP). Qed. Lemma rowgD m1 m2 (A : 'M_(m1, n)) (B : 'M_(m2, n)) : rowg (A + B)%MS = (rowg A * rowg B)%g. Proof. (* Goal: @eq (@set_of (matrix_finType (FinRing.Field.finType F) (S O) n) (Phant (matrix (FinRing.Field.sort F) (S O) n))) (@rowg n (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B)) (@mulg (group_set_of_baseGroupType (matrix_baseFinGroupType (FinRing.Field.finZmodType F) (S O) n)) (@rowg m1 A) (@rowg m2 B)) *) apply/eqP; rewrite eq_sym eqEcard mulG_subG /= !rowgS. (* Goal: is_true (andb (andb (@submx (FinRing.Field.fieldType F) m1 n n A (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B)) (@submx (FinRing.Field.fieldType F) m2 n n B (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B))) (leq (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (matrix (FinRing.Field.sort F) (S O) n) (predPredType (matrix (FinRing.Field.sort F) (S O) n)) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg n (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B))))) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (matrix (FinRing.Field.sort F) (S O) n) (predPredType (matrix (FinRing.Field.sort F) (S O) n)) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@mulg (group_set_of_baseGroupType (matrix_baseFinGroupType (FinRing.Field.finZmodType F) (S O) n)) (@rowg m1 A) (@rowg m2 B))))))) *) rewrite addsmxSl addsmxSr -(@leq_pmul2r #|rowg A :&: rowg B|) ?cardG_gt0 //=. (* Goal: is_true (leq (muln (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (matrix (FinRing.Field.sort F) (S O) n) (predPredType (matrix (FinRing.Field.sort F) (S O) n)) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg n (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B))))) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (matrix (FinRing.Field.sort F) (S O) n) (predPredType (matrix (FinRing.Field.sort F) (S O) n)) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@setI (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m1 A) (@rowg m2 B)))))) (muln (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (matrix (FinRing.Field.sort F) (S O) n) (predPredType (matrix (FinRing.Field.sort F) (S O) n)) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@mulg (group_set_of_baseGroupType (matrix_baseFinGroupType (FinRing.Field.finZmodType F) (S O) n)) (@rowg m1 A) (@rowg m2 B))))) (@card (matrix_finType (FinRing.Field.finType F) (S O) n) (@mem (matrix (FinRing.Field.sort F) (S O) n) (predPredType (matrix (FinRing.Field.sort F) (S O) n)) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) n) (@setI (matrix_finType (FinRing.Field.finType F) (S O) n) (@rowg m1 A) (@rowg m2 B))))))) *) by rewrite -mul_cardG -rowgI !card_rowg -!expnD mxrank_sum_cap. Qed. Lemma cprod_rowg m1 m2 (A : 'M_(m1, n)) (B : 'M_(m2, n)) : rowg A \* rowg B = rowg (A + B)%MS. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (Phant (FinGroup.arg_sort (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))))) (central_product (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) (@rowg m1 A) (@rowg m2 B)) (@rowg n (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B)) *) by rewrite rowgD cprodE // (sub_abelian_cent2 (zmod_abelian setT)). Qed. Lemma dprod_rowg m1 m2 (A : 'M[F]_(m1, n)) (B : 'M[F]_(m2, n)) : mxdirect (A + B) -> rowg A \x rowg B = rowg (A + B)%MS. Proof. (* Goal: forall _ : is_true (@mxdirect_def (FinRing.Field.fieldType F) n n (@sum_mxsum (FinRing.Field.fieldType F) n (@binary_mxsum_expr (FinRing.Field.fieldType F) m1 m2 n (@trivial_mxsum (FinRing.Field.fieldType F) m1 n A) (@trivial_mxsum (FinRing.Field.fieldType F) m2 n B))) (Phantom (matrix (GRing.Field.sort (FinRing.Field.fieldType F)) n n) (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (Phant (FinGroup.arg_sort (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))))) (direct_product (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) (@rowg m1 A) (@rowg m2 B)) (@rowg n (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B)) *) rewrite (sameP mxdirect_addsP eqP) -trivg_rowg rowgI => /eqP tiAB. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (Phant (FinGroup.arg_sort (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))))) (direct_product (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n) (@rowg m1 A) (@rowg m2 B)) (@rowg n (@addsmx (FinRing.Field.fieldType F) m1 m2 n A B)) *) by rewrite -cprod_rowg dprodEcp. Qed. Lemma bigcprod_rowg m I r (P : pred I) (A : I -> 'M[F]_n) (B : 'M[F]_(m, n)) : (\sum_(i <- r | P i) A i :=: B)%MS -> \big[cprod/1%g]_(i <- r | P i) rowg (A i) = rowg B. Proof. (* Goal: forall _ : @eqmx (FinRing.Field.fieldType F) n m n (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.Field.zmodType (FinRing.Field.fieldType F)) n n)) I (GRing.zero (matrix_zmodType (GRing.Field.zmodType (FinRing.Field.fieldType F)) n n)) r (fun i : I => @BigBody (matrix (GRing.Field.sort (FinRing.Field.fieldType F)) n n) I i (@addsmx (FinRing.Field.fieldType F) n n n) (P i) (A i))) B, @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) I (oneg (group_set_of_baseGroupType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))) (Phant (FinGroup.arg_sort (FinGroup.base (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n))))) I i (central_product (matrix_finGroupType (FinRing.Field.finZmodType F) (S O) n)) (P i) (@rowg n (A i)))) (@rowg m B) *) by move/eq_rowg <-; apply/esym/big_morph=> [? ?|]; rewrite (rowg0, cprod_rowg). Qed. Lemma bigdprod_rowg m (I : finType) (P : pred I) A (B : 'M[F]_(m, n)) : let S := (\sum_(i | P i) A i)%MS in (S :=: B)%MS -> mxdirect S -> \big[dprod/1%g]_(i | P i) rowg (A i) = rowg B. Canonical GLrepr := MxRepresentation GL_mx_repr. Lemma GLmx_faithful : mx_faithful GLrepr. Proof. (* Goal: is_true (@mx_faithful (FinRing.ComUnitRing.comUnitRingType (FinRing.Field.finComUnitRingType F)) (GL_finGroupType (S n') (FinRing.Field.finComUnitRingType F)) (@GLgroup_group (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F))) (S (Nat.pred (S n'))) GLrepr) *) by apply/subsetP=> A; rewrite !inE mul1mx. Qed. Definition reprGLm x : {'GL_n[F]} := insubd (1%g : {'GL_n[F]}) (rG x). Lemma val_reprGLm x : x \in G -> val (reprGLm x) = rG x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (matrix (FinRing.ComUnitRing.sort (FinRing.Field.finComUnitRingType F)) (S (Nat.pred (S n'))) (S (Nat.pred (S n')))) (@val (matrix (FinRing.ComUnitRing.sort (FinRing.Field.finComUnitRingType F)) (S (Nat.pred (S n'))) (S (Nat.pred (S n')))) (fun x : FinRing.UnitRing.sort (matrix_finUnitRingType (FinRing.Field.finComUnitRingType F) (Nat.pred (S n'))) => @in_mem (FinRing.UnitRing.sort (matrix_finUnitRingType (FinRing.Field.finComUnitRingType F) (Nat.pred (S n')))) x (@mem (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (matrix_finUnitRingType (FinRing.Field.finComUnitRingType F) (Nat.pred (S n'))))) (predPredType (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (matrix_finUnitRingType (FinRing.Field.finComUnitRingType F) (Nat.pred (S n')))))) (@has_quality (S O) (GRing.UnitRing.sort (FinRing.UnitRing.unitRingType (matrix_finUnitRingType (FinRing.Field.finComUnitRingType F) (Nat.pred (S n'))))) (@GRing.unit (FinRing.UnitRing.unitRingType (matrix_finUnitRingType (FinRing.Field.finComUnitRingType F) (Nat.pred (S n')))))))) (GL_subType (S n') (FinRing.Field.finComUnitRingType F)) (reprGLm x)) (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG x) *) by move=> Gx; rewrite val_insubd (repr_mx_unitr rG). Qed. Lemma comp_reprGLm : {in G, GLval \o reprGLm =1 rG}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (matrix (FinRing.ComUnitRing.sort (FinRing.Field.finComUnitRingType F)) (S (Nat.pred (S n'))) (S (Nat.pred (S n')))) (@funcomp (matrix (FinRing.ComUnitRing.sort (FinRing.Field.finComUnitRingType F)) (S (Nat.pred (S n'))) (S (Nat.pred (S n')))) (@GLtype (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F))) (FinGroup.arg_sort (FinGroup.base gT)) tt (@GLval (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F))) reprGLm x) (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG x)) (inPhantom (@eqfun (matrix (FinRing.ComUnitRing.sort (FinRing.Field.finComUnitRingType F)) (S (Nat.pred (S n'))) (S (Nat.pred (S n')))) (FinGroup.arg_sort (FinGroup.base gT)) (@funcomp (matrix (FinRing.ComUnitRing.sort (FinRing.Field.finComUnitRingType F)) (S (Nat.pred (S n'))) (S (Nat.pred (S n')))) (@GLtype (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F))) (FinGroup.arg_sort (FinGroup.base gT)) tt (@GLval (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F))) reprGLm) (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG))) *) exact: val_reprGLm. Qed. Lemma reprGLmM : {in G &, {morph reprGLm : x y / x * y}}%g. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (@GLtype (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F))) (reprGLm ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : @GLtype (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F)) => @mulg (GL_baseFinGroupType (S n') (FinRing.Field.finComUnitRingType F)) x0 y0) (reprGLm x) (reprGLm y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (@GLtype (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F))) reprGLm (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : @GLtype (S n') (FinRing.Field.finComUnitRingType F) (Phant (FinRing.Field.sort F)) => @mulg (GL_baseFinGroupType (S n') (FinRing.Field.finComUnitRingType F)) x y))) *) by move=> x y Gx Gy; apply: val_inj; rewrite /= !val_reprGLm ?groupM ?repr_mxM. Qed. Canonical reprGL_morphism := Morphism reprGLmM. Lemma ker_reprGLm : 'ker reprGLm = rker rG. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT (GL_finGroupType (S n') (FinRing.Field.finComUnitRingType F)) (@gval gT G) reprGL_morphism (@MorPhantom gT (GL_finGroupType (S n') (FinRing.Field.finComUnitRingType F)) reprGLm)) (@rker (FinRing.Field.comUnitRingType F) gT G (S n') rG) *) apply/setP=> x; rewrite !inE mul1mx; apply: andb_id2l => Gx. (* Goal: @eq bool (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base (GL_finGroupType (S n') (FinRing.Field.finComUnitRingType F))))) (@mfun gT (GL_finGroupType (S n') (FinRing.Field.finComUnitRingType F)) (@gval gT G) reprGL_morphism x) (oneg (FinGroup.base (GL_finGroupType (S n') (FinRing.Field.finComUnitRingType F))))) (@eq_op (matrix_eqType (GRing.Ring.eqType (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F))) (S n') (S n')) (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG x) (@scalar_mx (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F)) (S n') (GRing.one (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F))))) *) by rewrite -val_eqE val_reprGLm. Qed. Lemma astab_rowg_repr m (A : 'M_(m, n)) : 'C(rowg A | 'MR rG) = rstab rG A. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@astab gT (@gval gT G) (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A) (@mx_repr_action (FinRing.Field.finComUnitRingType F) gT G (S n') rG)) (@rstab (FinRing.Field.comUnitRingType F) gT G (S n') rG m A) *) apply/setP=> x; rewrite !inE /=; apply: andb_id2l => Gx. (* Goal: @eq bool (@subset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@mem (matrix (FinRing.Field.sort F) (S O) (S n')) (predPredType (matrix (FinRing.Field.sort F) (S O) (S n'))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A))) (@mem (matrix (FinRing.Field.sort F) (S O) (S n')) (predPredType (matrix (FinRing.Field.sort F) (S O) (S n'))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@SetDef.finset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (fun x0 : matrix (FinRing.Field.sort F) (S O) (S n') => @eq_op (Finite.eqType (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (@mx_repr_act (FinRing.Field.finComUnitRingType F) gT G (S n') rG x0 x) x0))))) (@eq_op (matrix_eqType (GRing.Ring.eqType (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F))) m (S n')) (@mulmx (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F)) m (S n') (S n') A (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG x)) A) *) apply/subsetP/eqP=> cAx => [|u]; last first. (* Goal: @eq (Equality.sort (matrix_eqType (GRing.Ring.eqType (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F))) m (S n'))) (@mulmx (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F)) m (S n') (S n') A (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG x)) A *) (* Goal: forall _ : is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A)))), is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@SetDef.finset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (fun x0 : matrix (FinRing.Field.sort F) (S O) (S n') => @eq_op (Finite.eqType (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (@mx_repr_act (FinRing.Field.finComUnitRingType F) gT G (S n') rG x0 x) x0))))) *) by rewrite !inE mx_repr_actE // => /submxP[u' ->]; rewrite -mulmxA cAx. (* Goal: @eq (Equality.sort (matrix_eqType (GRing.Ring.eqType (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F))) m (S n'))) (@mulmx (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F)) m (S n') (S n') A (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG x)) A *) apply/row_matrixP=> i; apply/eqP; move/implyP: (cAx (row i A)). (* Goal: forall _ : is_true (implb (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (@row (FinRing.Field.sort F) m (S n') i A) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A)))) (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (@row (FinRing.Field.sort F) m (S n') i A) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@SetDef.finset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (fun x0 : matrix (FinRing.Field.sort F) (S O) (S n') => @eq_op (Finite.eqType (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (@mx_repr_act (FinRing.Field.finComUnitRingType F) gT G (S n') rG x0 x) x0)))))), is_true (@eq_op (matrix_eqType (GRing.Ring.eqType (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F))) (S O) (S n')) (@row (Equality.sort (GRing.Ring.eqType (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F)))) m (S n') i (@mulmx (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F)) m (S n') (S n') A (@repr_mx (FinRing.Field.comUnitRingType F) gT (@gval gT G) (S n') rG x))) (@row (Equality.sort (GRing.Ring.eqType (GRing.ComUnitRing.ringType (FinRing.Field.comUnitRingType F)))) m (S n') i A)) *) by rewrite !inE row_sub mx_repr_actE //= row_mul. Qed. Lemma astabs_rowg_repr m (A : 'M_(m, n)) : 'N(rowg A | 'MR rG) = rstabs rG A. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@astabs gT (@gval gT G) (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A) (@mx_repr_action (FinRing.Field.finComUnitRingType F) gT G (S n') rG)) (@rstabs (FinRing.Field.fieldType F) gT G (S n') rG m A) *) apply/setP=> x; rewrite !inE /=; apply: andb_id2l => Gx. (* Goal: @eq bool (@subset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@mem (matrix (FinRing.Field.sort F) (S O) (S n')) (predPredType (matrix (FinRing.Field.sort F) (S O) (S n'))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A))) (@mem (matrix (FinRing.Field.sort F) (S O) (S n')) (predPredType (matrix (FinRing.Field.sort F) (S O) (S n'))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@preimset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (matrix (FinRing.Field.sort F) (S O) (S n')) (fun x0 : matrix (FinRing.Field.sort F) (S O) (S n') => @mx_repr_act (FinRing.Field.finComUnitRingType F) gT G (S n') rG x0 x) (@mem (matrix (FinRing.Field.sort F) (S O) (S n')) (predPredType (matrix (FinRing.Field.sort F) (S O) (S n'))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A))))))) (@submx (FinRing.Field.fieldType F) m m (S n') (@mulmx (GRing.Field.ringType (FinRing.Field.fieldType F)) m (S n') (S n') A (@repr_mx (GRing.Field.comUnitRingType (FinRing.Field.fieldType F)) gT (@gval gT G) (S n') rG x)) A) *) apply/subsetP/idP=> nAx => [|u]; last first. (* Goal: is_true (@submx (FinRing.Field.fieldType F) m m (S n') (@mulmx (GRing.Field.ringType (FinRing.Field.fieldType F)) m (S n') (S n') A (@repr_mx (GRing.Field.comUnitRingType (FinRing.Field.fieldType F)) gT (@gval gT G) (S n') rG x)) A) *) (* Goal: forall _ : is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A)))), is_true (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) u (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@preimset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (matrix (FinRing.Field.sort F) (S O) (S n')) (fun x0 : matrix (FinRing.Field.sort F) (S O) (S n') => @mx_repr_act (FinRing.Field.finComUnitRingType F) gT G (S n') rG x0 x) (@mem (matrix (FinRing.Field.sort F) (S O) (S n')) (predPredType (matrix (FinRing.Field.sort F) (S O) (S n'))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A))))))) *) by rewrite !inE mx_repr_actE // => Au; apply: (submx_trans (submxMr _ Au)). (* Goal: is_true (@submx (FinRing.Field.fieldType F) m m (S n') (@mulmx (GRing.Field.ringType (FinRing.Field.fieldType F)) m (S n') (S n') A (@repr_mx (GRing.Field.comUnitRingType (FinRing.Field.fieldType F)) gT (@gval gT G) (S n') rG x)) A) *) apply/row_subP=> i; move/implyP: (nAx (row i A)). (* Goal: forall _ : is_true (implb (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (@row (FinRing.Field.sort F) m (S n') i A) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A)))) (@in_mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (@row (FinRing.Field.sort F) m (S n') i A) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n'))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType F) (S O) (S n')))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@preimset (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (matrix (FinRing.Field.sort F) (S O) (S n')) (fun x0 : matrix (FinRing.Field.sort F) (S O) (S n') => @mx_repr_act (FinRing.Field.finComUnitRingType F) gT G (S n') rG x0 x) (@mem (matrix (FinRing.Field.sort F) (S O) (S n')) (predPredType (matrix (FinRing.Field.sort F) (S O) (S n'))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') m A)))))))), is_true (@submx (FinRing.Field.fieldType F) (S O) m (S n') (@row (GRing.Field.sort (FinRing.Field.fieldType F)) m (S n') i (@mulmx (GRing.Field.ringType (FinRing.Field.fieldType F)) m (S n') (S n') A (@repr_mx (GRing.Field.comUnitRingType (FinRing.Field.fieldType F)) gT (@gval gT G) (S n') rG x))) A) *) by rewrite !inE row_sub mx_repr_actE //= row_mul. Qed. Lemma acts_rowg (A : 'M_n) : [acts G, on rowg A | 'MR rG] = mxmodule rG A. Proof. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@astabs gT (@gval gT G) (matrix_finType (FinRing.Field.finType F) (S O) (S n')) (@rowg (S n') (S n') A) (@mx_repr_action (FinRing.Field.finComUnitRingType F) gT G (S n') rG))))) (@mxmodule (FinRing.Field.fieldType F) gT G (S n') rG (S n') A) *) by rewrite astabs_rowg_repr. Qed. Lemma astab_setT_repr : 'C(setT | 'MR rG) = rker rG. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@astab gT (@gval gT G) (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n')) (@setTfor (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n')) (Phant (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n'))))) (@mx_repr_action (FinRing.Field.finComUnitRingType F) gT G (S n') rG)) (@rker (FinRing.Field.comUnitRingType F) gT G (S n') rG) *) by rewrite -rowg1 astab_rowg_repr. Qed. Lemma mx_repr_action_faithful : [faithful G, on setT | 'MR rG] = mx_faithful rG. Proof. (* Goal: @eq bool (@faithful gT (@gval gT G) (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n')) (@gval gT G) (@setTfor (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n')) (Phant (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n'))))) (@mx_repr_action (FinRing.Field.finComUnitRingType F) gT G (S n') rG)) (@mx_faithful (FinRing.Field.comUnitRingType F) gT G (S n') rG) *) by rewrite /faithful astab_setT_repr (setIidPr _) // [rker _]setIdE subsetIl. Qed. Lemma afix_repr (H : {set gT}) : H \subset G -> 'Fix_('MR rG)(H) = rowg (rfix_mx rG H). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (@set_of (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n')) (Phant (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n'))))) (@afix gT (@gval gT G) (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n')) (@mx_repr_action (FinRing.Field.finComUnitRingType F) gT G (S n') rG) H) (@rowg (S n') (S n') (@rfix_mx (FinRing.Field.fieldType F) gT G (S n') rG H)) *) move/subsetP=> sHG; apply/setP=> /= u; rewrite !inE. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq_op (Finite.eqType (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n'))) (@act gT (@gval gT G) (Finite.sort (matrix_finType (FinRing.Ring.join_finType (FinRing.ComUnitRing.join_finRingType (FinRing.Field.finComUnitRingType F))) (S O) (S n'))) (@mx_repr_action (FinRing.Field.finComUnitRingType F) gT G (S n') rG) u a) u))))) (@submx (FinRing.Field.fieldType F) (S O) (S n') (S n') u (@rfix_mx (FinRing.Field.fieldType F) gT G (S n') rG H)) *) apply/subsetP/rfix_mxP=> cHu x Hx; have:= cHu x Hx; by rewrite !inE /= => /eqP; rewrite mx_repr_actE ?sHG. Qed. Lemma gacent_repr (H : {set gT}) : H \subset G -> 'C_(| 'MR rG)(H) = rowg (rfix_mx rG H). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.ComUnitRing.finZmodType (FinRing.Field.finComUnitRingType F)) (S O) (S n')))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (FinRing.ComUnitRing.finZmodType (FinRing.Field.finComUnitRingType F)) (S O) (S n'))))))) (@gacent gT (matrix_finGroupType (FinRing.ComUnitRing.finZmodType (FinRing.Field.finComUnitRingType F)) (S O) (S n')) (@gval gT G) (@setTfor (matrix_finType (FinRing.ComUnitRing.finType (FinRing.Field.finComUnitRingType F)) (S O) (S n')) (Phant (matrix (FinRing.ComUnitRing.sort (FinRing.Field.finComUnitRingType F)) (S O) (S n')))) (@mx_repr_groupAction (FinRing.Field.finComUnitRingType F) gT G (S n') rG) H) (@rowg (S n') (S n') (@rfix_mx (FinRing.Field.fieldType F) gT G (S n') rG H)) *) by move=> sHG; rewrite gacentE // setTI afix_repr. Qed. End FinFieldRepr. Arguments rowg_mx {F n%N} L%g. Notation "''Zm'" := (scale_action _ _ _) (at level 8) : action_scope. Notation "''Zm'" := (scale_groupAction _ _ _) : groupAction_scope. Section MatrixGroups. Implicit Types m n p q : nat. Lemma exponent_mx_group m n q : m > 0 -> n > 0 -> q > 1 -> exponent [set: 'M['Z_q]_(m, n)] = q. Lemma rank_mx_group m n q : 'r([set: 'M['Z_q]_(m, n)]) = (m * n)%N. Proof. (* Goal: @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc q)))) m n)))) (muln m n) *) wlog q_gt1: q / q > 1 by case: q => [|[|q -> //]] /(_ 2)->. (* Goal: @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc q)))) m n)))) (muln m n) *) set G := setT; have cGG: abelian G := zmod_abelian _. (* Goal: @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n) *) have [mn0 | ] := posnP (m * n). (* Goal: forall _ : is_true (leq (S O) (muln m n)), @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n) *) (* Goal: @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n) *) by rewrite [G](card1_trivg _) ?rank1 // cardsT card_matrix mn0. (* Goal: forall _ : is_true (leq (S O) (muln m n)), @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n) *) rewrite muln_gt0 => /andP[m_gt0 n_gt0]. (* Goal: @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n) *) have expG: exponent G = q := exponent_mx_group m_gt0 n_gt0 q_gt1. (* Goal: @eq nat (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n) *) apply/eqP; rewrite eqn_leq andbC -(leq_exp2l _ _ q_gt1) -{2}expG. (* Goal: is_true (andb (leq (expn q (muln m n)) (expn (@exponent (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G))) (leq (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n))) *) have ->: (q ^ (m * n))%N = #|G| by rewrite cardsT card_matrix card_ord Zp_cast. (* Goal: is_true (andb (leq (@card (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (@mem (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n)) (predPredType (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n))) (@SetDef.pred_of_set (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) G))) (expn (@exponent (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G))) (leq (@rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n))) *) rewrite max_card_abelian //= -grank_abelian //= -/G. (* Goal: is_true (leq (@gen_rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n)) *) pose B : {set 'M['Z_q]_(m, n)} := [set delta_mx ij.1 ij.2 | ij : 'I_m * 'I_n]. (* Goal: is_true (leq (@gen_rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n)) *) suffices ->: G = <<B>>. (* Goal: @eq (@set_of (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n)))) G (@generated (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) B) *) (* Goal: is_true (leq (@gen_rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@generated (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) B)) (muln m n)) *) have ->: (m * n)%N = #|{: 'I_m * 'I_n}| by rewrite card_prod !card_ord. (* Goal: @eq (@set_of (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n)))) G (@generated (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) B) *) (* Goal: is_true (leq (@gen_rank (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@generated (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) B)) (@card (prod_finType (ordinal_finType m) (ordinal_finType n)) (@mem (prod (ordinal m) (ordinal n)) (predPredType (prod (ordinal m) (ordinal n))) (@sort_of_simpl_pred (prod (ordinal m) (ordinal n)) (pred_of_argType (prod (ordinal m) (ordinal n))))))) *) exact: leq_trans (grank_min _) (leq_imset_card _ _). (* Goal: @eq (@set_of (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n)))) G (@generated (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) B) *) apply/setP=> v; rewrite inE (matrix_sum_delta v). (* Goal: @eq bool true (@in_mem (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) (Finite.sort (ordinal_finType m)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) (index_enum (ordinal_finType m)) (fun i : ordinal m => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) (ordinal m) i (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) true (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) (Finite.sort (ordinal_finType n)) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) (index_enum (ordinal_finType n)) (fun j : ordinal n => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) (ordinal n) j (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.base (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (@GRing.Lmodule.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n)) (@GRing.Lmodule.class (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (Phant (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n))))) true (@GRing.scale (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n) (@fun_of_matrix (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q)))) m n v i j) (@delta_mx (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n i j)))))) (@mem (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n)) (predPredType (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n))) (@SetDef.pred_of_set (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (@generated (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) B)))) *) rewrite group_prod // => i _; rewrite group_prod // => j _. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n)))) (@GRing.scale (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) (matrix_lmodType (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n) (@fun_of_matrix (GRing.Ring.sort (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q)))) m n v i j) (@delta_mx (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n i j)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@generated_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) B))))) *) rewrite -[v i j]natr_Zp scaler_nat groupX // mem_gen //. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n))) (@delta_mx (FinRing.Ring.ringType (Zp_finRingType (Zp_trunc q))) m n i j) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n))) B))) *) by apply/imsetP; exists (i, j). Qed. Lemma mx_group_homocyclic m n q : homocyclic [set: 'M['Z_q]_(m, n)]. Proof. (* Goal: is_true (@homocyclic (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc q)))) m n)))) *) wlog q_gt1: q / q > 1 by case: q => [|[|q -> //]] /(_ 2)->. (* Goal: is_true (@homocyclic (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc q)))) m n)))) *) set G := setT; have cGG: abelian G := zmod_abelian _. (* Goal: is_true (@homocyclic (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) *) rewrite -max_card_abelian //= rank_mx_group cardsT card_matrix card_ord -/G. (* Goal: is_true (@eq_op nat_eqType (expn (S (S (Zp_trunc q))) (muln m n)) (expn (@exponent (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n))) *) rewrite {1}Zp_cast //; have [-> // | ] := posnP (m * n). (* Goal: forall _ : is_true (leq (S O) (muln m n)), is_true (@eq_op nat_eqType (expn q (muln m n)) (expn (@exponent (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) G) (muln m n))) *) by rewrite muln_gt0 => /andP[m_gt0 n_gt0]; rewrite exponent_mx_group. Qed. Lemma abelian_type_mx_group m n q : q > 1 -> abelian_type [set: 'M['Z_q]_(m, n)] = nseq (m * n) q. Proof. (* Goal: forall _ : is_true (leq (S (S O)) q), @eq (list nat) (@abelian_type (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc q)))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc q)))) m n)))) (@nseq nat (muln m n) q) *) rewrite (abelian_type_homocyclic (mx_group_homocyclic m n q)) rank_mx_group. (* Goal: forall _ : is_true (leq (S (S O)) q), @eq (list nat) (@nseq nat (muln m n) (@exponent (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@setT_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc q)))) m n)))))) (@nseq nat (muln m n) q) *) have [-> // | ] := posnP (m * n); rewrite muln_gt0 => /andP[m_gt0 n_gt0] q_gt1. (* Goal: @eq (list nat) (@nseq nat (muln m n) (@exponent (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (@setT_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc q))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc q)))) m n)))))) (@nseq nat (muln m n) q) *) by rewrite exponent_mx_group. Qed. End MatrixGroups. Delimit Scope abelem_scope with Mg. Open Scope abelem_scope. Definition abelem_dim' (gT : finGroupType) (E : {set gT}) := (logn (pdiv #|E|) #|E|).-1. Arguments abelem_dim' {gT} E%g. Notation "''dim' E" := (abelem_dim' E).+1 (at level 10, E at level 8, format "''dim' E") : abelem_scope. Notation "''rV' ( E )" := 'rV_('dim E) (at level 8, format "''rV' ( E )") : abelem_scope. Notation "''M' ( E )" := 'M_('dim E) (at level 8, format "''M' ( E )") : abelem_scope. Notation "''rV[' F ] ( E )" := 'rV[F]_('dim E) (at level 8, only parsing) : abelem_scope. Notation "''M[' F ] ( E )" := 'M[F]_('dim E) (at level 8, only parsing) : abelem_scope. Section AbelemRepr. Section FpMatrix. Variables p m n : nat. Local Notation Mmn := 'M['F_p]_(m, n). Lemma mx_Fp_abelem : prime p -> p.-abelem [set: Mmn]. Proof. (* Goal: forall _ : is_true (prime p), is_true (@abelem (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n) p (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc (pdiv p))))) m n) (Phant (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) m n)))) *) exact: fin_Fp_lmod_abelem. Qed. Lemma mx_Fp_stable (L : {group Mmn}) : [acts setT, on L | 'Zm]. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p)))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))) (@astabs (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p)))))))) (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n) L) (scale_action (Fp_finFieldType p) m n))))) *) apply/subsetP=> a _; rewrite !inE; apply/subsetP=> A L_A. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n)))) A (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n))) (@preimset (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n))) (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n))) => @act (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))) (@setTfor (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (FinRing.unit_finGroupType (FinRing.Field.finUnitRingType (Fp_finFieldType p)))))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n)))) (scale_action (Fp_finFieldType p) m n) x a) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) m n) L))))))) *) by rewrite inE /= /scale_act -[val _]natr_Zp scaler_nat groupX. Qed. End FpMatrix. Section FpRow. Variables p n : nat. Local Notation rVn := 'rV['F_p]_n. Lemma rowg_mxK (L : {group rVn}) : rowg (rowg_mx L) = L. Proof. (* Goal: @eq (@set_of (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) n) (Phant (matrix (FinRing.Field.sort (Fp_finFieldType p)) (S O) n))) (@rowg (Fp_finFieldType p) n n (@rowg_mx (Fp_finFieldType p) n (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) L))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) L) *) by apply: stable_rowg_mxK; apply: mx_Fp_stable. Qed. Lemma rowg_mxSK (L : {set rVn}) (M : {group rVn}) : (rowg_mx L <= rowg_mx M)%MS = (L \subset M). Lemma mxrank_rowg (L : {group rVn}) : prime p -> \rank (rowg_mx L) = logn p #|L|. Proof. (* Goal: forall _ : is_true (prime p), @eq nat (@mxrank (FinRing.Field.fieldType (Fp_finFieldType p)) n n (@rowg_mx (Fp_finFieldType p) n (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) L))) (logn p (@card (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) n) L))))) *) by move=> p_pr; rewrite -{2}(rowg_mxK L) card_rowg card_Fp ?pfactorK. Qed. End FpRow. Variables (p : nat) (gT : finGroupType) (E : {group gT}). Hypotheses (abelE : p.-abelem E) (ntE : E :!=: 1%g). Let pE : p.-group E := abelem_pgroup abelE. Local Notation n' := (abelem_dim' (gval E)). Local Notation n := n'.+1. Local Notation rVn := 'rV['F_p](gval E). Lemma dim_abelemE : n = logn p #|E|. Proof. (* Goal: @eq nat (S (@abelem_dim' gT (@gval gT E))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))) *) rewrite /n'; have [_ _ [k ->]] := pgroup_pdiv pE ntE. (* Goal: @eq nat (S (Nat.pred (logn (pdiv (expn p (S k))) (expn p (S k))))) (logn p (expn p (S k))) *) by rewrite /pdiv primes_exp ?primes_prime // pfactorK. Qed. Lemma card_abelem_rV : #|rVn| = #|E|. Proof. (* Goal: @eq nat (@card (matrix_finType (ordinal_finType (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (predPredType (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@sort_of_simpl_pred (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (pred_of_argType (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) *) by rewrite dim_abelemE card_matrix mul1n card_Fp // -p_part part_pnat_id. Qed. Lemma isog_abelem_rV : E \isog [set: rVn]. Proof. (* Goal: is_true (@isog gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) (@setTfor (matrix_finType (ordinal_finType (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (Phant (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) *) by rewrite (isog_abelem_card _ abelE) cardsT card_abelem_rV mx_Fp_abelem /=. Qed. Local Notation ab_rV_P := (existsP isog_abelem_rV). Definition abelem_rV : gT -> rVn := xchoose ab_rV_P. Local Notation ErV := abelem_rV. Lemma abelem_rV_M : {in E &, {morph ErV : x y / (x * y)%g >-> x + y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (abelem_rV ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))) => @GRing.add (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) x0 y0) (abelem_rV x) (abelem_rV y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))) => @GRing.add (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) x y))) *) by case/misomP: (xchooseP ab_rV_P) => fM _; move/morphicP: fM. Qed. Canonical abelem_rV_morphism := Morphism abelem_rV_M. Lemma abelem_rV_isom : isom E setT ErV. Proof. (* Goal: is_true (@isom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) (@setTfor (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))))) abelem_rV) *) by case/misomP: (xchooseP ab_rV_P). Qed. Lemma abelem_rV_inj : {in E &, injective ErV}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (fun x1 x2 : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (abelem_rV x1) (abelem_rV x2), @eq (FinGroup.arg_sort (FinGroup.base gT)) x1 x2) (inPhantom (@injective (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (FinGroup.arg_sort (FinGroup.base gT)) abelem_rV)) *) by apply/injmP; apply: abelem_rV_injm. Qed. Lemma mem_im_abelem_rV u : u \in ErV @* E. Proof. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) u (@mem (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E))))) *) by rewrite im_abelem_rV inE. Qed. Lemma sub_im_abelem_rV mA : subset mA (mem (ErV @* E)). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) mA (@mem (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E))))) *) by rewrite unlock; apply/pred0P=> v /=; rewrite mem_im_abelem_rV. Qed. Lemma abelem_rV_X x i : x \in E -> ErV (x ^+ i) = i%:R *: ErV x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), @eq (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (abelem_rV (@expgn (FinGroup.base gT) x i)) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@GRing.natmul (GRing.Ring.zmodType (Zp_ringType (Zp_trunc (pdiv p)))) (GRing.one (Zp_ringType (Zp_trunc (pdiv p)))) i) (abelem_rV x)) *) by move=> Ex; rewrite morphX // scaler_nat. Qed. Lemma abelem_rV_V x : x \in E -> ErV x^-1 = - ErV x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), @eq (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (abelem_rV (@invg (FinGroup.base gT) x)) (@GRing.opp (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (abelem_rV x)) *) by move=> Ex; rewrite morphV. Qed. Definition rVabelem : rVn -> gT := invm abelem_rV_injm. Lemma rVabelemD : {morph rV_E : u v / u + v >-> (u * v)%g}. Proof. (* Goal: @morphism_2 (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (FinGroup.arg_sort (FinGroup.base gT)) rVabelem (fun u v : matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))) => @GRing.add (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) u v) (fun u v : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) u v) *) by move=> u v /=; rewrite -morphM. Qed. Lemma rVabelemN : {morph rV_E: u / - u >-> (u^-1)%g}. Proof. (* Goal: @morphism_1 (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (FinGroup.arg_sort (FinGroup.base gT)) rVabelem (fun u : matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))) => @GRing.opp (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) u) (fun u : FinGroup.arg_sort (FinGroup.base gT) => @invg (FinGroup.base gT) u) *) by move=> u /=; rewrite -morphV. Qed. Lemma rVabelemZ (m : 'F_p) : {morph rV_E : u / m *: u >-> (u ^+ m)%g}. Proof. (* Goal: @morphism_1 (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (FinGroup.arg_sort (FinGroup.base gT)) rVabelem (fun u : matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))) => @GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))) m u) (fun u : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) u (@nat_of_ord (S (S (Zp_trunc (pdiv p)))) m)) *) by move=> u; rewrite /= -morphX -?[(u ^+ m)%g]scaler_nat ?natr_Zp. Qed. Lemma abelem_rV_K : {in E, cancel ErV rV_E}. Proof. exact: invmE. Qed. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.arg_sort (FinGroup.base gT)) (rVabelem (abelem_rV x)) x) (inPhantom (@cancel (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (FinGroup.arg_sort (FinGroup.base gT)) abelem_rV rVabelem)) *) exact: invmE. Qed. Lemma rVabelem_inj : injective rV_E. Proof. exact: can_inj rVabelemK. Qed. Proof. (* Goal: @injective (FinGroup.arg_sort (FinGroup.base gT)) (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) rVabelem *) exact: can_inj rVabelemK. Qed. Lemma im_rVabelem : rV_E @* setT = E. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@setTfor (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))))) (@gval gT E) *) by rewrite -im_abelem_rV im_invm. Qed. Lemma mem_rVabelem u : rV_E u \in E. Proof. (* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (rVabelem u) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) *) by rewrite -im_rVabelem mem_morphim. Qed. Lemma sub_rVabelem L : rV_E @* L \subset E. Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) *) by rewrite -[_ @* L]morphimIim im_invm subsetIl. Qed. Hint Resolve mem_rVabelem sub_rVabelem : core. Lemma card_rVabelem L : #|rV_E @* L| = #|L|. Proof. (* Goal: @eq nat (@card (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) L)))) (@card (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) L))) *) by rewrite card_injm ?rVabelem_injm. Qed. Lemma abelem_rV_mK (H : {set gT}) : H \subset E -> rV_E @* (ErV @* H) = H. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) H)) H *) exact: morphim_invm abelem_rV_injm H. Qed. Lemma rVabelem_mK L : ErV @* (rV_E @* L) = L. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) L)) L *) by rewrite morphim_invmE morphpreK. Qed. Lemma rVabelem_minj : injective (morphim (MorPhantom rV_E)). Proof. (* Goal: @injective (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@set_of (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))))) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem)) *) exact: can_inj rVabelem_mK. Qed. Lemma rVabelemS L M : (rV_E @* L \subset rV_E @* M) = (L \subset M). Proof. (* Goal: @eq bool (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) L))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) M)))) (@subset (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) L)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) M))) *) by rewrite injmSK ?rVabelem_injm. Qed. Lemma abelem_rV_S (H K : {set gT}) : H \subset E -> (ErV @* H \subset ErV @* K) = (H \subset K). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), @eq bool (@subset (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) H))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) K)))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) K))) *) by move=> sHE; rewrite injmSK ?abelem_rV_injm. Qed. Lemma sub_rVabelem_im L (H : {set gT}) : (rV_E @* L \subset H) = (L \subset ErV @* H). Proof. (* Goal: @eq bool (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H))) (@subset (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) L)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) H)))) *) by rewrite sub_morphim_pre ?morphpre_invm. Qed. Lemma sub_abelem_rV_im (H : {set gT}) (L : {set 'rV['F_p]_n}) : H \subset E -> (ErV @* H \subset L) = (H \subset rV_E @* L). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), @eq bool (@subset (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) H))) (@mem (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (ordinal_finType (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (ordinal_finType (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) L))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) L)))) *) by move=> sHE; rewrite sub_morphim_pre ?morphim_invmE. Qed. Section OneGroup. Variable G : {group gT}. Definition abelem_mx_fun (g : subg_of G) v := ErV ((rV_E v) ^ val g). Definition abelem_mx of G \subset 'N(E) := fun x => lin1_mx (abelem_mx_fun (subg G x)). Hypothesis nEG : G \subset 'N(E). Local Notation r := (abelem_mx nEG). Fact abelem_mx_linear_proof g : linear (abelem_mx_fun g). Proof. (* Goal: @GRing.Linear.axiom (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (abelem_mx_fun g) (@GRing.Scale.scale_law (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@Logic.eq_refl (forall (_ : GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p)))) (_ : GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@GRing.Lmodule.base (Zp_ringType (Zp_trunc (pdiv p))) (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@GRing.Lmodule.class (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))), GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@GRing.Lmodule.base (Zp_ringType (Zp_trunc (pdiv p))) (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@GRing.Lmodule.class (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))))))) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) *) rewrite /abelem_mx_fun; case: g => x /= /(subsetP nEG) Nx /= m u v. (* Goal: @eq (GRing.Zmodule.sort (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (abelem_rV (@conjg gT (rVabelem (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@GRing.Lmodule.base (Zp_ringType (Zp_trunc (pdiv p))) (@GRing.Lmodule.sort (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (@GRing.Lmodule.class (Zp_ringType (Zp_trunc (pdiv p))) (Phant (GRing.Ring.sort (Zp_ringType (Zp_trunc (pdiv p))))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))))))) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))) m u) v)) x)) (@GRing.add (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))) m (abelem_rV (@conjg gT (rVabelem u) x))) (abelem_rV (@conjg gT (rVabelem v) x))) *) rewrite rVabelemD rVabelemZ conjMg conjXg. (* Goal: @eq (GRing.Zmodule.sort (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))) (abelem_rV (@mulg (FinGroup.base gT) (@expgn (FinGroup.base gT) (@conjg gT (rVabelem u) x) (@nat_of_ord (S (S (Zp_trunc (pdiv p)))) m)) (@conjg gT (rVabelem v) x))) (@GRing.add (matrix_zmodType (Zp_zmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@GRing.scale (Zp_ringType (Zp_trunc (pdiv p))) (matrix_lmodType (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E)))) m (abelem_rV (@conjg gT (rVabelem u) x))) (abelem_rV (@conjg gT (rVabelem v) x))) *) by rewrite abelem_rV_M ?abelem_rV_X ?groupX ?memJ_norm // natr_Zp. Qed. Canonical abelem_mx_linear g := Linear (abelem_mx_linear_proof g). Let rVabelemJmx v x : x \in G -> rV_E (v *m r x) = (rV_E v) ^ x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (FinGroup.arg_sort (FinGroup.base gT)) (rVabelem (@mulmx (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) v (abelem_mx nEG x))) (@conjg gT (rVabelem v) x) *) move=> Gx; rewrite /= mul_rV_lin1 /= /abelem_mx_fun subgK //. (* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (rVabelem (abelem_rV (@conjg gT (rVabelem v) x))) (@conjg gT (rVabelem v) x) *) by rewrite abelem_rV_K // memJ_norm // (subsetP nEG). Qed. Fact abelem_mx_repr : mx_repr G r. Canonical abelem_repr := MxRepresentation abelem_mx_repr. Let rG := abelem_repr. Lemma rVabelemJ v x : x \in G -> rV_E (v *m rG x) = (rV_E v) ^ x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (FinGroup.arg_sort (FinGroup.base gT)) (rVabelem (@mulmx (GRing.ComUnitRing.ringType (Zp_comUnitRingType (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) v (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG x))) (@conjg gT (rVabelem v) x) *) exact: rVabelemJmx. Qed. Lemma abelem_rV_J : {in E & G, forall x y, ErV (x ^ y) = ErV x *m rG y}. Proof. (* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (abelem_rV (@conjg gT x y)) (@mulmx (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (abelem_rV x) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG y))) (inPhantom (forall x y : FinGroup.arg_sort (FinGroup.base gT), @eq (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (abelem_rV (@conjg gT x y)) (@mulmx (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (abelem_rV x) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG y)))) *) by move=> x y Ex Gy; rewrite -{1}(abelem_rV_K Ex) -rVabelemJ ?rVabelemK. Qed. Lemma abelem_rowgJ m (A : 'M_(m, n)) x : x \in G -> rV_E @* rowg (A *m rG x) = (rV_E @* rowg A) :^ x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m (@mulmx (GRing.ComUnitRing.ringType (Zp_comUnitRingType (Zp_trunc (pdiv p)))) m (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) A (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG x)))) (@conjugate gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m A)) x) *) move=> Gx; apply: (canRL (conjsgKV _)); apply/setP=> y. (* Goal: @eq bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@conjugate gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m (@mulmx (GRing.ComUnitRing.ringType (Zp_comUnitRingType (Zp_trunc (pdiv p)))) m (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) A (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG x)))) (@invg (FinGroup.base gT) x))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m A))))) *) rewrite mem_conjgV !morphim_invmE !inE memJ_norm ?(subsetP nEG) //=. (* Goal: @eq bool (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (@submx (FinRing.Field.fieldType (Fp_finFieldType p)) (S O) m (S (@abelem_dim' gT (@gval gT E))) (abelem_rV (@conjg gT y x)) (@mulmx (GRing.ComUnitRing.ringType (Zp_comUnitRingType (Zp_trunc (pdiv p)))) m (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) A (abelem_mx nEG x)))) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (@submx (FinRing.Field.fieldType (Fp_finFieldType p)) (S O) m (S (@abelem_dim' gT (@gval gT E))) (abelem_rV y) A)) *) apply: andb_id2l => Ey; rewrite abelem_rV_J //. (* Goal: @eq bool (@submx (FinRing.Field.fieldType (Fp_finFieldType p)) (S O) m (S (@abelem_dim' gT (@gval gT E))) (@mulmx (Zp_ringType (Zp_trunc (pdiv p))) (S O) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (abelem_rV y) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG x)) (@mulmx (GRing.ComUnitRing.ringType (Zp_comUnitRingType (Zp_trunc (pdiv p)))) m (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) A (abelem_mx nEG x))) (@submx (FinRing.Field.fieldType (Fp_finFieldType p)) (S O) m (S (@abelem_dim' gT (@gval gT E))) (abelem_rV y) A) *) by rewrite submxMfree // row_free_unit (repr_mx_unit rG). Qed. Lemma rV_abelem_sJ (L : {group gT}) x : x \in G -> L \subset E -> ErV @* (L :^ x) = rowg (rowg_mx (ErV @* L) *m rG x). Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))), @eq (@set_of (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))))))))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@conjugate gT (@gval gT L) x)) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@mulmx (GRing.Field.ringType (FinRing.Field.fieldType (Fp_finFieldType p))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT L))) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG x))) *) move=> Gx sLE; apply: rVabelem_minj; rewrite abelem_rowgJ //. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@conjugate gT (@gval gT L) x))) (@conjugate gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT L))))) x) *) by rewrite rowg_mxK !morphim_invm // -(normsP nEG x Gx) conjSg. Qed. Lemma rstab_abelem m (A : 'M_(m, n)) : rstab rG A = 'C_G(rV_E @* rowg A). Lemma rstabs_abelem m (A : 'M_(m, n)) : rstabs rG A = 'N_G(rV_E @* rowg A). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@rstabs (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG m A) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m A)))) *) apply/setP=> x; rewrite !inE /=; apply: andb_id2l => Gx. (* Goal: @eq bool (@submx (Fp_fieldType p) m m (S (@abelem_dim' gT (@gval gT E))) (@mulmx (GRing.Field.ringType (Fp_fieldType p)) m (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) A (abelem_mx nEG x)) A) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@conjugate gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m A)) x))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m A))))) *) by rewrite -rowgS -rVabelemS abelem_rowgJ. Qed. Lemma rstabs_abelemG (L : {group gT}) : L \subset E -> rstabs rG (rowg_mx (ErV @* L)) = 'N_G(L). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@rstabs (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT L)))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@gval gT L))) *) by move=> sLE; rewrite rstabs_abelem rowg_mxK morphim_invm. Qed. Lemma mxmodule_abelem m (U : 'M['F_p]_(m, n)) : mxmodule rG U = (G \subset 'N(rV_E @* rowg U)). Proof. (* Goal: @eq bool (@mxmodule (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG m U) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) m U)))))) *) by rewrite -subsetIidl -rstabs_abelem. Qed. Lemma mxmodule_abelemG (L : {group gT}) : L \subset E -> mxmodule rG (rowg_mx (ErV @* L)) = (G \subset 'N(L)). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), @eq bool (@mxmodule (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT L)))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT L))))) *) by move=> sLE; rewrite -subsetIidl -rstabs_abelemG. Qed. Lemma mxsimple_abelemP (U : 'M['F_p]_n) : reflect (mxsimple rG U) (minnormal (rV_E @* rowg U) G). Proof. (* Goal: Bool.reflect (@mxsimple (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG U) (@minnormal gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)) (@gval gT G)) *) apply: (iffP mingroupP) => [[/andP[ntU modU] minU] | [modU ntU minU]]. (* Goal: and (is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))) *) (* Goal: @mxsimple (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG U *) split=> [||V modV sVU ntV]; first by rewrite mxmodule_abelem. (* Goal: and (is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))) *) (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U V) *) (* Goal: is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) U (GRing.zero (matrix_zmodType (GRing.Field.zmodType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))))))) *) by apply: contraNneq ntU => ->; rewrite /= rowg0 morphim1. (* Goal: and (is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))) *) (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U V) *) rewrite -rowgS -rVabelemS [_ @* rowg V]minU //. (* Goal: and (is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@mfun (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism)) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) V))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))))) *) (* Goal: is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@mfun (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism)) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) V))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@mfun (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism)) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) V)))))))) *) rewrite -subG1 sub_rVabelem_im morphim1 subG1 trivg_rowg ntV /=. (* Goal: and (is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@mfun (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism)) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) V))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@morphim (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) V)))))) *) by rewrite -mxmodule_abelem. (* Goal: and (is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@mfun (matrix_finGroupType (FinRing.Field.finZmodType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism)) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) V))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))))) *) by rewrite rVabelemS rowgS. (* Goal: and (is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))) *) split=> [|D /andP[ntD nDG sDU]]. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT D) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) *) (* Goal: is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))))))) *) rewrite -subG1 sub_rVabelem_im morphim1 subG1 trivg_rowg ntU /=. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT D) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U)))))) *) by rewrite -mxmodule_abelem. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT D) (@gval gT (@morphim_group (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) E) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg_group (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U))) *) apply/eqP; rewrite eqEsubset sDU sub_rVabelem_im /= -rowg_mxSK rowgK. (* Goal: is_true (@submx (FinRing.Field.fieldType (Fp_finFieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) D)))) *) have sDE: D \subset E := subset_trans sDU (sub_rVabelem _). (* Goal: is_true (@submx (FinRing.Field.fieldType (Fp_finFieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) D)))) *) rewrite minU ?mxmodule_abelemG //. (* Goal: is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) D))) (GRing.zero (matrix_zmodType (GRing.Field.zmodType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))))))) *) (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) D))) U) *) by rewrite -rowgS rowg_mxK sub_abelem_rV_im. (* Goal: is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) D))) (GRing.zero (matrix_zmodType (GRing.Field.zmodType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))))))) *) by rewrite rowg_mx_eq0 (morphim_injm_eq1 abelem_rV_injm). Qed. Lemma mxsimple_abelemGP (L : {group gT}) : L \subset E -> reflect (mxsimple rG (rowg_mx (ErV @* L))) (minnormal L G). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))), Bool.reflect (@mxsimple (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT L)))) (@minnormal gT (@gval gT L) (@gval gT G)) *) move/abelem_rV_mK=> {2}<-; rewrite -{2}[_ @* L]rowg_mxK. (* Goal: Bool.reflect (@mxsimple (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT L)))) (@minnormal gT (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@gval (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim_group gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) E abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism)) L))))) (@gval gT G)) *) exact: mxsimple_abelemP. Qed. Lemma abelem_mx_irrP : reflect (mx_irreducible rG) (minnormal E G). Proof. (* Goal: Bool.reflect (@mx_irreducible (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG) (@minnormal gT (@gval gT E) (@gval gT G)) *) by rewrite -[E in minnormal E G]im_rVabelem -rowg1; apply: mxsimple_abelemP. Qed. Lemma rfix_abelem (H : {set gT}) : H \subset G -> (rfix_mx rG H :=: rowg_mx (ErV @* 'C_E(H)%g))%MS. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) H)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eqmx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rfix_mx (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG H) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))) *) move/subsetP=> sHG; apply/eqmxP/andP; split. (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))) (@rfix_mx (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG H)) *) (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rfix_mx (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG H) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H))))) *) rewrite -rowgS rowg_mxK -sub_rVabelem_im // subsetI sub_rVabelem /=. (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))) (@rfix_mx (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG H)) *) (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E)) rVabelem_morphism (@MorPhantom (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT rVabelem) (@rowg (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rfix_mx (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG H))))) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@centraliser gT H)))) *) apply/centsP=> y /morphimP[v _]; rewrite inE => cGv ->{y} x Gx. (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))) (@rfix_mx (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG H)) *) (* Goal: @commute (FinGroup.base gT) (@mfun (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) gT (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@gval gT E)) rVabelem_morphism v) x *) by apply/commgP/conjg_fixP; rewrite /= -rVabelemJ ?sHG ?(rfix_mxP H _). (* Goal: is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@rowg_mx (Fp_finFieldType p) (S (@abelem_dim' gT (@gval gT E))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))) (@rfix_mx (Fp_fieldType p) gT G (S (@abelem_dim' gT (@gval gT E))) rG H)) *) rewrite genmxE; apply/rfix_mxP=> x Hx; apply/row_matrixP=> i. (* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@row (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p)))) (@card (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))))) (S (@abelem_dim' gT (@gval gT E))) i (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p))) (@card (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@matrix_of_fun (Finite.sort (FinRing.Field.finType (Fp_finFieldType p))) (@card (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))))) (S (@abelem_dim' gT (@gval gT E))) matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))))))) (j : Finite.sort (ordinal_finType (S (@abelem_dim' gT (@gval gT E))))) => @fun_of_matrix (Finite.sort (FinRing.Field.finType (Fp_finFieldType p))) (S O) (S (@abelem_dim' gT (@gval gT E))) (@enum_val (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))) i) (GRing.zero (Zp_zmodType O)) j)) (@repr_mx (GRing.Field.comUnitRingType (Fp_fieldType p)) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG x))) (@row (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p)))) (@card (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))))) (S (@abelem_dim' gT (@gval gT E))) i (@matrix_of_fun (Finite.sort (FinRing.Field.finType (Fp_finFieldType p))) (@card (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))))) (S (@abelem_dim' gT (@gval gT E))) matrix_key (fun (i : Finite.sort (ordinal_finType (@card (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mem (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E))))) (predPredType (Finite.sort (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))))))) (j : Finite.sort (ordinal_finType (S (@abelem_dim' gT (@gval gT E))))) => @fun_of_matrix (Finite.sort (FinRing.Field.finType (Fp_finFieldType p))) (S O) (S (@abelem_dim' gT (@gval gT E))) (@enum_val (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@SetDef.pred_of_set (matrix_finType (FinRing.Field.finType (Fp_finFieldType p)) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@morphim gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism (@MorPhantom gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) abelem_rV) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E) (@centraliser gT H)))) i) (GRing.zero (Zp_zmodType O)) j))) *) rewrite row_mul rowK; case/morphimP: (enum_valP i) => z Ez /setIP[_ cHz] ->. (* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p))) (S O) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism z) (@repr_mx (GRing.Field.comUnitRingType (Fp_fieldType p)) gT (@gval gT G) (S (@abelem_dim' gT (@gval gT E))) rG x)) (@mfun gT (matrix_finGroupType (Zp_finZmodType (S (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@gval gT E) abelem_rV_morphism z) *) by rewrite -abelem_rV_J ?sHG // conjgE (centP cHz) ?mulKg. Qed. Lemma rker_abelem : rker rG = 'C_G(E). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@rker (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G (S (@abelem_dim' gT (@gval gT E))) rG) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E))) *) by rewrite /rker rstab_abelem rowg1 im_rVabelem. Qed. Lemma abelem_mx_faithful : 'C_G(E) = 1%g -> mx_faithful rG. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))), is_true (@mx_faithful (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G (S (@abelem_dim' gT (@gval gT E))) rG) *) by rewrite /mx_faithful rker_abelem => ->. Qed. End OneGroup. Section SubGroup. Variables G H : {group gT}. Hypotheses (nEG : G \subset 'N(E)) (sHG : H \subset G). Let nEH := subset_trans sHG nEG. Local Notation rG := (abelem_repr nEG). Local Notation rHG := (subg_repr rG sHG). Local Notation rH := (abelem_repr nEH). Lemma eq_abelem_subg_repr : {in H, rHG =1 rH}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (matrix (GRing.ComUnitRing.sort (Zp_comUnitRingType (Zp_trunc (pdiv p)))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG) x) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) x)) (inPhantom (@eqfun (matrix (GRing.ComUnitRing.sort (Zp_comUnitRingType (Zp_trunc (pdiv p)))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) (FinGroup.arg_sort (FinGroup.base gT)) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG)) (@repr_mx (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH)))) *) move=> x Hx; apply/row_matrixP=> i; rewrite !rowE !mul_rV_lin1 /=. (* Goal: @eq (matrix (ordinal (S (S (Zp_trunc (pdiv p))))) (S O) (S (@abelem_dim' gT (@gval gT E)))) (@abelem_mx_fun G (@subg gT G x) (@delta_mx (GRing.ComUnitRing.ringType (Zp_comUnitRingType (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))) (GRing.zero (FinRing.Zmodule.zmodType (Zp_finZmodType O))) i)) (@abelem_mx_fun H (@subg gT H x) (@delta_mx (GRing.ComUnitRing.ringType (Zp_comUnitRingType (Zp_trunc (pdiv p)))) (S O) (S (@abelem_dim' gT (@gval gT E))) (GRing.zero (FinRing.Zmodule.zmodType (Zp_finZmodType O))) i)) *) by rewrite /abelem_mx_fun !subgK ?(subsetP sHG). Qed. Lemma rsim_abelem_subg : mx_rsim rHG rH. Proof. (* Goal: @mx_rsim (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG) (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) *) exists 1%:M => // [|x Hx]; first by rewrite row_free_unit unitmx1. (* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p)))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (Fp_fieldType p))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@repr_mx (GRing.Field.comUnitRingType (Fp_fieldType p)) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG) x) (@scalar_mx (GRing.Field.ringType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (GRing.one (GRing.Field.ringType (Fp_fieldType p))))) (@mulmx (GRing.Field.ringType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (@scalar_mx (GRing.Field.ringType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (GRing.one (GRing.Field.ringType (Fp_fieldType p)))) (@repr_mx (GRing.Field.comUnitRingType (Fp_fieldType p)) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) x)) *) by rewrite mul1mx mulmx1 eq_abelem_subg_repr. Qed. Lemma mxmodule_abelem_subg m (U : 'M_(m, n)) : mxmodule rHG U = mxmodule rH U. Proof. (* Goal: @eq bool (@mxmodule (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG) m U) (@mxmodule (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) m U) *) apply: eq_subset_r => x; rewrite !inE; apply: andb_id2l => Hx. (* Goal: @eq bool (@submx (Fp_fieldType p) m m (S (@abelem_dim' gT (@gval gT E))) (@mulmx (GRing.Field.ringType (Fp_fieldType p)) m (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U (@repr_mx (GRing.Field.comUnitRingType (Fp_fieldType p)) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG) x)) U) (@submx (Fp_fieldType p) m m (S (@abelem_dim' gT (@gval gT E))) (@mulmx (GRing.Field.ringType (Fp_fieldType p)) m (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U (@repr_mx (GRing.Field.comUnitRingType (Fp_fieldType p)) gT (@gval gT H) (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) x)) U) *) by rewrite eq_abelem_subg_repr. Qed. Lemma mxsimple_abelem_subg U : mxsimple rHG U <-> mxsimple rH U. Proof. (* Goal: iff (@mxsimple (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG) U) (@mxsimple (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) U) *) have eq_modH := mxmodule_abelem_subg; rewrite /mxsimple eq_modH. (* Goal: iff (and3 (is_true (@mxmodule (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) (S (@abelem_dim' gT (@gval gT E))) U)) (is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) U (GRing.zero (matrix_zmodType (GRing.Field.zmodType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))))))) (forall (U0 : matrix (GRing.Field.sort (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) (_ : is_true (@mxmodule (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@subg_repr (Zp_comUnitRingType (Zp_trunc (pdiv p))) gT G H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr G nEG) sHG) (S (@abelem_dim' gT (@gval gT E))) U0)) (_ : is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U0 U)) (_ : is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) U0 (GRing.zero (matrix_zmodType (GRing.Field.zmodType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))))))), is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U U0))) (and3 (is_true (@mxmodule (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) (S (@abelem_dim' gT (@gval gT E))) U)) (is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) U (GRing.zero (matrix_zmodType (GRing.Field.zmodType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))))))) (forall (U0 : matrix (GRing.Field.sort (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) (_ : is_true (@mxmodule (Fp_fieldType p) gT H (S (@abelem_dim' gT (@gval gT E))) (@abelem_repr H nEH) (S (@abelem_dim' gT (@gval gT E))) U0)) (_ : is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U0 U)) (_ : is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))) U0 (GRing.zero (matrix_zmodType (GRing.Field.zmodType (Fp_fieldType p)) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E)))))))), is_true (@submx (Fp_fieldType p) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) (S (@abelem_dim' gT (@gval gT E))) U U0))) *) by split=> [] [-> -> minU]; split=> // V; have:= minU V; rewrite eq_modH. Qed. End SubGroup. End AbelemRepr. Arguments rVabelem_inj {p%N gT E%G} abelE ntE [v1%R v2%R] : rename. Section ModularRepresentation. Variables (F : fieldType) (p : nat) (gT : finGroupType). Hypothesis charFp : p \in [char F]. Implicit Types G H : {group gT}. Lemma rfix_pgroup_char G H n (rG : mx_representation F G n) : n > 0 -> p.-group H -> H \subset G -> rfix_mx rG H != 0. Variables (G : {group gT}) (n : nat) (rG : mx_representation F G n). Lemma pcore_sub_rstab_mxsimple M : mxsimple rG M -> 'O_p(G) \subset rstab rG M. Proof. (* Goal: forall _ : @mxsimple F gT G n rG M, is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@rstab (GRing.Field.comUnitRingType F) gT G n rG n M)))) *) case=> modM nzM simM; have sGpG := pcore_sub p G. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@rstab (GRing.Field.comUnitRingType F) gT G n rG n M)))) *) rewrite rfix_mx_rstabC //; set U := rfix_mx _ _. (* Goal: is_true (@submx F n n n M U) *) have:= simM (M :&: U)%MS; rewrite sub_capmx submx_refl. (* Goal: forall _ : forall (_ : is_true (@mxmodule F gT G n rG n (@capmx F n n n M U))) (_ : is_true (@submx F n n n (@capmx F n n n M U) M)) (_ : is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType F) n n) (@capmx F n n n M U) (GRing.zero (matrix_zmodType (GRing.Field.zmodType F) n n))))), is_true (andb true (@submx F n n n M U)), is_true (@submx F n n n M U) *) apply; rewrite ?capmxSl //. (* Goal: is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType F) n n) (@capmx F n n n M U) (GRing.zero (matrix_zmodType (GRing.Field.zmodType F) n n)))) *) (* Goal: is_true (@mxmodule F gT G n rG n (@capmx F n n n M U)) *) by rewrite capmx_module // normal_rfix_mx_module ?pcore_normal. (* Goal: is_true (negb (@eq_op (matrix_eqType (GRing.Field.eqType F) n n) (@capmx F n n n M U) (GRing.zero (matrix_zmodType (GRing.Field.zmodType F) n n)))) *) rewrite -(in_submodK (capmxSl _ _)) val_submod_eq0 -submx0. (* Goal: is_true (negb (@submx F n (@mxrank F n n M) (@mxrank F n n M) (@in_submod F n M n (@capmx F n n n M U)) (GRing.zero (matrix_zmodType (GRing.Field.zmodType F) (@mxrank F n n M) (@mxrank F n n M))))) *) rewrite -(rfix_submod modM) // submx0 rfix_pgroup_char ?pcore_pgroup //. (* Goal: is_true (leq (S O) (@mxrank F n n M)) *) by rewrite lt0n mxrank_eq0. Qed. Lemma pcore_sub_rker_mx_irr : mx_irreducible rG -> 'O_p(G) \subset rker rG. Proof. (* Goal: forall _ : @mx_irreducible F gT G n rG, is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@rker (GRing.Field.comUnitRingType F) gT G n rG)))) *) exact: pcore_sub_rstab_mxsimple. Qed. Lemma pcore_faithful_mx_irr : mx_irreducible rG -> mx_faithful rG -> 'O_p(G) = 1%g. Proof. (* Goal: forall (_ : @mx_irreducible F gT G n rG) (_ : is_true (@mx_faithful (GRing.Field.comUnitRingType F) gT G n rG)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@pcore (nat_pred_of_nat p) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) move=> irrG ffulG; apply/trivgP; apply: subset_trans ffulG. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@pcore_group (nat_pred_of_nat p) gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@rker (GRing.Field.comUnitRingType F) gT G n rG)))) *) exact: pcore_sub_rstab_mxsimple. Qed. End ModularRepresentation. Section Extraspecial. Variables (F : fieldType) (gT : finGroupType) (S : {group gT}) (p n : nat). Hypotheses (pS : p.-group S) (esS : extraspecial S). Hypothesis oSpn : #|S| = (p ^ n.*2.+1)%N. Hypotheses (splitF : group_splitting_field F S) (F'S : [char F]^'.-group S). Let p_pr := extraspecial_prime pS esS. Proof. (* Goal: is_true (prime p) *) by have [] := pgroup_pdiv pE ntE. Qed. Let p_gt0 := prime_gt0 p_pr. Let p_gt1 := prime_gt1 p_pr. Let oZp := card_center_extraspecial pS esS. Let modIp' (i : 'I_p.-1) : (i.+1 %% p = i.+1)%N. Proof. (* Goal: @eq nat (modn (Datatypes.S (@nat_of_ord (Nat.pred p) i)) p) (Datatypes.S (@nat_of_ord (Nat.pred p) i)) *) by case: i => i; rewrite /= -ltnS prednK //; apply: modn_small. Qed. Theorem extraspecial_repr_structure (sS : irrType F S) : [/\ #|linear_irr sS| = (p ^ n.*2)%N, Variables (m : nat) (rS : mx_representation F S m) (U : 'M[F]_m). Hypotheses (simU : mxsimple rS U) (ffulU : rstab rS U == 1%g). Let sZS := center_sub S. Let rZ := subg_repr rS sZS. Lemma faithful_repr_extraspecial : \rank U = (p ^ n)%N /\ (forall V, mxsimple rS V -> mx_iso rZ U V -> mx_iso rS U V). End Extraspecial.
Require Import sur_les_relations. Section NewmanS. Variable A : Set. Variable R : A -> A -> Prop. Hypothesis N : explicit_noetherian _ R. Hypothesis C : explicit_local_confluence _ R. Theorem Newman : explicit_confluence _ R. Proof. (* Goal: explicit_confluence A R *) unfold explicit_confluence in |- *; intro x; pattern x in |- *; apply (noetherian_induction1 A R N). (* Goal: forall (y : A) (_ : forall (z : A) (_ : R y z), confluence_en A R z), confluence_en A R y *) intros y H1; unfold confluence_en in |- *. (* Goal: forall (y0 z : A) (_ : explicit_star A R y y0) (_ : explicit_star A R y z), @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) intros y0 z H2 H3; elim (star_case A R y z H3); intro H4. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) exists y0; split. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: explicit_star A R z y0 *) (* Goal: explicit_star A R y0 y0 *) apply star_refl. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: explicit_star A R z y0 *) rewrite <- H4; assumption. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (star_case A R y y0 H2); intro H5. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) exists z; split. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: explicit_star A R z z *) (* Goal: explicit_star A R y0 z *) rewrite <- H5; assumption. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) (* Goal: explicit_star A R z z *) apply star_refl. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H5; intros y0' H6; elim H6; intros H7 H8. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H4; intros z' H9; elim H9; intros H10 H11. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (C y y0' z' H7 H10); intros y' H12. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H12; intros H13 H14. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (H1 y0' H7 y0 y' H8 H13); intros y'' H15. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim H15; intros H16 H17. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) elim (H1 z' H10 y'' z (star_trans A R z' y' y'' H14 H17) H11). (* Goal: forall (x : A) (_ : and (explicit_star A R y'' x) (explicit_star A R z x)), @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) intros u H18; elim H18; intros H19 H20. (* Goal: @ex A (fun u : A => and (explicit_star A R y0 u) (explicit_star A R z u)) *) exists u; split. (* Goal: explicit_star A R z u *) (* Goal: explicit_star A R y0 u *) apply star_trans with y''; assumption. (* Goal: explicit_star A R z u *) assumption. Qed. End NewmanS.
Set Implicit Arguments. Unset Strict Implicit. Require Export Ring_cat. Require Export Group_facts. Require Export Abelian_group_facts. Section Lemmas. Variable R : RING. Lemma RING_assoc : forall x y z : R, Equal (ring_mult (ring_mult x y) z) (ring_mult x (ring_mult y z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@ring_mult R x y) z) (@ring_mult R x (@ring_mult R y z)) *) exact (sgroup_assoc_prf (E:=R) (ring_monoid R)). Qed. Lemma RING_comp : forall x x' y y' : R, Equal x x' -> Equal y y' -> Equal (ring_mult x y) (ring_mult x' y'). Proof. (* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) y y'), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x y) (@ring_mult R x' y') *) unfold ring_mult in |- *; auto with algebra. Qed. Lemma RING_unit_r : forall x : R, Equal (ring_mult x (ring_unit R)) x. Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (ring_unit R)) x *) exact (monoid_unit_r_prf (ring_monoid R)). Qed. Lemma RING_unit_l : forall x : R, Equal (ring_mult (ring_unit R) x) x. Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (ring_unit R) x) x *) exact (monoid_unit_l_prf (ring_monoid R)). Qed. Lemma RING_dist_r : forall x y z : R, Equal (ring_mult (sgroup_law R x y) z) (sgroup_law R (ring_mult x z) (ring_mult y z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) x y) z) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R x z) (@ring_mult R y z)) *) exact (ring_dist_r_prf R). Qed. Lemma RING_dist_l : forall x y z : R, Equal (ring_mult x (sgroup_law R y z)) (sgroup_law R (ring_mult x y) (ring_mult x z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) y z)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R x y) (@ring_mult R x z)) *) exact (ring_dist_l_prf R). Qed. Hint Resolve RING_assoc RING_comp RING_unit_r RING_unit_l RING_dist_r RING_dist_l: algebra. Lemma RING_absorbant_r : forall x : R, Equal (ring_mult x (monoid_unit R)) (monoid_unit R). Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply GROUP_reg_right with (ring_mult x (monoid_unit R)). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R)))))) (@ring_mult R x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))))) *) apply Trans with (ring_mult x (sgroup_law R (monoid_unit R) (monoid_unit R))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))))) *) apply Trans with (ring_mult x (monoid_unit R)); auto with algebra. Qed. Hint Resolve RING_absorbant_r: algebra. Lemma RING_absorbant_l : forall x : R, Equal (ring_mult (monoid_unit R) x) (monoid_unit R). Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) intros x; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply GROUP_reg_right with (ring_mult (monoid_unit R) x). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x)) *) apply Trans with (ring_mult (sgroup_law R (monoid_unit R) (monoid_unit R)) x); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R)))))) x) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) x)) *) apply Trans with (ring_mult (monoid_unit R) x); auto with algebra. Qed. Hint Resolve RING_absorbant_l: algebra. Lemma RING_op_mult_l : forall x y : R, Equal (ring_mult (group_inverse R x) y) (group_inverse R (ring_mult x y)). Proof. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) x) y) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) x) y) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) x) y) *) apply GROUP_law_inverse. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R x y) (@ring_mult R (group_inverse (abelian_group_group (ring_group R)) x) y)) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply Trans with (ring_mult (sgroup_law R x (group_inverse R x)) y); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) x (group_inverse (abelian_group_group (ring_group R)) x)) y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply Trans with (ring_mult (monoid_unit R) y); auto with algebra. Qed. Hint Resolve RING_op_mult_l: algebra. Lemma RING_op_mult_r : forall x y : R, Equal (ring_mult x (group_inverse R y)) (group_inverse R (ring_mult x y)). Proof. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) *) apply Sym. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (group_inverse (abelian_group_group (ring_group R)) (@ring_mult R x y)) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y)) *) apply GROUP_law_inverse. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (@ring_mult R x y) (@ring_mult R x (group_inverse (abelian_group_group (ring_group R)) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply Trans with (ring_mult x (sgroup_law R y (group_inverse R y))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (@ring_mult R x (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) y (group_inverse (abelian_group_group (ring_group R)) y))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_on_def (group_monoid (abelian_group_group (ring_group R))))) *) apply Trans with (ring_mult x (monoid_unit R)); auto with algebra. Qed. End Lemmas. Hint Resolve RING_assoc RING_comp RING_unit_r RING_unit_l RING_dist_r RING_dist_l RING_absorbant_r RING_absorbant_l RING_op_mult_l RING_op_mult_r: algebra. Section Commutative_rings. Variable R1 : CRING. Lemma CRING_com : forall x y : R1, Equal (ring_mult x y) (ring_mult y x). Proof. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) x y) (@ring_mult (cring_ring R1) y x) *) exact (cring_com_prf R1). Qed. Hint Immediate CRING_com: algebra. Lemma CRING_mult4 : forall a b c d : R1, Equal (ring_mult (ring_mult a b) (ring_mult c d)) (ring_mult (ring_mult a c) (ring_mult b d)). Proof. (* Goal: forall a b c d : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a b) (@ring_mult (cring_ring R1) c d)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a c) (@ring_mult (cring_ring R1) b d)) *) intros a b c d; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a b) (@ring_mult (cring_ring R1) c d)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a c) (@ring_mult (cring_ring R1) b d)) *) apply Trans with (ring_mult a (ring_mult b (ring_mult c d))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) a (@ring_mult (cring_ring R1) b (@ring_mult (cring_ring R1) c d))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a c) (@ring_mult (cring_ring R1) b d)) *) apply Trans with (ring_mult a (ring_mult (ring_mult b c) d)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) a (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) b c) d)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a c) (@ring_mult (cring_ring R1) b d)) *) apply Trans with (ring_mult a (ring_mult (ring_mult c b) d)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) a (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) c b) d)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) a c) (@ring_mult (cring_ring R1) b d)) *) apply Trans with (ring_mult a (ring_mult c (ring_mult b d))); auto with algebra. Qed. Hint Resolve CRING_mult4: algebra. Lemma CRING_mult3 : forall x y z : R1, Equal (ring_mult x (ring_mult y z)) (ring_mult y (ring_mult x z)). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) x (@ring_mult (cring_ring R1) y z)) (@ring_mult (cring_ring R1) y (@ring_mult (cring_ring R1) x z)) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) x (@ring_mult (cring_ring R1) y z)) (@ring_mult (cring_ring R1) y (@ring_mult (cring_ring R1) x z)) *) apply Trans with (ring_mult (ring_mult x y) z); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x y) z) (@ring_mult (cring_ring R1) y (@ring_mult (cring_ring R1) x z)) *) apply Trans with (ring_mult (ring_mult y x) z); auto with algebra. Qed. Hint Resolve CRING_mult3: algebra. Lemma CRING_mult3bis : forall x y z : R1, Equal (ring_mult (ring_mult x y) z) (ring_mult (ring_mult x z) y). Proof. (* Goal: forall x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x y) z) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) intros x y z; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x y) z) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult z (ring_mult x y)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) z (@ring_mult (cring_ring R1) x y)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult z (ring_mult y x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) z (@ring_mult (cring_ring R1) y x)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult y (ring_mult z x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R1)))))) (@ring_mult (cring_ring R1) y (@ring_mult (cring_ring R1) z x)) (@ring_mult (cring_ring R1) (@ring_mult (cring_ring R1) x z) y) *) apply Trans with (ring_mult (ring_mult z x) y); auto with algebra. Qed. Hint Resolve CRING_mult3bis: algebra. End Commutative_rings. Hint Resolve CRING_mult4 CRING_mult3 CRING_mult3bis: algebra. Hint Immediate CRING_com: algebra. Section Hom_lemmas. Hint Resolve RING_comp: algebra. Variable R R' : RING. Variable f : Hom R R'. Lemma RING_hom_prop : forall x y : R, Equal (f (ring_mult x y)) (ring_mult (f x) (f y)). Proof. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) (@ring_mult R x y)) (@ring_mult R' (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) y)) *) case f; auto with algebra. Qed. Lemma RING_one_prop : Equal (f (ring_unit R)) (ring_unit R'). Proof. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) (ring_unit R)) (ring_unit R') *) case f; auto with algebra. Qed. Lemma RING_hom_ext : forall f g : Hom R R', (forall x : R, Equal (f x) (g x)) -> Equal f g. Proof. (* Goal: forall (f g : Carrier (@Hom RING R R')) (_ : forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R'))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group R')))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group R))) (group_monoid (abelian_group_group (ring_group R'))) (@ring_plus_hom R R' g))) x)), @Equal (@Hom RING R R') f g *) auto with algebra. Qed. End Hom_lemmas. Hint Resolve RING_hom_prop RING_one_prop: algebra.
Require Import Coq.Arith.Arith Coq.Arith.Div2 Coq.NArith.NArith Coq.Bool.Bool Coq.ZArith.ZArith. Require Import Coq.Logic.Eqdep_dec Coq.Logic.EqdepFacts. Require Import Coq.Program.Tactics Coq.Program.Equality. Require Import Coq.setoid_ring.Ring. Require Import Coq.setoid_ring.Ring_polynom. Require Import bbv.Nomega. Require Export bbv.ZLib bbv.NatLib bbv.NLib. Require Export bbv.N_Z_nat_conversions. Require Export bbv.DepEq bbv.DepEqNat. Require Import bbv.ReservedNotations. Require Import Coq.micromega.Lia. Set Implicit Arguments. Inductive word : nat -> Set := | WO : word O | WS : bool -> forall n, word n -> word (S n). Delimit Scope word_scope with word. Bind Scope word_scope with word. Open Scope word_scope. Fixpoint wordToNat sz (w : word sz) : nat := match w with | WO => O | WS false w' => (wordToNat w') * 2 | WS true w' => S (wordToNat w' * 2) end. Fixpoint wordToNat' sz (w : word sz) : nat := match w with | WO => O | WS false w' => 2 * wordToNat w' | WS true w' => S (2 * wordToNat w') end. Fixpoint natToWord (sz n : nat) : word sz := match sz with | O => WO | S sz' => WS (mod2 n) (natToWord sz' (div2 n)) end. Fixpoint wordToN sz (w : word sz) : N := match w with | WO => 0 | WS false w' => 2 * wordToN w' | WS true w' => N.succ (2 * wordToN w') end%N. Definition wzero sz := natToWord sz 0. Fixpoint wzero' (sz : nat) : word sz := match sz with | O => WO | S sz' => WS false (wzero' sz') end. Fixpoint posToWord (sz : nat) (p : positive) {struct p} : word sz := match sz with | O => WO | S sz' => match p with | xI p' => WS true (posToWord sz' p') | xO p' => WS false (posToWord sz' p') | xH => WS true (wzero' sz') end end. Definition NToWord (sz : nat) (n : N) : word sz := match n with | N0 => wzero' sz | Npos p => posToWord sz p end. Definition wone sz := natToWord sz 1. Fixpoint wones (sz : nat) : word sz := match sz with | O => WO | S sz' => WS true (wones sz') end. Fixpoint wmsb sz (w : word sz) (a : bool) : bool := match w with | WO => a | WS b x => wmsb x b end. Definition wlsb sz (w: word (S sz)) := match w with | WO => idProp | WS b _ => b end. Definition whd sz (w : word (S sz)) : bool := match w in word sz' return match sz' with | O => unit | S _ => bool end with | WO => tt | WS b _ => b end. Definition wtl sz (w : word (S sz)) : word sz := match w in word sz' return match sz' with | O => unit | S sz'' => word sz'' end with | WO => tt | WS _ w' => w' end. Fixpoint rep_bit (n : nat) (b : word 1) : word n := match n as n0 return (word n0) with | 0 => WO | S n0 => WS (whd b) (rep_bit n0 b) end. Lemma shatter_word : forall n (a : word n), match n return word n -> Prop with | O => fun a => a = WO | S _ => fun a => a = WS (whd a) (wtl a) end a. Proof. (* Goal: forall (n : nat) (a : word n), match n as n0 return (forall _ : word n0, Prop) with | O => fun a0 : word O => @eq (word O) a0 WO | S n0 => fun a0 : word (S n0) => @eq (word (S n0)) a0 (@WS (@whd n0 a0) n0 (@wtl n0 a0)) end a *) destruct a; eauto. Qed. Lemma shatter_word_S : forall n (a : word (S n)), exists b, exists c, a = WS b c. Proof. (* Goal: forall (n : nat) (a : word (S n)), @ex bool (fun b : bool => @ex (word n) (fun c : word n => @eq (word (S n)) a (@WS b n c))) *) intros n a; repeat eexists; apply (shatter_word a). Qed. Lemma shatter_word_0 : forall a : word 0, a = WO. Proof. (* Goal: forall a : word O, @eq (word O) a WO *) intros a; apply (shatter_word a). Qed. Hint Resolve shatter_word_0. Definition weq : forall sz (x y : word sz), {x = y} + {x <> y}. Proof. (* Goal: forall (sz : nat) (x y : word sz), sumbool (@eq (word sz) x y) (not (@eq (word sz) x y)) *) refine (fix weq sz (x : word sz) : forall y : word sz, {x = y} + {x <> y} := match x in word sz return forall y : word sz, {x = y} + {x <> y} with | WO => fun _ => left _ _ | WS b x' => fun y => if bool_dec b (whd y) then if weq _ x' (wtl y) then left _ _ else right _ _ else right _ _ end); clear weq. (* Goal: not (@eq (word (S n)) (@WS b n x') y) *) (* Goal: not (@eq (word (S n)) (@WS b n x') y) *) (* Goal: @eq (word (S n)) (@WS b n x') y *) (* Goal: @eq (word O) WO w *) abstract (symmetry; apply shatter_word_0). (* Goal: not (@eq (word (S n)) (@WS b n x') y) *) (* Goal: not (@eq (word (S n)) (@WS b n x') y) *) (* Goal: @eq (word (S n)) (@WS b n x') y *) abstract (subst; symmetry; apply (shatter_word (n:=S _) _)). (* Goal: not (@eq (word (S n)) (@WS b n x') y) *) (* Goal: not (@eq (word (S n)) (@WS b n x') y) *) let y' := y in abstract (rewrite (shatter_word y'); simpl; intro H; injection H; intros; eauto using inj_pair2_eq_dec, eq_nat_dec). (* Goal: not (@eq (word (S n)) (@WS b n x') y) *) let y' := y in abstract (rewrite (shatter_word y'); simpl; intro H; injection H; auto). Qed. Fixpoint weqb sz (x : word sz) : word sz -> bool := match x in word sz return word sz -> bool with | WO => fun _ => true | WS b x' => fun y => if eqb b (whd y) then if @weqb _ x' (wtl y) then true else false else false end. Fixpoint combine (sz1 : nat) (w : word sz1) : forall sz2, word sz2 -> word (sz1 + sz2) := match w in word sz1 return forall sz2, word sz2 -> word (sz1 + sz2) with | WO => fun _ w' => w' | WS b w' => fun _ w'' => WS b (combine w' w'') end. Fixpoint split1 (sz1 sz2 : nat) : word (sz1 + sz2) -> word sz1 := match sz1 with | O => fun _ => WO | S sz1' => fun w => WS (whd w) (split1 sz1' sz2 (wtl w)) end. Fixpoint split2 (sz1 sz2 : nat) : word (sz1 + sz2) -> word sz2 := match sz1 with | O => fun w => w | S sz1' => fun w => split2 sz1' sz2 (wtl w) end. Definition sext (sz : nat) (w : word sz) (sz' : nat) : word (sz + sz') := if wmsb w false then combine w (wones sz') else combine w (wzero sz'). Definition zext (sz : nat) (w : word sz) (sz' : nat) : word (sz + sz') := combine w (wzero sz'). Definition wneg sz (x : word sz) : word sz := NToWord sz (Npow2 sz - wordToN x). Definition wordBin (f : N -> N -> N) sz (x y : word sz) : word sz := NToWord sz (f (wordToN x) (wordToN y)). Definition wplus := wordBin Nplus. Definition wmult := wordBin Nmult. Definition wdiv := wordBin N.div. Definition wmod := wordBin Nmod. Definition wmult' sz (x y : word sz) : word sz := split2 sz sz (NToWord (sz + sz) (Nmult (wordToN x) (wordToN y))). Definition wminus sz (x y : word sz) : word sz := wplus x (wneg y). Definition wnegN sz (x : word sz) : word sz := natToWord sz (pow2 sz - wordToNat x). Definition wordBinN (f : nat -> nat -> nat) sz (x y : word sz) : word sz := natToWord sz (f (wordToNat x) (wordToNat y)). Definition wplusN := wordBinN plus. Definition wmultN := wordBinN mult. Definition wmultN' sz (x y : word sz) : word sz := split2 sz sz (natToWord (sz + sz) (mult (wordToNat x) (wordToNat y))). Definition wminusN sz (x y : word sz) : word sz := wplusN x (wnegN y). Module Import ArithmeticNotations. Notation "w ~ 1" := (WS true w) : word_scope. Notation "w ~ 0" := (WS false w) : word_scope. Notation "^~" := wneg : word_scope. Notation "l ^+ r" := (@wplus _ l%word r%word) : word_scope. Notation "l ^* r" := (@wmult _ l%word r%word) : word_scope. Notation "l ^- r" := (@wminus _ l%word r%word) : word_scope. Notation "l ^/ r" := (@wdiv _ l%word r%word) : word_scope. Notation "l ^% r" := (@wmod _ l%word r%word) : word_scope. End ArithmeticNotations. Fixpoint wnot sz (w : word sz) : word sz := match w with | WO => WO | WS b w' => WS (negb b) (wnot w') end. Fixpoint bitwp (f : bool -> bool -> bool) sz (w1 : word sz) : word sz -> word sz := match w1 with | WO => fun _ => WO | WS b w1' => fun w2 => WS (f b (whd w2)) (bitwp f w1' (wtl w2)) end. Definition wnot' sz := bitwp xorb (wones sz). Definition wor := bitwp orb. Definition wand := bitwp andb. Definition wxor := bitwp xorb. Module Import BitwiseNotations. Notation "l ^| r" := (@wor _ l%word r%word) : word_scope. Notation "l ^& r" := (@wand _ l%word r%word) : word_scope. End BitwiseNotations. Definition wordToZ sz (w : word sz) : Z := if wmsb w false then match wordToN (wneg w) with | N0 => 0%Z | Npos x => Zneg x end else match wordToN w with | N0 => 0%Z | Npos x => Zpos x end. Definition uwordToZ sz (w : word sz) : Z := Z.of_N (wordToN w). Definition ZToWord (sz : nat) (z : Z) : word sz := match z with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => wneg (posToWord sz x) end. Definition wordBinZ (f : Z -> Z -> Z) sz (x y : word sz) : word sz := ZToWord sz (f (wordToZ x) (wordToZ y)). Definition wplusZ := wordBinZ Z.add. Definition wminusZ := wordBinZ Z.sub. Definition wmultZ := wordBinZ Z.mul. Definition wmultZsu sz (x y : word sz) := ZToWord sz (Z.mul (wordToZ x) (Z.of_N (wordToN y))). Definition wdivZ := wordBinZ Z.quot. Definition wdivZsu sz (x y : word sz) := ZToWord sz (Z.div (wordToZ x) (Z.of_N (wordToN y))). Definition wremZ := wordBinZ Z.rem. Definition wremZsu sz (x y : word sz) := ZToWord sz (Z.modulo (wordToZ x) (Z.of_N (wordToN y))). Definition wlt sz (l r : word sz) : Prop := N.lt (wordToN l) (wordToN r). Definition wslt sz (l r : word sz) : Prop := Z.lt (wordToZ l) (wordToZ r). Module Import ComparisonNotations. Notation "w1 > w2" := (@wlt _ w2%word w1%word) : word_scope. Notation "w1 >= w2" := (~(@wlt _ w1%word w2%word)) : word_scope. Notation "w1 < w2" := (@wlt _ w1%word w2%word) : word_scope. Notation "w1 <= w2" := (~(@wlt _ w2%word w1%word)) : word_scope. Notation "w1 '>s' w2" := (@wslt _ w2%word w1%word) : word_scope. Notation "w1 '>s=' w2" := (~(@wslt _ w1%word w2%word)) : word_scope. Notation "w1 '<s' w2" := (@wslt _ w1%word w2%word) : word_scope. Notation "w1 '<s=' w2" := (~(@wslt _ w2%word w1%word)) : word_scope. End ComparisonNotations. Definition wlt_dec : forall sz (l r : word sz), {l < r} + {l >= r}. Proof. (* Goal: forall (sz : nat) (l r : word sz), sumbool (@wlt sz l r) (not (@wlt sz l r)) *) refine (fun sz l r => match N.compare (wordToN l) (wordToN r) as k return N.compare (wordToN l) (wordToN r) = k -> _ with | Lt => fun pf => left _ _ | _ => fun pf => right _ _ end (refl_equal _)); abstract congruence. Qed. Definition wslt_dec : forall sz (l r : word sz), {l <s r} + {l >s= r}. Proof. (* Goal: forall (sz : nat) (l r : word sz), sumbool (@wslt sz l r) (not (@wslt sz l r)) *) refine (fun sz l r => match Z.compare (wordToZ l) (wordToZ r) as c return Z.compare (wordToZ l) (wordToZ r) = c -> _ with | Lt => fun pf => left _ _ | _ => fun pf => right _ _ end (refl_equal _)); abstract congruence. Qed. Definition wltb{sz: nat}(l r: word sz): bool := BinNat.N.ltb (wordToN l) (wordToN r). Definition wsltb{sz: nat}(l r: word sz): bool := Z.ltb (wordToZ l) (wordToZ r). Module Import ConversionNotations. Notation "$ n" := (natToWord _ n) : word_scope. Notation "# n" := (wordToNat n). End ConversionNotations. Fact sz_minus_nshift : forall sz nshift, (nshift < sz)%nat -> sz = sz - nshift + nshift. Proof. (* Goal: forall (sz nshift : nat) (_ : lt nshift sz), @eq nat sz (Init.Nat.add (Init.Nat.sub sz nshift) nshift) *) intros; omega. Qed. Fact nshift_plus_nkeep : forall sz nshift, (nshift < sz)%nat -> nshift + (sz - nshift) = sz. Proof. (* Goal: forall (sz nshift : nat) (_ : lt nshift sz), @eq nat (Init.Nat.add nshift (Init.Nat.sub sz nshift)) sz *) intros; omega. Qed. Definition wlshift (sz : nat) (w : word sz) (n : nat) : word sz. Proof. (* Goal: word sz *) refine (split1 sz n _). (* Goal: word (Init.Nat.add sz n) *) rewrite plus_comm. (* Goal: word (Nat.add n sz) *) exact (combine (wzero n) w). Qed. Definition wrshift (sz : nat) (w : word sz) (n : nat) : word sz. Proof. (* Goal: word sz *) refine (split2 n sz _). (* Goal: word (Init.Nat.add n sz) *) rewrite plus_comm. (* Goal: word (Nat.add sz n) *) exact (combine w (wzero n)). Qed. Definition wrshifta (sz : nat) (w : word sz) (n : nat) : word sz. Proof. (* Goal: word sz *) refine (split2 n sz _). (* Goal: word (Init.Nat.add n sz) *) rewrite plus_comm. (* Goal: word (Nat.add sz n) *) exact (sext w _). Qed. Definition wlshift' {sz : nat} (w : word sz) (n : nat) : word sz. Definition wrshift' {sz : nat} (w : word sz) (n : nat) : word sz. Definition wrshifta' {sz : nat} (w : word sz) (n : nat) : word sz. Definition extz {sz} (w: word sz) (n: nat) := combine (wzero n) w. Fixpoint wpow2 sz: word (S sz) := match sz with | O => WO~1 | S sz' => (wpow2 sz')~0 end. Module Import ShiftNotations. Notation "l ^<< r" := (@wlshift' _ l%word r) : word_scope. Notation "l ^>> r" := (@wrshift' _ l%word r) : word_scope. End ShiftNotations. Definition wbit sz sz' (n : word sz') := natToWord sz (pow2 (wordToNat n)). Hint Rewrite div2_double div2_S_double: div2. Local Hint Resolve mod2_S_double mod2_double. Theorem eq_rect_word_offset : forall n n' offset w Heq, eq_rect n (fun n => word (offset + n)) w n' Heq = eq_rect (offset + n) (fun n => word n) w (offset + n') (eq_rect_word_offset_helper _ _ _ Heq). Proof. (* Goal: forall (n n' offset : nat) (w : word (Init.Nat.add offset n)) (Heq : @eq nat n n'), @eq (word (Init.Nat.add offset n')) (@eq_rect nat n (fun n0 : nat => word (Init.Nat.add offset n0)) w n' Heq) (@eq_rect nat (Init.Nat.add offset n) (fun n0 : nat => word n0) w (Init.Nat.add offset n') (eq_rect_word_offset_helper n n' offset Heq)) *) intros. (* Goal: @eq (word (Init.Nat.add offset n')) (@eq_rect nat n (fun n : nat => word (Init.Nat.add offset n)) w n' Heq) (@eq_rect nat (Init.Nat.add offset n) (fun n : nat => word n) w (Init.Nat.add offset n') (eq_rect_word_offset_helper n n' offset Heq)) *) destruct Heq. (* Goal: @eq (word (Init.Nat.add offset n)) (@eq_rect nat n (fun n : nat => word (Init.Nat.add offset n)) w n (@eq_refl nat n)) (@eq_rect nat (Init.Nat.add offset n) (fun n : nat => word n) w (Init.Nat.add offset n) (eq_rect_word_offset_helper n n offset (@eq_refl nat n))) *) rewrite (UIP_dec eq_nat_dec (eq_rect_word_offset_helper _ _ offset eq_refl) eq_refl). (* Goal: @eq (word (Init.Nat.add offset n)) (@eq_rect nat n (fun n : nat => word (Init.Nat.add offset n)) w n (@eq_refl nat n)) (@eq_rect nat (Init.Nat.add offset n) (fun n : nat => word n) w (Init.Nat.add offset n) (@eq_refl nat (Init.Nat.add offset n))) *) reflexivity. Qed. Theorem eq_rect_word_mult : forall n n' scale w Heq, eq_rect n (fun n => word (n * scale)) w n' Heq = eq_rect (n * scale) (fun n => word n) w (n' * scale) (eq_rect_word_mult_helper _ _ _ Heq). Proof. (* Goal: forall (n n' scale : nat) (w : word (Init.Nat.mul n scale)) (Heq : @eq nat n n'), @eq (word (Init.Nat.mul n' scale)) (@eq_rect nat n (fun n0 : nat => word (Init.Nat.mul n0 scale)) w n' Heq) (@eq_rect nat (Init.Nat.mul n scale) (fun n0 : nat => word n0) w (Init.Nat.mul n' scale) (eq_rect_word_mult_helper n n' scale Heq)) *) intros. (* Goal: @eq (word (Init.Nat.mul n' scale)) (@eq_rect nat n (fun n : nat => word (Init.Nat.mul n scale)) w n' Heq) (@eq_rect nat (Init.Nat.mul n scale) (fun n : nat => word n) w (Init.Nat.mul n' scale) (eq_rect_word_mult_helper n n' scale Heq)) *) destruct Heq. (* Goal: @eq (word (Init.Nat.mul n scale)) (@eq_rect nat n (fun n : nat => word (Init.Nat.mul n scale)) w n (@eq_refl nat n)) (@eq_rect nat (Init.Nat.mul n scale) (fun n : nat => word n) w (Init.Nat.mul n scale) (eq_rect_word_mult_helper n n scale (@eq_refl nat n))) *) rewrite (UIP_dec eq_nat_dec (eq_rect_word_mult_helper _ _ scale eq_refl) eq_refl). (* Goal: @eq (word (Init.Nat.mul n scale)) (@eq_rect nat n (fun n : nat => word (Init.Nat.mul n scale)) w n (@eq_refl nat n)) (@eq_rect nat (Init.Nat.mul n scale) (fun n : nat => word n) w (Init.Nat.mul n scale) (@eq_refl nat (Init.Nat.mul n scale))) *) reflexivity. Qed. Theorem eq_rect_word_match : forall n n' (w : word n) (H : n = n'), match H in (_ = N) return (word N) with | eq_refl => w end = eq_rect n (fun n => word n) w n' H. Proof. (* Goal: forall (n n' : nat) (w : word n) (H : @eq nat n n'), @eq (word n') match H in (eq _ N) return (word N) with | eq_refl => w end (@eq_rect nat n (fun n0 : nat => word n0) w n' H) *) intros. (* Goal: @eq (word n') match H in (eq _ N) return (word N) with | eq_refl => w end (@eq_rect nat n (fun n : nat => word n) w n' H) *) destruct H. (* Goal: @eq (word n) w (@eq_rect nat n (fun n : nat => word n) w n (@eq_refl nat n)) *) rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n) w w *) reflexivity. Qed. Theorem whd_match : forall n n' (w : word (S n)) (Heq : S n = S n'), whd w = whd (match Heq in (_ = N) return (word N) with | eq_refl => w end). Proof. (* Goal: forall (n n' : nat) (w : word (S n)) (Heq : @eq nat (S n) (S n')), @eq bool (@whd n w) (@whd n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) intros. (* Goal: @eq bool (@whd n w) (@whd n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) rewrite eq_rect_word_match. (* Goal: @eq bool (@whd n w) (@whd n' (@eq_rect nat (S n) (fun n : nat => word n) w (S n') Heq)) *) generalize dependent w. (* Goal: forall w : word (S n), @eq bool (@whd n w) (@whd n' (@eq_rect nat (S n) (fun n : nat => word n) w (S n') Heq)) *) remember Heq as Heq'. (* Goal: forall w : word (S n), @eq bool (@whd n w) (@whd n' (@eq_rect nat (S n) (fun n : nat => word n) w (S n') Heq')) *) clear HeqHeq'. (* Goal: forall w : word (S n), @eq bool (@whd n w) (@whd n' (@eq_rect nat (S n) (fun n : nat => word n) w (S n') Heq')) *) generalize dependent Heq'. (* Goal: forall (Heq' : @eq nat (S n) (S n')) (w : word (S n)), @eq bool (@whd n w) (@whd n' (@eq_rect nat (S n) (fun n : nat => word n) w (S n') Heq')) *) replace (n') with (n) by omega. (* Goal: forall (Heq' : @eq nat (S n) (S n)) (w : word (S n)), @eq bool (@whd n w) (@whd n (@eq_rect nat (S n) (fun n : nat => word n) w (S n) Heq')) *) intros. (* Goal: @eq bool (@whd n w) (@whd n (@eq_rect nat (S n) (fun n : nat => word n) w (S n) Heq')) *) rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq bool (@whd n w) (@whd n w) *) reflexivity. Qed. Theorem wtl_match : forall n n' (w : word (S n)) (Heq : S n = S n') (Heq' : n = n'), (match Heq' in (_ = N) return (word N) with | eq_refl => wtl w end) = wtl (match Heq in (_ = N) return (word N) with | eq_refl => w end). Proof. (* Goal: forall (n n' : nat) (w : word (S n)) (Heq : @eq nat (S n) (S n')) (Heq' : @eq nat n n'), @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n w end (@wtl n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) intros. (* Goal: @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n w end (@wtl n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) repeat match goal with | [ |- context[match ?pf with refl_equal => _ end] ] => generalize pf end. (* Goal: forall (Heq : @eq nat (S n) (S n')) (Heq' : @eq nat n n'), @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n w end (@wtl n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) generalize dependent w; clear. (* Goal: forall (w : word (S n)) (Heq : @eq nat (S n) (S n')) (Heq' : @eq nat n n'), @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n w end (@wtl n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) intros. (* Goal: @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n w end (@wtl n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) generalize Heq Heq'. (* Goal: forall (Heq : @eq nat (S n) (S n')) (Heq' : @eq nat n n'), @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n w end (@wtl n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) subst. (* Goal: forall (Heq : @eq nat (S n') (S n')) (Heq' : @eq nat n' n'), @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n' w end (@wtl n' match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) intros. (* Goal: @eq (word n') match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl n' w end (@wtl n' match Heq0 in (eq _ N) return (word N) with | eq_refl => w end) *) rewrite (UIP_dec eq_nat_dec Heq' (refl_equal _)). (* Goal: @eq (word n') (@wtl n' w) (@wtl n' match Heq0 in (eq _ N) return (word N) with | eq_refl => w end) *) rewrite (UIP_dec eq_nat_dec Heq0 (refl_equal _)). (* Goal: @eq (word n') (@wtl n' w) (@wtl n' w) *) reflexivity. Qed. Theorem word0: forall (w : word 0), w = WO. Proof. (* Goal: forall w : word O, @eq (word O) w WO *) firstorder. Qed. Theorem wordToNat_wordToNat' : forall sz (w : word sz), wordToNat w = wordToNat' w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq nat (@wordToNat sz w) (@wordToNat' sz w) *) induction w. (* Goal: @eq nat (@wordToNat (S n) (@WS b n w)) (@wordToNat' (S n) (@WS b n w)) *) (* Goal: @eq nat (@wordToNat O WO) (@wordToNat' O WO) *) auto. (* Goal: @eq nat (@wordToNat (S n) (@WS b n w)) (@wordToNat' (S n) (@WS b n w)) *) unfold wordToNat. (* Goal: @eq nat (if b then S (Init.Nat.mul ((fix wordToNat (sz : nat) (w : word sz) {struct w} : nat := match w with | WO => O | @WS (true as b) n w' => S (Init.Nat.mul (wordToNat n w') (S (S O))) | @WS (false as b) n w' => Init.Nat.mul (wordToNat n w') (S (S O)) end) n w) (S (S O))) else Init.Nat.mul ((fix wordToNat (sz : nat) (w : word sz) {struct w} : nat := match w with | WO => O | @WS (true as b) n w' => S (Init.Nat.mul (wordToNat n w') (S (S O))) | @WS (false as b) n w' => Init.Nat.mul (wordToNat n w') (S (S O)) end) n w) (S (S O))) (@wordToNat' (S n) (@WS b n w)) *) simpl. (* Goal: @eq nat (if b then S (Init.Nat.mul ((fix wordToNat (sz : nat) (w : word sz) {struct w} : nat := match w with | WO => O | @WS (true as b) n w' => S (Init.Nat.mul (wordToNat n w') (S (S O))) | @WS (false as b) n w' => Init.Nat.mul (wordToNat n w') (S (S O)) end) n w) (S (S O))) else Init.Nat.mul ((fix wordToNat (sz : nat) (w : word sz) {struct w} : nat := match w with | WO => O | @WS (true as b) n w' => S (Init.Nat.mul (wordToNat n w') (S (S O))) | @WS (false as b) n w' => Init.Nat.mul (wordToNat n w') (S (S O)) end) n w) (S (S O))) (if b then S (Init.Nat.add (@wordToNat n w) (Init.Nat.add (@wordToNat n w) O)) else Init.Nat.add (@wordToNat n w) (Init.Nat.add (@wordToNat n w) O)) *) rewrite mult_comm. (* Goal: @eq nat (if b then S (Nat.mul (S (S O)) ((fix wordToNat (sz : nat) (w : word sz) {struct w} : nat := match w with | WO => O | @WS (true as b) n w' => S (Init.Nat.mul (wordToNat n w') (S (S O))) | @WS (false as b) n w' => Init.Nat.mul (wordToNat n w') (S (S O)) end) n w)) else Nat.mul (S (S O)) ((fix wordToNat (sz : nat) (w : word sz) {struct w} : nat := match w with | WO => O | @WS (true as b) n w' => S (Init.Nat.mul (wordToNat n w') (S (S O))) | @WS (false as b) n w' => Init.Nat.mul (wordToNat n w') (S (S O)) end) n w)) (if b then S (Init.Nat.add (@wordToNat n w) (Init.Nat.add (@wordToNat n w) O)) else Init.Nat.add (@wordToNat n w) (Init.Nat.add (@wordToNat n w) O)) *) reflexivity. Qed. Theorem natToWord_wordToNat : forall sz w, natToWord sz (wordToNat w) = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (natToWord sz (@wordToNat sz w)) w *) induction w as [|b]; rewrite wordToNat_wordToNat'; intuition; f_equal; unfold natToWord, wordToNat'; fold natToWord; fold wordToNat'; destruct b; f_equal; autorewrite with div2; intuition. Qed. Theorem roundTrip_0 : forall sz, wordToNat (natToWord sz 0) = 0. Proof. (* Goal: forall sz : nat, @eq nat (@wordToNat sz (natToWord sz O)) O *) induction sz; simpl; intuition. Qed. Hint Rewrite roundTrip_0 : wordToNat. Lemma wordToNat_natToWord' : forall sz w, exists k, wordToNat (natToWord sz w) + k * pow2 sz = w. Proof. (* Goal: forall sz w : nat, @ex nat (fun k : nat => @eq nat (Init.Nat.add (@wordToNat sz (natToWord sz w)) (Init.Nat.mul k (Nat.pow (S (S O)) sz))) w) *) induction sz as [|sz IHsz]; simpl; intro w; intuition; repeat rewrite untimes2. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (if mod2 w then S (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) else Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.mul k (S O)) w) *) exists w; intuition. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (if mod2 w then S (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) else Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) case_eq (mod2 w); intro Hmw. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (S (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O)))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) specialize (IHsz (div2 w)); firstorder. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (S (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O)))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) rewrite wordToNat_wordToNat' in *. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (S (Init.Nat.mul (@wordToNat' sz (natToWord sz (Nat.div2 w))) (S (S O)))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) let x' := match goal with H : _ + ?x * _ = _ |- _ => x end in rename x' into x. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (S (Init.Nat.mul (@wordToNat' sz (natToWord sz (Nat.div2 w))) (S (S O)))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) exists x; intuition. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (Init.Nat.add (S (Init.Nat.mul (@wordToNat' sz (natToWord sz (Nat.div2 w))) (S (S O)))) (Init.Nat.mul x (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w *) rewrite mult_assoc. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (Init.Nat.add (S (Init.Nat.mul (@wordToNat' sz (natToWord sz (Nat.div2 w))) (S (S O)))) (Nat.mul (Nat.mul x (S (S O))) (Nat.pow (S (S O)) sz))) w *) rewrite (mult_comm x 2). (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (Init.Nat.add (S (Init.Nat.mul (@wordToNat' sz (natToWord sz (Nat.div2 w))) (S (S O)))) (Nat.mul (Nat.mul (S (S O)) x) (Nat.pow (S (S O)) sz))) w *) rewrite mult_comm. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (Init.Nat.add (S (Nat.mul (S (S O)) (@wordToNat' sz (natToWord sz (Nat.div2 w))))) (Nat.mul (Nat.mul (S (S O)) x) (Nat.pow (S (S O)) sz))) w *) simpl mult at 1. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (Init.Nat.add (S (Nat.add (@wordToNat' sz (natToWord sz (Nat.div2 w))) (Nat.add (@wordToNat' sz (natToWord sz (Nat.div2 w))) O))) (Nat.mul (Nat.mul (S (S O)) x) (Nat.pow (S (S O)) sz))) w *) rewrite (plus_Sn_m (2 * wordToNat' (natToWord sz (div2 w)))). (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.mul (S (S O)) (@wordToNat' sz (natToWord sz (Nat.div2 w)))) (Nat.mul (Nat.mul (S (S O)) x) (Nat.pow (S (S O)) sz)))) w *) rewrite <- mult_assoc. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.mul (S (S O)) (@wordToNat' sz (natToWord sz (Nat.div2 w)))) (Nat.mul (S (S O)) (Nat.mul x (Nat.pow (S (S O)) sz))))) w *) rewrite <- mult_plus_distr_l. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (S (Nat.mul (S (S O)) (Nat.add (@wordToNat' sz (natToWord sz (Nat.div2 w))) (Nat.mul x (Nat.pow (S (S O)) sz))))) w *) rewrite H; clear H. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) (* Goal: @eq nat (S (Nat.mul (S (S O)) (Nat.div2 w))) w *) symmetry; apply div2_odd; auto. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) specialize (IHsz (div2 w)); firstorder. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) let x' := match goal with H : _ + ?x * _ = _ |- _ => x end in rename x' into x. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w) *) exists x; intuition. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Init.Nat.mul x (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) w *) rewrite mult_assoc. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Nat.mul (Nat.mul x (S (S O))) (Nat.pow (S (S O)) sz))) w *) rewrite (mult_comm x 2). (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Nat.mul (Nat.mul (S (S O)) x) (Nat.pow (S (S O)) sz))) w *) rewrite <- mult_assoc. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (@wordToNat sz (natToWord sz (Nat.div2 w))) (S (S O))) (Nat.mul (S (S O)) (Nat.mul x (Nat.pow (S (S O)) sz)))) w *) rewrite mult_comm. (* Goal: @eq nat (Init.Nat.add (Nat.mul (S (S O)) (@wordToNat sz (natToWord sz (Nat.div2 w)))) (Nat.mul (S (S O)) (Nat.mul x (Nat.pow (S (S O)) sz)))) w *) rewrite <- mult_plus_distr_l. (* Goal: @eq nat (Nat.mul (S (S O)) (Nat.add (@wordToNat sz (natToWord sz (Nat.div2 w))) (Nat.mul x (Nat.pow (S (S O)) sz)))) w *) match goal with H : _ |- _ => rewrite H; clear H end. (* Goal: @eq nat (Nat.mul (S (S O)) (Nat.div2 w)) w *) symmetry; apply div2_even; auto. Qed. Theorem wordToNat_natToWord: forall sz w, exists k, wordToNat (natToWord sz w) = w - k * pow2 sz /\ (k * pow2 sz <= w)%nat. Proof. (* Goal: forall sz w : nat, @ex nat (fun k : nat => and (@eq nat (@wordToNat sz (natToWord sz w)) (Init.Nat.sub w (Init.Nat.mul k (Nat.pow (S (S O)) sz)))) (le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) w)) *) intros sz w; destruct (wordToNat_natToWord' sz w) as [k]; exists k; intuition. Qed. Lemma wordToNat_natToWord_2: forall sz w : nat, (w < pow2 sz)%nat -> wordToNat (natToWord sz w) = w. Proof. (* Goal: forall (sz w : nat) (_ : lt w (Nat.pow (S (S O)) sz)), @eq nat (@wordToNat sz (natToWord sz w)) w *) intros. (* Goal: @eq nat (@wordToNat sz (natToWord sz w)) w *) pose proof (wordToNat_natToWord sz w). (* Goal: @eq nat (@wordToNat sz (natToWord sz w)) w *) destruct H0; destruct H0. (* Goal: @eq nat (@wordToNat sz (natToWord sz w)) w *) rewrite H0 in *; clear H0. (* Goal: @eq nat (Init.Nat.sub w (Init.Nat.mul x (Nat.pow (S (S O)) sz))) w *) destruct x; try omega. (* Goal: @eq nat (Init.Nat.sub w (Init.Nat.mul (S x) (Nat.pow (S (S O)) sz))) w *) exfalso; simpl in H1. (* Goal: False *) pose proof (Lt.le_lt_trans _ _ _ H1 H). (* Goal: False *) pose proof (Plus.le_plus_l (pow2 sz) (x * pow2 sz)). (* Goal: False *) pose proof (Lt.le_lt_trans _ _ _ H2 H0). (* Goal: False *) omega. Qed. Lemma natToWord_times2: forall sz x, ((natToWord sz x)~0)%word = natToWord (S sz) (2 * x). Proof. (* Goal: forall sz x : nat, @eq (word (S sz)) (@WS false sz (natToWord sz x)) (natToWord (S sz) (Init.Nat.mul (S (S O)) x)) *) intros. (* Goal: @eq (word (S sz)) (@WS false sz (natToWord sz x)) (natToWord (S sz) (Init.Nat.mul (S (S O)) x)) *) unfold natToWord. (* Goal: @eq (word (S sz)) (@WS false sz ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz x)) (@WS (mod2 (Init.Nat.mul (S (S O)) x)) sz ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz (Nat.div2 (Init.Nat.mul (S (S O)) x)))) *) fold natToWord. (* Goal: @eq (word (S sz)) (@WS false sz (natToWord sz x)) (@WS (mod2 (Init.Nat.mul (S (S O)) x)) sz (natToWord sz (Nat.div2 (Init.Nat.mul (S (S O)) x)))) *) f_equal. (* Goal: @eq (word sz) (natToWord sz x) (natToWord sz (Nat.div2 (Init.Nat.mul (S (S O)) x))) *) (* Goal: @eq bool false (mod2 (Init.Nat.mul (S (S O)) x)) *) - (* Goal: @eq bool false (mod2 (Init.Nat.mul (S (S O)) x)) *) symmetry. (* Goal: @eq bool (mod2 (Init.Nat.mul (S (S O)) x)) false *) apply mod2_double. (* BG Goal: @eq (word sz) (natToWord sz x) (natToWord sz (Nat.div2 (Init.Nat.mul (S (S O)) x))) *) - (* Goal: @eq (word sz) (natToWord sz x) (natToWord sz (Nat.div2 (Init.Nat.mul (S (S O)) x))) *) rewrite div2_double. (* Goal: @eq (word sz) (natToWord sz x) (natToWord sz x) *) reflexivity. Qed. Theorem WS_neq : forall b1 b2 sz (w1 w2 : word sz), (b1 <> b2 \/ w1 <> w2) -> WS b1 w1 <> WS b2 w2. Proof. (* Goal: forall (b1 b2 : bool) (sz : nat) (w1 w2 : word sz) (_ : or (not (@eq bool b1 b2)) (not (@eq (word sz) w1 w2))), not (@eq (word (S sz)) (@WS b1 sz w1) (@WS b2 sz w2)) *) intros b1 b2 sz w1 w2 ? H0; intuition. (* Goal: False *) (* Goal: False *) apply (f_equal (@whd _)) in H0; tauto. (* Goal: False *) apply (f_equal (@wtl _)) in H0; tauto. Qed. Theorem weqb_true_iff : forall sz x y, @weqb sz x y = true <-> x = y. Proof. (* Goal: forall (sz : nat) (x y : word sz), iff (@eq bool (@weqb sz x y) true) (@eq (word sz) x y) *) induction x as [|b ? x IHx]; simpl; intros y. (* Goal: iff (@eq bool (if eqb b (@whd n y) then if @weqb n x (@wtl n y) then true else false else false) true) (@eq (word (S n)) (@WS b n x) y) *) (* Goal: iff (@eq bool true true) (@eq (word O) WO y) *) { (* Goal: iff (@eq bool true true) (@eq (word O) WO y) *) split; auto. (* BG Goal: iff (@eq bool (if eqb b (@whd n y) then if @weqb n x (@wtl n y) then true else false else false) true) (@eq (word (S n)) (@WS b n x) y) *) } (* Goal: iff (@eq bool (if eqb b (@whd n y) then if @weqb n x (@wtl n y) then true else false else false) true) (@eq (word (S n)) (@WS b n x) y) *) { (* Goal: iff (@eq bool (if eqb b (@whd n y) then if @weqb n x (@wtl n y) then true else false else false) true) (@eq (word (S n)) (@WS b n x) y) *) rewrite (shatter_word y) in *. (* Goal: iff (@eq bool (if eqb b (@whd n (@WS (@whd n y) n (@wtl n y))) then if @weqb n x (@wtl n (@WS (@whd n y) n (@wtl n y))) then true else false else false) true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) simpl in *. (* Goal: iff (@eq bool (if eqb b (@whd n y) then if @weqb n x (@wtl n y) then true else false else false) true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) case_eq (eqb b (whd y)); intros H. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: iff (@eq bool (if @weqb n x (@wtl n y) then true else false) true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) case_eq (weqb x (wtl y)); intros H0. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: iff (@eq bool true true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) split; auto; intros. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: @eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y)) *) rewrite eqb_true_iff in H. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: @eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y)) *) f_equal; eauto. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: @eq (word n) x (@wtl n y) *) eapply IHx; eauto. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) split; intros H1; try congruence. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: @eq bool false true *) inversion H1; clear H1; subst. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: @eq bool false true *) eapply inj_pair2_eq_dec in H4. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: forall x y : nat, sumbool (@eq nat x y) (not (@eq nat x y)) *) (* Goal: @eq bool false true *) eapply IHx in H4. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: forall x y : nat, sumbool (@eq nat x y) (not (@eq nat x y)) *) (* Goal: @eq bool false true *) congruence. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) (* Goal: forall x y : nat, sumbool (@eq nat x y) (not (@eq nat x y)) *) eapply Peano_dec.eq_nat_dec. (* Goal: iff (@eq bool false true) (@eq (word (S n)) (@WS b n x) (@WS (@whd n y) n (@wtl n y))) *) split; intros; try congruence. (* Goal: @eq bool false true *) inversion H0. (* Goal: @eq bool false true *) apply eqb_false_iff in H. (* Goal: @eq bool false true *) congruence. Qed. Ltac shatterer := simpl; intuition; match goal with | [ w : _ |- _ ] => rewrite (shatter_word w); simpl end; f_equal; auto. Theorem combine_split : forall sz1 sz2 (w : word (sz1 + sz2)), combine (split1 sz1 sz2 w) (split2 sz1 sz2 w) = w. Proof. (* Goal: forall (sz1 sz2 : nat) (w : word (Init.Nat.add sz1 sz2)), @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (split1 sz1 sz2 w) sz2 (split2 sz1 sz2 w)) w *) induction sz1; shatterer. Qed. Theorem split1_combine : forall sz1 sz2 (w : word sz1) (z : word sz2), split1 sz1 sz2 (combine w z) = w. Proof. (* Goal: forall (sz1 sz2 : nat) (w : word sz1) (z : word sz2), @eq (word sz1) (split1 sz1 sz2 (@combine sz1 w sz2 z)) w *) induction sz1; shatterer. Qed. Theorem split2_combine : forall sz1 sz2 (w : word sz1) (z : word sz2), split2 sz1 sz2 (combine w z) = z. Proof. (* Goal: forall (sz1 sz2 : nat) (w : word sz1) (z : word sz2), @eq (word sz2) (split2 sz1 sz2 (@combine sz1 w sz2 z)) z *) induction sz1; shatterer. Qed. Hint Rewrite combine_split. Hint Rewrite split1_combine. Hint Rewrite split2_combine. Theorem combine_assoc : forall n1 (w1 : word n1) n2 n3 (w2 : word n2) (w3 : word n3) Heq, combine (combine w1 w2) w3 = match Heq in _ = N return word N with | refl_equal => combine w1 (combine w2 w3) end. Proof. (* Goal: forall (n1 : nat) (w1 : word n1) (n2 n3 : nat) (w2 : word n2) (w3 : word n3) (Heq : @eq nat (Init.Nat.add n1 (Init.Nat.add n2 n3)) (Init.Nat.add (Init.Nat.add n1 n2) n3)), @eq (word (Init.Nat.add (Init.Nat.add n1 n2) n3)) (@combine (Init.Nat.add n1 n2) (@combine n1 w1 n2 w2) n3 w3) match Heq in (eq _ N) return (word N) with | eq_refl => @combine n1 w1 (Init.Nat.add n2 n3) (@combine n2 w2 n3 w3) end *) induction w1 as [|?? w1 IHw1]; simpl; intros n2 n3 w2 w3 Heq; intuition. (* Goal: @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) (@combine (Init.Nat.add n n2) (@combine n w1 n2 w2) n3 w3)) match Heq in (eq _ N) return (word N) with | eq_refl => @WS b (Init.Nat.add n (Init.Nat.add n2 n3)) (@combine n w1 (Init.Nat.add n2 n3) (@combine n2 w2 n3 w3)) end *) (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 w2 n3 w3) match Heq in (eq _ N) return (word N) with | eq_refl => @combine n2 w2 n3 w3 end *) rewrite (UIP_dec eq_nat_dec Heq (refl_equal _)); reflexivity. (* Goal: @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) (@combine (Init.Nat.add n n2) (@combine n w1 n2 w2) n3 w3)) match Heq in (eq _ N) return (word N) with | eq_refl => @WS b (Init.Nat.add n (Init.Nat.add n2 n3)) (@combine n w1 (Init.Nat.add n2 n3) (@combine n2 w2 n3 w3)) end *) rewrite (IHw1 _ _ _ _ (plus_assoc _ _ _)); clear IHw1. (* Goal: @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) match Nat.add_assoc n n2 n3 in (eq _ N) return (word N) with | eq_refl => @combine n w1 (Init.Nat.add n2 n3) (@combine n2 w2 n3 w3) end) match Heq in (eq _ N) return (word N) with | eq_refl => @WS b (Init.Nat.add n (Init.Nat.add n2 n3)) (@combine n w1 (Init.Nat.add n2 n3) (@combine n2 w2 n3 w3)) end *) repeat match goal with | [ |- context[match ?pf with refl_equal => _ end] ] => generalize pf end. (* Goal: forall (Heq : @eq nat (S (Init.Nat.add n (Init.Nat.add n2 n3))) (S (Init.Nat.add (Init.Nat.add n n2) n3))) (e : @eq nat (Nat.add n (Nat.add n2 n3)) (Nat.add (Nat.add n n2) n3)), @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) match e in (eq _ N) return (word N) with | eq_refl => @combine n w1 (Init.Nat.add n2 n3) (@combine n2 w2 n3 w3) end) match Heq in (eq _ N) return (word N) with | eq_refl => @WS b (Init.Nat.add n (Init.Nat.add n2 n3)) (@combine n w1 (Init.Nat.add n2 n3) (@combine n2 w2 n3 w3)) end *) generalize dependent (combine w1 (combine w2 w3)). (* Goal: forall (w : word (Init.Nat.add n (Init.Nat.add n2 n3))) (Heq : @eq nat (S (Init.Nat.add n (Init.Nat.add n2 n3))) (S (Init.Nat.add (Init.Nat.add n n2) n3))) (e : @eq nat (Nat.add n (Nat.add n2 n3)) (Nat.add (Nat.add n n2) n3)), @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) match e in (eq _ N) return (word N) with | eq_refl => w end) match Heq in (eq _ N) return (word N) with | eq_refl => @WS b (Init.Nat.add n (Init.Nat.add n2 n3)) w end *) rewrite plus_assoc; intros w Heq0 e. (* Goal: @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) match e in (eq _ N) return (word N) with | eq_refl => w end) match Heq0 in (eq _ N) return (word N) with | eq_refl => @WS b (Nat.add (Nat.add n n2) n3) w end *) rewrite (UIP_dec eq_nat_dec e (refl_equal _)). (* Goal: @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) w) match Heq0 in (eq _ N) return (word N) with | eq_refl => @WS b (Nat.add (Nat.add n n2) n3) w end *) rewrite (UIP_dec eq_nat_dec Heq0 (refl_equal _)). (* Goal: @eq (word (S (Init.Nat.add (Init.Nat.add n n2) n3))) (@WS b (Init.Nat.add (Init.Nat.add n n2) n3) w) (@WS b (Nat.add (Nat.add n n2) n3) w) *) reflexivity. Qed. Theorem split1_iter : forall n1 n2 n3 Heq w, split1 n1 n2 (split1 (n1 + n2) n3 w) = split1 n1 (n2 + n3) (match Heq in _ = N return word N with | refl_equal => w end). Proof. (* Goal: forall (n1 n2 n3 : nat) (Heq : @eq nat (Init.Nat.add (Init.Nat.add n1 n2) n3) (Init.Nat.add n1 (Init.Nat.add n2 n3))) (w : word (Init.Nat.add (Init.Nat.add n1 n2) n3)), @eq (word n1) (split1 n1 n2 (split1 (Init.Nat.add n1 n2) n3 w)) (split1 n1 (Init.Nat.add n2 n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) induction n1; simpl; intuition. (* Goal: @eq (word (S n1)) (@WS (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w) n1 (split1 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w)))) (@WS (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end) n1 (split1 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) *) f_equal. (* Goal: @eq (word n1) (split1 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w))) (split1 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) (* Goal: @eq bool (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w) (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) apply whd_match. (* Goal: @eq (word n1) (split1 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w))) (split1 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) assert (n1 + n2 + n3 = n1 + (n2 + n3)) as Heq' by omega. (* Goal: @eq (word n1) (split1 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w))) (split1 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) rewrite IHn1 with (Heq:=Heq'). (* Goal: @eq (word n1) (split1 n1 (Init.Nat.add n2 n3) match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w end) (split1 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) f_equal. (* Goal: @eq (word (Init.Nat.add n1 (Init.Nat.add n2 n3))) match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w end (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) apply wtl_match. Qed. Theorem split2_iter : forall n1 n2 n3 Heq w, split2 n2 n3 (split2 n1 (n2 + n3) w) = split2 (n1 + n2) n3 (match Heq in _ = N return word N with | refl_equal => w end). Proof. (* Goal: forall (n1 n2 n3 : nat) (Heq : @eq nat (Init.Nat.add n1 (Init.Nat.add n2 n3)) (Init.Nat.add (Init.Nat.add n1 n2) n3)) (w : word (Init.Nat.add n1 (Init.Nat.add n2 n3))), @eq (word n3) (split2 n2 n3 (split2 n1 (Init.Nat.add n2 n3) w)) (split2 (Init.Nat.add n1 n2) n3 match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) induction n1 as [|n1 IHn1]; simpl; intros n2 n3 Heq w; intuition. (* Goal: @eq (word n3) (split2 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) (* Goal: @eq (word n3) (split2 n2 n3 w) (split2 n2 n3 match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) rewrite (UIP_dec eq_nat_dec Heq (refl_equal _)); reflexivity. (* Goal: @eq (word n3) (split2 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) rewrite (IHn1 _ _ (plus_assoc _ _ _)). (* Goal: @eq (word n3) (split2 (Init.Nat.add n1 n2) n3 match Nat.add_assoc n1 n2 n3 in (eq _ N) return (word N) with | eq_refl => @wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w end) (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) f_equal. (* Goal: @eq (word (Nat.add (Nat.add n1 n2) n3)) match Nat.add_assoc n1 n2 n3 in (eq _ N) return (word N) with | eq_refl => @wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w end (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) apply wtl_match. Qed. Theorem split1_split2 : forall n1 n2 n3 Heq w, split1 n2 n3 (split2 n1 (n2 + n3) w) = split2 n1 n2 (split1 (n1 + n2) n3 (match Heq in _ = N return word N with | refl_equal => w end)). Proof. (* Goal: forall (n1 n2 n3 : nat) (Heq : @eq nat (Init.Nat.add n1 (Init.Nat.add n2 n3)) (Init.Nat.add (Init.Nat.add n1 n2) n3)) (w : word (Init.Nat.add n1 (Init.Nat.add n2 n3))), @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) w)) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) induction n1; simpl; intros. (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) *) (* Goal: @eq (word n2) (split1 n2 n3 w) (split1 n2 n3 match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) rewrite (UIP_dec eq_nat_dec Heq (refl_equal _)). (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) *) (* Goal: @eq (word n2) (split1 n2 n3 w) (split1 n2 n3 w) *) reflexivity. (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) *) rewrite (shatter_word w). (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) (@WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end))) *) simpl. (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end))) *) assert (n1 + (n2 + n3) = n1 + n2 + n3) as Heq' by omega. (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end))) *) rewrite <- wtl_match with (Heq':=Heq'). (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w)) end)) *) rewrite <- IHn1. (* Goal: @eq (word n2) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))))) *) f_equal. Qed. Theorem split2_split1 : forall n1 n2 n3 Heq w, split2 n1 n2 (split1 (n1+n2) n3 w) = split1 n2 n3 (split2 n1 (n2+n3) (match Heq in _ = N return word N with | refl_equal => w end)). Proof. (* Goal: forall (n1 n2 n3 : nat) (Heq : @eq nat (Init.Nat.add (Init.Nat.add n1 n2) n3) (Init.Nat.add n1 (Init.Nat.add n2 n3))) (w : word (Init.Nat.add (Init.Nat.add n1 n2) n3)), @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 w)) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end)) *) induction n1; simpl; intros. (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) *) (* Goal: @eq (word n2) (split1 n2 n3 w) (split1 n2 n3 match Heq in (eq _ N) return (word N) with | eq_refl => w end) *) rewrite (UIP_dec eq_nat_dec Heq (refl_equal _)). (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) *) (* Goal: @eq (word n2) (split1 n2 n3 w) (split1 n2 n3 w) *) reflexivity. (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) w))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) *) rewrite (shatter_word w). (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) (@WS (@whd (Init.Nat.add (Init.Nat.add n1 n2) n3) w) (Init.Nat.add (Init.Nat.add n1 n2) n3) (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w))))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add (Init.Nat.add n1 n2) n3) w) (Init.Nat.add (Init.Nat.add n1 n2) n3) (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w) end))) *) simpl. (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add (Init.Nat.add n1 n2) n3) w) (Init.Nat.add (Init.Nat.add n1 n2) n3) (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w) end))) *) assert (n1 + n2 + n3 = n1 + (n2 + n3)) as Heq' by omega. (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add (Init.Nat.add n1 n2) n3) w) (Init.Nat.add (Init.Nat.add n1 n2) n3) (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w) end))) *) rewrite <- wtl_match with (Heq':=Heq'). (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w))) (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) match Heq' in (eq _ N) return (word N) with | eq_refl => @wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) (@WS (@whd (Init.Nat.add (Init.Nat.add n1 n2) n3) w) (Init.Nat.add (Init.Nat.add n1 n2) n3) (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w)) end)) *) rewrite <- IHn1. (* Goal: @eq (word n2) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w))) (split2 n1 n2 (split1 (Init.Nat.add n1 n2) n3 (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) (@WS (@whd (Init.Nat.add (Init.Nat.add n1 n2) n3) w) (Init.Nat.add (Init.Nat.add n1 n2) n3) (@wtl (Init.Nat.add (Init.Nat.add n1 n2) n3) w))))) *) f_equal. Qed. Theorem combine_0_n : forall sz2 (w: word 0) (v: word sz2), combine w v = v. Proof. (* Goal: forall (sz2 : nat) (w : word O) (v : word sz2), @eq (word (Init.Nat.add O sz2)) (@combine O w sz2 v) v *) intros. (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O w sz2 v) v *) replace w with WO. (* Goal: @eq (word O) WO w *) (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O WO sz2 v) v *) auto. (* Goal: @eq (word O) WO w *) rewrite word0; auto. Qed. Lemma WS_eq_rect : forall b n (w: word n) n' H H', eq_rect _ word (@WS b n w) _ H = @WS b n' (eq_rect _ word w _ H'). Proof. (* Goal: forall (b : bool) (n : nat) (w : word n) (n' : nat) (H : @eq nat (S n) (S n')) (H' : @eq nat n n'), @eq (word (S n')) (@eq_rect nat (S n) word (@WS b n w) (S n') H) (@WS b n' (@eq_rect nat n word w n' H')) *) destruct n; intros; subst; eq_rect_simpl; auto. Qed. Theorem combine_eq_rect2 : forall sz n n' (H: n = n') H' (a: word sz) (b: word n), combine a b = eq_rect _ word (combine a (eq_rect _ word b _ H)) _ H'. Theorem combine_n_0 : forall sz1 (w : word sz1) (v : word 0), combine w v = eq_rect _ word w _ (plus_n_O sz1). Lemma whd_eq_rect : forall n w Heq, whd (eq_rect (S n) word w (S (n + 0)) Heq) = whd w. Proof. (* Goal: forall (n : nat) (w : word (S n)) (Heq : @eq nat (S n) (S (Init.Nat.add n O))), @eq bool (@whd (Init.Nat.add n O) (@eq_rect nat (S n) word w (S (Init.Nat.add n O)) Heq)) (@whd n w) *) intros. (* Goal: @eq bool (@whd (Init.Nat.add n O) (@eq_rect nat (S n) word w (S (Init.Nat.add n O)) Heq)) (@whd n w) *) generalize Heq. (* Goal: forall Heq : @eq nat (S n) (S (Init.Nat.add n O)), @eq bool (@whd (Init.Nat.add n O) (@eq_rect nat (S n) word w (S (Init.Nat.add n O)) Heq)) (@whd n w) *) replace (n + 0) with n by omega. (* Goal: forall Heq : @eq nat (S n) (S n), @eq bool (@whd n (@eq_rect nat (S n) word w (S n) Heq)) (@whd n w) *) intros. (* Goal: @eq bool (@whd n (@eq_rect nat (S n) word w (S n) Heq0)) (@whd n w) *) f_equal. (* Goal: @eq (word (S n)) (@eq_rect nat (S n) word w (S n) Heq0) w *) eq_rect_simpl. (* Goal: @eq (word (S n)) w w *) reflexivity. Qed. Lemma wtl_eq_rect : forall n w Heq Heq', wtl (eq_rect (S n) word w (S (n + 0)) Heq) = eq_rect n word (wtl w) (n + 0) Heq'. Proof. (* Goal: forall (n : nat) (w : word (S n)) (Heq : @eq nat (S n) (S (Init.Nat.add n O))) (Heq' : @eq nat n (Init.Nat.add n O)), @eq (word (Init.Nat.add n O)) (@wtl (Init.Nat.add n O) (@eq_rect nat (S n) word w (S (Init.Nat.add n O)) Heq)) (@eq_rect nat n word (@wtl n w) (Init.Nat.add n O) Heq') *) intros. (* Goal: @eq (word (Init.Nat.add n O)) (@wtl (Init.Nat.add n O) (@eq_rect nat (S n) word w (S (Init.Nat.add n O)) Heq)) (@eq_rect nat n word (@wtl n w) (Init.Nat.add n O) Heq') *) generalize dependent Heq. (* Goal: forall Heq : @eq nat (S n) (S (Init.Nat.add n O)), @eq (word (Init.Nat.add n O)) (@wtl (Init.Nat.add n O) (@eq_rect nat (S n) word w (S (Init.Nat.add n O)) Heq)) (@eq_rect nat n word (@wtl n w) (Init.Nat.add n O) Heq') *) rewrite <- Heq'; simpl; intros. (* Goal: @eq (word n) (@wtl n (@eq_rect nat (S n) word w (S n) Heq)) (@wtl n w) *) rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n) (@wtl n w) (@wtl n w) *) reflexivity. Qed. Lemma whd_eq_rect_mul : forall n w Heq, whd (eq_rect (S n) word w (S (n * 1)) Heq) = whd w. Proof. (* Goal: forall (n : nat) (w : word (S n)) (Heq : @eq nat (S n) (S (Init.Nat.mul n (S O)))), @eq bool (@whd (Init.Nat.mul n (S O)) (@eq_rect nat (S n) word w (S (Init.Nat.mul n (S O))) Heq)) (@whd n w) *) intros. (* Goal: @eq bool (@whd (Init.Nat.mul n (S O)) (@eq_rect nat (S n) word w (S (Init.Nat.mul n (S O))) Heq)) (@whd n w) *) generalize Heq. (* Goal: forall Heq : @eq nat (S n) (S (Init.Nat.mul n (S O))), @eq bool (@whd (Init.Nat.mul n (S O)) (@eq_rect nat (S n) word w (S (Init.Nat.mul n (S O))) Heq)) (@whd n w) *) replace (n * 1) with n by auto. (* Goal: forall Heq : @eq nat (S n) (S n), @eq bool (@whd n (@eq_rect nat (S n) word w (S n) Heq)) (@whd n w) *) intros. (* Goal: @eq bool (@whd n (@eq_rect nat (S n) word w (S n) Heq0)) (@whd n w) *) eq_rect_simpl. (* Goal: @eq bool (@whd n w) (@whd n w) *) reflexivity. Qed. Lemma wtl_eq_rect_mul : forall n w b Heq Heq', wtl (eq_rect (S n) word (WS b w) (S (n * 1)) Heq) = eq_rect _ word w _ Heq'. Proof. (* Goal: forall (n : nat) (w : word n) (b : bool) (Heq : @eq nat (S n) (S (Init.Nat.mul n (S O)))) (Heq' : @eq nat n (Init.Nat.mul n (S O))), @eq (word (Init.Nat.mul n (S O))) (@wtl (Init.Nat.mul n (S O)) (@eq_rect nat (S n) word (@WS b n w) (S (Init.Nat.mul n (S O))) Heq)) (@eq_rect nat n word w (Init.Nat.mul n (S O)) Heq') *) intros. (* Goal: @eq (word (Init.Nat.mul n (S O))) (@wtl (Init.Nat.mul n (S O)) (@eq_rect nat (S n) word (@WS b n w) (S (Init.Nat.mul n (S O))) Heq)) (@eq_rect nat n word w (Init.Nat.mul n (S O)) Heq') *) generalize Heq. (* Goal: forall Heq : @eq nat (S n) (S (Init.Nat.mul n (S O))), @eq (word (Init.Nat.mul n (S O))) (@wtl (Init.Nat.mul n (S O)) (@eq_rect nat (S n) word (@WS b n w) (S (Init.Nat.mul n (S O))) Heq)) (@eq_rect nat n word w (Init.Nat.mul n (S O)) Heq') *) rewrite <- Heq'. (* Goal: forall Heq : @eq nat (S n) (S n), @eq (word n) (@wtl n (@eq_rect nat (S n) word (@WS b n w) (S n) Heq)) (@eq_rect nat n word w n (@eq_refl nat n)) *) intros. (* Goal: @eq (word n) (@wtl n (@eq_rect nat (S n) word (@WS b n w) (S n) Heq0)) (@eq_rect nat n word w n (@eq_refl nat n)) *) eq_rect_simpl. (* Goal: @eq (word n) (@wtl n (@WS b n w)) w *) reflexivity. Qed. Theorem split1_0 : forall n w Heq, split1 n 0 (eq_rect _ word w _ Heq) = w. Theorem split2_0 : forall n w Heq, split2 0 n (eq_rect _ word w _ Heq) = w. Proof. (* Goal: forall (n : nat) (w : word n) (Heq : @eq nat n (Init.Nat.add O n)), @eq (word n) (split2 O n (@eq_rect nat n word w (Init.Nat.add O n) Heq)) w *) intros. (* Goal: @eq (word n) (split2 O n (@eq_rect nat n word w (Init.Nat.add O n) Heq)) w *) simpl. (* Goal: @eq (word n) (@eq_rect nat n word w n Heq) w *) eq_rect_simpl. (* Goal: @eq (word n) w w *) reflexivity. Qed. Theorem combine_end : forall n1 n2 n3 Heq w, combine (split1 n2 n3 (split2 n1 (n2 + n3) w)) (split2 (n1 + n2) n3 (match Heq in _ = N return word N with | refl_equal => w end)) = split2 n1 (n2 + n3) w. Proof. (* Goal: forall (n1 n2 n3 : nat) (Heq : @eq nat (Init.Nat.add n1 (Init.Nat.add n2 n3)) (Init.Nat.add (Init.Nat.add n1 n2) n3)) (w : word (Init.Nat.add n1 (Init.Nat.add n2 n3))), @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) w)) n3 (split2 (Init.Nat.add n1 n2) n3 match Heq in (eq _ N) return (word N) with | eq_refl => w end)) (split2 n1 (Init.Nat.add n2 n3) w) *) induction n1 as [|n1 IHn1]; simpl; intros n2 n3 Heq w. (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) n3 (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w)) *) (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 w) n3 (split2 n2 n3 match Heq in (eq _ N) return (word N) with | eq_refl => w end)) w *) rewrite (UIP_dec eq_nat_dec Heq (refl_equal _)). (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) n3 (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w)) *) (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 w) n3 (split2 n2 n3 w)) w *) apply combine_split. (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w))) n3 (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => w end))) (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) w)) *) rewrite (shatter_word w) in *. (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) (@WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))))) n3 (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end))) (split2 n1 (Init.Nat.add n2 n3) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n1 (Init.Nat.add n2 n3)) (@WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w)))) *) simpl. (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))) n3 (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end))) (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w)) *) eapply trans_eq; [ | apply IHn1 with (Heq := plus_assoc _ _ _) ]; clear IHn1. (* Goal: @eq (word (Init.Nat.add n2 n3)) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))) n3 (split2 (Init.Nat.add n1 n2) n3 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end))) (@combine n2 (split1 n2 n3 (split2 n1 (Init.Nat.add n2 n3) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w))) n3 (split2 (Init.Nat.add n1 n2) n3 match Nat.add_assoc n1 n2 n3 in (eq _ N) return (word N) with | eq_refl => @wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w end)) *) repeat f_equal. (* Goal: @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end) match Nat.add_assoc n1 n2 n3 in (eq _ N) return (word N) with | eq_refl => @wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w end *) repeat match goal with | [ |- context[match ?pf with refl_equal => _ end] ] => generalize pf end. (* Goal: forall (e : @eq nat (Nat.add n1 (Nat.add n2 n3)) (Nat.add (Nat.add n1 n2) n3)) (Heq : @eq nat (S (Init.Nat.add n1 (Init.Nat.add n2 n3))) (S (Init.Nat.add (Init.Nat.add n1 n2) n3))), @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end) match e in (eq _ N) return (word N) with | eq_refl => @wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w end *) simpl. (* Goal: forall (e : @eq nat (Nat.add n1 (Nat.add n2 n3)) (Nat.add (Nat.add n1 n2) n3)) (Heq : @eq nat (S (Init.Nat.add n1 (Init.Nat.add n2 n3))) (S (Init.Nat.add (Init.Nat.add n1 n2) n3))), @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end) match e in (eq _ N) return (word N) with | eq_refl => @wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w end *) generalize dependent w. (* Goal: forall (w : word (S (Init.Nat.add n1 (Init.Nat.add n2 n3)))) (e : @eq nat (Nat.add n1 (Nat.add n2 n3)) (Nat.add (Nat.add n1 n2) n3)) (Heq : @eq nat (S (Init.Nat.add n1 (Init.Nat.add n2 n3))) (S (Init.Nat.add (Init.Nat.add n1 n2) n3))), @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) (Init.Nat.add n1 (Init.Nat.add n2 n3)) (@wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w) end) match e in (eq _ N) return (word N) with | eq_refl => @wtl (Init.Nat.add n1 (Init.Nat.add n2 n3)) w end *) rewrite plus_assoc. (* Goal: forall (w : word (S (Nat.add (Nat.add n1 n2) n3))) (e : @eq nat (Nat.add (Nat.add n1 n2) n3) (Nat.add (Nat.add n1 n2) n3)) (Heq : @eq nat (S (Nat.add (Nat.add n1 n2) n3)) (S (Init.Nat.add (Init.Nat.add n1 n2) n3))), @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Nat.add (Nat.add n1 n2) n3) w) (Nat.add (Nat.add n1 n2) n3) (@wtl (Nat.add (Nat.add n1 n2) n3) w) end) match e in (eq _ N) return (word N) with | eq_refl => @wtl (Nat.add (Nat.add n1 n2) n3) w end *) intros. (* Goal: @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq0 in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Nat.add (Nat.add n1 n2) n3) w) (Nat.add (Nat.add n1 n2) n3) (@wtl (Nat.add (Nat.add n1 n2) n3) w) end) match e in (eq _ N) return (word N) with | eq_refl => @wtl (Nat.add (Nat.add n1 n2) n3) w end *) rewrite (UIP_dec eq_nat_dec e (refl_equal _)). (* Goal: @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) match Heq0 in (eq _ N) return (word N) with | eq_refl => @WS (@whd (Nat.add (Nat.add n1 n2) n3) w) (Nat.add (Nat.add n1 n2) n3) (@wtl (Nat.add (Nat.add n1 n2) n3) w) end) (@wtl (Nat.add (Nat.add n1 n2) n3) w) *) rewrite (UIP_dec eq_nat_dec Heq0 (refl_equal _)). (* Goal: @eq (word ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3)) (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) (Init.Nat.add n1 n2) n3) (@WS (@whd (Nat.add (Nat.add n1 n2) n3) w) (Nat.add (Nat.add n1 n2) n3) (@wtl (Nat.add (Nat.add n1 n2) n3) w))) (@wtl (Nat.add (Nat.add n1 n2) n3) w) *) reflexivity. Qed. Theorem eq_rect_combine : forall n1 n2 n2' (w1 : word n1) (w2 : word n2') Heq, eq_rect (n1 + n2') (fun n => word n) (combine w1 w2) (n1 + n2) Heq = combine w1 (eq_rect n2' (fun n => word n) w2 n2 (plus_reg_l _ _ _ Heq)). Proof. (* Goal: forall (n1 n2 n2' : nat) (w1 : word n1) (w2 : word n2') (Heq : @eq nat (Init.Nat.add n1 n2') (Init.Nat.add n1 n2)), @eq (word (Init.Nat.add n1 n2)) (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) (@combine n1 w1 n2' w2) (Init.Nat.add n1 n2) Heq) (@combine n1 w1 n2 (@eq_rect nat n2' (fun n : nat => word n) w2 n2 (plus_reg_l n2' n2 n1 Heq))) *) intros. (* Goal: @eq (word (Init.Nat.add n1 n2)) (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) (@combine n1 w1 n2' w2) (Init.Nat.add n1 n2) Heq) (@combine n1 w1 n2 (@eq_rect nat n2' (fun n : nat => word n) w2 n2 (plus_reg_l n2' n2 n1 Heq))) *) generalize (plus_reg_l n2' n2 n1 Heq); intros. (* Goal: @eq (word (Init.Nat.add n1 n2)) (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) (@combine n1 w1 n2' w2) (Init.Nat.add n1 n2) Heq) (@combine n1 w1 n2 (@eq_rect nat n2' (fun n : nat => word n) w2 n2 e)) *) generalize dependent Heq. (* Goal: forall Heq : @eq nat (Init.Nat.add n1 n2') (Init.Nat.add n1 n2), @eq (word (Init.Nat.add n1 n2)) (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) (@combine n1 w1 n2' w2) (Init.Nat.add n1 n2) Heq) (@combine n1 w1 n2 (@eq_rect nat n2' (fun n : nat => word n) w2 n2 e)) *) generalize dependent w2. (* Goal: forall (w2 : word n2') (Heq : @eq nat (Init.Nat.add n1 n2') (Init.Nat.add n1 n2)), @eq (word (Init.Nat.add n1 n2)) (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) (@combine n1 w1 n2' w2) (Init.Nat.add n1 n2) Heq) (@combine n1 w1 n2 (@eq_rect nat n2' (fun n : nat => word n) w2 n2 e)) *) rewrite e; intros. (* Goal: @eq (word (Init.Nat.add n1 n2)) (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) (@combine n1 w1 n2 w2) (Init.Nat.add n1 n2) Heq) (@combine n1 w1 n2 (@eq_rect nat n2 (fun n : nat => word n) w2 n2 (@eq_refl nat n2))) *) repeat rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word (Init.Nat.add n1 n2)) (@combine n1 w1 n2 w2) (@combine n1 w1 n2 w2) *) reflexivity. Qed. Lemma eq_rect_combine_assoc' : forall a b c H wa wb wc, eq_rect (a + (b + c)) word (combine wa (combine wb wc)) _ H = combine (combine wa wb) wc. Lemma eq_rect_split2_helper : forall a b c, a = b -> c + a = c + b. Proof. (* Goal: forall (a b c : nat) (_ : @eq nat a b), @eq nat (Init.Nat.add c a) (Init.Nat.add c b) *) intros; omega. Qed. Theorem eq_rect_split2 : forall n1 n2 n2' (w : word (n1 + n2')) Heq, eq_rect n2' (fun n => word n) (split2 n1 n2' w) n2 Heq = split2 n1 n2 (eq_rect (n1+n2') (fun n => word n) w (n1+n2) (eq_rect_split2_helper _ Heq)). Proof. (* Goal: forall (n1 n2 n2' : nat) (w : word (Init.Nat.add n1 n2')) (Heq : @eq nat n2' n2), @eq (word n2) (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2) (@eq_rect_split2_helper n2' n2 n1 Heq))) *) intros. (* Goal: @eq (word n2) (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2) (@eq_rect_split2_helper n2' n2 n1 Heq))) *) generalize (eq_rect_split2_helper n1 Heq); intros. (* Goal: @eq (word n2) (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) generalize dependent Heq. (* Goal: forall Heq : @eq nat n2' n2, @eq (word n2) (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) generalize dependent w. (* Goal: forall (w : word (Init.Nat.add n1 n2')) (Heq : @eq nat n2' n2), @eq (word n2) (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) assert (n2' = n2) as H' by omega. (* Goal: forall (w : word (Init.Nat.add n1 n2')) (Heq : @eq nat n2' n2), @eq (word n2) (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) generalize dependent e. (* Goal: forall (e : @eq nat (Init.Nat.add n1 n2') (Init.Nat.add n1 n2)) (w : word (Init.Nat.add n1 n2')) (Heq : @eq nat n2' n2), @eq (word n2) (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) rewrite H'; intros. (* Goal: @eq (word n2) (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2 Heq) (split2 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) repeat rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n2) (split2 n1 n2 w) (split2 n1 n2 w) *) reflexivity. Qed. Theorem eq_rect_split2_eq2 : forall n1 n2 n2' (w : word (n1 + n2)) Heq Heq2, eq_rect n2 (fun n => word n) (split2 n1 n2 w) n2' Heq = split2 n1 n2' (eq_rect (n1+n2) (fun n => word n) w (n1+n2') Heq2). Proof. (* Goal: forall (n1 n2 n2' : nat) (w : word (Init.Nat.add n1 n2)) (Heq : @eq nat n2 n2') (Heq2 : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1 n2')), @eq (word n2') (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq) (split2 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') Heq2)) *) intros. (* Goal: @eq (word n2') (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq) (split2 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') Heq2)) *) assert (H' := Heq). (* Goal: @eq (word n2') (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq) (split2 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') Heq2)) *) generalize dependent w. (* Goal: forall w : word (Init.Nat.add n1 n2), @eq (word n2') (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq) (split2 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') Heq2)) *) generalize dependent Heq. (* Goal: forall (Heq : @eq nat n2 n2') (w : word (Init.Nat.add n1 n2)), @eq (word n2') (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq) (split2 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') Heq2)) *) generalize dependent Heq2. (* Goal: forall (Heq2 : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1 n2')) (Heq : @eq nat n2 n2') (w : word (Init.Nat.add n1 n2)), @eq (word n2') (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq) (split2 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') Heq2)) *) rewrite H'; intros. (* Goal: @eq (word n2') (@eq_rect nat n2' (fun n : nat => word n) (split2 n1 n2' w) n2' Heq) (split2 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2') (fun n : nat => word n) w (Init.Nat.add n1 n2') Heq2)) *) repeat rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n2') (split2 n1 n2' w) (split2 n1 n2' w) *) reflexivity. Qed. Theorem eq_rect_split2_eq1 : forall n1 n1' n2 (w: word (n1 + n2)) Heq, split2 n1 n2 w = split2 n1' n2 (eq_rect (n1 + n2) (fun y : nat => word y) w (n1' + n2) Heq). Proof. (* Goal: forall (n1 n1' n2 : nat) (w : word (Init.Nat.add n1 n2)) (Heq : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1' n2)), @eq (word n2) (split2 n1 n2 w) (split2 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1' n2) Heq)) *) intros. (* Goal: @eq (word n2) (split2 n1 n2 w) (split2 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1' n2) Heq)) *) assert (n1 = n1') as H' by omega. (* Goal: @eq (word n2) (split2 n1 n2 w) (split2 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1' n2) Heq)) *) generalize dependent w. (* Goal: forall w : word (Init.Nat.add n1 n2), @eq (word n2) (split2 n1 n2 w) (split2 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1' n2) Heq)) *) generalize dependent Heq. (* Goal: forall (Heq : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1' n2)) (w : word (Init.Nat.add n1 n2)), @eq (word n2) (split2 n1 n2 w) (split2 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1' n2) Heq)) *) rewrite H'; intros. (* Goal: @eq (word n2) (split2 n1' n2 w) (split2 n1' n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun y : nat => word y) w (Init.Nat.add n1' n2) Heq)) *) rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n2) (split2 n1' n2 w) (split2 n1' n2 w) *) reflexivity. Qed. Theorem combine_split_eq_rect2 : forall n1 n2 n2' (w : word (n1 + n2)) Heq, combine (split1 n1 n2 w) (eq_rect n2 (fun n => word n) (split2 n1 n2 w) n2' Heq) = eq_rect (n1 + n2) (fun n => word n) w (n1 + n2') (eq_rect_split2_helper _ Heq). Proof. (* Goal: forall (n1 n2 n2' : nat) (w : word (Init.Nat.add n1 n2)) (Heq : @eq nat n2 n2'), @eq (word (Init.Nat.add n1 n2')) (@combine n1 (split1 n1 n2 w) n2' (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq)) (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') (@eq_rect_split2_helper n2 n2' n1 Heq)) *) intros. (* Goal: @eq (word (Init.Nat.add n1 n2')) (@combine n1 (split1 n1 n2 w) n2' (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq)) (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') (@eq_rect_split2_helper n2 n2' n1 Heq)) *) assert (n2 = n2') by omega. (* Goal: @eq (word (Init.Nat.add n1 n2')) (@combine n1 (split1 n1 n2 w) n2' (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq)) (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') (@eq_rect_split2_helper n2 n2' n1 Heq)) *) generalize dependent Heq. (* Goal: forall Heq : @eq nat n2 n2', @eq (word (Init.Nat.add n1 n2')) (@combine n1 (split1 n1 n2 w) n2' (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq)) (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') (@eq_rect_split2_helper n2 n2' n1 Heq)) *) generalize dependent w. (* Goal: forall (w : word (Init.Nat.add n1 n2)) (Heq : @eq nat n2 n2'), @eq (word (Init.Nat.add n1 n2')) (@combine n1 (split1 n1 n2 w) n2' (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2' Heq)) (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2') (@eq_rect_split2_helper n2 n2' n1 Heq)) *) rewrite <- H; intros. (* Goal: @eq (word (Init.Nat.add n1 n2)) (@combine n1 (split1 n1 n2 w) n2 (@eq_rect nat n2 (fun n : nat => word n) (split2 n1 n2 w) n2 Heq)) (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) (@eq_rect_split2_helper n2 n2 n1 Heq)) *) repeat rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word (Init.Nat.add n1 n2)) (@combine n1 (split1 n1 n2 w) n2 (split2 n1 n2 w)) w *) apply combine_split. Qed. Lemma eq_rect_split1_helper : forall a b c, a = b -> a + c = b + c. Proof. (* Goal: forall (a b c : nat) (_ : @eq nat a b), @eq nat (Init.Nat.add a c) (Init.Nat.add b c) *) intros; omega. Qed. Lemma eq_rect_split1_eq2_helper : forall a b c, a = b -> c + a = c + b. Proof. (* Goal: forall (a b c : nat) (_ : @eq nat a b), @eq nat (Init.Nat.add c a) (Init.Nat.add c b) *) intros; omega. Qed. Theorem eq_rect_split1 : forall n1 n1' n2 (w : word (n1' + n2)) Heq, eq_rect n1' (fun n => word n) (split1 n1' n2 w) n1 Heq = split1 n1 n2 (eq_rect (n1'+n2) (fun n => word n) w (n1+n2) (eq_rect_split1_helper _ Heq)). Proof. (* Goal: forall (n1 n1' n2 : nat) (w : word (Init.Nat.add n1' n2)) (Heq : @eq nat n1' n1), @eq (word n1) (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) (@eq_rect_split1_helper n1' n1 n2 Heq))) *) intros. (* Goal: @eq (word n1) (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) (@eq_rect_split1_helper n1' n1 n2 Heq))) *) generalize (eq_rect_split1_helper n2 Heq); intros. (* Goal: @eq (word n1) (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) generalize dependent Heq. (* Goal: forall Heq : @eq nat n1' n1, @eq (word n1) (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) generalize dependent w. (* Goal: forall (w : word (Init.Nat.add n1' n2)) (Heq : @eq nat n1' n1), @eq (word n1) (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) assert (n1' = n1) as H' by omega. (* Goal: forall (w : word (Init.Nat.add n1' n2)) (Heq : @eq nat n1' n1), @eq (word n1) (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) generalize dependent e. (* Goal: forall (e : @eq nat (Init.Nat.add n1' n2) (Init.Nat.add n1 n2)) (w : word (Init.Nat.add n1' n2)) (Heq : @eq nat n1' n1), @eq (word n1) (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) rewrite H'; intros. (* Goal: @eq (word n1) (@eq_rect nat n1 (fun n : nat => word n) (split1 n1 n2 w) n1 Heq) (split1 n1 n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1 n2) e)) *) repeat rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n1) (split1 n1 n2 w) (split1 n1 n2 w) *) reflexivity. Qed. Theorem eq_rect_split1_eq1 : forall n1 n1' n2 (w : word (n1 + n2)) Heq Heq1, eq_rect n1 (fun n => word n) (split1 n1 n2 w) n1' Heq = split1 n1' n2 (eq_rect (n1+n2) (fun n => word n) w (n1'+n2) Heq1). Proof. (* Goal: forall (n1 n1' n2 : nat) (w : word (Init.Nat.add n1 n2)) (Heq : @eq nat n1 n1') (Heq1 : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1' n2)), @eq (word n1') (@eq_rect nat n1 (fun n : nat => word n) (split1 n1 n2 w) n1' Heq) (split1 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1' n2) Heq1)) *) intros. (* Goal: @eq (word n1') (@eq_rect nat n1 (fun n : nat => word n) (split1 n1 n2 w) n1' Heq) (split1 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1' n2) Heq1)) *) generalize dependent w. (* Goal: forall w : word (Init.Nat.add n1 n2), @eq (word n1') (@eq_rect nat n1 (fun n : nat => word n) (split1 n1 n2 w) n1' Heq) (split1 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1' n2) Heq1)) *) generalize dependent Heq1. (* Goal: forall (Heq1 : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1' n2)) (w : word (Init.Nat.add n1 n2)), @eq (word n1') (@eq_rect nat n1 (fun n : nat => word n) (split1 n1 n2 w) n1' Heq) (split1 n1' n2 (@eq_rect nat (Init.Nat.add n1 n2) (fun n : nat => word n) w (Init.Nat.add n1' n2) Heq1)) *) rewrite Heq; intros. (* Goal: @eq (word n1') (@eq_rect nat n1' (fun n : nat => word n) (split1 n1' n2 w) n1' (@eq_refl nat n1')) (split1 n1' n2 (@eq_rect nat (Init.Nat.add n1' n2) (fun n : nat => word n) w (Init.Nat.add n1' n2) Heq1)) *) repeat rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n1') (split1 n1' n2 w) (split1 n1' n2 w) *) reflexivity. Qed. Lemma split1_eq_rect_eq1_helper : forall a b c, b = a -> a + c = b + c. Proof. (* Goal: forall (a b c : nat) (_ : @eq nat b a), @eq nat (Init.Nat.add a c) (Init.Nat.add b c) *) intros. (* Goal: @eq nat (Init.Nat.add a c) (Init.Nat.add b c) *) subst. (* Goal: @eq nat (Init.Nat.add a c) (Init.Nat.add a c) *) reflexivity. Qed. Theorem split1_eq_rect_eq1 : forall a a' b H w, split1 a b w = eq_rect _ word (split1 a' b (eq_rect _ word w _ (split1_eq_rect_eq1_helper b H))) _ H. Proof. (* Goal: forall (a a' b : nat) (H : @eq nat a' a) (w : word (Init.Nat.add a b)), @eq (word a) (split1 a b w) (@eq_rect nat a' word (split1 a' b (@eq_rect nat (Init.Nat.add a b) word w (Init.Nat.add a' b) (@split1_eq_rect_eq1_helper a a' b H))) a H) *) intros a a' b H. (* Goal: forall w : word (Init.Nat.add a b), @eq (word a) (split1 a b w) (@eq_rect nat a' word (split1 a' b (@eq_rect nat (Init.Nat.add a b) word w (Init.Nat.add a' b) (@split1_eq_rect_eq1_helper a a' b H))) a H) *) subst a'; intros; eq_rect_simpl; auto. Qed. Theorem eq_rect_split1_eq2 : forall n1 n2 n2' (w: word (n1 + n2)) Heq, split1 n1 n2 w = split1 n1 n2' (eq_rect (n1 + n2) (fun y : nat => word y) w (n1 + n2') Heq). Proof. (* Goal: forall (n1 n2 n2' : nat) (w : word (Init.Nat.add n1 n2)) (Heq : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1 n2')), @eq (word n1) (split1 n1 n2 w) (split1 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1 n2') Heq)) *) intros. (* Goal: @eq (word n1) (split1 n1 n2 w) (split1 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1 n2') Heq)) *) assert (n2 = n2') as H' by omega. (* Goal: @eq (word n1) (split1 n1 n2 w) (split1 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1 n2') Heq)) *) generalize dependent w. (* Goal: forall w : word (Init.Nat.add n1 n2), @eq (word n1) (split1 n1 n2 w) (split1 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1 n2') Heq)) *) generalize dependent Heq. (* Goal: forall (Heq : @eq nat (Init.Nat.add n1 n2) (Init.Nat.add n1 n2')) (w : word (Init.Nat.add n1 n2)), @eq (word n1) (split1 n1 n2 w) (split1 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2) (fun y : nat => word y) w (Init.Nat.add n1 n2') Heq)) *) rewrite H'; intros. (* Goal: @eq (word n1) (split1 n1 n2' w) (split1 n1 n2' (@eq_rect nat (Init.Nat.add n1 n2') (fun y : nat => word y) w (Init.Nat.add n1 n2') Heq)) *) rewrite <- (eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word n1) (split1 n1 n2' w) (split1 n1 n2' w) *) reflexivity. Qed. Fact eq_rect_combine_dist_helper1 : forall a b c d, b * c = d -> (a + b) * c = a * c + d. Proof. (* Goal: forall (a b c d : nat) (_ : @eq nat (Init.Nat.mul b c) d), @eq nat (Init.Nat.mul (Init.Nat.add a b) c) (Init.Nat.add (Init.Nat.mul a c) d) *) intros; subst. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add a b) c) (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) *) apply Nat.mul_add_distr_r. Qed. Fact eq_rect_combine_dist_helper2 : forall a b c d, b * c = d -> a * c + d = (a + b) * c. Proof. (* Goal: forall (a b c d : nat) (_ : @eq nat (Init.Nat.mul b c) d), @eq nat (Init.Nat.add (Init.Nat.mul a c) d) (Init.Nat.mul (Init.Nat.add a b) c) *) intros; subst. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) (Init.Nat.mul (Init.Nat.add a b) c) *) symmetry; apply Nat.mul_add_distr_r. Qed. Theorem eq_rect_combine_dist : forall a b c d (w : word ((a + b) * c)) (H : b * c = d), b * c = d -> let H1 := (eq_rect_combine_dist_helper1 a b c H) in let H2 := (eq_rect_combine_dist_helper2 a b c H) in let w' := eq_rec ((a + b) * c) word w _ H1 in w = eq_rec _ word (combine (split1 (a * c) d w') (split2 (a * c) d w')) _ H2. Proof. (* Goal: forall (a b c d : nat) (w : word (Init.Nat.mul (Init.Nat.add a b) c)) (H _ : @eq nat (Init.Nat.mul b c) d), let H1 : @eq nat (Init.Nat.mul (Init.Nat.add a b) c) (Init.Nat.add (Init.Nat.mul a c) d) := @eq_rect_combine_dist_helper1 a b c d H in let H2 : @eq nat (Init.Nat.add (Init.Nat.mul a c) d) (Init.Nat.mul (Init.Nat.add a b) c) := @eq_rect_combine_dist_helper2 a b c d H in let w' := @eq_rec nat (Init.Nat.mul (Init.Nat.add a b) c) word w (Init.Nat.add (Init.Nat.mul a c) d) H1 in @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) w (@eq_rec nat (Init.Nat.add (Init.Nat.mul a c) d) word (@combine (Init.Nat.mul a c) (split1 (Init.Nat.mul a c) d w') d (split2 (Init.Nat.mul a c) d w')) (Init.Nat.mul (Init.Nat.add a b) c) H2) *) intros. (* Goal: @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) w (@eq_rec nat (Init.Nat.add (Init.Nat.mul a c) d) word (@combine (Init.Nat.mul a c) (split1 (Init.Nat.mul a c) d w') d (split2 (Init.Nat.mul a c) d w')) (Init.Nat.mul (Init.Nat.add a b) c) H2) *) subst d. (* Goal: @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) w (@eq_rec nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word (@combine (Init.Nat.mul a c) (split1 (Init.Nat.mul a c) (Init.Nat.mul b c) w') (Init.Nat.mul b c) (split2 (Init.Nat.mul a c) (Init.Nat.mul b c) w')) (Init.Nat.mul (Init.Nat.add a b) c) H2) *) rewrite combine_split. (* Goal: @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) w (@eq_rec nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word w' (Init.Nat.mul (Init.Nat.add a b) c) H2) *) eq_rect_simpl. (* Goal: @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) w (@eq_rect nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word w' (Init.Nat.mul (Init.Nat.add a b) c) H2) *) generalize dependent w. (* Goal: forall w : word (Init.Nat.mul (Init.Nat.add a b) c), let w' := @eq_rec nat (Init.Nat.mul (Init.Nat.add a b) c) word w (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) H1 in @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) w (@eq_rect nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word w' (Init.Nat.mul (Init.Nat.add a b) c) H2) *) generalize dependent H2. (* Goal: forall (H2 : @eq nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) (Init.Nat.mul (Init.Nat.add a b) c)) (w : word (Init.Nat.mul (Init.Nat.add a b) c)), let w' := @eq_rec nat (Init.Nat.mul (Init.Nat.add a b) c) word w (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) H1 in @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) w (@eq_rect nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word w' (Init.Nat.mul (Init.Nat.add a b) c) H2) *) rewrite H1. (* Goal: forall (H2 : @eq nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c))) (w : word (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c))), let w' := @eq_rec nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word w (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) (@eq_refl nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c))) in @eq (word (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c))) w (@eq_rect nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word w' (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) H2) *) intros. (* Goal: @eq (word (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c))) w (@eq_rect nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word w' (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) H2) *) eq_rect_simpl; auto. Qed. Lemma wzero_dist : forall a b c H, wzero ((a + b) * c) = eq_rect _ word (wzero (a * c + b * c)) _ H. Proof. (* Goal: forall (a b c : nat) (H : @eq nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) (Init.Nat.mul (Init.Nat.add a b) c)), @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) (wzero (Init.Nat.mul (Init.Nat.add a b) c)) (@eq_rect nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word (wzero (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c))) (Init.Nat.mul (Init.Nat.add a b) c) H) *) intros a b c H. (* Goal: @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) (wzero (Init.Nat.mul (Init.Nat.add a b) c)) (@eq_rect nat (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c)) word (wzero (Init.Nat.add (Init.Nat.mul a c) (Init.Nat.mul b c))) (Init.Nat.mul (Init.Nat.add a b) c) H) *) rewrite H. (* Goal: @eq (word (Init.Nat.mul (Init.Nat.add a b) c)) (wzero (Init.Nat.mul (Init.Nat.add a b) c)) (@eq_rect nat (Init.Nat.mul (Init.Nat.add a b) c) word (wzero (Init.Nat.mul (Init.Nat.add a b) c)) (Init.Nat.mul (Init.Nat.add a b) c) (@eq_refl nat (Init.Nat.mul (Init.Nat.add a b) c))) *) reflexivity. Qed. Lemma wzero_rev : forall (a b : nat) H, wzero (a + b) = eq_rect _ word (wzero (b + a)) _ H. Proof. (* Goal: forall (a b : nat) (H : @eq nat (Init.Nat.add b a) (Init.Nat.add a b)), @eq (word (Init.Nat.add a b)) (wzero (Init.Nat.add a b)) (@eq_rect nat (Init.Nat.add b a) word (wzero (Init.Nat.add b a)) (Init.Nat.add a b) H) *) intros a b H. (* Goal: @eq (word (Init.Nat.add a b)) (wzero (Init.Nat.add a b)) (@eq_rect nat (Init.Nat.add b a) word (wzero (Init.Nat.add b a)) (Init.Nat.add a b) H) *) rewrite H. (* Goal: @eq (word (Init.Nat.add a b)) (wzero (Init.Nat.add a b)) (@eq_rect nat (Init.Nat.add a b) word (wzero (Init.Nat.add a b)) (Init.Nat.add a b) (@eq_refl nat (Init.Nat.add a b))) *) auto. Qed. Lemma split1_zero : forall sz1 sz2, split1 sz1 sz2 (natToWord _ O) = natToWord _ O. Proof. (* Goal: forall sz1 sz2 : nat, @eq (word sz1) (split1 sz1 sz2 (natToWord (Init.Nat.add sz1 sz2) O)) (natToWord sz1 O) *) induction sz1; auto; simpl; intros. (* Goal: @eq (word (S sz1)) (@WS false sz1 (split1 sz1 sz2 (natToWord (Init.Nat.add sz1 sz2) O))) (@WS false sz1 (natToWord sz1 O)) *) f_equal. (* Goal: @eq (word sz1) (split1 sz1 sz2 (natToWord (Init.Nat.add sz1 sz2) O)) (natToWord sz1 O) *) eauto. Qed. Lemma split2_zero : forall sz1 sz2, split2 sz1 sz2 (natToWord _ O) = natToWord _ O. Proof. (* Goal: forall sz1 sz2 : nat, @eq (word sz2) (split2 sz1 sz2 (natToWord (Init.Nat.add sz1 sz2) O)) (natToWord sz2 O) *) induction sz1; auto. Qed. Theorem combine_inj : forall sz1 sz2 a b c d, @combine sz1 a sz2 b = @combine sz1 c sz2 d -> a = c /\ b = d. Proof. (* Goal: forall (sz1 sz2 : nat) (a : word sz1) (b : word sz2) (c : word sz1) (d : word sz2) (_ : @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 a sz2 b) (@combine sz1 c sz2 d)), and (@eq (word sz1) a c) (@eq (word sz2) b d) *) induction sz1; simpl; intros. (* Goal: and (@eq (word (S sz1)) a c) (@eq (word sz2) b d) *) (* Goal: and (@eq (word O) a c) (@eq (word sz2) b d) *) - (* Goal: and (@eq (word O) a c) (@eq (word sz2) b d) *) rewrite (word0 a) in *. (* Goal: and (@eq (word O) WO c) (@eq (word sz2) b d) *) rewrite (word0 c) in *. (* Goal: and (@eq (word O) WO WO) (@eq (word sz2) b d) *) simpl in *. (* Goal: and (@eq (word O) WO WO) (@eq (word sz2) b d) *) intuition. (* BG Goal: and (@eq (word (S sz1)) a c) (@eq (word sz2) b d) *) - (* Goal: and (@eq (word (S sz1)) a c) (@eq (word sz2) b d) *) rewrite (shatter_word a) in *. (* Goal: and (@eq (word (S sz1)) (@WS (@whd sz1 a) sz1 (@wtl sz1 a)) c) (@eq (word sz2) b d) *) rewrite (shatter_word c) in *. (* Goal: and (@eq (word (S sz1)) (@WS (@whd sz1 a) sz1 (@wtl sz1 a)) (@WS (@whd sz1 c) sz1 (@wtl sz1 c))) (@eq (word sz2) b d) *) simpl in *. (* Goal: and (@eq (word (S sz1)) (@WS (@whd sz1 a) sz1 (@wtl sz1 a)) (@WS (@whd sz1 c) sz1 (@wtl sz1 c))) (@eq (word sz2) b d) *) inversion H. (* Goal: and (@eq (word (S sz1)) (@WS (@whd sz1 a) sz1 (@wtl sz1 a)) (@WS (@whd sz1 a) sz1 (@wtl sz1 c))) (@eq (word sz2) b d) *) apply (inj_pair2_eq_dec _ eq_nat_dec) in H2. (* Goal: and (@eq (word (S sz1)) (@WS (@whd sz1 a) sz1 (@wtl sz1 a)) (@WS (@whd sz1 a) sz1 (@wtl sz1 c))) (@eq (word sz2) b d) *) destruct (IHsz1 _ _ _ _ _ H2). (* Goal: and (@eq (word (S sz1)) (@WS (@whd sz1 a) sz1 (@wtl sz1 a)) (@WS (@whd sz1 a) sz1 (@wtl sz1 c))) (@eq (word sz2) b d) *) intuition. (* Goal: @eq (word (S sz1)) (@WS (@whd sz1 a) sz1 (@wtl sz1 a)) (@WS (@whd sz1 a) sz1 (@wtl sz1 c)) *) f_equal; auto. Qed. Theorem combine_wzero : forall sz1 sz2, combine (wzero sz1) (wzero sz2) = wzero (sz1 + sz2). Proof. (* Goal: forall sz1 sz2 : nat, @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (wzero sz1) sz2 (wzero sz2)) (wzero (Init.Nat.add sz1 sz2)) *) induction sz1; auto. (* Goal: forall sz2 : nat, @eq (word (Init.Nat.add (S sz1) sz2)) (@combine (S sz1) (wzero (S sz1)) sz2 (wzero sz2)) (wzero (Init.Nat.add (S sz1) sz2)) *) unfold wzero in *. (* Goal: forall sz2 : nat, @eq (word (Init.Nat.add (S sz1) sz2)) (@combine (S sz1) (natToWord (S sz1) O) sz2 (natToWord sz2 O)) (natToWord (Init.Nat.add (S sz1) sz2) O) *) intros; simpl; f_equal; auto. Qed. Theorem combine_wones : forall sz1 sz2, combine (wones sz1) (wones sz2) = wones (sz1 + sz2). Proof. (* Goal: forall sz1 sz2 : nat, @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (wones sz1) sz2 (wones sz2)) (wones (Init.Nat.add sz1 sz2)) *) induction sz1; auto. (* Goal: forall sz2 : nat, @eq (word (Init.Nat.add (S sz1) sz2)) (@combine (S sz1) (wones (S sz1)) sz2 (wones sz2)) (wones (Init.Nat.add (S sz1) sz2)) *) intros; simpl; f_equal; auto. Qed. Theorem wordToN_nat : forall sz (w : word sz), wordToN w = N_of_nat (wordToNat w). Proof. (* Goal: forall (sz : nat) (w : word sz), @eq N (@wordToN sz w) (N.of_nat (@wordToNat sz w)) *) induction w; intuition. (* Goal: @eq N (@wordToN (S n) (@WS b n w)) (N.of_nat (@wordToNat (S n) (@WS b n w))) *) destruct b; unfold wordToN, wordToNat; fold wordToN; fold wordToNat. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.of_nat (Init.Nat.mul (@wordToNat n w) (S (S O)))) *) (* Goal: @eq N (N.succ (N.mul (Npos (xO xH)) (@wordToN n w))) (N.of_nat (S (Init.Nat.mul (@wordToNat n w) (S (S O))))) *) rewrite N_of_S. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.of_nat (Init.Nat.mul (@wordToNat n w) (S (S O)))) *) (* Goal: @eq N (N.succ (N.mul (Npos (xO xH)) (@wordToN n w))) (N.succ (N.of_nat (Init.Nat.mul (@wordToNat n w) (S (S O))))) *) rewrite N_of_mult. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.of_nat (Init.Nat.mul (@wordToNat n w) (S (S O)))) *) (* Goal: @eq N (N.succ (N.mul (Npos (xO xH)) (@wordToN n w))) (N.succ (N.mul (N.of_nat (@wordToNat n w)) (N.of_nat (S (S O))))) *) rewrite <- IHw. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.of_nat (Init.Nat.mul (@wordToNat n w) (S (S O)))) *) (* Goal: @eq N (N.succ (N.mul (Npos (xO xH)) (@wordToN n w))) (N.succ (N.mul (@wordToN n w) (N.of_nat (S (S O))))) *) rewrite Nmult_comm. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.of_nat (Init.Nat.mul (@wordToNat n w) (S (S O)))) *) (* Goal: @eq N (N.succ (N.mul (@wordToN n w) (Npos (xO xH)))) (N.succ (N.mul (@wordToN n w) (N.of_nat (S (S O))))) *) reflexivity. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.of_nat (Init.Nat.mul (@wordToNat n w) (S (S O)))) *) rewrite N_of_mult. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.mul (N.of_nat (@wordToNat n w)) (N.of_nat (S (S O)))) *) rewrite <- IHw. (* Goal: @eq N (N.mul (Npos (xO xH)) (@wordToN n w)) (N.mul (@wordToN n w) (N.of_nat (S (S O)))) *) rewrite Nmult_comm. (* Goal: @eq N (N.mul (@wordToN n w) (Npos (xO xH))) (N.mul (@wordToN n w) (N.of_nat (S (S O)))) *) reflexivity. Qed. Lemma wordToN_to_nat sz: forall (w: word sz), BinNat.N.to_nat (wordToN w) = wordToNat w. Proof. (* Goal: forall w : word sz, @eq nat (N.to_nat (@wordToN sz w)) (@wordToNat sz w) *) intros. (* Goal: @eq nat (N.to_nat (@wordToN sz w)) (@wordToNat sz w) *) rewrite wordToN_nat. (* Goal: @eq nat (N.to_nat (N.of_nat (@wordToNat sz w))) (@wordToNat sz w) *) rewrite Nnat.Nat2N.id. (* Goal: @eq nat (@wordToNat sz w) (@wordToNat sz w) *) reflexivity. Qed. Local Hint Extern 1 (@eq nat _ _) => omega. Theorem mod2_S : forall n k, 2 * k = S n -> mod2 n = true. Proof. (* Goal: forall (n k : nat) (_ : @eq nat (Init.Nat.mul (S (S O)) k) (S n)), @eq bool (mod2 n) true *) induction n as [n] using strong; intros. (* Goal: @eq bool (mod2 n) true *) destruct n; simpl in *. (* Goal: @eq bool match n with | O => true | S n' => mod2 n' end true *) (* Goal: @eq bool false true *) elimtype False; omega. (* Goal: @eq bool match n with | O => true | S n' => mod2 n' end true *) destruct n; simpl in *; auto. (* Goal: @eq bool (mod2 n) true *) destruct k as [|k]; simpl in *. (* Goal: @eq bool (mod2 n) true *) (* Goal: @eq bool (mod2 n) true *) discriminate. (* Goal: @eq bool (mod2 n) true *) apply H with k; auto. Qed. Theorem wzero'_def : forall sz, wzero' sz = wzero sz. Proof. (* Goal: forall sz : nat, @eq (word sz) (wzero' sz) (wzero sz) *) unfold wzero; induction sz; simpl; intuition. (* Goal: @eq (word (S sz)) (@WS false sz (wzero' sz)) (@WS false sz (natToWord sz O)) *) congruence. Qed. Theorem posToWord_nat : forall p sz, posToWord sz p = natToWord sz (nat_of_P p). Proof. (* Goal: forall (p : positive) (sz : nat), @eq (word sz) (posToWord sz p) (natToWord sz (Pos.to_nat p)) *) induction p as [ p IHp | p IHp | ]; destruct sz; simpl; intuition; f_equal; try rewrite wzero'_def in *. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz match Pos.iter_op nat Init.Nat.add p (S (S O)) with | O => O | S n' => S (Nat.div2 n') end) *) (* Goal: @eq bool true match Pos.iter_op nat Init.Nat.add p (S (S O)) with | O => true | S n' => mod2 n' end *) rewrite ZL6. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz match Pos.iter_op nat Init.Nat.add p (S (S O)) with | O => O | S n' => S (Nat.div2 n') end) *) (* Goal: @eq bool true match Init.Nat.add (Pos.to_nat p) (Pos.to_nat p) with | O => true | S n' => mod2 n' end *) destruct (ZL4 p) as [x Heq]; rewrite Heq; simpl. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz match Pos.iter_op nat Init.Nat.add p (S (S O)) with | O => O | S n' => S (Nat.div2 n') end) *) (* Goal: @eq bool true (mod2 (Init.Nat.add x (S x))) *) replace (x + S x) with (S (2 * x)) by omega. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz match Pos.iter_op nat Init.Nat.add p (S (S O)) with | O => O | S n' => S (Nat.div2 n') end) *) (* Goal: @eq bool true (mod2 (S (Init.Nat.mul (S (S O)) x))) *) symmetry; apply mod2_S_double. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz match Pos.iter_op nat Init.Nat.add p (S (S O)) with | O => O | S n' => S (Nat.div2 n') end) *) rewrite IHp. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (natToWord sz (Pos.to_nat p)) (natToWord sz match Pos.iter_op nat Init.Nat.add p (S (S O)) with | O => O | S n' => S (Nat.div2 n') end) *) rewrite ZL6. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (natToWord sz (Pos.to_nat p)) (natToWord sz match Init.Nat.add (Pos.to_nat p) (Pos.to_nat p) with | O => O | S n' => S (Nat.div2 n') end) *) destruct (nat_of_P p); simpl; intuition. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (natToWord sz (S n)) (natToWord sz (S (Nat.div2 (Init.Nat.add n (S n))))) *) replace (n + S n) with (S (2 * n)) by omega. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) (* Goal: @eq (word sz) (natToWord sz (S n)) (natToWord sz (S (Nat.div2 (S (Init.Nat.mul (S (S O)) n))))) *) rewrite div2_S_double; auto. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.to_nat (xO p))) *) unfold nat_of_P; simpl. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Pos.iter_op nat Init.Nat.add p (S (S O)))) *) rewrite ZL6. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Init.Nat.add (Pos.to_nat p) (Pos.to_nat p))) *) replace (nat_of_P p + nat_of_P p) with (2 * nat_of_P p) by omega. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) (* Goal: @eq bool false (mod2 (Init.Nat.mul (S (S O)) (Pos.to_nat p))) *) symmetry; apply mod2_double. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) rewrite IHp. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (natToWord sz (Pos.to_nat p)) (natToWord sz (Nat.div2 (Pos.to_nat (xO p)))) *) unfold nat_of_P; simpl. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (natToWord sz (Pos.iter_op nat Init.Nat.add p (S O))) (natToWord sz (Nat.div2 (Pos.iter_op nat Init.Nat.add p (S (S O))))) *) rewrite ZL6. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (natToWord sz (Pos.iter_op nat Init.Nat.add p (S O))) (natToWord sz (Nat.div2 (Init.Nat.add (Pos.to_nat p) (Pos.to_nat p)))) *) replace (nat_of_P p + nat_of_P p) with (2 * nat_of_P p) by omega. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (natToWord sz (Pos.iter_op nat Init.Nat.add p (S O))) (natToWord sz (Nat.div2 (Init.Nat.mul (S (S O)) (Pos.to_nat p)))) *) rewrite div2_double. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) (* Goal: @eq (word sz) (natToWord sz (Pos.iter_op nat Init.Nat.add p (S O))) (natToWord sz (Pos.to_nat p)) *) auto. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) auto. Qed. Lemma posToWord_sz0: forall p, posToWord 0 p = $0. Proof. (* Goal: forall p : positive, @eq (word O) (posToWord O p) (natToWord O O) *) intros. (* Goal: @eq (word O) (posToWord O p) (natToWord O O) *) unfold posToWord. (* Goal: @eq (word O) ((fix posToWord (sz : nat) (p : positive) {struct p} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => match p with | xI p' => @WS true sz' (posToWord sz' p') | xO p' => @WS false sz' (posToWord sz' p') | xH => @WS true sz' (wzero' sz') end end) O p) (natToWord O O) *) destruct p; reflexivity. Qed. Theorem NToWord_nat : forall sz n, NToWord sz n = natToWord sz (nat_of_N n). Proof. (* Goal: forall (sz : nat) (n : N), @eq (word sz) (NToWord sz n) (natToWord sz (N.to_nat n)) *) destruct n; simpl; intuition; try rewrite wzero'_def in *. (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Pos.to_nat p)) *) (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) auto. (* Goal: @eq (word sz) (posToWord sz p) (natToWord sz (Pos.to_nat p)) *) apply posToWord_nat. Qed. Theorem wplus_alt : forall sz (x y : word sz), wplus x y = wplusN x y. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wplus sz x y) (@wplusN sz x y) *) unfold wplusN, wplus, wordBinN, wordBin; intros. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz x) (@wordToN sz y))) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y))) *) repeat rewrite wordToN_nat; repeat rewrite NToWord_nat. (* Goal: @eq (word sz) (natToWord sz (N.to_nat (N.add (N.of_nat (@wordToNat sz x)) (N.of_nat (@wordToNat sz y))))) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y))) *) rewrite nat_of_Nplus. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (N.to_nat (N.of_nat (@wordToNat sz x))) (N.to_nat (N.of_nat (@wordToNat sz y))))) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y))) *) repeat rewrite nat_of_N_of_nat. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y))) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y))) *) reflexivity. Qed. Theorem wmult_alt : forall sz (x y : word sz), wmult x y = wmultN x y. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wmult sz x y) (@wmultN sz x y) *) unfold wmultN, wmult, wordBinN, wordBin; intros. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz x) (@wordToN sz y))) (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y))) *) repeat rewrite wordToN_nat; repeat rewrite NToWord_nat. (* Goal: @eq (word sz) (natToWord sz (N.to_nat (N.mul (N.of_nat (@wordToNat sz x)) (N.of_nat (@wordToNat sz y))))) (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y))) *) rewrite nat_of_Nmult. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.mul (N.to_nat (N.of_nat (@wordToNat sz x))) (N.to_nat (N.of_nat (@wordToNat sz y))))) (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y))) *) repeat rewrite nat_of_N_of_nat. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y))) (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y))) *) reflexivity. Qed. Theorem wneg_alt : forall sz (x : word sz), wneg x = wnegN x. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wneg sz x) (@wnegN sz x) *) unfold wnegN, wneg; intros. (* Goal: @eq (word sz) (NToWord sz (N.sub (Npow2 sz) (@wordToN sz x))) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x))) *) repeat rewrite wordToN_nat; repeat rewrite NToWord_nat. (* Goal: @eq (word sz) (natToWord sz (N.to_nat (N.sub (Npow2 sz) (N.of_nat (@wordToNat sz x))))) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x))) *) rewrite nat_of_Nminus. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (N.to_nat (Npow2 sz)) (N.to_nat (N.of_nat (@wordToNat sz x))))) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x))) *) do 2 f_equal. (* Goal: @eq nat (N.to_nat (N.of_nat (@wordToNat sz x))) (@wordToNat sz x) *) (* Goal: @eq nat (N.to_nat (Npow2 sz)) (Nat.pow (S (S O)) sz) *) apply Npow2_nat. (* Goal: @eq nat (N.to_nat (N.of_nat (@wordToNat sz x))) (@wordToNat sz x) *) apply nat_of_N_of_nat. Qed. Theorem wminus_Alt : forall sz (x y : word sz), wminus x y = wminusN x y. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wminus sz x y) (@wminusN sz x y) *) intros; unfold wminusN, wminus; rewrite wneg_alt; apply wplus_alt. Qed. Theorem wplus_unit : forall sz (x : word sz), natToWord sz 0 ^+ x = x. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wplus sz (natToWord sz O) x) x *) intros; rewrite wplus_alt; unfold wplusN, wordBinN; intros. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz (natToWord sz O)) (@wordToNat sz x))) x *) rewrite roundTrip_0; apply natToWord_wordToNat. Qed. Theorem wplus_comm : forall sz (x y : word sz), x ^+ y = y ^+ x. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wplus sz x y) (@wplus sz y x) *) intros; repeat rewrite wplus_alt; unfold wplusN, wordBinN; f_equal; auto. Qed. Theorem drop_sub : forall sz n k, (k * pow2 sz <= n)%nat -> natToWord sz (n - k * pow2 sz) = natToWord sz n. Proof. (* Goal: forall (sz n k : nat) (_ : le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) n), @eq (word sz) (natToWord sz (Init.Nat.sub n (Init.Nat.mul k (Nat.pow (S (S O)) sz)))) (natToWord sz n) *) induction sz as [|sz IHsz]; simpl; intros n k *; intuition; repeat rewrite untimes2 in *; f_equal. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: @eq bool (mod2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz))))) (mod2 n) *) rewrite mult_assoc. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: @eq bool (mod2 (Init.Nat.sub n (Nat.mul (Nat.mul k (S (S O))) (Nat.pow (S (S O)) sz)))) (mod2 n) *) rewrite (mult_comm k). (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: @eq bool (mod2 (Init.Nat.sub n (Nat.mul (Nat.mul (S (S O)) k) (Nat.pow (S (S O)) sz)))) (mod2 n) *) rewrite <- mult_assoc. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: @eq bool (mod2 (Init.Nat.sub n (Nat.mul (S (S O)) (Nat.mul k (Nat.pow (S (S O)) sz))))) (mod2 n) *) apply drop_mod2. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: le (Init.Nat.mul (S (S O)) (Nat.mul k (Nat.pow (S (S O)) sz))) n *) rewrite mult_assoc. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: le (Nat.mul (Nat.mul (S (S O)) k) (Nat.pow (S (S O)) sz)) n *) rewrite (mult_comm 2). (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: le (Nat.mul (Nat.mul k (S (S O))) (Nat.pow (S (S O)) sz)) n *) rewrite <- mult_assoc. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) (* Goal: le (Nat.mul k (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz))) n *) auto. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Nat.div2 n)) *) rewrite <- (IHsz (div2 n) k). (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Init.Nat.mul k (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (natToWord sz (Init.Nat.sub (Nat.div2 n) (Init.Nat.mul k (Nat.pow (S (S O)) sz)))) *) rewrite mult_assoc. (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Nat.mul (Nat.mul k (S (S O))) (Nat.pow (S (S O)) sz))))) (natToWord sz (Init.Nat.sub (Nat.div2 n) (Init.Nat.mul k (Nat.pow (S (S O)) sz)))) *) rewrite (mult_comm k). (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Nat.mul (Nat.mul (S (S O)) k) (Nat.pow (S (S O)) sz))))) (natToWord sz (Init.Nat.sub (Nat.div2 n) (Init.Nat.mul k (Nat.pow (S (S O)) sz)))) *) rewrite <- mult_assoc. (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (Init.Nat.sub n (Nat.mul (S (S O)) (Nat.mul k (Nat.pow (S (S O)) sz)))))) (natToWord sz (Init.Nat.sub (Nat.div2 n) (Init.Nat.mul k (Nat.pow (S (S O)) sz)))) *) rewrite div2_minus_2. (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: le (Init.Nat.mul (S (S O)) (Nat.mul k (Nat.pow (S (S O)) sz))) n *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Nat.div2 n) (Nat.mul k (Nat.pow (S (S O)) sz)))) (natToWord sz (Init.Nat.sub (Nat.div2 n) (Init.Nat.mul k (Nat.pow (S (S O)) sz)))) *) reflexivity. (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: le (Init.Nat.mul (S (S O)) (Nat.mul k (Nat.pow (S (S O)) sz))) n *) rewrite mult_assoc. (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: le (Nat.mul (Nat.mul (S (S O)) k) (Nat.pow (S (S O)) sz)) n *) rewrite (mult_comm 2). (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: le (Nat.mul (Nat.mul k (S (S O))) (Nat.pow (S (S O)) sz)) n *) rewrite <- mult_assoc. (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) (* Goal: le (Nat.mul k (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz))) n *) auto. (* Goal: le (Init.Nat.mul k (Nat.pow (S (S O)) sz)) (Nat.div2 n) *) apply div2_bound. (* Goal: le (Init.Nat.mul (S (S O)) (Init.Nat.mul k (Nat.pow (S (S O)) sz))) n *) rewrite mult_assoc. (* Goal: le (Nat.mul (Nat.mul (S (S O)) k) (Nat.pow (S (S O)) sz)) n *) rewrite (mult_comm 2). (* Goal: le (Nat.mul (Nat.mul k (S (S O))) (Nat.pow (S (S O)) sz)) n *) rewrite <- mult_assoc. (* Goal: le (Nat.mul k (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz))) n *) auto. Qed. Local Hint Extern 1 (_ <= _)%nat => omega. Theorem wplus_assoc : forall sz (x y z : word sz), x ^+ (y ^+ z) = x ^+ y ^+ z. Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wplus sz x (@wplus sz y z)) (@wplus sz (@wplus sz x y) z) *) intros sz x y z *; repeat rewrite wplus_alt; unfold wplusN, wordBinN; intros. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.add (@wordToNat sz y) (@wordToNat sz z)))))) (natToWord sz (Init.Nat.add (@wordToNat sz (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)))) (@wordToNat sz z))) *) repeat match goal with | [ |- context[wordToNat (natToWord ?sz ?w)] ] => let Heq := fresh "Heq" in destruct (wordToNat_natToWord sz w) as [? [Heq ?]]; rewrite Heq end. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Init.Nat.add (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))))) (natToWord sz (Init.Nat.add (Init.Nat.sub (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (@wordToNat sz z))) *) match goal with | [ |- context[wordToNat ?x + wordToNat ?y - ?x1 * pow2 ?sz + wordToNat ?z] ] => replace (wordToNat x + wordToNat y - x1 * pow2 sz + wordToNat z) with (wordToNat x + wordToNat y + wordToNat z - x1 * pow2 sz) by auto end. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Init.Nat.add (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))))) (natToWord sz (Init.Nat.sub (Init.Nat.add (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)))) *) match goal with | [ |- context[wordToNat ?x + (wordToNat ?y + wordToNat ?z - ?x0 * pow2 ?sz)] ] => replace (wordToNat x + (wordToNat y + wordToNat z - x0 * pow2 sz)) with (wordToNat x + wordToNat y + wordToNat z - x0 * pow2 sz) by auto end. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Init.Nat.add (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)))) (natToWord sz (Init.Nat.sub (Init.Nat.add (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)))) *) repeat rewrite drop_sub; auto. Qed. Theorem roundTrip_1 : forall sz, wordToNat (natToWord (S sz) 1) = 1. Proof. (* Goal: forall sz : nat, @eq nat (@wordToNat (S sz) (natToWord (S sz) (S O))) (S O) *) induction sz; simpl in *; intuition. Qed. Theorem roundTrip_1': forall sz, sz <> 0 -> wordToNat (natToWord sz 1) = 1. Proof. (* Goal: forall (sz : nat) (_ : not (@eq nat sz O)), @eq nat (@wordToNat sz (natToWord sz (S O))) (S O) *) intros. (* Goal: @eq nat (@wordToNat sz (natToWord sz (S O))) (S O) *) destruct sz. (* Goal: @eq nat (@wordToNat (S sz) (natToWord (S sz) (S O))) (S O) *) (* Goal: @eq nat (@wordToNat O (natToWord O (S O))) (S O) *) - (* Goal: @eq nat (@wordToNat O (natToWord O (S O))) (S O) *) tauto. (* BG Goal: @eq nat (@wordToNat (S sz) (natToWord (S sz) (S O))) (S O) *) - (* Goal: @eq nat (@wordToNat (S sz) (natToWord (S sz) (S O))) (S O) *) apply roundTrip_1. Qed. Theorem mod2_WS : forall sz (x : word sz) b, mod2 (wordToNat (WS b x)) = b. Proof. (* Goal: forall (sz : nat) (x : word sz) (b : bool), @eq bool (mod2 (@wordToNat (S sz) (@WS b sz x))) b *) intros sz x b. (* Goal: @eq bool (mod2 (@wordToNat (S sz) (@WS b sz x))) b *) rewrite wordToNat_wordToNat'. (* Goal: @eq bool (mod2 (@wordToNat' (S sz) (@WS b sz x))) b *) destruct b; simpl. (* Goal: @eq bool (mod2 (Init.Nat.add (@wordToNat sz x) (Init.Nat.add (@wordToNat sz x) O))) false *) (* Goal: @eq bool match Init.Nat.add (@wordToNat sz x) (Init.Nat.add (@wordToNat sz x) O) with | O => true | S n' => mod2 n' end true *) rewrite untimes2. (* Goal: @eq bool (mod2 (Init.Nat.add (@wordToNat sz x) (Init.Nat.add (@wordToNat sz x) O))) false *) (* Goal: @eq bool match Init.Nat.mul (S (S O)) (@wordToNat sz x) with | O => true | S n' => mod2 n' end true *) case_eq (2 * wordToNat x); intuition. (* Goal: @eq bool (mod2 (Init.Nat.add (@wordToNat sz x) (Init.Nat.add (@wordToNat sz x) O))) false *) (* Goal: @eq bool (mod2 n) true *) eapply mod2_S; eauto. (* Goal: @eq bool (mod2 (Init.Nat.add (@wordToNat sz x) (Init.Nat.add (@wordToNat sz x) O))) false *) rewrite <- (mod2_double (wordToNat x)); f_equal; omega. Qed. Theorem div2_WS : forall sz (x : word sz) b, div2 (wordToNat (WS b x)) = wordToNat x. Proof. (* Goal: forall (sz : nat) (x : word sz) (b : bool), @eq nat (Nat.div2 (@wordToNat (S sz) (@WS b sz x))) (@wordToNat sz x) *) destruct b; rewrite wordToNat_wordToNat'; unfold wordToNat'; fold wordToNat'. (* Goal: @eq nat (Nat.div2 (Init.Nat.mul (S (S O)) (@wordToNat sz x))) (@wordToNat sz x) *) (* Goal: @eq nat (Nat.div2 (S (Init.Nat.mul (S (S O)) (@wordToNat sz x)))) (@wordToNat sz x) *) apply div2_S_double. (* Goal: @eq nat (Nat.div2 (Init.Nat.mul (S (S O)) (@wordToNat sz x))) (@wordToNat sz x) *) apply div2_double. Qed. Theorem wmult_unit : forall sz (x : word sz), natToWord sz 1 ^* x = x. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wmult sz (natToWord sz (S O)) x) x *) intros sz x; rewrite wmult_alt; unfold wmultN, wordBinN; intros. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.mul (@wordToNat sz (natToWord sz (S O))) (@wordToNat sz x))) x *) destruct sz; simpl. (* Goal: @eq (word (S sz)) (@WS (mod2 (Init.Nat.add (@wordToNat (S sz) x) (Init.Nat.mul (Init.Nat.mul (@wordToNat sz (natToWord sz O)) (S (S O))) (@wordToNat (S sz) x)))) sz (natToWord sz (Nat.div2 (Init.Nat.add (@wordToNat (S sz) x) (Init.Nat.mul (Init.Nat.mul (@wordToNat sz (natToWord sz O)) (S (S O))) (@wordToNat (S sz) x)))))) x *) (* Goal: @eq (word O) WO x *) rewrite (shatter_word x); reflexivity. (* Goal: @eq (word (S sz)) (@WS (mod2 (Init.Nat.add (@wordToNat (S sz) x) (Init.Nat.mul (Init.Nat.mul (@wordToNat sz (natToWord sz O)) (S (S O))) (@wordToNat (S sz) x)))) sz (natToWord sz (Nat.div2 (Init.Nat.add (@wordToNat (S sz) x) (Init.Nat.mul (Init.Nat.mul (@wordToNat sz (natToWord sz O)) (S (S O))) (@wordToNat (S sz) x)))))) x *) rewrite roundTrip_0; simpl. (* Goal: @eq (word (S sz)) (@WS (mod2 (Init.Nat.add (@wordToNat (S sz) x) O)) sz (natToWord sz (Nat.div2 (Init.Nat.add (@wordToNat (S sz) x) O)))) x *) rewrite plus_0_r. (* Goal: @eq (word (S sz)) (@WS (mod2 (@wordToNat (S sz) x)) sz (natToWord sz (Nat.div2 (@wordToNat (S sz) x)))) x *) rewrite (shatter_word x). (* Goal: @eq (word (S sz)) (@WS (mod2 (@wordToNat (S sz) (@WS (@whd sz x) sz (@wtl sz x)))) sz (natToWord sz (Nat.div2 (@wordToNat (S sz) (@WS (@whd sz x) sz (@wtl sz x)))))) (@WS (@whd sz x) sz (@wtl sz x)) *) f_equal. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (@wordToNat (S sz) (@WS (@whd sz x) sz (@wtl sz x))))) (@wtl sz x) *) (* Goal: @eq bool (mod2 (@wordToNat (S sz) (@WS (@whd sz x) sz (@wtl sz x)))) (@whd sz x) *) apply mod2_WS. (* Goal: @eq (word sz) (natToWord sz (Nat.div2 (@wordToNat (S sz) (@WS (@whd sz x) sz (@wtl sz x))))) (@wtl sz x) *) rewrite div2_WS. (* Goal: @eq (word sz) (natToWord sz (@wordToNat sz (@wtl sz x))) (@wtl sz x) *) apply natToWord_wordToNat. Qed. Theorem wmult_comm : forall sz (x y : word sz), x ^* y = y ^* x. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wmult sz x y) (@wmult sz y x) *) intros; repeat rewrite wmult_alt; unfold wmultN, wordBinN; auto with arith. Qed. Theorem wmult_unit_r : forall sz (x : word sz), x ^* natToWord sz 1 = x. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wmult sz x (natToWord sz (S O))) x *) intros. (* Goal: @eq (word sz) (@wmult sz x (natToWord sz (S O))) x *) rewrite wmult_comm. (* Goal: @eq (word sz) (@wmult sz (natToWord sz (S O)) x) x *) apply wmult_unit. Qed. Lemma wmult_neut_l: forall (sz : nat) (x : word sz), $0 ^* x = $0. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wmult sz (natToWord sz O) x) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wmult sz (natToWord sz O) x) (natToWord sz O) *) unfold wmult. (* Goal: @eq (word sz) (@wordBin N.mul sz (natToWord sz O) x) (natToWord sz O) *) unfold wordBin. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz (natToWord sz O)) (@wordToN sz x))) (natToWord sz O) *) do 2 rewrite wordToN_nat. (* Goal: @eq (word sz) (NToWord sz (N.mul (N.of_nat (@wordToNat sz (natToWord sz O))) (N.of_nat (@wordToNat sz x)))) (natToWord sz O) *) rewrite <- Nnat.Nat2N.inj_mul. (* Goal: @eq (word sz) (NToWord sz (N.of_nat (Init.Nat.mul (@wordToNat sz (natToWord sz O)) (@wordToNat sz x)))) (natToWord sz O) *) rewrite roundTrip_0. (* Goal: @eq (word sz) (NToWord sz (N.of_nat (Init.Nat.mul O (@wordToNat sz x)))) (natToWord sz O) *) rewrite Nat.mul_0_l. (* Goal: @eq (word sz) (NToWord sz (N.of_nat O)) (natToWord sz O) *) simpl. (* Goal: @eq (word sz) (wzero' sz) (natToWord sz O) *) rewrite wzero'_def. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) reflexivity. Qed. Lemma wmult_neut_r: forall (sz : nat) (x : word sz), x ^* $0 = $0. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wmult sz x (natToWord sz O)) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wmult sz x (natToWord sz O)) (natToWord sz O) *) unfold wmult. (* Goal: @eq (word sz) (@wordBin N.mul sz x (natToWord sz O)) (natToWord sz O) *) unfold wordBin. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz x) (@wordToN sz (natToWord sz O)))) (natToWord sz O) *) do 2 rewrite wordToN_nat. (* Goal: @eq (word sz) (NToWord sz (N.mul (N.of_nat (@wordToNat sz x)) (N.of_nat (@wordToNat sz (natToWord sz O))))) (natToWord sz O) *) rewrite <- Nnat.Nat2N.inj_mul. (* Goal: @eq (word sz) (NToWord sz (N.of_nat (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz (natToWord sz O))))) (natToWord sz O) *) rewrite roundTrip_0. (* Goal: @eq (word sz) (NToWord sz (N.of_nat (Init.Nat.mul (@wordToNat sz x) O))) (natToWord sz O) *) rewrite Nat.mul_0_r. (* Goal: @eq (word sz) (NToWord sz (N.of_nat O)) (natToWord sz O) *) simpl. (* Goal: @eq (word sz) (wzero' sz) (natToWord sz O) *) rewrite wzero'_def. (* Goal: @eq (word sz) (wzero sz) (natToWord sz O) *) reflexivity. Qed. Theorem wmult_assoc : forall sz (x y z : word sz), x ^* (y ^* z) = x ^* y ^* z. Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wmult sz x (@wmult sz y z)) (@wmult sz (@wmult sz x y) z) *) intros sz x y z; repeat rewrite wmult_alt; unfold wmultN, wordBinN; intros. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)))))) (natToWord sz (Init.Nat.mul (@wordToNat sz (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)))) (@wordToNat sz z))) *) repeat match goal with | [ |- context[wordToNat (natToWord ?sz ?w)] ] => let Heq := fresh "Heq" in destruct (wordToNat_natToWord sz w) as [? [Heq ?]]; rewrite Heq end. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.mul (@wordToNat sz x) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))))) (natToWord sz (Init.Nat.mul (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (@wordToNat sz z))) *) rewrite mult_minus_distr_l. (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Nat.mul (@wordToNat sz x) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))))) (natToWord sz (Init.Nat.mul (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (@wordToNat sz z))) *) rewrite mult_minus_distr_r. (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Nat.mul (@wordToNat sz x) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))))) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)) (@wordToNat sz z)))) *) match goal with | [ |- natToWord _ (_ - _ * (?x0' * _)) = natToWord _ (_ - ?x1' * _ * _) ] => rename x0' into x0, x1' into x1 end. (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Nat.mul (@wordToNat sz x) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))))) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)) (@wordToNat sz z)))) *) rewrite (mult_assoc (wordToNat x) x0). (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)))) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)) (@wordToNat sz z)))) *) rewrite <- (mult_assoc x1). (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)))) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul x1 (Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz z))))) *) rewrite (mult_comm (pow2 sz)). (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)))) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul x1 (Nat.mul (@wordToNat sz z) (Nat.pow (S (S O)) sz))))) *) rewrite (mult_assoc x1). (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)))) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Nat.mul x1 (@wordToNat sz z)) (Nat.pow (S (S O)) sz)))) *) repeat rewrite drop_sub; auto with arith. (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) (* Goal: le (Init.Nat.mul (Nat.mul x1 (@wordToNat sz z)) (Nat.pow (S (S O)) sz)) (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) *) rewrite (mult_comm x1). (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz z) x1) (Nat.pow (S (S O)) sz)) (Nat.mul (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) *) rewrite <- (mult_assoc (wordToNat x)). (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz z) x1) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) rewrite (mult_comm (wordToNat y)). (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz z) x1) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Nat.mul (@wordToNat sz z) (@wordToNat sz y))) *) rewrite mult_assoc. (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz z) x1) (Nat.pow (S (S O)) sz)) (Nat.mul (Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (@wordToNat sz y)) *) rewrite (mult_comm (wordToNat x)). (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz z) x1) (Nat.pow (S (S O)) sz)) (Nat.mul (Nat.mul (@wordToNat sz z) (@wordToNat sz x)) (@wordToNat sz y)) *) repeat rewrite <- mult_assoc. (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) (* Goal: le (Nat.mul (@wordToNat sz z) (Nat.mul x1 (Nat.pow (S (S O)) sz))) (Nat.mul (@wordToNat sz z) (Nat.mul (@wordToNat sz x) (@wordToNat sz y))) *) auto with arith. (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz x) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) repeat rewrite <- mult_assoc. (* Goal: le (Nat.mul (@wordToNat sz x) (Nat.mul x0 (Nat.pow (S (S O)) sz))) (Nat.mul (@wordToNat sz x) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) *) auto with arith. Qed. Theorem wmult_plus_distr : forall sz (x y z : word sz), (x ^+ y) ^* z = (x ^* z) ^+ (y ^* z). Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wmult sz (@wplus sz x y) z) (@wplus sz (@wmult sz x z) (@wmult sz y z)) *) intros sz x y z; repeat rewrite wmult_alt; repeat rewrite wplus_alt; unfold wmultN, wplusN, wordBinN; intros. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.mul (@wordToNat sz (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)))) (@wordToNat sz z))) (natToWord sz (Init.Nat.add (@wordToNat sz (natToWord sz (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)))) (@wordToNat sz (natToWord sz (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)))))) *) repeat match goal with | [ |- context[wordToNat (natToWord ?sz ?w)] ] => let Heq := fresh "Heq" in destruct (wordToNat_natToWord sz w) as [? [Heq ?]]; rewrite Heq end. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.mul (Init.Nat.sub (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))) (@wordToNat sz z))) (natToWord sz (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))))) *) rewrite mult_minus_distr_r. (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)) (@wordToNat sz z)))) (natToWord sz (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))))) *) match goal with | [ |- natToWord _ (_ - ?x0' * _ * _) = natToWord _ (_ - ?x1' * _ + (_ - ?x2' * _)) ] => rename x0' into x0, x1' into x1, x2' into x2 end. (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)) (@wordToNat sz z)))) (natToWord sz (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))))) *) rewrite <- (mult_assoc x0). (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul x0 (Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz z))))) (natToWord sz (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))))) *) rewrite (mult_comm (pow2 sz)). (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul x0 (Nat.mul (@wordToNat sz z) (Nat.pow (S (S O)) sz))))) (natToWord sz (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))))) *) rewrite (mult_assoc x0). (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Nat.mul x0 (@wordToNat sz z)) (Nat.pow (S (S O)) sz)))) (natToWord sz (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))))) *) replace (wordToNat x * wordToNat z - x1 * pow2 sz + (wordToNat y * wordToNat z - x2 * pow2 sz)) with (wordToNat x * wordToNat z + wordToNat y * wordToNat z - x1 * pow2 sz - x2 * pow2 sz). (* Goal: @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) (* Goal: @eq (word sz) (natToWord sz (Nat.sub (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) (Nat.mul (Nat.mul x0 (@wordToNat sz z)) (Nat.pow (S (S O)) sz)))) (natToWord sz (Init.Nat.sub (Init.Nat.sub (Init.Nat.add (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) repeat rewrite drop_sub; auto with arith. (* Goal: @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) (* Goal: le (Init.Nat.mul (Nat.mul x0 (@wordToNat sz z)) (Nat.pow (S (S O)) sz)) (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) *) rewrite (mult_comm x0). (* Goal: @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz z) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y)) (@wordToNat sz z)) *) rewrite (mult_comm (wordToNat x + wordToNat y)). (* Goal: @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) (* Goal: le (Init.Nat.mul (Nat.mul (@wordToNat sz z) x0) (Nat.pow (S (S O)) sz)) (Nat.mul (@wordToNat sz z) (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y))) *) rewrite <- (mult_assoc (wordToNat z)). (* Goal: @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) (* Goal: le (Nat.mul (@wordToNat sz z) (Nat.mul x0 (Nat.pow (S (S O)) sz))) (Nat.mul (@wordToNat sz z) (Init.Nat.add (@wordToNat sz x) (@wordToNat sz y))) *) auto with arith. (* Goal: @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub (Init.Nat.mul (@wordToNat sz x) (@wordToNat sz z)) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) generalize dependent (wordToNat x * wordToNat z). (* Goal: forall (n : nat) (_ : @eq nat (@wordToNat sz (natToWord sz n)) (Init.Nat.sub n (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)))) (_ : le (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)) n), @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add n (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z))) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub n (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub (Init.Nat.mul (@wordToNat sz y) (@wordToNat sz z)) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) generalize dependent (wordToNat y * wordToNat z). (* Goal: forall (n : nat) (_ : @eq nat (@wordToNat sz (natToWord sz n)) (Init.Nat.sub n (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) (_ : le (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)) n) (n0 : nat) (_ : @eq nat (@wordToNat sz (natToWord sz n0)) (Init.Nat.sub n0 (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)))) (_ : le (Init.Nat.mul x1 (Nat.pow (S (S O)) sz)) n0), @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add n0 n) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub n0 (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub n (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) intros. (* Goal: @eq nat (Init.Nat.sub (Init.Nat.sub (Init.Nat.add n0 n) (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.mul x2 (Nat.pow (S (S O)) sz))) (Init.Nat.add (Init.Nat.sub n0 (Init.Nat.mul x1 (Nat.pow (S (S O)) sz))) (Init.Nat.sub n (Init.Nat.mul x2 (Nat.pow (S (S O)) sz)))) *) omega. Qed. Theorem wminus_def : forall sz (x y : word sz), x ^- y = x ^+ ^~ y. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wminus sz x y) (@wplus sz x (@wneg sz y)) *) reflexivity. Qed. Theorem wordToNat_bound : forall sz (w : word sz), (wordToNat w < pow2 sz)%nat. Proof. (* Goal: forall (sz : nat) (w : word sz), lt (@wordToNat sz w) (Nat.pow (S (S O)) sz) *) induction w as [|b]; simpl; intuition. (* Goal: lt (if b then S (Init.Nat.mul (@wordToNat n w) (S (S O))) else Init.Nat.mul (@wordToNat n w) (S (S O))) (Nat.add (Nat.pow (S (S O)) n) (Nat.add (Nat.pow (S (S O)) n) O)) *) destruct b; simpl; omega. Qed. Theorem natToWord_pow2 : forall sz, natToWord sz (pow2 sz) = natToWord sz 0. Proof. (* Goal: forall sz : nat, @eq (word sz) (natToWord sz (Nat.pow (S (S O)) sz)) (natToWord sz O) *) induction sz as [|sz]; simpl; intuition. (* Goal: @eq (word (S sz)) (@WS (mod2 (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O))) sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O))))) (@WS false sz (natToWord sz O)) *) generalize (div2_double (pow2 sz)); simpl; intro Hr; rewrite Hr; clear Hr. (* Goal: @eq (word (S sz)) (@WS (mod2 (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O))) sz (natToWord sz (Nat.pow (S (S O)) sz))) (@WS false sz (natToWord sz O)) *) f_equal. (* Goal: @eq (word sz) (natToWord sz (Nat.pow (S (S O)) sz)) (natToWord sz O) *) (* Goal: @eq bool (mod2 (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O))) false *) generalize (mod2_double (pow2 sz)); auto. (* Goal: @eq (word sz) (natToWord sz (Nat.pow (S (S O)) sz)) (natToWord sz O) *) auto. Qed. Theorem wminus_inv : forall sz (x : word sz), x ^+ ^~ x = wzero sz. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wplus sz x (@wneg sz x)) (wzero sz) *) intros sz x; rewrite wneg_alt; rewrite wplus_alt; unfold wnegN, wplusN, wzero, wordBinN; intros. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x)))))) (natToWord sz O) *) repeat match goal with | [ |- context[wordToNat (natToWord ?sz ?w)] ] => let Heq := fresh "Heq" in destruct (wordToNat_natToWord sz w) as [? [Heq ?]]; rewrite Heq end. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))))) (natToWord sz O) *) match goal with | [ |- context[wordToNat ?x + (pow2 ?sz - wordToNat ?x - ?x0 * pow2 ?sz)] ] => replace (wordToNat x + (pow2 sz - wordToNat x - x0 * pow2 sz)) with (pow2 sz - x0 * pow2 sz) end. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)))) (natToWord sz O) *) rewrite drop_sub; auto with arith. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)))) *) (* Goal: @eq (word sz) (natToWord sz (Nat.pow (S (S O)) sz)) (natToWord sz O) *) apply natToWord_pow2. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)))) *) generalize (wordToNat_bound x). (* Goal: forall _ : lt (@wordToNat sz x) (Nat.pow (S (S O)) sz), @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz))) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz x)) (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)))) *) omega. Qed. Lemma wminus_diag: forall sz (w: word sz), w ^- w = $0. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wminus sz w w) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wminus sz w w) (natToWord sz O) *) unfold wminus. (* Goal: @eq (word sz) (@wplus sz w (@wneg sz w)) (natToWord sz O) *) apply wminus_inv. Qed. Lemma wneg_0_wminus: forall {sz: nat} (x: word sz), ^~ x = $0 ^- x. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wneg sz x) (@wminus sz (natToWord sz O) x) *) intros. (* Goal: @eq (word sz) (@wneg sz x) (@wminus sz (natToWord sz O) x) *) rewrite <- wplus_unit at 1. (* Goal: @eq (word sz) (@wplus sz (natToWord sz O) (@wneg sz x)) (@wminus sz (natToWord sz O) x) *) reflexivity. Qed. Definition wring (sz : nat) : ring_theory (wzero sz) (wone sz) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (@eq _) := mk_rt _ _ _ _ _ _ _ (@wplus_unit _) (@wplus_comm _) (@wplus_assoc _) (@wmult_unit _) (@wmult_comm _) (@wmult_assoc _) (@wmult_plus_distr _) (@wminus_def _) (@wminus_inv _). Theorem weqb_sound : forall sz (x y : word sz), weqb x y = true -> x = y. Proof. (* Goal: forall (sz : nat) (x y : word sz) (_ : @eq bool (@weqb sz x y) true), @eq (word sz) x y *) eapply weqb_true_iff. Qed. Arguments weqb_sound : clear implicits. Lemma weqb_eq: forall sz (a b: word sz), a = b -> weqb a b = true. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq (word sz) a b), @eq bool (@weqb sz a b) true *) intros. (* Goal: @eq bool (@weqb sz a b) true *) rewrite weqb_true_iff. (* Goal: @eq (word sz) a b *) assumption. Qed. Lemma weqb_ne: forall sz (a b: word sz), a <> b -> weqb a b = false. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@eq (word sz) a b)), @eq bool (@weqb sz a b) false *) intros. (* Goal: @eq bool (@weqb sz a b) false *) destruct (weqb a b) eqn: E. (* Goal: @eq bool false false *) (* Goal: @eq bool true false *) - (* Goal: @eq bool true false *) rewrite weqb_true_iff in E. (* Goal: @eq bool true false *) contradiction. (* BG Goal: @eq bool false false *) - (* Goal: @eq bool false false *) reflexivity. Qed. Lemma weqb_false: forall sz (a b: word sz), weqb a b = false -> a <> b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq bool (@weqb sz a b) false), not (@eq (word sz) a b) *) intros. (* Goal: not (@eq (word sz) a b) *) destruct (weqb a b) eqn: E. (* Goal: not (@eq (word sz) a b) *) (* Goal: not (@eq (word sz) a b) *) - (* Goal: not (@eq (word sz) a b) *) discriminate. (* BG Goal: not (@eq (word sz) a b) *) - (* Goal: not (@eq (word sz) a b) *) intro C. (* Goal: False *) subst. (* Goal: False *) rewrite weqb_eq in E; congruence. Qed. Ltac is_nat_cst n := match eval hnf in n with | O => constr:(true) | S ?n' => is_nat_cst n' | _ => constr:(false) end. Ltac isWcst w := match eval hnf in w with | WO => constr:(true) | WS ?b ?w' => match eval hnf in b with | true => isWcst w' | false => isWcst w' | _ => constr:(false) end | natToWord _ ?n => is_nat_cst n | _ => constr:(false) end. Ltac wcst w := let b := isWcst w in match b with | true => w | _ => constr:(NotConstant) end. Ltac noptac x := idtac. Ltac PackWring sz F := let RNG := (fun proj => proj inv_morph_nothing inv_morph_nothing noptac noptac (word sz) (@eq (word sz)) (wzero sz) (wone sz) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (BinNums.Z) (BinNums.N) (id_phi_N) (pow_N (wone sz) (@wmult sz)) (ring_correct (@Eqsth (word sz)) (Eq_ext _ _ _) (Rth_ARth (@Eqsth (word sz)) (Eq_ext _ _ _) (wring sz)) (gen_phiZ_morph (@Eqsth (word sz)) (Eq_ext _ _ _) (wring sz)) (pow_N_th _ _ (@Eqsth (word sz))) (triv_div_th (@Eqsth (word sz)) (Eq_ext _ _ _) (Rth_ARth (@Eqsth (word sz)) (Eq_ext _ _ _) (wring sz)) (gen_phiZ_morph (@Eqsth (word sz)) (Eq_ext _ _ _) (wring sz))) ) tt) in F RNG (@nil (word sz)) (@nil (word sz)). Ltac ring_sz sz := PackWring sz Ring_gen. Fact bitwp_wtl : forall sz (w w' : word (S sz)) op, bitwp op (wtl w) (wtl w') = wtl (bitwp op w w'). Proof. (* Goal: forall (sz : nat) (w w' : word (S sz)) (op : forall (_ : bool) (_ : bool), bool), @eq (word sz) (@bitwp op sz (@wtl sz w) (@wtl sz w')) (@wtl sz (@bitwp op (S sz) w w')) *) intros. (* Goal: @eq (word sz) (@bitwp op sz (@wtl sz w) (@wtl sz w')) (@wtl sz (@bitwp op (S sz) w w')) *) rewrite (shatter_word w), (shatter_word w'). (* Goal: @eq (word sz) (@bitwp op sz (@wtl sz (@WS (@whd sz w) sz (@wtl sz w))) (@wtl sz (@WS (@whd sz w') sz (@wtl sz w')))) (@wtl sz (@bitwp op (S sz) (@WS (@whd sz w) sz (@wtl sz w)) (@WS (@whd sz w') sz (@wtl sz w')))) *) auto. Qed. Lemma split1_bitwp_dist : forall sz1 sz2 w w' op, split1 sz1 sz2 (bitwp op w w') = bitwp op (split1 sz1 sz2 w) (split1 sz1 sz2 w'). Proof. (* Goal: forall (sz1 sz2 : nat) (w w' : word (Init.Nat.add sz1 sz2)) (op : forall (_ : bool) (_ : bool), bool), @eq (word sz1) (split1 sz1 sz2 (@bitwp op (Init.Nat.add sz1 sz2) w w')) (@bitwp op sz1 (split1 sz1 sz2 w) (split1 sz1 sz2 w')) *) induction sz1; intros; auto. (* Goal: @eq (word (S sz1)) (split1 (S sz1) sz2 (@bitwp op (Init.Nat.add (S sz1) sz2) w w')) (@bitwp op (S sz1) (split1 (S sz1) sz2 w) (split1 (S sz1) sz2 w')) *) simpl. (* Goal: @eq (word (S sz1)) (@WS (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S (Init.Nat.add sz1 sz2)) w w')) sz1 (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S (Init.Nat.add sz1 sz2)) w w')))) (@WS (op (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w) (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w')) sz1 (@bitwp op sz1 (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w)) (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w')))) *) f_equal. (* Goal: @eq (word sz1) (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S (Init.Nat.add sz1 sz2)) w w'))) (@bitwp op sz1 (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w)) (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w'))) *) (* Goal: @eq bool (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S (Init.Nat.add sz1 sz2)) w w')) (op (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w) (@whd ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w')) *) rewrite (shatter_word w), (shatter_word w'); auto. (* Goal: @eq (word sz1) (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S (Init.Nat.add sz1 sz2)) w w'))) (@bitwp op sz1 (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w)) (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) w'))) *) rewrite <- IHsz1, bitwp_wtl. (* Goal: @eq (word sz1) (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S (Init.Nat.add sz1 sz2)) w w'))) (split1 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2)) w w'))) *) reflexivity. Qed. Lemma split2_bitwp_dist : forall sz1 sz2 w w' op, split2 sz1 sz2 (bitwp op w w') = bitwp op (split2 sz1 sz2 w) (split2 sz1 sz2 w'). Proof. (* Goal: forall (sz1 sz2 : nat) (w w' : word (Init.Nat.add sz1 sz2)) (op : forall (_ : bool) (_ : bool), bool), @eq (word sz2) (split2 sz1 sz2 (@bitwp op (Init.Nat.add sz1 sz2) w w')) (@bitwp op sz2 (split2 sz1 sz2 w) (split2 sz1 sz2 w')) *) induction sz1; intros; auto. (* Goal: @eq (word sz2) (split2 (S sz1) sz2 (@bitwp op (Init.Nat.add (S sz1) sz2) w w')) (@bitwp op sz2 (split2 (S sz1) sz2 w) (split2 (S sz1) sz2 w')) *) simpl; rewrite <- IHsz1, bitwp_wtl. (* Goal: @eq (word sz2) (split2 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S (Init.Nat.add sz1 sz2)) w w'))) (split2 sz1 sz2 (@wtl ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2) (@bitwp op (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) sz1 sz2)) w w'))) *) reflexivity. Qed. Lemma combine_bitwp : forall sz1 sz2 (wa wa' : word sz1) (wb wb' : word sz2) op, combine (bitwp op wa wa') (bitwp op wb wb') = bitwp op (combine wa wb) (combine wa' wb'). Proof. (* Goal: forall (sz1 sz2 : nat) (wa wa' : word sz1) (wb wb' : word sz2) (op : forall (_ : bool) (_ : bool), bool), @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (@bitwp op sz1 wa wa') sz2 (@bitwp op sz2 wb wb')) (@bitwp op (Init.Nat.add sz1 sz2) (@combine sz1 wa sz2 wb) (@combine sz1 wa' sz2 wb')) *) induction sz1; intros; rewrite (shatter_word wa), (shatter_word wa'); simpl; f_equal; auto. Qed. Lemma eq_rect_bitwp : forall a b Heq f w1 w2, bitwp f w1 w2 = eq_rect a word ( bitwp f (eq_rect b word w1 a Heq) (eq_rect b word w2 a Heq)) b (eq_sym Heq). Proof. (* Goal: forall (a b : nat) (Heq : @eq nat b a) (f : forall (_ : bool) (_ : bool), bool) (w1 w2 : word b), @eq (word b) (@bitwp f b w1 w2) (@eq_rect nat a word (@bitwp f a (@eq_rect nat b word w1 a Heq) (@eq_rect nat b word w2 a Heq)) b (@eq_sym nat b a Heq)) *) intros a b H; subst a. (* Goal: forall (f : forall (_ : bool) (_ : bool), bool) (w1 w2 : word b), @eq (word b) (@bitwp f b w1 w2) (@eq_rect nat b word (@bitwp f b (@eq_rect nat b word w1 b (@eq_refl nat b)) (@eq_rect nat b word w2 b (@eq_refl nat b))) b (@eq_sym nat b b (@eq_refl nat b))) *) intros; eq_rect_simpl; reflexivity. Qed. Fact eq_rect_bitwp' : forall a b Heq f w1 w2, eq_rect b word (bitwp f w1 w2) a Heq = bitwp f (eq_rect b word w1 a Heq) (eq_rect b word w2 a Heq). Proof. (* Goal: forall (a b : nat) (Heq : @eq nat b a) (f : forall (_ : bool) (_ : bool), bool) (w1 w2 : word b), @eq (word a) (@eq_rect nat b word (@bitwp f b w1 w2) a Heq) (@bitwp f a (@eq_rect nat b word w1 a Heq) (@eq_rect nat b word w2 a Heq)) *) intros a b H1; subst a. (* Goal: forall (f : forall (_ : bool) (_ : bool), bool) (w1 w2 : word b), @eq (word b) (@eq_rect nat b word (@bitwp f b w1 w2) b (@eq_refl nat b)) (@bitwp f b (@eq_rect nat b word w1 b (@eq_refl nat b)) (@eq_rect nat b word w2 b (@eq_refl nat b))) *) intros; eq_rect_simpl; reflexivity. Qed. Fact eq_rect_bitwp_1 : forall a b Heq f w1 w2, bitwp f (eq_rect a word w1 b Heq) w2 = eq_rect a word (bitwp f w1 (eq_rect b word w2 a (eq_sym Heq))) b Heq. Proof. (* Goal: forall (a b : nat) (Heq : @eq nat a b) (f : forall (_ : bool) (_ : bool), bool) (w1 : word a) (w2 : word b), @eq (word b) (@bitwp f b (@eq_rect nat a word w1 b Heq) w2) (@eq_rect nat a word (@bitwp f a w1 (@eq_rect nat b word w2 a (@eq_sym nat a b Heq))) b Heq) *) intros a b H. (* Goal: forall (f : forall (_ : bool) (_ : bool), bool) (w1 : word a) (w2 : word b), @eq (word b) (@bitwp f b (@eq_rect nat a word w1 b H) w2) (@eq_rect nat a word (@bitwp f a w1 (@eq_rect nat b word w2 a (@eq_sym nat a b H))) b H) *) subst a; intros; eq_rect_simpl; auto. Qed. Theorem wnot_wnot'_equiv : forall sz (w : word sz), wnot w = wnot' w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wnot sz w) (@wnot' sz w) *) unfold wnot'. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wnot sz w) (@bitwp xorb sz (wones sz) w) *) induction sz; intros w; shatterer. Qed. Theorem wnot_split1 : forall sz1 sz2 w, wnot (split1 sz1 sz2 w) = split1 sz1 sz2 (wnot w). Theorem wnot_split2 : forall sz1 sz2 w, wnot (split2 sz1 sz2 w) = split2 sz1 sz2 (wnot w). Theorem wnot_combine : forall sz1 sz2 (w1 : word sz1) (w2 : word sz2), wnot (combine w1 w2) = combine (wnot w1) (wnot w2). Proof. (* Goal: forall (sz1 sz2 : nat) (w1 : word sz1) (w2 : word sz2), @eq (word (Init.Nat.add sz1 sz2)) (@wnot (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (@combine sz1 (@wnot sz1 w1) sz2 (@wnot sz2 w2)) *) intros. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@wnot (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (@combine sz1 (@wnot sz1 w1) sz2 (@wnot sz2 w2)) *) repeat rewrite wnot_wnot'_equiv. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@wnot' (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (@combine sz1 (@wnot' sz1 w1) sz2 (@wnot' sz2 w2)) *) unfold wnot'. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@bitwp xorb (Init.Nat.add sz1 sz2) (wones (Init.Nat.add sz1 sz2)) (@combine sz1 w1 sz2 w2)) (@combine sz1 (@bitwp xorb sz1 (wones sz1) w1) sz2 (@bitwp xorb sz2 (wones sz2) w2)) *) rewrite <- combine_wones, combine_bitwp. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@bitwp xorb (Init.Nat.add sz1 sz2) (@combine sz1 (wones sz1) sz2 (wones sz2)) (@combine sz1 w1 sz2 w2)) (@bitwp xorb (Init.Nat.add sz1 sz2) (@combine sz1 (wones sz1) sz2 (wones sz2)) (@combine sz1 w1 sz2 w2)) *) reflexivity. Qed. Theorem wnot_zero: forall sz, wnot (wzero sz) = wones sz. Proof. (* Goal: forall sz : nat, @eq (word sz) (@wnot sz (wzero sz)) (wones sz) *) induction sz; simpl; f_equal; eauto. Qed. Theorem wnot_ones : forall sz, wnot (wones sz) = wzero sz. Proof. (* Goal: forall sz : nat, @eq (word sz) (@wnot sz (wones sz)) (wzero sz) *) induction sz; simpl; f_equal; try rewrite IHsz; eauto. Qed. Theorem wnot_eq_rect : forall a b H (w : word a), wnot (eq_rect a word w b H) = eq_rect a word (wnot w) b H. Proof. (* Goal: forall (a b : nat) (H : @eq nat a b) (w : word a), @eq (word b) (@wnot b (@eq_rect nat a word w b H)) (@eq_rect nat a word (@wnot a w) b H) *) intros. (* Goal: @eq (word b) (@wnot b (@eq_rect nat a word w b H)) (@eq_rect nat a word (@wnot a w) b H) *) subst b; eq_rect_simpl; auto. Qed. Theorem wor_unit : forall sz (x : word sz), wzero sz ^| x = x. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wor sz (wzero sz) x) x *) unfold wzero, wor; induction x; simpl; intuition congruence. Qed. Theorem wor_comm : forall sz (x y : word sz), x ^| y = y ^| x. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wor sz x y) (@wor sz y x) *) unfold wor; induction x; intro y; rewrite (shatter_word y); simpl; intuition; f_equal; auto with bool. Qed. Theorem wor_assoc : forall sz (x y z : word sz), x ^| (y ^| z) = x ^| y ^| z. Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wor sz x (@wor sz y z)) (@wor sz (@wor sz x y) z) *) unfold wor; induction x; intro y; rewrite (shatter_word y); simpl; intuition; f_equal; auto with bool. Qed. Theorem wand_unit : forall sz (x : word sz), wones sz ^& x = x. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wand sz (wones sz) x) x *) unfold wand; induction x; simpl; intuition congruence. Qed. Theorem wand_kill : forall sz (x : word sz), wzero sz ^& x = wzero sz. Proof. (* Goal: forall (sz : nat) (x : word sz), @eq (word sz) (@wand sz (wzero sz) x) (wzero sz) *) unfold wzero, wand; induction x; simpl; intuition congruence. Qed. Theorem wand_comm : forall sz (x y : word sz), x ^& y = y ^& x. Proof. (* Goal: forall (sz : nat) (x y : word sz), @eq (word sz) (@wand sz x y) (@wand sz y x) *) unfold wand; induction x; intro y; rewrite (shatter_word y); simpl; intuition; f_equal; auto with bool. Qed. Theorem wand_assoc : forall sz (x y z : word sz), x ^& (y ^& z) = x ^& y ^& z. Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wand sz x (@wand sz y z)) (@wand sz (@wand sz x y) z) *) unfold wand; induction x; intro y; rewrite (shatter_word y); simpl; intuition; f_equal; auto with bool. Qed. Theorem wand_or_distr : forall sz (x y z : word sz), (x ^| y) ^& z = (x ^& z) ^| (y ^& z). Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wand sz (@wor sz x y) z) (@wor sz (@wand sz x z) (@wand sz y z)) *) unfold wand, wor; induction x; intro y; rewrite (shatter_word y); intro z; rewrite (shatter_word z); simpl; intuition; f_equal; auto with bool. (* Goal: @eq bool (andb (orb b (@whd n y)) (@whd n z)) (orb (andb b (@whd n z)) (andb (@whd n y) (@whd n z))) *) destruct (whd y); destruct (whd z); destruct b; reflexivity. Qed. Lemma wor_wones : forall sz w, wones sz ^| w = wones sz. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wor sz (wones sz) w) (wones sz) *) unfold wor; induction sz; intros; simpl; auto. (* Goal: @eq (word (S sz)) (@WS true sz (@bitwp orb sz (wones sz) (@wtl sz w))) (@WS true sz (wones sz)) *) rewrite IHsz; auto. Qed. Lemma wor_wzero : forall sz w, wzero sz ^| w = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wor sz (wzero sz) w) w *) unfold wor; induction sz; shatterer. Qed. Lemma wand_wones : forall sz w, wones sz ^& w = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wand sz (wones sz) w) w *) unfold wand; induction sz; shatterer. Qed. Lemma wand_wzero : forall sz w, wzero sz ^& w = wzero sz. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wand sz (wzero sz) w) (wzero sz) *) intros. (* Goal: @eq (word sz) (@wand sz (wzero sz) w) (wzero sz) *) rewrite <- wzero'_def. (* Goal: @eq (word sz) (@wand sz (wzero' sz) w) (wzero' sz) *) unfold wand; induction sz; shatterer. Qed. Lemma wxor_wones : forall sz w, wxor (wones sz) w = wnot w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wxor sz (wones sz) w) (@wnot sz w) *) unfold wxor; induction sz; shatterer. Qed. Lemma wxor_wzero : forall sz w, wxor (wzero sz) w = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wxor sz (wzero sz) w) w *) unfold wxor; induction sz; shatterer; destruct (whd w); auto. Qed. Lemma wxor_comm : forall sz (w1 w2 : word sz), wxor w1 w2 = wxor w2 w1. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (@wxor sz w1 w2) (@wxor sz w2 w1) *) unfold wxor; induction sz. (* Goal: forall w1 w2 : word (S sz), @eq (word (S sz)) (@bitwp xorb (S sz) w1 w2) (@bitwp xorb (S sz) w2 w1) *) (* Goal: forall w1 w2 : word O, @eq (word O) (@bitwp xorb O w1 w2) (@bitwp xorb O w2 w1) *) shatterer. (* Goal: forall w1 w2 : word (S sz), @eq (word (S sz)) (@bitwp xorb (S sz) w1 w2) (@bitwp xorb (S sz) w2 w1) *) intros. (* Goal: @eq (word (S sz)) (@bitwp xorb (S sz) w1 w2) (@bitwp xorb (S sz) w2 w1) *) rewrite (shatter_word w1), (shatter_word w2). (* Goal: @eq (word (S sz)) (@bitwp xorb (S sz) (@WS (@whd sz w1) sz (@wtl sz w1)) (@WS (@whd sz w2) sz (@wtl sz w2))) (@bitwp xorb (S sz) (@WS (@whd sz w2) sz (@wtl sz w2)) (@WS (@whd sz w1) sz (@wtl sz w1))) *) simpl. (* Goal: @eq (word (S sz)) (@WS (xorb (@whd sz w1) (@whd sz w2)) sz (@bitwp xorb sz (@wtl sz w1) (@wtl sz w2))) (@WS (xorb (@whd sz w2) (@whd sz w1)) sz (@bitwp xorb sz (@wtl sz w2) (@wtl sz w1))) *) rewrite xorb_comm, IHsz. (* Goal: @eq (word (S sz)) (@WS (xorb (@whd sz w2) (@whd sz w1)) sz (@bitwp xorb sz (@wtl sz w2) (@wtl sz w1))) (@WS (xorb (@whd sz w2) (@whd sz w1)) sz (@bitwp xorb sz (@wtl sz w2) (@wtl sz w1))) *) reflexivity. Qed. Lemma wxor_assoc : forall sz (w1 w2 w3 : word sz), wxor w1 (wxor w2 w3) = wxor (wxor w1 w2) w3. Proof. (* Goal: forall (sz : nat) (w1 w2 w3 : word sz), @eq (word sz) (@wxor sz w1 (@wxor sz w2 w3)) (@wxor sz (@wxor sz w1 w2) w3) *) unfold wxor. (* Goal: forall (sz : nat) (w1 w2 w3 : word sz), @eq (word sz) (@bitwp xorb sz w1 (@bitwp xorb sz w2 w3)) (@bitwp xorb sz (@bitwp xorb sz w1 w2) w3) *) induction sz; intros; rewrite (shatter_word w1), (shatter_word w2), (shatter_word w3); auto. (* Goal: @eq (word (S sz)) (@bitwp xorb (S sz) (@WS (@whd sz w1) sz (@wtl sz w1)) (@bitwp xorb (S sz) (@WS (@whd sz w2) sz (@wtl sz w2)) (@WS (@whd sz w3) sz (@wtl sz w3)))) (@bitwp xorb (S sz) (@bitwp xorb (S sz) (@WS (@whd sz w1) sz (@wtl sz w1)) (@WS (@whd sz w2) sz (@wtl sz w2))) (@WS (@whd sz w3) sz (@wtl sz w3))) *) simpl; f_equal. (* Goal: @eq (word sz) (@bitwp xorb sz (@wtl sz w1) (@bitwp xorb sz (@wtl sz w2) (@wtl sz w3))) (@bitwp xorb sz (@bitwp xorb sz (@wtl sz w1) (@wtl sz w2)) (@wtl sz w3)) *) (* Goal: @eq bool (xorb (@whd sz w1) (xorb (@whd sz w2) (@whd sz w3))) (xorb (xorb (@whd sz w1) (@whd sz w2)) (@whd sz w3)) *) rewrite xorb_assoc_reverse; auto. (* Goal: @eq (word sz) (@bitwp xorb sz (@wtl sz w1) (@bitwp xorb sz (@wtl sz w2) (@wtl sz w3))) (@bitwp xorb sz (@bitwp xorb sz (@wtl sz w1) (@wtl sz w2)) (@wtl sz w3)) *) rewrite IHsz. (* Goal: @eq (word sz) (@bitwp xorb sz (@bitwp xorb sz (@wtl sz w1) (@wtl sz w2)) (@wtl sz w3)) (@bitwp xorb sz (@bitwp xorb sz (@wtl sz w1) (@wtl sz w2)) (@wtl sz w3)) *) reflexivity. Qed. Lemma wor_wone : forall sz (w : word sz) b, WS b w ^| wone _ = WS true w. Proof. (* Goal: forall (sz : nat) (w : word sz) (b : bool), @eq (word (S sz)) (@wor (S sz) (@WS b sz w) (wone (S sz))) (@WS true sz w) *) intros. (* Goal: @eq (word (S sz)) (@wor (S sz) (@WS b sz w) (wone (S sz))) (@WS true sz w) *) compute [wone natToWord wor]. (* Goal: @eq (word (S sz)) (@bitwp orb (S sz) (@WS b sz w) (@WS (mod2 (S O)) sz ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz (Nat.div2 (S O))))) (@WS true sz w) *) simpl. (* Goal: @eq (word (S sz)) (@WS (orb b true) sz (@bitwp orb sz w ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz O))) (@WS true sz w) *) fold natToWord. (* Goal: @eq (word (S sz)) (@WS (orb b true) sz (@bitwp orb sz w (natToWord sz O))) (@WS true sz w) *) change (natToWord sz 0) with (wzero sz). (* Goal: @eq (word (S sz)) (@WS (orb b true) sz (@bitwp orb sz w (wzero sz))) (@WS true sz w) *) rewrite orb_true_r. (* Goal: @eq (word (S sz)) (@WS true sz (@bitwp orb sz w (wzero sz))) (@WS true sz w) *) rewrite wor_comm, wor_wzero. (* Goal: @eq (word (S sz)) (@WS true sz w) (@WS true sz w) *) reflexivity. Qed. Lemma wand_wone : forall sz (w : word sz) b, WS b w ^& wone _ = WS b (wzero _). Proof. (* Goal: forall (sz : nat) (w : word sz) (b : bool), @eq (word (S sz)) (@wand (S sz) (@WS b sz w) (wone (S sz))) (@WS b sz (wzero sz)) *) intros. (* Goal: @eq (word (S sz)) (@wand (S sz) (@WS b sz w) (wone (S sz))) (@WS b sz (wzero sz)) *) compute [wone natToWord wand]. (* Goal: @eq (word (S sz)) (@bitwp andb (S sz) (@WS b sz w) (@WS (mod2 (S O)) sz ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz (Nat.div2 (S O))))) (@WS b sz (wzero sz)) *) simpl. (* Goal: @eq (word (S sz)) (@WS (andb b true) sz (@bitwp andb sz w ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz O))) (@WS b sz (wzero sz)) *) fold natToWord. (* Goal: @eq (word (S sz)) (@WS (andb b true) sz (@bitwp andb sz w (natToWord sz O))) (@WS b sz (wzero sz)) *) change (natToWord sz 0) with (wzero sz). (* Goal: @eq (word (S sz)) (@WS (andb b true) sz (@bitwp andb sz w (wzero sz))) (@WS b sz (wzero sz)) *) rewrite andb_true_r. (* Goal: @eq (word (S sz)) (@WS b sz (@bitwp andb sz w (wzero sz))) (@WS b sz (wzero sz)) *) rewrite wand_comm, wand_wzero. (* Goal: @eq (word (S sz)) (@WS b sz (wzero sz)) (@WS b sz (wzero sz)) *) reflexivity. Qed. Lemma wxor_wone : forall sz (w : word sz) b, wxor (WS b w) (wone _) = WS (negb b) w. Proof. (* Goal: forall (sz : nat) (w : word sz) (b : bool), @eq (word (S sz)) (@wxor (S sz) (@WS b sz w) (wone (S sz))) (@WS (negb b) sz w) *) intros. (* Goal: @eq (word (S sz)) (@wxor (S sz) (@WS b sz w) (wone (S sz))) (@WS (negb b) sz w) *) compute [wone natToWord wxor]. (* Goal: @eq (word (S sz)) (@bitwp xorb (S sz) (@WS b sz w) (@WS (mod2 (S O)) sz ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz (Nat.div2 (S O))))) (@WS (negb b) sz w) *) simpl. (* Goal: @eq (word (S sz)) (@WS (xorb b true) sz (@bitwp xorb sz w ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz O))) (@WS (negb b) sz w) *) fold natToWord. (* Goal: @eq (word (S sz)) (@WS (xorb b true) sz (@bitwp xorb sz w (natToWord sz O))) (@WS (negb b) sz w) *) change (natToWord sz 0) with (wzero sz). (* Goal: @eq (word (S sz)) (@WS (xorb b true) sz (@bitwp xorb sz w (wzero sz))) (@WS (negb b) sz w) *) rewrite xorb_true_r. (* Goal: @eq (word (S sz)) (@WS (negb b) sz (@bitwp xorb sz w (wzero sz))) (@WS (negb b) sz w) *) rewrite wxor_comm, wxor_wzero. (* Goal: @eq (word (S sz)) (@WS (negb b) sz w) (@WS (negb b) sz w) *) reflexivity. Qed. Definition wbring (sz : nat) : semi_ring_theory (wzero sz) (wones sz) (@wor sz) (@wand sz) (@eq _) := mk_srt _ _ _ _ _ (@wor_unit _) (@wor_comm _) (@wor_assoc _) (@wand_unit _) (@wand_kill _) (@wand_comm _) (@wand_assoc _) (@wand_or_distr _). Ltac word_simpl := unfold sext, zext, wzero in *; simpl in *. Ltac word_eq := ring. Ltac word_eq1 := match goal with | _ => ring | [ H : _ = _ |- _ ] => ring [H] end. Theorem word_neq : forall sz (w1 w2 : word sz), w1 ^- w2 <> wzero sz -> w1 <> w2. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (_ : not (@eq (word sz) (@wminus sz w1 w2) (wzero sz))), not (@eq (word sz) w1 w2) *) intros; intro; subst. (* Goal: False *) unfold wminus in H. (* Goal: False *) rewrite wminus_inv in H. (* Goal: False *) tauto. Qed. Ltac word_neq := apply word_neq; let H := fresh "H" in intro H; simpl in H; ring_simplify in H; try discriminate. Ltac word_contra := match goal with | [ H : _ <> _ |- False ] => apply H; ring end. Ltac word_contra1 := match goal with | [ H : _ <> _ |- False ] => apply H; match goal with | _ => ring | [ H' : _ = _ |- _ ] => ring [H'] end end. Lemma not_wlt_ge : forall sz (l r : word sz), ((l < r) -> False) -> (r <= l). Proof. (* Goal: forall (sz : nat) (l r : word sz) (_ : forall _ : @wlt sz l r, False), not (@wlt sz l r) *) intros. (* Goal: not (@wlt sz l r) *) case_eq (wlt_dec l r); intros; try contradiction; auto. Qed. Lemma not_wle_gt : forall sz (l r : word sz), ((l <= r) -> False) -> (r < l). Proof. (* Goal: forall (sz : nat) (l r : word sz) (_ : forall _ : not (@wlt sz r l), False), @wlt sz r l *) intros. (* Goal: @wlt sz r l *) case_eq (wlt_dec r l); intros; try contradiction; auto. Qed. Lemma lt_le : forall sz (a b : word sz), a < b -> a <= b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @wlt sz a b), not (@wlt sz b a) *) unfold wlt, N.lt. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq comparison (N.compare (@wordToN sz a) (@wordToN sz b)) Lt), not (@eq comparison (N.compare (@wordToN sz b) (@wordToN sz a)) Lt) *) intros sz a b H H0. (* Goal: False *) rewrite N.compare_antisym in H0. (* Goal: False *) rewrite H in H0. (* Goal: False *) simpl in *. (* Goal: False *) congruence. Qed. Lemma eq_le : forall sz (a b : word sz), a = b -> a <= b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq (word sz) a b), not (@wlt sz b a) *) intros; subst. (* Goal: not (@wlt sz b b) *) unfold wlt, N.lt. (* Goal: not (@eq comparison (N.compare (@wordToN sz b) (@wordToN sz b)) Lt) *) rewrite N.compare_refl. (* Goal: not (@eq comparison Eq Lt) *) congruence. Qed. Lemma wordToN_inj : forall sz (a b : word sz), wordToN a = wordToN b -> a = b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq N (@wordToN sz a) (@wordToN sz b)), @eq (word sz) a b *) induction a; intro b0; rewrite (shatter_word b0); intuition. (* Goal: @eq (word (S n)) (@WS b n a) (@WS (@whd n b0) n (@wtl n b0)) *) simpl in H. (* Goal: @eq (word (S n)) (@WS b n a) (@WS (@whd n b0) n (@wtl n b0)) *) destruct b; destruct (whd b0); intros. (* Goal: @eq (word (S n)) (@WS false n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS false n a) (@WS true n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS true n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS true n a) (@WS true n (@wtl n b0)) *) f_equal. (* Goal: @eq (word (S n)) (@WS false n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS false n a) (@WS true n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS true n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word n) a (@wtl n b0) *) eapply IHa. (* Goal: @eq (word (S n)) (@WS false n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS false n a) (@WS true n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS true n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq N (@wordToN n a) (@wordToN n (@wtl n b0)) *) eapply N.succ_inj in H. (* Goal: @eq (word (S n)) (@WS false n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS false n a) (@WS true n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS true n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq N (@wordToN n a) (@wordToN n (@wtl n b0)) *) destruct (wordToN a); destruct (wordToN (wtl b0)); try congruence. (* Goal: @eq (word (S n)) (@WS false n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS false n a) (@WS true n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS true n a) (@WS false n (@wtl n b0)) *) destruct (wordToN (wtl b0)); destruct (wordToN a); inversion H. (* Goal: @eq (word (S n)) (@WS false n a) (@WS false n (@wtl n b0)) *) (* Goal: @eq (word (S n)) (@WS false n a) (@WS true n (@wtl n b0)) *) destruct (wordToN (wtl b0)); destruct (wordToN a); inversion H. (* Goal: @eq (word (S n)) (@WS false n a) (@WS false n (@wtl n b0)) *) f_equal. (* Goal: @eq (word n) a (@wtl n b0) *) eapply IHa. (* Goal: @eq N (@wordToN n a) (@wordToN n (@wtl n b0)) *) destruct (wordToN a); destruct (wordToN (wtl b0)); try congruence. Qed. Lemma wordToNat_inj : forall sz (a b : word sz), wordToNat a = wordToNat b -> a = b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq nat (@wordToNat sz a) (@wordToNat sz b)), @eq (word sz) a b *) intros; apply wordToN_inj. (* Goal: @eq N (@wordToN sz a) (@wordToN sz b) *) repeat rewrite wordToN_nat. (* Goal: @eq N (N.of_nat (@wordToNat sz a)) (N.of_nat (@wordToNat sz b)) *) apply Nat2N.inj_iff; auto. Qed. Lemma unique_inverse : forall sz (a b1 b2 : word sz), a ^+ b1 = wzero _ -> a ^+ b2 = wzero _ -> b1 = b2. Proof. (* Goal: forall (sz : nat) (a b1 b2 : word sz) (_ : @eq (word sz) (@wplus sz a b1) (wzero sz)) (_ : @eq (word sz) (@wplus sz a b2) (wzero sz)), @eq (word sz) b1 b2 *) intros sz a b1 b2 H *. (* Goal: forall _ : @eq (word sz) (@wplus sz a b2) (wzero sz), @eq (word sz) b1 b2 *) transitivity (b1 ^+ wzero _). (* Goal: @eq (word sz) (@wplus sz b1 (wzero sz)) b2 *) (* Goal: @eq (word sz) b1 (@wplus sz b1 (wzero sz)) *) rewrite wplus_comm. (* Goal: @eq (word sz) (@wplus sz b1 (wzero sz)) b2 *) (* Goal: @eq (word sz) b1 (@wplus sz (wzero sz) b1) *) rewrite wplus_unit. (* Goal: @eq (word sz) (@wplus sz b1 (wzero sz)) b2 *) (* Goal: @eq (word sz) b1 b1 *) auto. (* Goal: @eq (word sz) (@wplus sz b1 (wzero sz)) b2 *) transitivity (b1 ^+ (a ^+ b2)). (* Goal: @eq (word sz) (@wplus sz b1 (@wplus sz a b2)) b2 *) (* Goal: @eq (word sz) (@wplus sz b1 (wzero sz)) (@wplus sz b1 (@wplus sz a b2)) *) congruence. (* Goal: @eq (word sz) (@wplus sz b1 (@wplus sz a b2)) b2 *) rewrite wplus_assoc. (* Goal: @eq (word sz) (@wplus sz (@wplus sz b1 a) b2) b2 *) rewrite (wplus_comm b1). (* Goal: @eq (word sz) (@wplus sz (@wplus sz a b1) b2) b2 *) rewrite H. (* Goal: @eq (word sz) (@wplus sz (wzero sz) b2) b2 *) rewrite wplus_unit. (* Goal: @eq (word sz) b2 b2 *) auto. Qed. Lemma sub_0_eq : forall sz (a b : word sz), a ^- b = wzero _ -> a = b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq (word sz) (@wminus sz a b) (wzero sz)), @eq (word sz) a b *) intros sz a b H. (* Goal: @eq (word sz) a b *) destruct (weq (wneg b) (wneg a)) as [e|n]. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) a b *) transitivity (a ^+ (^~ b ^+ b)). (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz b) b)) b *) (* Goal: @eq (word sz) a (@wplus sz a (@wplus sz (@wneg sz b) b)) *) rewrite (wplus_comm (^~ b)). (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz b) b)) b *) (* Goal: @eq (word sz) a (@wplus sz a (@wplus sz b (@wneg sz b))) *) rewrite wminus_inv. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz b) b)) b *) (* Goal: @eq (word sz) a (@wplus sz a (wzero sz)) *) rewrite wplus_comm. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz b) b)) b *) (* Goal: @eq (word sz) a (@wplus sz (wzero sz) a) *) rewrite wplus_unit. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz b) b)) b *) (* Goal: @eq (word sz) a a *) auto. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz b) b)) b *) rewrite e. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz a) b)) b *) rewrite wplus_assoc. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz (@wplus sz a (@wneg sz a)) b) b *) rewrite wminus_inv. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) (@wplus sz (wzero sz) b) b *) rewrite wplus_unit. (* Goal: @eq (word sz) a b *) (* Goal: @eq (word sz) b b *) auto. (* Goal: @eq (word sz) a b *) unfold wminus in H. (* Goal: @eq (word sz) a b *) generalize (unique_inverse a (wneg a) (^~ b)). (* Goal: forall _ : forall (_ : @eq (word sz) (@wplus sz a (@wneg sz a)) (wzero sz)) (_ : @eq (word sz) (@wplus sz a (@wneg sz b)) (wzero sz)), @eq (word sz) (@wneg sz a) (@wneg sz b), @eq (word sz) a b *) intro H0. (* Goal: @eq (word sz) a b *) elimtype False. (* Goal: False *) apply n. (* Goal: @eq (word sz) (@wneg sz b) (@wneg sz a) *) symmetry; apply H0. (* Goal: @eq (word sz) (@wplus sz a (@wneg sz b)) (wzero sz) *) (* Goal: @eq (word sz) (@wplus sz a (@wneg sz a)) (wzero sz) *) apply wminus_inv. (* Goal: @eq (word sz) (@wplus sz a (@wneg sz b)) (wzero sz) *) auto. Qed. Lemma le_neq_lt : forall sz (a b : word sz), b <= a -> a <> b -> b < a. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@wlt sz a b)) (_ : not (@eq (word sz) a b)), @wlt sz b a *) intros sz a b H H0; destruct (wlt_dec b a) as [?|n]; auto. (* Goal: @wlt sz b a *) elimtype False. (* Goal: False *) apply H0. (* Goal: @eq (word sz) a b *) unfold wlt, N.lt in *. (* Goal: @eq (word sz) a b *) eapply wordToN_inj. (* Goal: @eq N (@wordToN sz a) (@wordToN sz b) *) eapply Ncompare_eq_correct. (* Goal: @eq comparison (N.compare (@wordToN sz a) (@wordToN sz b)) Eq *) case_eq ((wordToN a ?= wordToN b)%N); auto; try congruence. (* Goal: forall _ : @eq comparison (N.compare (@wordToN sz a) (@wordToN sz b)) Gt, @eq comparison Gt Eq *) intros H1. (* Goal: @eq comparison Gt Eq *) rewrite N.compare_antisym in n. (* Goal: @eq comparison Gt Eq *) rewrite H1 in n. (* Goal: @eq comparison Gt Eq *) simpl in *. (* Goal: @eq comparison Gt Eq *) congruence. Qed. Hint Resolve word_neq lt_le eq_le sub_0_eq le_neq_lt : worder. Ltac shatter_word x := match type of x with | word 0 => try rewrite (shatter_word_0 x) in * | word (S ?N) => let x' := fresh in let H := fresh in destruct (@shatter_word_S N x) as [ ? [ x' H ] ]; rewrite H in *; clear H; shatter_word x' end. Lemma rewrite_weq : forall sz (a b : word sz) (pf : a = b), weq a b = left _ pf. Proof. (* Goal: forall (sz : nat) (a b : word sz) (pf : @eq (word sz) a b), @eq (sumbool (@eq (word sz) a b) (not (@eq (word sz) a b))) (@weq sz a b) (@left (@eq (word sz) a b) (not (@eq (word sz) a b)) pf) *) intros sz a b *; destruct (weq a b); try solve [ elimtype False; auto ]. (* Goal: @eq (sumbool (@eq (word sz) a b) (not (@eq (word sz) a b))) (@left (@eq (word sz) a b) (not (@eq (word sz) a b)) e) (@left (@eq (word sz) a b) (not (@eq (word sz) a b)) pf) *) f_equal. (* Goal: @eq (@eq (word sz) a b) e pf *) eapply UIP_dec. (* Goal: forall x y : word sz, sumbool (@eq (word sz) x y) (not (@eq (word sz) x y)) *) eapply weq. Qed. Lemma natToWord_plus : forall sz n m, natToWord sz (n + m) = natToWord _ n ^+ natToWord _ m. Proof. (* Goal: forall sz n m : nat, @eq (word sz) (natToWord sz (Init.Nat.add n m)) (@wplus sz (natToWord sz n) (natToWord sz m)) *) destruct sz as [|sz]; intros n m; intuition. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n m)) (@wplus (S sz) (natToWord (S sz) n) (natToWord (S sz) m)) *) rewrite wplus_alt. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n m)) (@wplusN (S sz) (natToWord (S sz) n) (natToWord (S sz) m)) *) unfold wplusN, wordBinN. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n m)) (natToWord (S sz) (Init.Nat.add (@wordToNat (S sz) (natToWord (S sz) n)) (@wordToNat (S sz) (natToWord (S sz) m)))) *) destruct (wordToNat_natToWord (S sz) n); intuition. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n m)) (natToWord (S sz) (Init.Nat.add (@wordToNat (S sz) (natToWord (S sz) n)) (@wordToNat (S sz) (natToWord (S sz) m)))) *) destruct (wordToNat_natToWord (S sz) m); intuition. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n m)) (natToWord (S sz) (Init.Nat.add (@wordToNat (S sz) (natToWord (S sz) n)) (@wordToNat (S sz) (natToWord (S sz) m)))) *) do 2 match goal with H : _ |- _ => rewrite H; clear H end. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n m)) (natToWord (S sz) (Init.Nat.add (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) (Init.Nat.sub m (Init.Nat.mul x0 (Nat.pow (S (S O)) (S sz)))))) *) match goal with | [ |- context[?n - ?x * pow2 (S ?sz) + (?m - ?x0 * pow2 (S ?sz))] ] => replace (n - x * pow2 (S sz) + (m - x0 * pow2 (S sz))) with (n + m - x * pow2 (S sz) - x0 * pow2 (S sz)) by omega end. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n m)) (natToWord (S sz) (Init.Nat.sub (Init.Nat.sub (Init.Nat.add n m) (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) (Init.Nat.mul x0 (Nat.pow (S (S O)) (S sz))))) *) repeat rewrite drop_sub; auto; omega. Qed. Lemma natToWord_S : forall sz n, natToWord sz (S n) = natToWord _ 1 ^+ natToWord _ n. Proof. (* Goal: forall sz n : nat, @eq (word sz) (natToWord sz (S n)) (@wplus sz (natToWord sz (S O)) (natToWord sz n)) *) intros sz n; change (S n) with (1 + n); apply natToWord_plus. Qed. Theorem natToWord_inj : forall sz n m, natToWord sz n = natToWord sz m -> (n < pow2 sz)%nat -> (m < pow2 sz)%nat -> n = m. Proof. (* Goal: forall (sz n m : nat) (_ : @eq (word sz) (natToWord sz n) (natToWord sz m)) (_ : lt n (Nat.pow (S (S O)) sz)) (_ : lt m (Nat.pow (S (S O)) sz)), @eq nat n m *) intros sz n m H H0 H1. (* Goal: @eq nat n m *) apply (f_equal (@wordToNat _)) in H. (* Goal: @eq nat n m *) destruct (wordToNat_natToWord sz n) as [x H2]. (* Goal: @eq nat n m *) destruct (wordToNat_natToWord sz m) as [x0 H3]. (* Goal: @eq nat n m *) intuition. (* Goal: @eq nat n m *) match goal with | [ H : wordToNat ?x = wordToNat ?y, H' : wordToNat ?x = ?a, H'' : wordToNat ?y = ?b |- _ ] => let H0 := fresh in assert (H0 : a = b) by congruence; clear H H' H''; rename H0 into H end. (* Goal: @eq nat n m *) assert (x = 0). (* Goal: @eq nat n m *) (* Goal: @eq nat x O *) destruct x; auto. (* Goal: @eq nat n m *) (* Goal: @eq nat (S x) O *) simpl in *. (* Goal: @eq nat n m *) (* Goal: @eq nat (S x) O *) generalize dependent (x * pow2 sz). (* Goal: @eq nat n m *) (* Goal: forall (n0 : nat) (_ : le (Init.Nat.add (Nat.pow (S (S O)) sz) n0) n) (_ : @eq nat (Init.Nat.sub n (Init.Nat.add (Nat.pow (S (S O)) sz) n0)) (Init.Nat.sub m (Init.Nat.mul x0 (Nat.pow (S (S O)) sz)))), @eq nat (S x) O *) intros. (* Goal: @eq nat n m *) (* Goal: @eq nat (S x) O *) omega. (* Goal: @eq nat n m *) assert (x0 = 0). (* Goal: @eq nat n m *) (* Goal: @eq nat x0 O *) destruct x0; auto. (* Goal: @eq nat n m *) (* Goal: @eq nat (S x0) O *) simpl in *. (* Goal: @eq nat n m *) (* Goal: @eq nat (S x0) O *) generalize dependent (x0 * pow2 sz). (* Goal: @eq nat n m *) (* Goal: forall (n0 : nat) (_ : le (Init.Nat.add (Nat.pow (S (S O)) sz) n0) m) (_ : @eq nat (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) sz))) (Init.Nat.sub m (Init.Nat.add (Nat.pow (S (S O)) sz) n0))), @eq nat (S x0) O *) intros. (* Goal: @eq nat n m *) (* Goal: @eq nat (S x0) O *) omega. (* Goal: @eq nat n m *) subst; simpl in *; omega. Qed. Lemma wordToNat_natToWord_idempotent : forall sz n, (N.of_nat n < Npow2 sz)%N Proof. (* Goal: forall (sz n : nat) (_ : N.lt (N.of_nat n) (Npow2 sz)), @eq nat (@wordToNat sz (natToWord sz n)) n *) intros sz n H. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) destruct (wordToNat_natToWord sz n) as [x]; intuition. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) destruct x as [|x]. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) simpl in *; omega. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) simpl in *. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) apply Nlt_out in H. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) autorewrite with N in *. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) rewrite Npow2_nat in *. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) generalize dependent (x * pow2 sz). (* Goal: forall (n0 : nat) (_ : @eq nat (@wordToNat sz (natToWord sz n)) (Init.Nat.sub n (Init.Nat.add (Nat.pow (S (S O)) sz) n0))) (_ : le (Init.Nat.add (Nat.pow (S (S O)) sz) n0) n), @eq nat (@wordToNat sz (natToWord sz n)) n *) intros; omega. Qed. Lemma wplus_cancel : forall sz (a b c : word sz), a ^+ c = b ^+ c -> a = b. Proof. (* Goal: forall (sz : nat) (a b c : word sz) (_ : @eq (word sz) (@wplus sz a c) (@wplus sz b c)), @eq (word sz) a b *) intros sz a b c H. (* Goal: @eq (word sz) a b *) apply (f_equal (fun x => x ^+ ^~ c)) in H. (* Goal: @eq (word sz) a b *) repeat rewrite <- wplus_assoc in H. (* Goal: @eq (word sz) a b *) rewrite wminus_inv in H. (* Goal: @eq (word sz) a b *) repeat rewrite (wplus_comm _ (wzero sz)) in H. (* Goal: @eq (word sz) a b *) repeat rewrite wplus_unit in H. (* Goal: @eq (word sz) a b *) assumption. Qed. Lemma wminus_plus_distr: forall {sz} (x y z: word sz), x ^- (y ^+ z) = x ^- y ^- z. Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wminus sz x (@wplus sz y z)) (@wminus sz (@wminus sz x y) z) *) intros. (* Goal: @eq (word sz) (@wminus sz x (@wplus sz y z)) (@wminus sz (@wminus sz x y) z) *) apply wplus_cancel with (c:= y ^+ z). (* Goal: @eq (word sz) (@wplus sz (@wminus sz x (@wplus sz y z)) (@wplus sz y z)) (@wplus sz (@wminus sz (@wminus sz x y) z) (@wplus sz y z)) *) rewrite wminus_def, <-wplus_assoc. (* Goal: @eq (word sz) (@wplus sz x (@wplus sz (@wneg sz (@wplus sz y z)) (@wplus sz y z))) (@wplus sz (@wminus sz (@wminus sz x y) z) (@wplus sz y z)) *) rewrite wplus_comm with (y:= y ^+ z), wminus_inv. (* Goal: @eq (word sz) (@wplus sz x (wzero sz)) (@wplus sz (@wminus sz (@wminus sz x y) z) (@wplus sz y z)) *) rewrite wplus_comm with (x:= x), wplus_unit. (* Goal: @eq (word sz) x (@wplus sz (@wminus sz (@wminus sz x y) z) (@wplus sz y z)) *) rewrite !wminus_def, <-wplus_assoc. (* Goal: @eq (word sz) x (@wplus sz (@wplus sz x (@wneg sz y)) (@wplus sz (@wneg sz z) (@wplus sz y z))) *) rewrite wplus_assoc with (x:= ^~ z). (* Goal: @eq (word sz) x (@wplus sz (@wplus sz x (@wneg sz y)) (@wplus sz (@wplus sz (@wneg sz z) y) z)) *) rewrite wplus_comm with (x:= ^~ z). (* Goal: @eq (word sz) x (@wplus sz (@wplus sz x (@wneg sz y)) (@wplus sz (@wplus sz y (@wneg sz z)) z)) *) rewrite <-wplus_assoc with (x:= y). (* Goal: @eq (word sz) x (@wplus sz (@wplus sz x (@wneg sz y)) (@wplus sz y (@wplus sz (@wneg sz z) z))) *) rewrite wplus_comm with (x:= ^~ z), wminus_inv. (* Goal: @eq (word sz) x (@wplus sz (@wplus sz x (@wneg sz y)) (@wplus sz y (wzero sz))) *) rewrite wplus_comm with (x:= y), wplus_unit. (* Goal: @eq (word sz) x (@wplus sz (@wplus sz x (@wneg sz y)) y) *) rewrite <-wplus_assoc. (* Goal: @eq (word sz) x (@wplus sz x (@wplus sz (@wneg sz y) y)) *) rewrite wplus_comm with (x:= ^~ y), wminus_inv. (* Goal: @eq (word sz) x (@wplus sz x (wzero sz)) *) rewrite wplus_comm, wplus_unit. (* Goal: @eq (word sz) x x *) reflexivity. Qed. Lemma wminus_wplus_undo: forall sz (a b: word sz), a ^- b ^+ b = a. Proof. (* Goal: forall (sz : nat) (a b : word sz), @eq (word sz) (@wplus sz (@wminus sz a b) b) a *) intros. (* Goal: @eq (word sz) (@wplus sz (@wminus sz a b) b) a *) rewrite wminus_def. (* Goal: @eq (word sz) (@wplus sz (@wplus sz a (@wneg sz b)) b) a *) rewrite <- wplus_assoc. (* Goal: @eq (word sz) (@wplus sz a (@wplus sz (@wneg sz b) b)) a *) rewrite (wplus_comm (^~ b)). (* Goal: @eq (word sz) (@wplus sz a (@wplus sz b (@wneg sz b))) a *) rewrite wminus_inv. (* Goal: @eq (word sz) (@wplus sz a (wzero sz)) a *) rewrite wplus_comm. (* Goal: @eq (word sz) (@wplus sz (wzero sz) a) a *) rewrite wplus_unit. (* Goal: @eq (word sz) a a *) reflexivity. Qed. Lemma wneg_zero: forall {sz} (w: word sz), ^~ w = (natToWord sz 0) -> w = natToWord sz 0. Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : @eq (word sz) (@wneg sz w) (natToWord sz O)), @eq (word sz) w (natToWord sz O) *) intros. (* Goal: @eq (word sz) w (natToWord sz O) *) apply wplus_cancel with (c:= ^~ w). (* Goal: @eq (word sz) (@wplus sz w (@wneg sz w)) (@wplus sz (natToWord sz O) (@wneg sz w)) *) rewrite wminus_inv, wplus_unit; auto. Qed. Lemma wneg_idempotent: forall {sz} (w: word sz), ^~ (^~ w) = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wneg sz (@wneg sz w)) w *) intros. (* Goal: @eq (word sz) (@wneg sz (@wneg sz w)) w *) apply sub_0_eq. (* Goal: @eq (word sz) (@wminus sz (@wneg sz (@wneg sz w)) w) (wzero sz) *) rewrite wminus_def. (* Goal: @eq (word sz) (@wplus sz (@wneg sz (@wneg sz w)) (@wneg sz w)) (wzero sz) *) rewrite wplus_comm. (* Goal: @eq (word sz) (@wplus sz (@wneg sz w) (@wneg sz (@wneg sz w))) (wzero sz) *) apply wminus_inv. Qed. Lemma wneg_zero': forall sz, wneg (natToWord sz 0) = natToWord sz 0. Proof. (* Goal: forall sz : nat, @eq (word sz) (@wneg sz (natToWord sz O)) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wneg sz (natToWord sz O)) (natToWord sz O) *) apply wneg_zero. (* Goal: @eq (word sz) (@wneg sz (@wneg sz (natToWord sz O))) (natToWord sz O) *) apply wneg_idempotent. Qed. Lemma wplus_one_neq: forall {sz} (w: word (S sz)), w ^+ (natToWord (S sz) 1) <> w. Proof. (* Goal: forall (sz : nat) (w : word (S sz)), not (@eq (word (S sz)) (@wplus (S sz) w (natToWord (S sz) (S O))) w) *) intros; intro Hx. (* Goal: False *) rewrite wplus_comm in Hx. (* Goal: False *) assert ((natToWord (S sz) 1) ^+ w ^- w = w ^- w) by (rewrite Hx; reflexivity). (* Goal: False *) clear Hx. (* Goal: False *) do 2 rewrite wminus_def in H. (* Goal: False *) rewrite <-wplus_assoc in H. (* Goal: False *) rewrite wminus_inv in H. (* Goal: False *) rewrite wplus_comm, wplus_unit in H. (* Goal: False *) inversion H. Qed. Lemma wneg_one_pow2_minus_one: forall {sz}, wordToNat (^~ (natToWord sz 1)) = pow2 sz - 1. Proof. (* Goal: forall sz : nat, @eq nat (@wordToNat sz (@wneg sz (natToWord sz (S O)))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) *) destruct sz; auto. (* Goal: @eq nat (@wordToNat (S sz) (@wneg (S sz) (natToWord (S sz) (S O)))) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) *) unfold wneg; intros. (* Goal: @eq nat (@wordToNat (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (natToWord (S sz) (S O)))))) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) *) rewrite wordToN_nat, roundTrip_1. (* Goal: @eq nat (@wordToNat (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (N.of_nat (S O))))) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) *) simpl BinNat.N.of_nat. (* Goal: @eq nat (@wordToNat (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (Npos xH)))) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) *) rewrite NToWord_nat, Nnat.N2Nat.inj_sub, Npow2_nat. (* Goal: @eq nat (@wordToNat (S sz) (natToWord (S sz) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (N.to_nat (Npos xH))))) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) *) apply wordToNat_natToWord_2. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) (Nat.pow (S (S O)) (S sz)) *) pose (pow2_zero (S sz)). (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) (Nat.pow (S (S O)) (S sz)) *) omega. Qed. Lemma wones_pow2_minus_one: forall {sz}, wordToNat (wones sz) = pow2 sz - 1. Proof. (* Goal: forall sz : nat, @eq nat (@wordToNat sz (wones sz)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) *) induction sz; simpl; auto. (* Goal: @eq nat (S (Init.Nat.mul (@wordToNat sz (wones sz)) (S (S O)))) (Init.Nat.sub (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) (S O)) *) rewrite IHsz; pose (pow2_zero sz). (* Goal: @eq nat (S (Init.Nat.mul (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (S (S O)))) (Init.Nat.sub (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) (S O)) *) omega. Qed. Lemma pow2_minus_one_wones: forall {sz} (w: word sz), wordToNat w = pow2 sz - 1 -> w = wones sz. Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : @eq nat (@wordToNat sz w) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))), @eq (word sz) w (wones sz) *) intros; rewrite <-wones_pow2_minus_one in H. (* Goal: @eq (word sz) w (wones sz) *) apply wordToNat_inj; auto. Qed. Lemma wones_natToWord: forall sz, wones sz = $ (pow2 sz - 1). Proof. (* Goal: forall sz : nat, @eq (word sz) (wones sz) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))) *) induction sz. (* Goal: @eq (word (S sz)) (wones (S sz)) (natToWord (S sz) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) (* Goal: @eq (word O) (wones O) (natToWord O (Init.Nat.sub (Nat.pow (S (S O)) O) (S O))) *) - (* Goal: @eq (word O) (wones O) (natToWord O (Init.Nat.sub (Nat.pow (S (S O)) O) (S O))) *) reflexivity. (* BG Goal: @eq (word (S sz)) (wones (S sz)) (natToWord (S sz) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) - (* Goal: @eq (word (S sz)) (wones (S sz)) (natToWord (S sz) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) unfold wones. (* Goal: @eq (word (S sz)) (@WS true sz ((fix wones (sz : nat) : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS true sz' (wones sz') end) sz)) (natToWord (S sz) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) fold wones. (* Goal: @eq (word (S sz)) (@WS true sz (wones sz)) (natToWord (S sz) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) rewrite IHsz. (* Goal: @eq (word (S sz)) (@WS true sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)))) (natToWord (S sz) (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) unfold natToWord at 2. (* Goal: @eq (word (S sz)) (@WS true sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)))) (@WS (mod2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) sz ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))))) *) fold natToWord. (* Goal: @eq (word (S sz)) (@WS true sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)))) (@WS (mod2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) sz (natToWord sz (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))))) *) f_equal. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))) (natToWord sz (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)))) *) (* Goal: @eq bool true (mod2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) + (* Goal: @eq bool true (mod2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) rewrite mod2sub. (* Goal: le (S O) (Nat.pow (S (S O)) (S sz)) *) (* Goal: @eq bool true (xorb (mod2 (Nat.pow (S (S O)) (S sz))) (mod2 (S O))) *) * (* Goal: @eq bool true (xorb (mod2 (Nat.pow (S (S O)) (S sz))) (mod2 (S O))) *) simpl. (* Goal: @eq bool true (xorb (mod2 (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O))) true) *) rewrite mod2_pow2_twice. (* Goal: @eq bool true (xorb false true) *) reflexivity. (* BG Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))) (natToWord sz (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)))) *) (* BG Goal: le (S O) (Nat.pow (S (S O)) (S sz)) *) * (* Goal: le (S O) (Nat.pow (S (S O)) (S sz)) *) pose proof (zero_lt_pow2 (S sz)). (* Goal: le (S O) (Nat.pow (S (S O)) (S sz)) *) omega. (* BG Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))) (natToWord sz (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)))) *) + (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))) (natToWord sz (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)))) *) f_equal. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O))) *) unfold pow2 at 2. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Nat.div2 (Init.Nat.sub (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz)) (S O))) *) fold pow2. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Nat.div2 (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)) (S O))) *) rewrite <- (div2_S_double (pow2 sz - 1)). (* Goal: @eq nat (Nat.div2 (S (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))))) (Nat.div2 (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)) (S O))) *) f_equal. (* Goal: @eq nat (S (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)))) (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)) (S O)) *) pose proof (zero_lt_pow2 sz). (* Goal: @eq nat (S (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)))) (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)) (S O)) *) omega. Qed. Lemma wones_wneg_one: forall {sz}, wones sz = ^~ (natToWord sz 1). Proof. (* Goal: forall sz : nat, @eq (word sz) (wones sz) (@wneg sz (natToWord sz (S O))) *) intros; apply wordToNat_inj. (* Goal: @eq nat (@wordToNat sz (wones sz)) (@wordToNat sz (@wneg sz (natToWord sz (S O)))) *) rewrite wneg_one_pow2_minus_one. (* Goal: @eq nat (@wordToNat sz (wones sz)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) *) rewrite wones_pow2_minus_one. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) *) reflexivity. Qed. Lemma wordToNat_natToWord_pred: forall {sz} (w: word sz), w <> wzero sz -> pred (wordToNat w) = wordToNat (w ^- (natToWord sz 1)). Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : not (@eq (word sz) w (wzero sz))), @eq nat (Init.Nat.pred (@wordToNat sz w)) (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) *) intros; remember (wordToNat w) as wn; destruct wn; simpl in *. (* Goal: @eq nat wn (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) *) (* Goal: @eq nat O (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) *) - (* Goal: @eq nat O (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) *) elim H. (* Goal: @eq (word sz) w (wzero sz) *) apply wordToNat_inj. (* Goal: @eq nat (@wordToNat sz w) (@wordToNat sz (wzero sz)) *) rewrite roundTrip_0; auto. (* BG Goal: @eq nat wn (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) *) - (* Goal: @eq nat wn (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) *) apply natToWord_inj with (sz:= sz). (* Goal: lt (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) (Nat.pow (S (S O)) sz) *) (* Goal: lt wn (Nat.pow (S (S O)) sz) *) (* Goal: @eq (word sz) (natToWord sz wn) (natToWord sz (@wordToNat sz (@wminus sz w (natToWord sz (S O))))) *) + (* Goal: @eq (word sz) (natToWord sz wn) (natToWord sz (@wordToNat sz (@wminus sz w (natToWord sz (S O))))) *) rewrite natToWord_wordToNat. (* Goal: @eq (word sz) (natToWord sz wn) (@wminus sz w (natToWord sz (S O))) *) apply wplus_cancel with (c:= (natToWord sz 1)). (* Goal: @eq (word sz) (@wplus sz (natToWord sz wn) (natToWord sz (S O))) (@wplus sz (@wminus sz w (natToWord sz (S O))) (natToWord sz (S O))) *) rewrite wminus_def, <-wplus_assoc. (* Goal: @eq (word sz) (@wplus sz (natToWord sz wn) (natToWord sz (S O))) (@wplus sz w (@wplus sz (@wneg sz (natToWord sz (S O))) (natToWord sz (S O)))) *) rewrite wplus_comm with (x:= ^~ (natToWord sz 1)). (* Goal: @eq (word sz) (@wplus sz (natToWord sz wn) (natToWord sz (S O))) (@wplus sz w (@wplus sz (natToWord sz (S O)) (@wneg sz (natToWord sz (S O))))) *) rewrite wminus_inv. (* Goal: @eq (word sz) (@wplus sz (natToWord sz wn) (natToWord sz (S O))) (@wplus sz w (wzero sz)) *) rewrite wplus_comm with (x:= w). (* Goal: @eq (word sz) (@wplus sz (natToWord sz wn) (natToWord sz (S O))) (@wplus sz (wzero sz) w) *) rewrite wplus_unit. (* Goal: @eq (word sz) (@wplus sz (natToWord sz wn) (natToWord sz (S O))) w *) rewrite wplus_comm, <-natToWord_S. (* Goal: @eq (word sz) (natToWord sz (S wn)) w *) apply wordToNat_inj. (* Goal: @eq nat (@wordToNat sz (natToWord sz (S wn))) (@wordToNat sz w) *) rewrite wordToNat_natToWord_2; auto. (* Goal: lt (S wn) (Nat.pow (S (S O)) sz) *) rewrite Heqwn. (* Goal: lt (@wordToNat sz w) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. (* BG Goal: lt (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) (Nat.pow (S (S O)) sz) *) (* BG Goal: lt wn (Nat.pow (S (S O)) sz) *) + (* Goal: lt wn (Nat.pow (S (S O)) sz) *) pose proof (wordToNat_bound w); omega. (* BG Goal: lt (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) (Nat.pow (S (S O)) sz) *) + (* Goal: lt (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. Qed. Lemma natToWord_mult : forall sz n m, natToWord sz (n * m) = natToWord _ n ^* natToWord _ m. Proof. (* Goal: forall sz n m : nat, @eq (word sz) (natToWord sz (Init.Nat.mul n m)) (@wmult sz (natToWord sz n) (natToWord sz m)) *) destruct sz; intuition. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (@wmult (S sz) (natToWord (S sz) n) (natToWord (S sz) m)) *) rewrite wmult_alt. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (@wmultN (S sz) (natToWord (S sz) n) (natToWord (S sz) m)) *) unfold wmultN, wordBinN. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (natToWord (S sz) (Init.Nat.mul (@wordToNat (S sz) (natToWord (S sz) n)) (@wordToNat (S sz) (natToWord (S sz) m)))) *) destruct (wordToNat_natToWord (S sz) n); intuition. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (natToWord (S sz) (Init.Nat.mul (@wordToNat (S sz) (natToWord (S sz) n)) (@wordToNat (S sz) (natToWord (S sz) m)))) *) destruct (wordToNat_natToWord (S sz) m); intuition. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (natToWord (S sz) (Init.Nat.mul (@wordToNat (S sz) (natToWord (S sz) n)) (@wordToNat (S sz) (natToWord (S sz) m)))) *) rewrite H0; rewrite H2; clear H0 H2. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (natToWord (S sz) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) (Init.Nat.sub m (Init.Nat.mul x0 (Nat.pow (S (S O)) (S sz)))))) *) replace ((n - x * pow2 (S sz)) * (m - x0 * pow2 (S sz))) with ((n - x * pow2 (S sz)) * m - (n - x * pow2 (S sz)) * (x0 * pow2 (S sz))) by (rewrite Nat.mul_sub_distr_l; auto). (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (natToWord (S sz) (Init.Nat.sub (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) (Init.Nat.mul x0 (Nat.pow (S (S O)) (S sz)))))) *) rewrite mult_assoc; rewrite drop_sub. (* Goal: le (Init.Nat.mul (Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) x0) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m) *) (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.mul n m)) (natToWord (S sz) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m)) *) repeat rewrite mult_comm with (m:=m). (* Goal: le (Init.Nat.mul (Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) x0) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m) *) (* Goal: @eq (word (S sz)) (natToWord (S sz) (Nat.mul m n)) (natToWord (S sz) (Nat.mul m (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))))) *) replace (m * (n - x * pow2 (S sz))) with (m * n - m * (x * pow2 (S sz))) by (rewrite Nat.mul_sub_distr_l; auto). (* Goal: le (Init.Nat.mul (Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) x0) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m) *) (* Goal: @eq (word (S sz)) (natToWord (S sz) (Nat.mul m n)) (natToWord (S sz) (Init.Nat.sub (Init.Nat.mul m n) (Init.Nat.mul m (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))))) *) rewrite mult_assoc; rewrite drop_sub. (* Goal: le (Init.Nat.mul (Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) x0) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m) *) (* Goal: le (Init.Nat.mul (Nat.mul m x) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul m n) *) (* Goal: @eq (word (S sz)) (natToWord (S sz) (Nat.mul m n)) (natToWord (S sz) (Init.Nat.mul m n)) *) auto. (* Goal: le (Init.Nat.mul (Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) x0) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m) *) (* Goal: le (Init.Nat.mul (Nat.mul m x) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul m n) *) rewrite <- mult_assoc; apply Nat.mul_le_mono_l; auto. (* Goal: le (Init.Nat.mul (Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) x0) (Nat.pow (S (S O)) (S sz))) (Init.Nat.mul (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) (S sz)))) m) *) rewrite <- mult_assoc; apply Nat.mul_le_mono_l; auto. Qed. Lemma wlt_lt: forall sz (a b : word sz), a < b -> (wordToNat a < wordToNat b)%nat. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @wlt sz a b), lt (@wordToNat sz a) (@wordToNat sz b) *) intros. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) unfold wlt in H. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite wordToN_nat in *. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) apply Nlt_out in H. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite Nat2N.id in *. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) auto. Qed. Lemma wle_le: forall sz (a b : word sz), (a <= b)%word -> (wordToNat a <= wordToNat b)%nat. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@wlt sz b a)), le (@wordToNat sz a) (@wordToNat sz b) *) intros. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) unfold wlt in H. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite wordToN_nat in *. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) apply Nge_out in H. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite Nat2N.id in *. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) auto. Qed. Lemma wlt_lt': forall sz a b, (a < pow2 sz)%nat -> natToWord sz a < b -> (wordToNat (natToWord sz a) < wordToNat b)%nat. Proof. (* Goal: forall (sz a : nat) (b : word sz) (_ : lt a (Nat.pow (S (S O)) sz)) (_ : @wlt sz (natToWord sz a) b), lt (@wordToNat sz (natToWord sz a)) (@wordToNat sz b) *) intros. (* Goal: lt (@wordToNat sz (natToWord sz a)) (@wordToNat sz b) *) apply wlt_lt. (* Goal: @wlt sz (natToWord sz a) b *) auto. Qed. Lemma lt_word_lt_nat : forall (sz:nat) (n:word sz) (m:nat), (n < (natToWord sz m))%word -> (wordToNat n < m)%nat. Proof. (* Goal: forall (sz : nat) (n : word sz) (m : nat) (_ : @wlt sz n (natToWord sz m)), lt (@wordToNat sz n) m *) intros. (* Goal: lt (@wordToNat sz n) m *) apply wlt_lt in H. (* Goal: lt (@wordToNat sz n) m *) destruct (wordToNat_natToWord' sz m). (* Goal: lt (@wordToNat sz n) m *) rewrite <- H0. (* Goal: lt (@wordToNat sz n) (Init.Nat.add (@wordToNat sz (natToWord sz m)) (Init.Nat.mul x (Nat.pow (S (S O)) sz))) *) apply lt_plus_trans with (p := x * pow2 sz). (* Goal: lt (@wordToNat sz n) (@wordToNat sz (natToWord sz m)) *) assumption. Qed. Lemma le_word_le_nat : forall (sz:nat) (n:word sz) (m:nat), (n <= (natToWord sz m))%word -> (wordToNat n <= m)%nat. Proof. (* Goal: forall (sz : nat) (n : word sz) (m : nat) (_ : not (@wlt sz (natToWord sz m) n)), le (@wordToNat sz n) m *) intros. (* Goal: le (@wordToNat sz n) m *) apply wle_le in H. (* Goal: le (@wordToNat sz n) m *) destruct (wordToNat_natToWord' sz m). (* Goal: le (@wordToNat sz n) m *) rewrite <- H0. (* Goal: le (@wordToNat sz n) (Init.Nat.add (@wordToNat sz (natToWord sz m)) (Init.Nat.mul x (Nat.pow (S (S O)) sz))) *) apply le_plus_trans with (p := x * pow2 sz). (* Goal: le (@wordToNat sz n) (@wordToNat sz (natToWord sz m)) *) assumption. Qed. Lemma lt_word_le_nat : forall (sz:nat) (n:word sz) (m:nat), (n < (natToWord sz m))%word -> (wordToNat n <= m)%nat. Proof. (* Goal: forall (sz : nat) (n : word sz) (m : nat) (_ : @wlt sz n (natToWord sz m)), le (@wordToNat sz n) m *) intros. (* Goal: le (@wordToNat sz n) m *) apply lt_word_lt_nat in H. (* Goal: le (@wordToNat sz n) m *) apply Nat.lt_le_incl. (* Goal: lt (@wordToNat sz n) m *) assumption. Qed. Hint Resolve lt_word_le_nat. Lemma wordToNat_natToWord_idempotent' : forall sz n, (n < pow2 sz)%nat -> wordToNat (natToWord sz n) = n. Proof. (* Goal: forall (sz n : nat) (_ : lt n (Nat.pow (S (S O)) sz)), @eq nat (@wordToNat sz (natToWord sz n)) n *) intros. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) destruct (wordToNat_natToWord sz n); intuition. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) destruct x. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) simpl in *; omega. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) simpl in *. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) generalize dependent (x * pow2 sz). (* Goal: forall (n0 : nat) (_ : @eq nat (@wordToNat sz (natToWord sz n)) (Init.Nat.sub n (Init.Nat.add (Nat.pow (S (S O)) sz) n0))) (_ : le (Init.Nat.add (Nat.pow (S (S O)) sz) n0) n), @eq nat (@wordToNat sz (natToWord sz n)) n *) intros; omega. Qed. Lemma le_word_le_nat': forall (sz:nat) n m, (n < pow2 sz)%nat -> (natToWord sz n <= m)%word -> (n <= wordToNat m)%nat. Proof. (* Goal: forall (sz n : nat) (m : word sz) (_ : lt n (Nat.pow (S (S O)) sz)) (_ : not (@wlt sz m (natToWord sz n))), le n (@wordToNat sz m) *) intros. (* Goal: le n (@wordToNat sz m) *) apply wle_le in H0. (* Goal: le n (@wordToNat sz m) *) rewrite wordToNat_natToWord_idempotent' in H0; auto. Qed. Lemma wordToNat_natToWord_bound : forall sz n (bound : word sz), (n <= wordToNat bound)%nat -> wordToNat (natToWord sz n) = n. Proof. (* Goal: forall (sz n : nat) (bound : word sz) (_ : le n (@wordToNat sz bound)), @eq nat (@wordToNat sz (natToWord sz n)) n *) intros. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) n *) apply wordToNat_natToWord_idempotent'. (* Goal: lt n (Nat.pow (S (S O)) sz) *) eapply le_lt_trans; eauto. (* Goal: lt (@wordToNat sz bound) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. Qed. Lemma wordToNat_natToWord_le : forall sz n, (wordToNat (natToWord sz n) <= n)%nat. Lemma wordToNat_natToWord_lt : forall sz n b, (n < b -> wordToNat (natToWord sz n) < b)%nat. Lemma wordToNat_eq_natToWord : forall sz (w : word sz) n, wordToNat w = n -> w = natToWord sz n. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat) (_ : @eq nat (@wordToNat sz w) n), @eq (word sz) w (natToWord sz n) *) intros. (* Goal: @eq (word sz) w (natToWord sz n) *) rewrite <- H. (* Goal: @eq (word sz) w (natToWord sz (@wordToNat sz w)) *) rewrite natToWord_wordToNat. (* Goal: @eq (word sz) w w *) auto. Qed. Lemma wlt_lt_bound: forall sz (a : word sz) (b bound : nat), (a < natToWord sz b)%word -> (b <= wordToNat (natToWord sz bound))%nat -> (wordToNat a < b)%nat. Proof. (* Goal: forall (sz : nat) (a : word sz) (b bound : nat) (_ : @wlt sz a (natToWord sz b)) (_ : le b (@wordToNat sz (natToWord sz bound))), lt (@wordToNat sz a) b *) intros. (* Goal: lt (@wordToNat sz a) b *) apply wlt_lt in H. (* Goal: lt (@wordToNat sz a) b *) erewrite wordToNat_natToWord_bound in H; eauto. Qed. Lemma natplus1_wordplus1_eq: forall sz (a bound : word sz), (0 < sz)%nat -> (a < bound)%word -> (wordToNat a) + 1 = wordToNat (a ^+ (natToWord sz 1)). Lemma lt_wlt: forall sz (n : word sz) m, (wordToNat n < wordToNat m)%nat -> n < m. Proof. (* Goal: forall (sz : nat) (n m : word sz) (_ : lt (@wordToNat sz n) (@wordToNat sz m)), @wlt sz n m *) intros. (* Goal: @wlt sz n m *) unfold wlt. (* Goal: N.lt (@wordToN sz n) (@wordToN sz m) *) repeat rewrite wordToN_nat. (* Goal: N.lt (N.of_nat (@wordToNat sz n)) (N.of_nat (@wordToNat sz m)) *) apply Nlt_in. (* Goal: lt (N.to_nat (N.of_nat (@wordToNat sz n))) (N.to_nat (N.of_nat (@wordToNat sz m))) *) repeat rewrite Nat2N.id. (* Goal: lt (@wordToNat sz n) (@wordToNat sz m) *) auto. Qed. Lemma le_wle: forall sz (n : word sz) m, (wordToNat n <= wordToNat m)%nat -> n <= m. Proof. (* Goal: forall (sz : nat) (n m : word sz) (_ : le (@wordToNat sz n) (@wordToNat sz m)), not (@wlt sz m n) *) intros. (* Goal: not (@wlt sz m n) *) unfold wlt. (* Goal: not (N.lt (@wordToN sz m) (@wordToN sz n)) *) repeat rewrite wordToN_nat. (* Goal: not (N.lt (N.of_nat (@wordToNat sz m)) (N.of_nat (@wordToNat sz n))) *) apply N.le_ngt. (* Goal: N.le (N.of_nat (@wordToNat sz n)) (N.of_nat (@wordToNat sz m)) *) apply N.ge_le. (* Goal: N.ge (N.of_nat (@wordToNat sz m)) (N.of_nat (@wordToNat sz n)) *) apply Nge_in. (* Goal: ge (N.to_nat (N.of_nat (@wordToNat sz m))) (N.to_nat (N.of_nat (@wordToNat sz n))) *) repeat rewrite Nat2N.id. (* Goal: ge (@wordToNat sz m) (@wordToNat sz n) *) auto. Qed. Lemma wlt_wle_incl : forall sz (a b : word sz), (a < b)%word -> (a <= b)%word. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @wlt sz a b), not (@wlt sz b a) *) intros. (* Goal: not (@wlt sz b a) *) apply wlt_lt in H. (* Goal: not (@wlt sz b a) *) apply le_wle. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) omega. Qed. Lemma wminus_Alt2: forall sz x y, y <= x -> @wminusN sz x y = wordBinN minus x y. Proof. (* Goal: forall (sz : nat) (x y : word sz) (_ : not (@wlt sz x y)), @eq (word sz) (@wminusN sz x y) (@wordBinN Init.Nat.sub sz x y) *) intros. (* Goal: @eq (word sz) (@wminusN sz x y) (@wordBinN Init.Nat.sub sz x y) *) unfold wminusN, wplusN, wnegN, wordBinN. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) destruct (weq y (natToWord sz 0)); subst. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz (natToWord sz O))))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz (natToWord sz O)))) *) rewrite roundTrip_0. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) O))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) O)) *) repeat rewrite <- minus_n_O. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Nat.pow (S (S O)) sz))))) (natToWord sz (@wordToNat sz x)) *) rewrite <- drop_sub with (k:=1) (n:=pow2 sz); try omega. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz))))))) (natToWord sz (@wordToNat sz x)) *) replace (pow2 sz - 1 * pow2 sz) with (0) by omega. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz O)))) (natToWord sz (@wordToNat sz x)) *) rewrite roundTrip_0. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) O)) (natToWord sz (@wordToNat sz x)) *) rewrite <- plus_n_O. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (@wordToNat sz x)) (natToWord sz (@wordToNat sz x)) *) reflexivity. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) rewrite wordToNat_natToWord_idempotent' with (n:=pow2 sz - wordToNat y). (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) rewrite <- drop_sub with (k:=1). (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) simpl. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) (Init.Nat.add (Nat.pow (S (S O)) sz) O))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) rewrite <- plus_n_O. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) (Nat.pow (S (S O)) sz))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) replace (wordToNat x + (pow2 sz - wordToNat y) - pow2 sz) with (wordToNat x - wordToNat y). (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) (* Goal: @eq nat (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y)) (Init.Nat.sub (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) (Nat.pow (S (S O)) sz)) *) (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) (natToWord sz (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) auto. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) (* Goal: @eq nat (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y)) (Init.Nat.sub (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) (Nat.pow (S (S O)) sz)) *) rewrite Nat.add_sub_assoc. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) (* Goal: le (@wordToNat sz y) (Nat.pow (S (S O)) sz) *) (* Goal: @eq nat (Init.Nat.sub (@wordToNat sz x) (@wordToNat sz y)) (Init.Nat.sub (Nat.sub (Nat.add (@wordToNat sz x) (Nat.pow (S (S O)) sz)) (@wordToNat sz y)) (Nat.pow (S (S O)) sz)) *) omega. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) (* Goal: le (@wordToNat sz y) (Nat.pow (S (S O)) sz) *) remember (wordToNat_bound y); omega. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.mul (S O) (Nat.pow (S (S O)) sz)) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) simpl. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Init.Nat.add (Nat.pow (S (S O)) sz) O) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) rewrite <- plus_n_O. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Nat.pow (S (S O)) sz) (Init.Nat.add (@wordToNat sz x) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y))) *) rewrite Nat.add_sub_assoc; [| remember (wordToNat_bound y); omega ]. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Nat.pow (S (S O)) sz) (Nat.sub (Nat.add (@wordToNat sz x) (Nat.pow (S (S O)) sz)) (@wordToNat sz y)) *) rewrite plus_comm. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (Nat.pow (S (S O)) sz) (Nat.sub (Nat.add (Nat.pow (S (S O)) sz) (@wordToNat sz x)) (@wordToNat sz y)) *) rewrite <- Nat.add_sub_assoc. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (@wordToNat sz y) (@wordToNat sz x) *) (* Goal: le (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) (Nat.sub (@wordToNat sz x) (@wordToNat sz y))) *) omega. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: le (@wordToNat sz y) (@wordToNat sz x) *) apply Nat.nlt_ge. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: not (lt (@wordToNat sz x) (@wordToNat sz y)) *) unfold not in *; intros. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: False *) apply H. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) (* Goal: @wlt sz x y *) apply lt_wlt; auto. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz y)) (Nat.pow (S (S O)) sz) *) apply Nat.sub_lt. (* Goal: lt O (@wordToNat sz y) *) (* Goal: le (@wordToNat sz y) (Nat.pow (S (S O)) sz) *) remember (wordToNat_bound y); omega. (* Goal: lt O (@wordToNat sz y) *) assert (wordToNat y <> 0); try omega. (* Goal: not (@eq nat (@wordToNat sz y) O) *) assert (wordToN y <> wordToN (natToWord sz 0)). (* Goal: not (@eq nat (@wordToNat sz y) O) *) (* Goal: not (@eq N (@wordToN sz y) (@wordToN sz (natToWord sz O))) *) unfold not in *. (* Goal: not (@eq nat (@wordToNat sz y) O) *) (* Goal: forall _ : @eq N (@wordToN sz y) (@wordToN sz (natToWord sz O)), False *) intros. (* Goal: not (@eq nat (@wordToNat sz y) O) *) (* Goal: False *) apply n. (* Goal: not (@eq nat (@wordToNat sz y) O) *) (* Goal: @eq (word sz) y (natToWord sz O) *) apply wordToN_inj. (* Goal: not (@eq nat (@wordToNat sz y) O) *) (* Goal: @eq N (@wordToN sz y) (@wordToN sz (natToWord sz O)) *) auto. (* Goal: not (@eq nat (@wordToNat sz y) O) *) repeat rewrite wordToN_nat in H0. (* Goal: not (@eq nat (@wordToNat sz y) O) *) unfold not in *. (* Goal: forall _ : @eq nat (@wordToNat sz y) O, False *) intros. (* Goal: False *) apply H0. (* Goal: @eq N (N.of_nat (@wordToNat sz y)) (N.of_nat (@wordToNat sz (natToWord sz O))) *) apply N2Nat.inj. (* Goal: @eq nat (N.to_nat (N.of_nat (@wordToNat sz y))) (N.to_nat (N.of_nat (@wordToNat sz (natToWord sz O)))) *) repeat rewrite Nat2N.id. (* Goal: @eq nat (@wordToNat sz y) (@wordToNat sz (natToWord sz O)) *) rewrite roundTrip_0. (* Goal: @eq nat (@wordToNat sz y) O *) auto. Qed. Theorem wlt_wf: forall sz, well_founded (@wlt sz). Proof. (* Goal: forall sz : nat, @well_founded (word sz) (@wlt sz) *) intros. (* Goal: @well_founded (word sz) (@wlt sz) *) eapply well_founded_lt_compat with (f:=@wordToNat sz). (* Goal: forall (x y : word sz) (_ : @wlt sz x y), lt (@wordToNat sz x) (@wordToNat sz y) *) apply wlt_lt. Qed. Ltac wlt_ind := match goal with | [ |- forall (n: word ?len), ?P ] => refine (well_founded_ind (@wlt_wf len) (fun n => P) _) end. Theorem wordToNat_plusone: forall sz w w', w < w' -> wordToNat (w ^+ natToWord sz 1) = S (wordToNat w). Theorem wordToNat_minus_one': forall sz n, n <> natToWord sz 0 -> S (wordToNat (n ^- natToWord sz 1)) = wordToNat n. Proof. (* Goal: forall (sz : nat) (n : word sz) (_ : not (@eq (word sz) n (natToWord sz O))), @eq nat (S (@wordToNat sz (@wminus sz n (natToWord sz (S O))))) (@wordToNat sz n) *) intros. (* Goal: @eq nat (S (@wordToNat sz (@wminus sz n (natToWord sz (S O))))) (@wordToNat sz n) *) destruct sz. (* Goal: @eq nat (S (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O))))) (@wordToNat (S sz) n) *) (* Goal: @eq nat (S (@wordToNat O (@wminus O n (natToWord O (S O))))) (@wordToNat O n) *) rewrite word0 with (w:=n) in H. (* Goal: @eq nat (S (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O))))) (@wordToNat (S sz) n) *) (* Goal: @eq nat (S (@wordToNat O (@wminus O n (natToWord O (S O))))) (@wordToNat O n) *) rewrite word0 with (w:=natToWord 0 0) in H. (* Goal: @eq nat (S (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O))))) (@wordToNat (S sz) n) *) (* Goal: @eq nat (S (@wordToNat O (@wminus O n (natToWord O (S O))))) (@wordToNat O n) *) exfalso; auto. (* Goal: @eq nat (S (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O))))) (@wordToNat (S sz) n) *) destruct (weq n (natToWord (S sz) 0)); intuition. (* Goal: @eq nat (S (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O))))) (@wordToNat (S sz) n) *) rewrite wminus_Alt. (* Goal: @eq nat (S (@wordToNat (S sz) (@wminusN (S sz) n (natToWord (S sz) (S O))))) (@wordToNat (S sz) n) *) rewrite wminus_Alt2. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (S (@wordToNat (S sz) (@wordBinN Init.Nat.sub (S sz) n (natToWord (S sz) (S O))))) (@wordToNat (S sz) n) *) unfold wordBinN. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (S (@wordToNat (S sz) (natToWord (S sz) (Init.Nat.sub (@wordToNat (S sz) n) (@wordToNat (S sz) (natToWord (S sz) (S O))))))) (@wordToNat (S sz) n) *) rewrite roundTrip_1. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (S (@wordToNat (S sz) (natToWord (S sz) (Init.Nat.sub (@wordToNat (S sz) n) (S O))))) (@wordToNat (S sz) n) *) erewrite wordToNat_natToWord_bound with (bound:=n); try omega. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (S (Init.Nat.sub (@wordToNat (S sz) n) (S O))) (@wordToNat (S sz) n) *) assert (wordToNat n <> 0); try omega. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: not (@eq nat (@wordToNat (S sz) n) O) *) unfold not; intros; apply n0; clear n0. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq (word (S sz)) n (natToWord (S sz) O) *) rewrite <- H0; rewrite natToWord_wordToNat; auto. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) unfold not; intros; apply n0; clear n0. (* Goal: @eq (word (S sz)) n (natToWord (S sz) O) *) apply wlt_lt in H0. (* Goal: @eq (word (S sz)) n (natToWord (S sz) O) *) replace n with (natToWord (S sz) (wordToNat n)) by (rewrite natToWord_wordToNat; auto). (* Goal: @eq (word (S sz)) (natToWord (S sz) (@wordToNat (S sz) n)) (natToWord (S sz) O) *) f_equal; rewrite roundTrip_1 in *. (* Goal: @eq nat (@wordToNat (S sz) n) O *) omega. Qed. Theorem wordToNat_minus_one: forall sz n, n <> natToWord sz 0 -> wordToNat (n ^- natToWord sz 1) = wordToNat n - 1. Proof. (* Goal: forall (sz : nat) (n : word sz) (_ : not (@eq (word sz) n (natToWord sz O))), @eq nat (@wordToNat sz (@wminus sz n (natToWord sz (S O)))) (Init.Nat.sub (@wordToNat sz n) (S O)) *) intros. (* Goal: @eq nat (@wordToNat sz (@wminus sz n (natToWord sz (S O)))) (Init.Nat.sub (@wordToNat sz n) (S O)) *) erewrite Nat.succ_inj with (n2 := wordToNat (n ^- (natToWord sz 1))); auto. (* Goal: @eq nat (S (Init.Nat.sub (@wordToNat sz n) (S O))) (S (@wordToNat sz (@wminus sz n (natToWord sz (S O))))) *) rewrite wordToNat_minus_one'; auto. (* Goal: @eq nat (S (Init.Nat.sub (@wordToNat sz n) (S O))) (@wordToNat sz n) *) assert (wordToNat n <> 0). (* Goal: @eq nat (S (Init.Nat.sub (@wordToNat sz n) (S O))) (@wordToNat sz n) *) (* Goal: not (@eq nat (@wordToNat sz n) O) *) intuition. (* Goal: @eq nat (S (Init.Nat.sub (@wordToNat sz n) (S O))) (@wordToNat sz n) *) (* Goal: False *) erewrite <- roundTrip_0 with (sz := sz) in H0. (* Goal: @eq nat (S (Init.Nat.sub (@wordToNat sz n) (S O))) (@wordToNat sz n) *) (* Goal: False *) apply wordToNat_inj in H0; tauto. (* Goal: @eq nat (S (Init.Nat.sub (@wordToNat sz n) (S O))) (@wordToNat sz n) *) omega. Qed. Lemma lt_minus : forall a b c, (b <= a -> b < c -> a < c -> a - b < c)%nat. Proof. (* Goal: forall (a b c : nat) (_ : le b a) (_ : lt b c) (_ : lt a c), lt (Init.Nat.sub a b) c *) intros; omega. Qed. Lemma wminus_minus : forall sz (a b : word sz), b <= a -> wordToNat (a ^- b) = wordToNat a - wordToNat b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@wlt sz a b)), @eq nat (@wordToNat sz (@wminus sz a b)) (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) *) intros. (* Goal: @eq nat (@wordToNat sz (@wminus sz a b)) (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) *) rewrite wminus_Alt. (* Goal: @eq nat (@wordToNat sz (@wminusN sz a b)) (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) *) rewrite wminus_Alt2; auto. (* Goal: @eq nat (@wordToNat sz (@wordBinN Init.Nat.sub sz a b)) (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) *) unfold wordBinN. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)))) (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) *) eapply wordToNat_natToWord_idempotent'. (* Goal: lt (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) (Nat.pow (S (S O)) sz) *) apply lt_minus. (* Goal: lt (@wordToNat sz a) (Nat.pow (S (S O)) sz) *) (* Goal: lt (@wordToNat sz b) (Nat.pow (S (S O)) sz) *) (* Goal: le (@wordToNat sz b) (@wordToNat sz a) *) apply wle_le; auto. (* Goal: lt (@wordToNat sz a) (Nat.pow (S (S O)) sz) *) (* Goal: lt (@wordToNat sz b) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. (* Goal: lt (@wordToNat sz a) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. Qed. Lemma wminus_minus': forall (sz : nat) (a b : word sz), (#b <= #a)%nat -> #(a ^- b) = #a - #b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : le (@wordToNat sz b) (@wordToNat sz a)), @eq nat (@wordToNat sz (@wminus sz a b)) (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) *) intros. (* Goal: @eq nat (@wordToNat sz (@wminus sz a b)) (Init.Nat.sub (@wordToNat sz a) (@wordToNat sz b)) *) apply wminus_minus. (* Goal: not (@wlt sz a b) *) unfold wlt. (* Goal: not (N.lt (@wordToN sz a) (@wordToN sz b)) *) intro C. (* Goal: False *) apply Nlt_out in C. (* Goal: False *) rewrite! wordToN_to_nat in *. (* Goal: False *) omega. Qed. Lemma wordToNat_neq_inj: forall sz (a b : word sz), a <> b <-> wordToNat a <> wordToNat b. Lemma natToWord_discriminate: forall sz, (sz > 0)%nat -> natToWord sz 0 <> natToWord sz 1. Proof. (* Goal: forall (sz : nat) (_ : gt sz O), not (@eq (word sz) (natToWord sz O) (natToWord sz (S O))) *) unfold not. (* Goal: forall (sz : nat) (_ : gt sz O) (_ : @eq (word sz) (natToWord sz O) (natToWord sz (S O))), False *) intros. (* Goal: False *) induction sz. (* Goal: False *) (* Goal: False *) omega. (* Goal: False *) unfold natToWord in H0; fold natToWord in H0. (* Goal: False *) discriminate H0. Qed. Definition bit_dec : forall (a : word 1), {a = $0} + {a = $1}. Proof. (* Goal: forall a : word (S O), sumbool (@eq (word (S O)) a (natToWord (S O) O)) (@eq (word (S O)) a (natToWord (S O) (S O))) *) intro. (* Goal: sumbool (@eq (word (S O)) a (natToWord (S O) O)) (@eq (word (S O)) a (natToWord (S O) (S O))) *) rewrite (shatter_word a). (* Goal: sumbool (@eq (word (S O)) (@WS (@whd O a) O (@wtl O a)) (natToWord (S O) O)) (@eq (word (S O)) (@WS (@whd O a) O (@wtl O a)) (natToWord (S O) (S O))) *) replace (wtl a) with WO by auto. (* Goal: sumbool (@eq (word (S O)) (@WS (@whd O a) O WO) (natToWord (S O) O)) (@eq (word (S O)) (@WS (@whd O a) O WO) (natToWord (S O) (S O))) *) destruct (whd a). (* Goal: sumbool (@eq (word (S O)) (@WS false O WO) (natToWord (S O) O)) (@eq (word (S O)) (@WS false O WO) (natToWord (S O) (S O))) *) (* Goal: sumbool (@eq (word (S O)) (@WS true O WO) (natToWord (S O) O)) (@eq (word (S O)) (@WS true O WO) (natToWord (S O) (S O))) *) right; apply eq_refl. (* Goal: sumbool (@eq (word (S O)) (@WS false O WO) (natToWord (S O) O)) (@eq (word (S O)) (@WS false O WO) (natToWord (S O) (S O))) *) left; apply eq_refl. Qed. Lemma neq0_wneq0: forall sz (n : word sz), wordToNat n <> 0 <-> n <> $0. Proof. (* Goal: forall (sz : nat) (n : word sz), iff (not (@eq nat (@wordToNat sz n) O)) (not (@eq (word sz) n (natToWord sz O))) *) split; intros. (* Goal: not (@eq nat (@wordToNat sz n) O) *) (* Goal: not (@eq (word sz) n (natToWord sz O)) *) apply wordToNat_neq_inj. (* Goal: not (@eq nat (@wordToNat sz n) O) *) (* Goal: not (@eq nat (@wordToNat sz n) (@wordToNat sz (natToWord sz O))) *) rewrite roundTrip_0; auto. (* Goal: not (@eq nat (@wordToNat sz n) O) *) apply wordToNat_neq_inj in H. (* Goal: not (@eq nat (@wordToNat sz n) O) *) rewrite roundTrip_0 in H; auto. Qed. Lemma gt0_wneq0: forall sz (n : word sz), (wordToNat n > 0)%nat <-> n <> $0. Proof. (* Goal: forall (sz : nat) (n : word sz), iff (gt (@wordToNat sz n) O) (not (@eq (word sz) n (natToWord sz O))) *) split; intros. (* Goal: gt (@wordToNat sz n) O *) (* Goal: not (@eq (word sz) n (natToWord sz O)) *) apply neq0_wneq0; omega. (* Goal: gt (@wordToNat sz n) O *) apply wordToNat_neq_inj in H. (* Goal: gt (@wordToNat sz n) O *) rewrite roundTrip_0 in H; omega. Qed. Lemma weq_minus1_wlt: forall sz (a b : word sz), (a <> $0 -> a ^- $1 = b -> a > b)%word. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@eq (word sz) a (natToWord sz O))) (_ : @eq (word sz) (@wminus sz a (natToWord sz (S O))) b), @wlt sz b a *) intros. (* Goal: @wlt sz b a *) apply lt_wlt; subst. (* Goal: lt (@wordToNat sz (@wminus sz a (natToWord sz (S O)))) (@wordToNat sz a) *) rewrite wordToNat_minus_one; auto. (* Goal: lt (Init.Nat.sub (@wordToNat sz a) (S O)) (@wordToNat sz a) *) apply gt0_wneq0 in H. (* Goal: lt (Init.Nat.sub (@wordToNat sz a) (S O)) (@wordToNat sz a) *) omega. Qed. Lemma wordnat_minus1_eq : forall sz n (w : word sz), (n > 0)%nat -> n = wordToNat w -> n - 1 = wordToNat (w ^- $1). Proof. (* Goal: forall (sz n : nat) (w : word sz) (_ : gt n O) (_ : @eq nat n (@wordToNat sz w)), @eq nat (Init.Nat.sub n (S O)) (@wordToNat sz (@wminus sz w (natToWord sz (S O)))) *) intros; rewrite wordToNat_minus_one; auto. (* Goal: not (@eq (word sz) w (natToWord sz O)) *) apply gt0_wneq0; subst; auto. Qed. Theorem wlshift_0 : forall sz (w : word sz), @wlshift sz w 0 = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wlshift sz w O) w *) intros. (* Goal: @eq (word sz) (@wlshift sz w O) w *) unfold wlshift. (* Goal: @eq (word sz) (split1 sz O (@eq_rec_r nat (Nat.add O sz) (fun n : nat => word n) (@combine O (wzero O) sz w) (Nat.add sz O) (Nat.add_comm sz O))) w *) eapply split1_0. Qed. Theorem wrshift_0 : forall sz (w : word sz), @wrshift sz w 0 = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wrshift sz w O) w *) intros. (* Goal: @eq (word sz) (@wrshift sz w O) w *) unfold wrshift. (* Goal: @eq (word sz) (split2 O sz (@eq_rec_r nat (Nat.add sz O) (fun n : nat => word n) (@combine sz w O (wzero O)) (Nat.add O sz) (Nat.add_comm O sz))) w *) simpl. (* Goal: @eq (word sz) (@eq_rec_r nat (Nat.add sz O) (fun n : nat => word n) (@combine sz w O (wzero O)) sz (Nat.add_comm O sz)) w *) rewrite combine_n_0. (* Goal: @eq (word sz) (@eq_rec_r nat (Nat.add sz O) (fun n : nat => word n) (@eq_rect nat sz word w (Init.Nat.add sz O) (plus_n_O sz)) sz (Nat.add_comm O sz)) w *) eq_rect_simpl. (* Goal: @eq (word sz) w w *) reflexivity. Qed. Theorem wlshift_gt : forall sz n (w : word sz), (n > sz)%nat -> wlshift w n = wzero sz. Theorem wrshift_gt : forall sz n (w : word sz), (n > sz)%nat -> wrshift w n = wzero sz. Theorem wlshift_bitwp : forall sz (w1 w2 : word sz) f n, wlshift (bitwp f w1 w2) n = split1 sz n ( eq_rec _ word (combine (wzero n) (bitwp f w1 w2)) _ (eq_sym (Nat.add_comm sz n))). Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (f : forall (_ : bool) (_ : bool), bool) (n : nat), @eq (word sz) (@wlshift sz (@bitwp f sz w1 w2) n) (split1 sz n (@eq_rec nat (Init.Nat.add n sz) word (@combine n (wzero n) sz (@bitwp f sz w1 w2)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) intros. (* Goal: @eq (word sz) (@wlshift sz (@bitwp f sz w1 w2) n) (split1 sz n (@eq_rec nat (Init.Nat.add n sz) word (@combine n (wzero n) sz (@bitwp f sz w1 w2)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) unfold wlshift. (* Goal: @eq (word sz) (split1 sz n (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz (@bitwp f sz w1 w2)) (Nat.add sz n) (Nat.add_comm sz n))) (split1 sz n (@eq_rec nat (Init.Nat.add n sz) word (@combine n (wzero n) sz (@bitwp f sz w1 w2)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) eq_rect_simpl. (* Goal: @eq (word sz) (split1 sz n (@eq_rect nat (Nat.add n sz) (fun y : nat => word y) (@combine n (wzero n) sz (@bitwp f sz w1 w2)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wzero n) sz (@bitwp f sz w1 w2)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) reflexivity. Qed. Theorem wrshift_bitwp : forall sz (w1 w2 : word sz) f n, wrshift (bitwp f w1 w2) n = split2 n sz ( eq_rect _ word (combine (bitwp f w1 w2) (wzero n)) _ (eq_sym (Nat.add_comm n sz))). Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (f : forall (_ : bool) (_ : bool), bool) (n : nat), @eq (word sz) (@wrshift sz (@bitwp f sz w1 w2) n) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@bitwp f sz w1 w2) n (wzero n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) intros. (* Goal: @eq (word sz) (@wrshift sz (@bitwp f sz w1 w2) n) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@bitwp f sz w1 w2) n (wzero n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) unfold wrshift. (* Goal: @eq (word sz) (split2 n sz (@eq_rec_r nat (Nat.add sz n) (fun n : nat => word n) (@combine sz (@bitwp f sz w1 w2) n (wzero n)) (Nat.add n sz) (Nat.add_comm n sz))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@bitwp f sz w1 w2) n (wzero n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) eq_rect_simpl. (* Goal: @eq (word sz) (split2 n sz (@eq_rect nat (Nat.add sz n) (fun y : nat => word y) (@combine sz (@bitwp f sz w1 w2) n (wzero n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@bitwp f sz w1 w2) n (wzero n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) reflexivity. Qed. Theorem wnot_wlshift : forall sz (w : word sz) n, wnot (wlshift w n) = split1 sz n (eq_rect _ word (combine (wones n) (wnot w)) _ (eq_sym (Nat.add_comm sz n))). Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq (word sz) (@wnot sz (@wlshift sz w n)) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) intros. (* Goal: @eq (word sz) (@wnot sz (@wlshift sz w n)) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) unfold wlshift. (* Goal: @eq (word sz) (@wnot sz (split1 sz n (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz w) (Nat.add sz n) (Nat.add_comm sz n)))) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) rewrite wnot_split1. (* Goal: @eq (word sz) (split1 sz n (@wnot (Init.Nat.add sz n) (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz w) (Nat.add sz n) (Nat.add_comm sz n)))) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) eq_rect_simpl. (* Goal: @eq (word sz) (split1 sz n (@wnot (Init.Nat.add sz n) (@eq_rect nat (Nat.add n sz) (fun y : nat => word y) (@combine n (wzero n) sz w) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n))))) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) rewrite wnot_eq_rect. (* Goal: @eq (word sz) (split1 sz n (@eq_rect nat (Nat.add n sz) word (@wnot (Nat.add n sz) (@combine n (wzero n) sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) rewrite wnot_combine. (* Goal: @eq (word sz) (split1 sz n (@eq_rect nat (Nat.add n sz) word (@combine n (@wnot n (wzero n)) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) rewrite wnot_zero. (* Goal: @eq (word sz) (split1 sz n (@eq_rect nat (Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) (split1 sz n (@eq_rect nat (Init.Nat.add n sz) word (@combine n (wones n) sz (@wnot sz w)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) *) reflexivity. Qed. Theorem wnot_wrshift : forall sz (w : word sz) n, wnot (wrshift w n) = split2 n sz (eq_rect _ word (combine (wnot w) (wones n)) _ (eq_sym (Nat.add_comm n sz))). Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq (word sz) (@wnot sz (@wrshift sz w n)) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) intros. (* Goal: @eq (word sz) (@wnot sz (@wrshift sz w n)) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) unfold wrshift. (* Goal: @eq (word sz) (@wnot sz (split2 n sz (@eq_rec_r nat (Nat.add sz n) (fun n : nat => word n) (@combine sz w n (wzero n)) (Nat.add n sz) (Nat.add_comm n sz)))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) rewrite wnot_split2. (* Goal: @eq (word sz) (split2 n sz (@wnot (Init.Nat.add n sz) (@eq_rec_r nat (Nat.add sz n) (fun n : nat => word n) (@combine sz w n (wzero n)) (Nat.add n sz) (Nat.add_comm n sz)))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) eq_rect_simpl. (* Goal: @eq (word sz) (split2 n sz (@wnot (Init.Nat.add n sz) (@eq_rect nat (Nat.add sz n) (fun y : nat => word y) (@combine sz w n (wzero n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz))))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) rewrite wnot_eq_rect. (* Goal: @eq (word sz) (split2 n sz (@eq_rect nat (Nat.add sz n) word (@wnot (Nat.add sz n) (@combine sz w n (wzero n))) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) rewrite wnot_combine. (* Goal: @eq (word sz) (split2 n sz (@eq_rect nat (Nat.add sz n) word (@combine sz (@wnot sz w) n (@wnot n (wzero n))) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) rewrite wnot_zero. (* Goal: @eq (word sz) (split2 n sz (@eq_rect nat (Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) (split2 n sz (@eq_rect nat (Init.Nat.add sz n) word (@combine sz (@wnot sz w) n (wones n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) *) reflexivity. Qed. Lemma wlshift_alt: forall sz n (a: word sz), wlshift' a n = wlshift a n. Theorem div2_pow2_twice: forall n, Nat.div2 (pow2 n + (pow2 n + 0)) = pow2 n. Proof. (* Goal: forall n : nat, @eq nat (Nat.div2 (Init.Nat.add (Nat.pow (S (S O)) n) (Init.Nat.add (Nat.pow (S (S O)) n) O))) (Nat.pow (S (S O)) n) *) intros. (* Goal: @eq nat (Nat.div2 (Init.Nat.add (Nat.pow (S (S O)) n) (Init.Nat.add (Nat.pow (S (S O)) n) O))) (Nat.pow (S (S O)) n) *) replace (pow2 n + (pow2 n + 0)) with (2 * pow2 n) by omega. (* Goal: @eq nat (Nat.div2 (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) n))) (Nat.pow (S (S O)) n) *) rewrite Nat.div2_double. (* Goal: @eq nat (Nat.pow (S (S O)) n) (Nat.pow (S (S O)) n) *) auto. Qed. Theorem zero_or_wordToNat_S: forall sz (n : word sz), n = $0 \/ exists nn, wordToNat n = S nn /\ wordToNat (n ^- $1) = nn. Proof. (* Goal: forall (sz : nat) (n : word sz), or (@eq (word sz) n (natToWord sz O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat sz n) (S nn)) (@eq nat (@wordToNat sz (@wminus sz n (natToWord sz (S O)))) nn))) *) intros. (* Goal: or (@eq (word sz) n (natToWord sz O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat sz n) (S nn)) (@eq nat (@wordToNat sz (@wminus sz n (natToWord sz (S O)))) nn))) *) destruct sz. (* Goal: or (@eq (word (S sz)) n (natToWord (S sz) O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat (S sz) n) (S nn)) (@eq nat (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O)))) nn))) *) (* Goal: or (@eq (word O) n (natToWord O O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat O n) (S nn)) (@eq nat (@wordToNat O (@wminus O n (natToWord O (S O)))) nn))) *) left. (* Goal: or (@eq (word (S sz)) n (natToWord (S sz) O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat (S sz) n) (S nn)) (@eq nat (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O)))) nn))) *) (* Goal: @eq (word O) n (natToWord O O) *) rewrite (word0 n). (* Goal: or (@eq (word (S sz)) n (natToWord (S sz) O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat (S sz) n) (S nn)) (@eq nat (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O)))) nn))) *) (* Goal: @eq (word O) WO (natToWord O O) *) auto. (* Goal: or (@eq (word (S sz)) n (natToWord (S sz) O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat (S sz) n) (S nn)) (@eq nat (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O)))) nn))) *) destruct (weq n $0); intuition. (* Goal: or (@eq (word (S sz)) n (natToWord (S sz) O)) (@ex nat (fun nn : nat => and (@eq nat (@wordToNat (S sz) n) (S nn)) (@eq nat (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O)))) nn))) *) right. (* Goal: @ex nat (fun nn : nat => and (@eq nat (@wordToNat (S sz) n) (S nn)) (@eq nat (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O)))) nn)) *) exists (wordToNat (n ^- $1)); intuition. (* Goal: @eq nat (@wordToNat (S sz) n) (S (@wordToNat (S sz) (@wminus (S sz) n (natToWord (S sz) (S O))))) *) rewrite wminus_Alt. (* Goal: @eq nat (@wordToNat (S sz) n) (S (@wordToNat (S sz) (@wminusN (S sz) n (natToWord (S sz) (S O))))) *) rewrite wminus_Alt2. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (@wordToNat (S sz) n) (S (@wordToNat (S sz) (@wordBinN Init.Nat.sub (S sz) n (natToWord (S sz) (S O))))) *) unfold wordBinN. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (@wordToNat (S sz) n) (S (@wordToNat (S sz) (natToWord (S sz) (Init.Nat.sub (@wordToNat (S sz) n) (@wordToNat (S sz) (natToWord (S sz) (S O))))))) *) rewrite roundTrip_1. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (@wordToNat (S sz) n) (S (@wordToNat (S sz) (natToWord (S sz) (Init.Nat.sub (@wordToNat (S sz) n) (S O))))) *) erewrite wordToNat_natToWord_bound with (bound:=n); try omega. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq nat (@wordToNat (S sz) n) (S (Init.Nat.sub (@wordToNat (S sz) n) (S O))) *) assert (wordToNat n <> 0); try omega. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: not (@eq nat (@wordToNat (S sz) n) O) *) unfold not; intros; apply n0; clear n0. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq (word (S sz)) n (natToWord (S sz) O) *) rewrite <- H. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) (* Goal: @eq (word (S sz)) n (natToWord (S sz) (@wordToNat (S sz) n)) *) rewrite natToWord_wordToNat; auto. (* Goal: not (@wlt (S sz) n (natToWord (S sz) (S O))) *) unfold not; intros; apply n0; clear n0. (* Goal: @eq (word (S sz)) n (natToWord (S sz) O) *) apply wlt_lt in H. (* Goal: @eq (word (S sz)) n (natToWord (S sz) O) *) replace n with (natToWord (S sz) (wordToNat n)) by (rewrite natToWord_wordToNat; auto). (* Goal: @eq (word (S sz)) (natToWord (S sz) (@wordToNat (S sz) n)) (natToWord (S sz) O) *) f_equal. (* Goal: @eq nat (@wordToNat (S sz) n) O *) rewrite roundTrip_1 in *. (* Goal: @eq nat (@wordToNat (S sz) n) O *) omega. Qed. Theorem wbit_or_same : forall sz sz' (n : word sz'), (wordToNat n < sz)%nat -> (wbit sz n) ^| (wbit sz n) <> wzero sz. Proof. (* Goal: forall (sz sz' : nat) (n : word sz') (_ : lt (@wordToNat sz' n) sz), not (@eq (word sz) (@wor sz (@wbit sz sz' n) (@wbit sz sz' n)) (wzero sz)) *) unfold not. (* Goal: forall (sz sz' : nat) (n : word sz') (_ : lt (@wordToNat sz' n) sz) (_ : @eq (word sz) (@wor sz (@wbit sz sz' n) (@wbit sz sz' n)) (wzero sz)), False *) induction sz; intros; try omega. (* Goal: False *) unfold wbit, wzero, wor in *. (* Goal: False *) simpl in *. (* Goal: False *) destruct (zero_or_wordToNat_S n). (* Goal: False *) (* Goal: False *) subst; rewrite roundTrip_0 in *. (* Goal: False *) (* Goal: False *) discriminate. (* Goal: False *) destruct H1. (* Goal: False *) destruct H1. (* Goal: False *) rewrite H1 in *. (* Goal: False *) inversion H0. (* Goal: False *) apply (inj_pair2_eq_dec _ eq_nat_dec) in H5. (* Goal: False *) rewrite div2_pow2_twice in H5. (* Goal: False *) repeat rewrite <- H2 in H5. (* Goal: False *) eapply IHsz; eauto. (* Goal: lt (@wordToNat sz' (@wminus sz' n (natToWord sz' (S O)))) sz *) omega. Qed. Theorem wbit_or_other : forall sz sz' (n1 n2 : word sz'), (wordToNat n1 < sz)%nat -> (wordToNat n2 < sz)%nat -> (n1 <> n2) -> (wbit sz n1) ^& (wbit sz n2) = wzero sz. Proof. (* Goal: forall (sz sz' : nat) (n1 n2 : word sz') (_ : lt (@wordToNat sz' n1) sz) (_ : lt (@wordToNat sz' n2) sz) (_ : not (@eq (word sz') n1 n2)), @eq (word sz) (@wand sz (@wbit sz sz' n1) (@wbit sz sz' n2)) (wzero sz) *) induction sz; intros; try omega. (* Goal: @eq (word (S sz)) (@wand (S sz) (@wbit (S sz) sz' n1) (@wbit (S sz) sz' n2)) (wzero (S sz)) *) unfold wbit, wzero, wand. (* Goal: @eq (word (S sz)) (@bitwp andb (S sz) (natToWord (S sz) (Nat.pow (S (S O)) (@wordToNat sz' n1))) (natToWord (S sz) (Nat.pow (S (S O)) (@wordToNat sz' n2)))) (natToWord (S sz) O) *) simpl. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (@WS false sz (natToWord sz O)) *) destruct (zero_or_wordToNat_S n1); destruct (zero_or_wordToNat_S n2); try congruence; destruct_conjs; subst; try rewrite roundTrip_0. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (@WS false sz (natToWord sz O)) *) (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) O))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) O))))) (@WS false sz (natToWord sz O)) *) (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) O)) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) O))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (@WS false sz (natToWord sz O)) *) repeat rewrite H4; simpl; repeat rewrite mod2_pow2_twice; f_equal. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (@WS false sz (natToWord sz O)) *) (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) O))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) O))))) (@WS false sz (natToWord sz O)) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz O) (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) O))))) (natToWord sz O) *) rewrite wand_kill; auto. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (@WS false sz (natToWord sz O)) *) (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) O))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) O))))) (@WS false sz (natToWord sz O)) *) repeat rewrite H4; simpl; repeat rewrite mod2_pow2_twice; f_equal. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (@WS false sz (natToWord sz O)) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) O)))) (natToWord sz O)) (natToWord sz O) *) rewrite wand_comm; rewrite wand_kill; auto. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (@WS false sz (natToWord sz O)) *) repeat rewrite H4; repeat rewrite H6; simpl. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) O))) (mod2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) O)))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) O)))) (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) O)))))) (@WS false sz (natToWord sz O)) *) repeat rewrite mod2_pow2_twice; f_equal. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) O)))) (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) O))))) (natToWord sz O) *) repeat rewrite div2_pow2_twice. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))))) (natToWord sz O) *) eapply IHsz; try omega. (* Goal: not (@eq (word sz') (@wminus sz' n1 (natToWord sz' (S O))) (@wminus sz' n2 (natToWord sz' (S O)))) *) apply word_neq. (* Goal: not (@eq (word sz') (@wminus sz' (@wminus sz' n1 (natToWord sz' (S O))) (@wminus sz' n2 (natToWord sz' (S O)))) (wzero sz')) *) unfold not in *; intros; apply H1; clear H1. (* Goal: @eq (word sz') n1 n2 *) apply sub_0_eq; rewrite <- H2. (* Goal: @eq (word sz') (@wminus sz' n1 n2) (@wminus sz' (@wminus sz' n1 (natToWord sz' (S O))) (@wminus sz' n2 (natToWord sz' (S O)))) *) ring_sz sz'. Qed. Theorem wbit_and_not: forall sz sz' (n : word sz'), (wordToNat n < sz)%nat -> (wbit sz n) ^& wnot (wbit sz n) = wzero sz. Proof. (* Goal: forall (sz sz' : nat) (n : word sz') (_ : lt (@wordToNat sz' n) sz), @eq (word sz) (@wand sz (@wbit sz sz' n) (@wnot sz (@wbit sz sz' n))) (wzero sz) *) induction sz; intros; try omega. (* Goal: @eq (word (S sz)) (@wand (S sz) (@wbit (S sz) sz' n) (@wnot (S sz) (@wbit (S sz) sz' n))) (wzero (S sz)) *) unfold wbit, wzero, wand, wnot. (* Goal: @eq (word (S sz)) (@bitwp andb (S sz) (natToWord (S sz) (Nat.pow (S (S O)) (@wordToNat sz' n))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) (S sz) (natToWord (S sz) (Nat.pow (S (S O)) (@wordToNat sz' n))))) (natToWord (S sz) O) *) simpl. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n))))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n))))))) (@WS false sz (natToWord sz O)) *) f_equal. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))))) (natToWord sz O) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n))))) false *) apply andb_negb_r. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))))) (natToWord sz O) *) destruct (zero_or_wordToNat_S n); subst. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))))) (natToWord sz O) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' (natToWord sz' O))))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' (natToWord sz' O))))))) (natToWord sz O) *) rewrite roundTrip_0; simpl. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))))) (natToWord sz O) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz O) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz O))) (natToWord sz O) *) apply wand_kill. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))))) (natToWord sz O) *) do 2 destruct H0. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n)))))) (natToWord sz O) *) rewrite H0; simpl. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) x) (Nat.add (Nat.pow (S (S O)) x) O)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) x) (Nat.add (Nat.pow (S (S O)) x) O)))))) (natToWord sz O) *) rewrite div2_pow2_twice. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.pow (S (S O)) x)) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.pow (S (S O)) x)))) (natToWord sz O) *) fold wnot. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.pow (S (S O)) x)) (@wnot sz (natToWord sz (Nat.pow (S (S O)) x)))) (natToWord sz O) *) rewrite <- H1. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n (natToWord sz' (S O)))))) (@wnot sz (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n (natToWord sz' (S O)))))))) (natToWord sz O) *) eapply IHsz. (* Goal: lt (@wordToNat sz' (@wminus sz' n (natToWord sz' (S O)))) sz *) omega. Qed. Theorem wbit_and_not_other: forall sz sz' (n1 n2 : word sz'), (wordToNat n1 < sz)%nat -> (wordToNat n2 < sz)%nat -> n1 <> n2 -> (wbit sz n1) ^& wnot (wbit sz n2) = wbit sz n1. Proof. (* Goal: forall (sz sz' : nat) (n1 n2 : word sz') (_ : lt (@wordToNat sz' n1) sz) (_ : lt (@wordToNat sz' n2) sz) (_ : not (@eq (word sz') n1 n2)), @eq (word sz) (@wand sz (@wbit sz sz' n1) (@wnot sz (@wbit sz sz' n2))) (@wbit sz sz' n1) *) induction sz; intros; try omega. (* Goal: @eq (word (S sz)) (@wand (S sz) (@wbit (S sz) sz' n1) (@wnot (S sz) (@wbit (S sz) sz' n2))) (@wbit (S sz) sz' n1) *) unfold wbit, wzero, wand, wnot. (* Goal: @eq (word (S sz)) (@bitwp andb (S sz) (natToWord (S sz) (Nat.pow (S (S O)) (@wordToNat sz' n1))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) (S sz) (natToWord (S sz) (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (natToWord (S sz) (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) simpl. (* Goal: @eq (word (S sz)) (@WS (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) sz (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) ((fix wnot (sz : nat) (w : word sz) {struct w} : word sz := match w in (word n) return (word n) with | WO => WO | @WS b n w' => @WS (negb b) n (wnot n w') end) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))))) (@WS (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1))))) *) destruct (zero_or_wordToNat_S n1); destruct (zero_or_wordToNat_S n2); try congruence; destruct_conjs; subst; fold wnot; try rewrite roundTrip_0; simpl; f_equal. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz O))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) false) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz O) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz O) *) (* Goal: @eq bool (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))) true *) rewrite H4; simpl; rewrite mod2_pow2_twice; auto. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz O))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) false) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz O) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz O) *) rewrite H4; simpl; rewrite div2_pow2_twice; apply wand_kill. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz O))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) false) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) rewrite H4; simpl; rewrite mod2_pow2_twice; auto. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz O))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) rewrite H4; simpl; rewrite div2_pow2_twice. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) (@wnot sz (natToWord sz O))) (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) *) rewrite wnot_zero. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) (wones sz)) (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) *) rewrite wand_comm. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) (* Goal: @eq (word sz) (@wand sz (wones sz) (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))))) (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) *) apply wand_unit. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) (* Goal: @eq bool (andb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) (negb (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n2))))) (mod2 (Nat.pow (S (S O)) (@wordToNat sz' n1))) *) rewrite H4; simpl; rewrite mod2_pow2_twice; simpl; apply andb_true_r. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n2)))))) (natToWord sz (Nat.div2 (Nat.pow (S (S O)) (@wordToNat sz' n1)))) *) rewrite H4; rewrite H6; simpl. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) O)))) (@wnot sz (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O))))) O)))))) (natToWord sz (Nat.div2 (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) (Nat.add (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O))))) O)))) *) repeat rewrite div2_pow2_twice. (* Goal: @eq (word sz) (@bitwp andb sz (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) (@wnot sz (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n2 (natToWord sz' (S O)))))))) (natToWord sz (Nat.pow (S (S O)) (@wordToNat sz' (@wminus sz' n1 (natToWord sz' (S O)))))) *) apply IHsz; try omega. (* Goal: not (@eq (word sz') (@wminus sz' n1 (natToWord sz' (S O))) (@wminus sz' n2 (natToWord sz' (S O)))) *) apply word_neq. (* Goal: not (@eq (word sz') (@wminus sz' (@wminus sz' n1 (natToWord sz' (S O))) (@wminus sz' n2 (natToWord sz' (S O)))) (wzero sz')) *) unfold not in *; intros; apply H1. (* Goal: @eq (word sz') n1 n2 *) apply sub_0_eq. (* Goal: @eq (word sz') (@wminus sz' n1 n2) (wzero sz') *) rewrite <- H2. (* Goal: @eq (word sz') (@wminus sz' n1 n2) (@wminus sz' (@wminus sz' n1 (natToWord sz' (S O))) (@wminus sz' n2 (natToWord sz' (S O)))) *) ring_sz sz'. Qed. Lemma wordToNat_wzero: forall sz, wordToNat (wzero sz) = 0. Proof. (* Goal: forall sz : nat, @eq nat (@wordToNat sz (wzero sz)) O *) unfold wzero; intros. (* Goal: @eq nat (@wordToNat sz (natToWord sz O)) O *) apply roundTrip_0. Qed. Lemma wordToN_wzero: forall sz, wordToN (wzero sz) = 0%N. Proof. (* Goal: forall sz : nat, @eq N (@wordToN sz (wzero sz)) N0 *) intros; rewrite wordToN_nat. (* Goal: @eq N (N.of_nat (@wordToNat sz (wzero sz))) N0 *) rewrite wordToNat_wzero. (* Goal: @eq N (N.of_nat O) N0 *) reflexivity. Qed. Lemma combine_zero: forall n m, combine (natToWord n 0) (natToWord m 0) = natToWord _ 0. Proof. (* Goal: forall n m : nat, @eq (word (Init.Nat.add n m)) (@combine n (natToWord n O) m (natToWord m O)) (natToWord (Init.Nat.add n m) O) *) induction n; simpl; intros; [reflexivity|]. (* Goal: @eq (word (S (Init.Nat.add n m))) (@WS false (Init.Nat.add n m) (@combine n (natToWord n O) m (natToWord m O))) (@WS false (Init.Nat.add n m) (natToWord (Init.Nat.add n m) O)) *) rewrite IHn; reflexivity. Qed. Lemma combine_one: forall n m, combine (natToWord (S n) 1) (natToWord m 0) = natToWord _ 1. Proof. (* Goal: forall n m : nat, @eq (word (Init.Nat.add (S n) m)) (@combine (S n) (natToWord (S n) (S O)) m (natToWord m O)) (natToWord (Init.Nat.add (S n) m) (S O)) *) cbn; intros. (* Goal: @eq (word (S (Init.Nat.add n m))) (@WS true (Init.Nat.add n m) (@combine n (natToWord n O) m (natToWord m O))) (@WS true (Init.Nat.add n m) (natToWord (Init.Nat.add n m) O)) *) rewrite combine_zero; reflexivity. Qed. Lemma wmsb_wzero': forall sz, wmsb (wzero' sz) false = false. Proof. (* Goal: forall sz : nat, @eq bool (@wmsb sz (wzero' sz) false) false *) induction sz; auto. Qed. Lemma wmsb_wzero: forall sz, wmsb (wzero sz) false = false. Proof. (* Goal: forall sz : nat, @eq bool (@wmsb sz (wzero sz) false) false *) intros. (* Goal: @eq bool (@wmsb sz (wzero sz) false) false *) rewrite <-wzero'_def. (* Goal: @eq bool (@wmsb sz (wzero' sz) false) false *) apply wmsb_wzero'. Qed. Lemma wmsb_wones: forall sz, wmsb (wones (S sz)) false = true. Proof. (* Goal: forall sz : nat, @eq bool (@wmsb (S sz) (wones (S sz)) false) true *) induction sz; cbn; auto. Qed. Lemma wmsb_0: forall sz (m: word (S sz)) default, (# m < pow2 sz)%nat -> @wmsb (S sz) m default = false. Proof. (* Goal: forall (sz : nat) (m : word (S sz)) (default : bool) (_ : lt (@wordToNat (S sz) m) (Nat.pow (S (S O)) sz)), @eq bool (@wmsb (S sz) m default) false *) induction sz; intros. (* Goal: @eq bool (@wmsb (S (S sz)) m default) false *) (* Goal: @eq bool (@wmsb (S O) m default) false *) - (* Goal: @eq bool (@wmsb (S O) m default) false *) simpl in *. (* Goal: @eq bool (@wmsb (S O) m default) false *) assert (#m = 0) as N by omega. (* Goal: @eq bool (@wmsb (S O) m default) false *) rewrite <- (roundTrip_0 1) in N. (* Goal: @eq bool (@wmsb (S O) m default) false *) apply wordToNat_inj in N. (* Goal: @eq bool (@wmsb (S O) m default) false *) subst m. (* Goal: @eq bool (@wmsb (S O) (natToWord (S O) O) default) false *) simpl. (* Goal: @eq bool false false *) reflexivity. (* BG Goal: @eq bool (@wmsb (S (S sz)) m default) false *) - (* Goal: @eq bool (@wmsb (S (S sz)) m default) false *) pose proof (shatter_word_S m) as P. (* Goal: @eq bool (@wmsb (S (S sz)) m default) false *) destruct P as [b [m0 E]]. (* Goal: @eq bool (@wmsb (S (S sz)) m default) false *) subst. (* Goal: @eq bool (@wmsb (S (S sz)) (@WS b (S sz) m0) default) false *) unfold wmsb. (* Goal: @eq bool ((fix wmsb (sz : nat) (w : word sz) (a : bool) {struct w} : bool := match w with | WO => a | @WS b n x => wmsb n x b end) (S sz) m0 b) false *) fold wmsb. (* Goal: @eq bool (@wmsb (S sz) m0 b) false *) apply IHsz. (* Goal: lt (@wordToNat (S sz) m0) (Nat.pow (S (S O)) sz) *) simpl in H. (* Goal: lt (@wordToNat (S sz) m0) (Nat.pow (S (S O)) sz) *) destruct b; omega. Qed. Lemma wmsb_1: forall sz (m: word (S sz)) default, pow2 sz <= # m < 2 * pow2 sz -> @wmsb (S sz) m default = true. Proof. (* Goal: forall (sz : nat) (m : word (S sz)) (default : bool) (_ : and (le (Nat.pow (S (S O)) sz) (@wordToNat (S sz) m)) (lt (@wordToNat (S sz) m) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))), @eq bool (@wmsb (S sz) m default) true *) induction sz; intros. (* Goal: @eq bool (@wmsb (S (S sz)) m default) true *) (* Goal: @eq bool (@wmsb (S O) m default) true *) - (* Goal: @eq bool (@wmsb (S O) m default) true *) simpl in *. (* Goal: @eq bool (@wmsb (S O) m default) true *) assert (#m = 1) as N by omega. (* Goal: @eq bool (@wmsb (S O) m default) true *) rewrite <- (roundTrip_1 1) in N. (* Goal: @eq bool (@wmsb (S O) m default) true *) apply (wordToNat_inj m ($ 1)) in N. (* Goal: @eq bool (@wmsb (S O) m default) true *) subst m. (* Goal: @eq bool (@wmsb (S O) (natToWord (S O) (S O)) default) true *) simpl. (* Goal: @eq bool true true *) reflexivity. (* BG Goal: @eq bool (@wmsb (S (S sz)) m default) true *) - (* Goal: @eq bool (@wmsb (S (S sz)) m default) true *) pose proof (shatter_word_S m) as P. (* Goal: @eq bool (@wmsb (S (S sz)) m default) true *) destruct P as [b [m0 E]]. (* Goal: @eq bool (@wmsb (S (S sz)) m default) true *) subst. (* Goal: @eq bool (@wmsb (S (S sz)) (@WS b (S sz) m0) default) true *) unfold wmsb. (* Goal: @eq bool ((fix wmsb (sz : nat) (w : word sz) (a : bool) {struct w} : bool := match w with | WO => a | @WS b n x => wmsb n x b end) (S sz) m0 b) true *) fold wmsb. (* Goal: @eq bool (@wmsb (S sz) m0 b) true *) apply IHsz. (* Goal: and (le (Nat.pow (S (S O)) sz) (@wordToNat (S sz) m0)) (lt (@wordToNat (S sz) m0) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz))) *) simpl in H. (* Goal: and (le (Nat.pow (S (S O)) sz) (@wordToNat (S sz) m0)) (lt (@wordToNat (S sz) m0) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz))) *) destruct b; omega. Qed. Lemma wmsb_0_natToWord: forall sz n default, (2 * n < pow2 (S sz))%nat -> @wmsb (S sz) (natToWord (S sz) n) default = false. Proof. (* Goal: forall (sz n : nat) (default : bool) (_ : lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) (S sz))), @eq bool (@wmsb (S sz) (natToWord (S sz) n) default) false *) intros. (* Goal: @eq bool (@wmsb (S sz) (natToWord (S sz) n) default) false *) apply wmsb_0. (* Goal: lt (@wordToNat (S sz) (natToWord (S sz) n)) (Nat.pow (S (S O)) sz) *) pose proof (wordToNat_natToWord_le (S sz) n). (* Goal: lt (@wordToNat (S sz) (natToWord (S sz) n)) (Nat.pow (S (S O)) sz) *) unfold pow2 in H. (* Goal: lt (@wordToNat (S sz) (natToWord (S sz) n)) (Nat.pow (S (S O)) sz) *) fold pow2 in H. (* Goal: lt (@wordToNat (S sz) (natToWord (S sz) n)) (Nat.pow (S (S O)) sz) *) omega. Qed. Lemma wmsb_1_natToWord: forall sz n default, pow2 sz <= n < 2 * pow2 sz -> @wmsb (S sz) (natToWord (S sz) n) default = true. Proof. (* Goal: forall (sz n : nat) (default : bool) (_ : and (le (Nat.pow (S (S O)) sz) n) (lt n (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))), @eq bool (@wmsb (S sz) (natToWord (S sz) n) default) true *) intros. (* Goal: @eq bool (@wmsb (S sz) (natToWord (S sz) n) default) true *) apply wmsb_1. (* Goal: and (le (Nat.pow (S (S O)) sz) (@wordToNat (S sz) (natToWord (S sz) n))) (lt (@wordToNat (S sz) (natToWord (S sz) n)) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz))) *) rewrite wordToNat_natToWord_idempotent'; simpl; omega. Qed. Lemma wordToN_wzero': forall sz, wordToN (wzero' sz) = 0%N. Proof. (* Goal: forall sz : nat, @eq N (@wordToN sz (wzero' sz)) N0 *) induction sz; simpl; auto. (* Goal: @eq N match @wordToN sz (wzero' sz) with | N0 => N0 | Npos q => Npos (xO q) end N0 *) rewrite IHsz; auto. Qed. Lemma wordToZ_wzero': forall sz, wordToZ (wzero' sz) = 0%Z. Proof. (* Goal: forall sz : nat, @eq Z (@wordToZ sz (wzero' sz)) Z0 *) unfold wordToZ; intros. (* Goal: @eq Z (if @wmsb sz (wzero' sz) false then match @wordToN sz (@wneg sz (wzero' sz)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz (wzero' sz) with | N0 => Z0 | Npos x => Zpos x end) Z0 *) rewrite wmsb_wzero'. (* Goal: @eq Z match @wordToN sz (wzero' sz) with | N0 => Z0 | Npos x => Zpos x end Z0 *) rewrite wordToN_wzero'. (* Goal: @eq Z Z0 Z0 *) reflexivity. Qed. Lemma wordToZ_wzero: forall sz, wordToZ (wzero sz) = 0%Z. Proof. (* Goal: forall sz : nat, @eq Z (@wordToZ sz (wzero sz)) Z0 *) unfold wordToZ; intros. (* Goal: @eq Z (if @wmsb sz (wzero sz) false then match @wordToN sz (@wneg sz (wzero sz)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz (wzero sz) with | N0 => Z0 | Npos x => Zpos x end) Z0 *) rewrite wmsb_wzero. (* Goal: @eq Z match @wordToN sz (wzero sz) with | N0 => Z0 | Npos x => Zpos x end Z0 *) rewrite wordToN_wzero. (* Goal: @eq Z Z0 Z0 *) reflexivity. Qed. Lemma wmsb_existT: forall sz1 (w1: word sz1) sz2 (w2: word sz2), existT word _ w1 = existT word _ w2 -> forall b, wmsb w1 b = wmsb w2 b. Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (_ : @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2)) (b : bool), @eq bool (@wmsb sz1 w1 b) (@wmsb sz2 w2 b) *) intros. (* Goal: @eq bool (@wmsb sz1 w1 b) (@wmsb sz2 w2 b) *) assert (sz1 = sz2) by (apply eq_sigT_fst in H; auto); subst. (* Goal: @eq bool (@wmsb sz2 w1 b) (@wmsb sz2 w2 b) *) destruct_existT; reflexivity. Qed. Lemma destruct_word_S: forall sz (w: word (S sz)), exists v b, w = WS b v. Proof. (* Goal: forall (sz : nat) (w : word (S sz)), @ex (word sz) (fun v : word sz => @ex bool (fun b : bool => @eq (word (S sz)) w (@WS b sz v))) *) intros. (* Goal: @ex (word sz) (fun v : word sz => @ex bool (fun b : bool => @eq (word (S sz)) w (@WS b sz v))) *) refine (match w with | WO => _ | WS b v => _ end); unfold IDProp; eauto. Qed. Lemma induct_word_S: forall (P : forall n : nat, word (S n) -> Prop), (forall b, P 0 (WS b WO)) -> (forall b b0 n (w : word n), P n (WS b0 w) -> P (S n) (WS b (WS b0 w))) -> forall (n : nat) (w : word (S n)), P n w. Proof. (* Goal: forall (P : forall (n : nat) (_ : word (S n)), Prop) (_ : forall b : bool, P O (@WS b O WO)) (_ : forall (b b0 : bool) (n : nat) (w : word n) (_ : P n (@WS b0 n w)), P (S n) (@WS b (S n) (@WS b0 n w))) (n : nat) (w : word (S n)), P n w *) induction n; intros. (* Goal: P (S n) w *) (* Goal: P O w *) - (* Goal: P O w *) destruct (destruct_word_S w) as [v [b E]]. (* Goal: P O w *) subst w. (* Goal: P O (@WS b O v) *) rewrite (word0 v). (* Goal: P O (@WS b O WO) *) apply H. (* BG Goal: P (S n) w *) - (* Goal: P (S n) w *) destruct (destruct_word_S w) as [v [b E]]. (* Goal: P (S n) w *) subst w. (* Goal: P (S n) (@WS b (S n) v) *) destruct (destruct_word_S v) as [w [b0 E]]. (* Goal: P (S n) (@WS b (S n) v) *) subst v. (* Goal: P (S n) (@WS b (S n) (@WS b0 n w)) *) apply H0. (* Goal: P n (@WS b0 n w) *) apply IHn. Qed. Lemma wmsb_ws: forall sz (w: word (S sz)) b a, wmsb (WS b w) a = wmsb w a. Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (b a : bool), @eq bool (@wmsb (S (S sz)) (@WS b (S sz) w) a) (@wmsb (S sz) w a) *) intros. (* Goal: @eq bool (@wmsb (S (S sz)) (@WS b (S sz) w) a) (@wmsb (S sz) w a) *) cbn. (* Goal: @eq bool (@wmsb (S sz) w b) (@wmsb (S sz) w a) *) destruct (destruct_word_S w) as [v [c E]]. (* Goal: @eq bool (@wmsb (S sz) w b) (@wmsb (S sz) w a) *) rewrite E. (* Goal: @eq bool (@wmsb (S sz) (@WS c sz v) b) (@wmsb (S sz) (@WS c sz v) a) *) reflexivity. Qed. Lemma wmsb_extz: forall sz (w: word sz) n, wmsb (extz w n) false = wmsb w false. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq bool (@wmsb (Init.Nat.add n sz) (@extz sz w n) false) (@wmsb sz w false) *) induction n; intros; auto. Qed. Lemma wmsb_default: forall sz (w: word sz) b1 b2, sz <> 0 -> wmsb w b1 = wmsb w b2. Proof. (* Goal: forall (sz : nat) (w : word sz) (b1 b2 : bool) (_ : not (@eq nat sz O)), @eq bool (@wmsb sz w b1) (@wmsb sz w b2) *) dependent induction w; intros; intuition idtac. Qed. Lemma wmsb_nat_cast: forall sz1 (w: word sz1) sz2 (Hsz: sz1 = sz2) b, wmsb w b = wmsb (nat_cast word Hsz w) b. Proof. (* Goal: forall (sz1 : nat) (w : word sz1) (sz2 : nat) (Hsz : @eq nat sz1 sz2) (b : bool), @eq bool (@wmsb sz1 w b) (@wmsb sz2 (@nat_cast word sz1 sz2 Hsz w) b) *) destruct sz1; intros. (* Goal: @eq bool (@wmsb (S sz1) w b) (@wmsb sz2 (@nat_cast word (S sz1) sz2 Hsz w) b) *) (* Goal: @eq bool (@wmsb O w b) (@wmsb sz2 (@nat_cast word O sz2 Hsz w) b) *) - (* Goal: @eq bool (@wmsb O w b) (@wmsb sz2 (@nat_cast word O sz2 Hsz w) b) *) subst sz2. (* Goal: @eq bool (@wmsb O w b) (@wmsb O (@nat_cast word O O (@eq_refl nat O) w) b) *) reflexivity. (* BG Goal: @eq bool (@wmsb (S sz1) w b) (@wmsb sz2 (@nat_cast word (S sz1) sz2 Hsz w) b) *) - (* Goal: @eq bool (@wmsb (S sz1) w b) (@wmsb sz2 (@nat_cast word (S sz1) sz2 Hsz w) b) *) destruct sz2; [discriminate|]. (* Goal: @eq bool (@wmsb (S sz1) w b) (@wmsb (S sz2) (@nat_cast word (S sz1) (S sz2) Hsz w) b) *) destruct (destruct_word_S w) as [v [b0 E]]. (* Goal: @eq bool (@wmsb (S sz1) w b) (@wmsb (S sz2) (@nat_cast word (S sz1) (S sz2) Hsz w) b) *) subst w. (* Goal: @eq bool (@wmsb (S sz1) (@WS b0 sz1 v) b) (@wmsb (S sz2) (@nat_cast word (S sz1) (S sz2) Hsz (@WS b0 sz1 v)) b) *) pose proof (eq_add_S sz1 sz2 Hsz) as Hsz'. (* Goal: @eq bool (@wmsb (S sz1) (@WS b0 sz1 v) b) (@wmsb (S sz2) (@nat_cast word (S sz1) (S sz2) Hsz (@WS b0 sz1 v)) b) *) subst sz2. (* Goal: @eq bool (@wmsb (S sz1) (@WS b0 sz1 v) b) (@wmsb (S sz1) (@nat_cast word (S sz1) (S sz1) Hsz (@WS b0 sz1 v)) b) *) rewrite nat_cast_eq_rect. (* Goal: @eq bool (@wmsb (S sz1) (@WS b0 sz1 v) b) (@wmsb (S sz1) (@eq_rect nat (S sz1) word (@WS b0 sz1 v) (S sz1) Hsz) b) *) f_equal. (* Goal: @eq (word (S sz1)) (@WS b0 sz1 v) (@eq_rect nat (S sz1) word (@WS b0 sz1 v) (S sz1) Hsz) *) erewrite (WS_eq_rect _ _ _ eq_refl). (* Goal: @eq (word (S sz1)) (@WS b0 sz1 v) (@WS b0 sz1 (@eq_rect nat sz1 word v sz1 (@eq_refl nat sz1))) *) reflexivity. Qed. Lemma wmsb_eq_rect: forall sz1 (w: word sz1) sz2 (Hsz: sz1 = sz2) b, wmsb w b = wmsb (eq_rect _ word w _ Hsz) b. Proof. (* Goal: forall (sz1 : nat) (w : word sz1) (sz2 : nat) (Hsz : @eq nat sz1 sz2) (b : bool), @eq bool (@wmsb sz1 w b) (@wmsb sz2 (@eq_rect nat sz1 word w sz2 Hsz) b) *) intros. (* Goal: @eq bool (@wmsb sz1 w b) (@wmsb sz2 (@eq_rect nat sz1 word w sz2 Hsz) b) *) rewrite <- nat_cast_eq_rect. (* Goal: @eq bool (@wmsb sz1 w b) (@wmsb sz2 (@nat_cast word sz1 sz2 Hsz w) b) *) apply wmsb_nat_cast. Qed. Local Arguments nat_cast: simpl never. Lemma nat_cast_inj: forall sz sz' (p: sz = sz') (w1 w2: word sz), nat_cast word p w1 = nat_cast word p w2 -> w1 = w2. Proof. (* Goal: forall (sz sz' : nat) (p : @eq nat sz sz') (w1 w2 : word sz) (_ : @eq (word sz') (@nat_cast word sz sz' p w1) (@nat_cast word sz sz' p w2)), @eq (word sz) w1 w2 *) intros. (* Goal: @eq (word sz) w1 w2 *) destruct p. (* Goal: @eq (word sz) w1 w2 *) rewrite? nat_cast_same in H. (* Goal: @eq (word sz) w1 w2 *) assumption. Qed. Lemma wtl_nat_cast_WS: forall n m (q: n = m) (p: S n = S m) (w: word n) (b: bool), wtl (nat_cast word p (WS b w)) = nat_cast word q w. Proof. (* Goal: forall (n m : nat) (q : @eq nat n m) (p : @eq nat (S n) (S m)) (w : word n) (b : bool), @eq (word m) (@wtl m (@nat_cast word (S n) (S m) p (@WS b n w))) (@nat_cast word n m q w) *) intros n m. (* Goal: forall (q : @eq nat n m) (p : @eq nat (S n) (S m)) (w : word n) (b : bool), @eq (word m) (@wtl m (@nat_cast word (S n) (S m) p (@WS b n w))) (@nat_cast word n m q w) *) destruct q. (* Goal: forall (p : @eq nat (S n) (S n)) (w : word n) (b : bool), @eq (word n) (@wtl n (@nat_cast word (S n) (S n) p (@WS b n w))) (@nat_cast word n n (@eq_refl nat n) w) *) intros. (* Goal: @eq (word n) (@wtl n (@nat_cast word (S n) (S n) p (@WS b n w))) (@nat_cast word n n (@eq_refl nat n) w) *) rewrite nat_cast_same. (* Goal: @eq (word n) (@wtl n (@nat_cast word (S n) (S n) p (@WS b n w))) w *) transitivity (wtl (WS b w)); [|reflexivity]. (* Goal: @eq (word n) (@wtl n (@nat_cast word (S n) (S n) p (@WS b n w))) (@wtl n (@WS b n w)) *) f_equal. (* Goal: @eq (word (S n)) (@nat_cast word (S n) (S n) p (@WS b n w)) (@WS b n w) *) rewrite <- nat_cast_same. (* Goal: @eq (word (S n)) (@nat_cast word (S n) (S n) p (@WS b n w)) (@nat_cast word (S n) (S n) (@eq_refl nat (S n)) (@WS b n w)) *) apply nat_cast_proof_irrel. Qed. Lemma wmsb_split2': forall sz (w: word (S sz)) b, wmsb w b = negb (weqb (split2 sz 1 (nat_cast _ (eq_sym (Nat.add_1_r sz)) w)) (natToWord _ 0)). Lemma wmsb_split2: forall sz (w: word (sz + 1)) b, wmsb w b = if weq (split2 _ 1 w) (natToWord _ 0) then false else true. Proof. (* Goal: forall (sz : nat) (w : word (Init.Nat.add sz (S O))) (b : bool), @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) intros. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) pose proof (@wmsb_split2' sz). (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) specialize (H (nat_cast _ (Nat.add_1_r sz) w) b). (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) simpl in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) rewrite nat_cast_fuse in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) rewrite <- (nat_cast_proof_irrel word _ _ eq_refl) in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) rewrite nat_cast_same in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (if @weq (S O) (split2 sz (S O) w) (natToWord (S O) O) then false else true) *) destruct (weq (split2 sz 1 w) $ (0)). (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true *) (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) false *) - (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) false *) rewrite e in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) false *) simpl in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) false *) rewrite <- H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (@wmsb (S sz) (@nat_cast word (Nat.add sz (S O)) (S sz) (Nat.add_1_r sz) w) b) *) clear. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (@wmsb (S sz) (@nat_cast word (Nat.add sz (S O)) (S sz) (Nat.add_1_r sz) w) b) *) apply wmsb_nat_cast. (* BG Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true *) - (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true *) simpl in n. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true *) apply weqb_ne in n. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true *) rewrite n in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true *) simpl in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true *) rewrite <- H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (@wmsb (S sz) (@nat_cast word (Nat.add sz (S O)) (S sz) (Nat.add_1_r sz) w) b) *) clear. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) (@wmsb (S sz) (@nat_cast word (Nat.add sz (S O)) (S sz) (Nat.add_1_r sz) w) b) *) apply wmsb_nat_cast. Qed. Lemma wmsb_true_split2_wones: forall sz (w: word (sz + 1)) b, wmsb w b = true -> wones 1 = split2 sz 1 w. Proof. (* Goal: forall (sz : nat) (w : word (Init.Nat.add sz (S O))) (b : bool) (_ : @eq bool (@wmsb (Init.Nat.add sz (S O)) w b) true), @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) intros. (* Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) pose proof (wmsb_split2 _ w b). (* Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) destruct (weq _ _). (* Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) (* Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) - (* Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) rewrite H in H0; discriminate. (* BG Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) - (* Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) clear -n. (* Goal: @eq (word (S O)) (wones (S O)) (split2 sz (S O) w) *) remember (split2 sz 1 w) as ww; clear Heqww w. (* Goal: @eq (word (S O)) (wones (S O)) ww *) destruct (destruct_word_S ww) as [w [b E]]. (* Goal: @eq (word (S O)) (wones (S O)) ww *) subst ww. (* Goal: @eq (word (S O)) (wones (S O)) (@WS b O w) *) rewrite (word0 w) in *. (* Goal: @eq (word (S O)) (wones (S O)) (@WS b O WO) *) clear w. (* Goal: @eq (word (S O)) (wones (S O)) (@WS b O WO) *) simpl in *. (* Goal: @eq (word (S O)) (@WS true O WO) (@WS b O WO) *) destruct b; congruence. Qed. Lemma wmsb_false_split2_wzero: forall sz (w: word (sz + 1)) b, wmsb w b = false -> wzero 1 = split2 sz 1 w. Lemma wmsb_split1_sext: forall sz (w: word (sz + 1)), wmsb w false = wmsb (split1 _ 1 w) false -> exists sw, sext sw 1 = w. Proof. (* Goal: forall (sz : nat) (w : word (Init.Nat.add sz (S O))) (_ : @eq bool (@wmsb (Init.Nat.add sz (S O)) w false) (@wmsb sz (split1 sz (S O) w) false)), @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz (S O))) (@sext sz sw (S O)) w) *) unfold sext; intros. (* Goal: @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz (S O))) (if @wmsb sz sw false then @combine sz sw (S O) (wones (S O)) else @combine sz sw (S O) (wzero (S O))) w) *) pose proof (combine_split _ _ w) as Hw. (* Goal: @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz (S O))) (if @wmsb sz sw false then @combine sz sw (S O) (wones (S O)) else @combine sz sw (S O) (wzero (S O))) w) *) rewrite <-Hw; rewrite <-Hw in H at 2; clear Hw. (* Goal: @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz (S O))) (if @wmsb sz sw false then @combine sz sw (S O) (wones (S O)) else @combine sz sw (S O) (wzero (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w))) *) rewrite split1_combine in H. (* Goal: @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz (S O))) (if @wmsb sz sw false then @combine sz sw (S O) (wones (S O)) else @combine sz sw (S O) (wzero (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w))) *) exists (split1 sz 1 w). (* Goal: @eq (word (Init.Nat.add sz (S O))) (if @wmsb sz (split1 sz (S O) w) false then @combine sz (split1 sz (S O) w) (S O) (wones (S O)) else @combine sz (split1 sz (S O) w) (S O) (wzero (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w)) *) destruct (wmsb (split1 sz 1 w) false). (* Goal: @eq (word (Init.Nat.add sz (S O))) (@combine sz (split1 sz (S O) w) (S O) (wzero (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w)) *) (* Goal: @eq (word (Init.Nat.add sz (S O))) (@combine sz (split1 sz (S O) w) (S O) (wones (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w)) *) - (* Goal: @eq (word (Init.Nat.add sz (S O))) (@combine sz (split1 sz (S O) w) (S O) (wones (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w)) *) rewrite <-wmsb_true_split2_wones with (b:= false) by assumption. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@combine sz (split1 sz (S O) w) (S O) (wones (S O))) (@combine sz (split1 sz (S O) w) (S O) (wones (S O))) *) reflexivity. (* BG Goal: @eq (word (Init.Nat.add sz (S O))) (@combine sz (split1 sz (S O) w) (S O) (wzero (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w)) *) - (* Goal: @eq (word (Init.Nat.add sz (S O))) (@combine sz (split1 sz (S O) w) (S O) (wzero (S O))) (@combine sz (split1 sz (S O) w) (S O) (split2 sz (S O) w)) *) rewrite <-wmsb_false_split2_wzero with (b:= false) by assumption. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@combine sz (split1 sz (S O) w) (S O) (wzero (S O))) (@combine sz (split1 sz (S O) w) (S O) (wzero (S O))) *) reflexivity. Qed. Lemma wmsb_combine_WO: forall sz (w: word sz) b, wmsb (combine w WO) b = wmsb w b. Proof. (* Goal: forall (sz : nat) (w : word sz) (b : bool), @eq bool (@wmsb (Init.Nat.add sz O) (@combine sz w O WO) b) (@wmsb sz w b) *) dependent induction w; cbn; intros; auto. Qed. Lemma wmsb_combine: forall sz1 sz2 (w1: word sz1) (w2: word sz2) b1 b2, sz2 <> 0 -> wmsb (combine w1 w2) b1 = wmsb w2 b2. Proof. (* Goal: forall (sz1 sz2 : nat) (w1 : word sz1) (w2 : word sz2) (b1 b2 : bool) (_ : not (@eq nat sz2 O)), @eq bool (@wmsb (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) b1) (@wmsb sz2 w2 b2) *) dependent induction w1; cbn; intros. (* Goal: @eq bool (@wmsb (Init.Nat.add n sz2) (@combine n w1 sz2 w2) b) (@wmsb sz2 w2 b2) *) (* Goal: @eq bool (@wmsb sz2 w2 b1) (@wmsb sz2 w2 b2) *) - (* Goal: @eq bool (@wmsb sz2 w2 b1) (@wmsb sz2 w2 b2) *) auto using wmsb_default. (* BG Goal: @eq bool (@wmsb (Init.Nat.add n sz2) (@combine n w1 sz2 w2) b) (@wmsb sz2 w2 b2) *) - (* Goal: @eq bool (@wmsb (Init.Nat.add n sz2) (@combine n w1 sz2 w2) b) (@wmsb sz2 w2 b2) *) auto using IHw1. Qed. Lemma wmsb_combine_existT: forall sz (w: word sz) sz1 (w1: word sz1) sz2 (w2: word sz2) b1 b2, sz2 <> 0 -> existT word _ w = existT word _ (combine w1 w2) -> wmsb w b1 = wmsb w2 b2. Proof. (* Goal: forall (sz : nat) (w : word sz) (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (b1 b2 : bool) (_ : not (@eq nat sz2 O)) (_ : @eq (@sigT nat word) (@existT nat word sz w) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2))), @eq bool (@wmsb sz w b1) (@wmsb sz2 w2 b2) *) intros. (* Goal: @eq bool (@wmsb sz w b1) (@wmsb sz2 w2 b2) *) pose proof (eq_sigT_fst H0); subst. (* Goal: @eq bool (@wmsb (Init.Nat.add sz1 sz2) w b1) (@wmsb sz2 w2 b2) *) destruct_existT. (* Goal: @eq bool (@wmsb (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) b1) (@wmsb sz2 w2 b2) *) auto using wmsb_combine. Qed. Lemma wmsb_zext: forall sz (w: word sz) b n, n <> 0 -> wmsb (zext w n) b = false. Proof. (* Goal: forall (sz : nat) (w : word sz) (b : bool) (n : nat) (_ : not (@eq nat n O)), @eq bool (@wmsb (Init.Nat.add sz n) (@zext sz w n) b) false *) destruct n; cbn; intros; [elim H; reflexivity|]. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@zext sz w (S n)) b) false *) unfold zext. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@combine sz w (S n) (wzero (S n))) b) false *) erewrite wmsb_combine with (b2:= false) by discriminate. (* Goal: @eq bool (@wmsb (S n) (wzero (S n)) false) false *) apply wmsb_wzero. Qed. Lemma wordToN_zext: forall sz (w: word sz) n, wordToN (zext w n) = wordToN w. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq N (@wordToN (Init.Nat.add sz n) (@zext sz w n)) (@wordToN sz w) *) dependent induction w; cbn; intros. (* Goal: @eq N (if b then N.succ match @wordToN (Init.Nat.add n n0) (@combine n w n0 (wzero n0)) with | N0 => N0 | Npos q => Npos (xO q) end else match @wordToN (Init.Nat.add n n0) (@combine n w n0 (wzero n0)) with | N0 => N0 | Npos q => Npos (xO q) end) (if b then N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end else match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) *) (* Goal: @eq N (@wordToN n (wzero n)) N0 *) - (* Goal: @eq N (@wordToN n (wzero n)) N0 *) induction n; cbn; intros; [reflexivity|]. (* Goal: @eq N match @wordToN n (natToWord n O) with | N0 => N0 | Npos q => Npos (xO q) end N0 *) unfold wzero in IHn; rewrite IHn; reflexivity. (* BG Goal: @eq N (if b then N.succ match @wordToN (Init.Nat.add n n0) (@combine n w n0 (wzero n0)) with | N0 => N0 | Npos q => Npos (xO q) end else match @wordToN (Init.Nat.add n n0) (@combine n w n0 (wzero n0)) with | N0 => N0 | Npos q => Npos (xO q) end) (if b then N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end else match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) *) - (* Goal: @eq N (if b then N.succ match @wordToN (Init.Nat.add n n0) (@combine n w n0 (wzero n0)) with | N0 => N0 | Npos q => Npos (xO q) end else match @wordToN (Init.Nat.add n n0) (@combine n w n0 (wzero n0)) with | N0 => N0 | Npos q => Npos (xO q) end) (if b then N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end else match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) *) rewrite IHw; reflexivity. Qed. Lemma wordToNat_zext: forall sz (w: word sz) n, wordToNat (zext w n) = wordToNat w. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq nat (@wordToNat (Init.Nat.add sz n) (@zext sz w n)) (@wordToNat sz w) *) dependent induction w; cbn; intros. (* Goal: @eq nat (if b then S (Init.Nat.mul (@wordToNat (Init.Nat.add n n0) (@combine n w n0 (wzero n0))) (S (S O))) else Init.Nat.mul (@wordToNat (Init.Nat.add n n0) (@combine n w n0 (wzero n0))) (S (S O))) (if b then S (Init.Nat.mul (@wordToNat n w) (S (S O))) else Init.Nat.mul (@wordToNat n w) (S (S O))) *) (* Goal: @eq nat (@wordToNat n (wzero n)) O *) - (* Goal: @eq nat (@wordToNat n (wzero n)) O *) induction n; cbn; intros; [reflexivity|]. (* Goal: @eq nat (Init.Nat.mul (@wordToNat n (natToWord n O)) (S (S O))) O *) unfold wzero in IHn; rewrite IHn; reflexivity. (* BG Goal: @eq nat (if b then S (Init.Nat.mul (@wordToNat (Init.Nat.add n n0) (@combine n w n0 (wzero n0))) (S (S O))) else Init.Nat.mul (@wordToNat (Init.Nat.add n n0) (@combine n w n0 (wzero n0))) (S (S O))) (if b then S (Init.Nat.mul (@wordToNat n w) (S (S O))) else Init.Nat.mul (@wordToNat n w) (S (S O))) *) - (* Goal: @eq nat (if b then S (Init.Nat.mul (@wordToNat (Init.Nat.add n n0) (@combine n w n0 (wzero n0))) (S (S O))) else Init.Nat.mul (@wordToNat (Init.Nat.add n n0) (@combine n w n0 (wzero n0))) (S (S O))) (if b then S (Init.Nat.mul (@wordToNat n w) (S (S O))) else Init.Nat.mul (@wordToNat n w) (S (S O))) *) rewrite IHw; reflexivity. Qed. Lemma zext_wordToNat_equal_Z: forall sz (w: word sz) n, n <> 0 -> wordToZ (zext w n) = Z.of_nat (wordToNat w). Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat) (_ : not (@eq nat n O)), @eq Z (@wordToZ (Init.Nat.add sz n) (@zext sz w n)) (Z.of_nat (@wordToNat sz w)) *) unfold wordToZ, zext; intros. (* Goal: @eq Z (if @wmsb (Init.Nat.add sz n) (@combine sz w n (wzero n)) false then match @wordToN (Init.Nat.add sz n) (@wneg (Init.Nat.add sz n) (@combine sz w n (wzero n))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (Init.Nat.add sz n) (@combine sz w n (wzero n)) with | N0 => Z0 | Npos x => Zpos x end) (Z.of_nat (@wordToNat sz w)) *) rewrite wmsb_combine with (b2:= false) by assumption. (* Goal: @eq Z (if @wmsb n (wzero n) false then match @wordToN (Init.Nat.add sz n) (@wneg (Init.Nat.add sz n) (@combine sz w n (wzero n))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (Init.Nat.add sz n) (@combine sz w n (wzero n)) with | N0 => Z0 | Npos x => Zpos x end) (Z.of_nat (@wordToNat sz w)) *) rewrite wmsb_wzero. (* Goal: @eq Z match @wordToN (Init.Nat.add sz n) (@combine sz w n (wzero n)) with | N0 => Z0 | Npos x => Zpos x end (Z.of_nat (@wordToNat sz w)) *) replace (combine w (wzero n)) with (zext w n) by reflexivity. (* Goal: @eq Z match @wordToN (Init.Nat.add sz n) (@zext sz w n) with | N0 => Z0 | Npos x => Zpos x end (Z.of_nat (@wordToNat sz w)) *) rewrite wordToN_zext. (* Goal: @eq Z match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end (Z.of_nat (@wordToNat sz w)) *) rewrite wordToN_nat. (* Goal: @eq Z match N.of_nat (@wordToNat sz w) with | N0 => Z0 | Npos x => Zpos x end (Z.of_nat (@wordToNat sz w)) *) rewrite <-nat_N_Z. (* Goal: @eq Z match N.of_nat (@wordToNat sz w) with | N0 => Z0 | Npos x => Zpos x end (Z.of_N (N.of_nat (@wordToNat sz w))) *) unfold Z.of_N; reflexivity. Qed. Lemma wordToN_WS_0: forall sz (w: word sz), wordToN w~0 = (2 * wordToN w)%N. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq N (@wordToN (S sz) (@WS false sz w)) (N.mul (Npos (xO xH)) (@wordToN sz w)) *) reflexivity. Qed. Lemma wordToN_WS_1: forall sz (w: word sz), wordToN w~1 = (2 * wordToN w + 1)%N. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq N (@wordToN (S sz) (@WS true sz w)) (N.add (N.mul (Npos (xO xH)) (@wordToN sz w)) (Npos xH)) *) intros; cbn. (* Goal: @eq N (N.succ match @wordToN sz w with | N0 => N0 | Npos q => Npos (xO q) end) (N.add match @wordToN sz w with | N0 => N0 | Npos q => Npos (xO q) end (Npos xH)) *) unfold N.succ_double. (* Goal: @eq N (N.succ match @wordToN sz w with | N0 => N0 | Npos q => Npos (xO q) end) (N.add match @wordToN sz w with | N0 => N0 | Npos q => Npos (xO q) end (Npos xH)) *) destruct (wordToN w); reflexivity. Qed. Lemma NToWord_WS_0: forall sz n, NToWord (S sz) (2 * n) = (NToWord sz n)~0. Proof. (* Goal: forall (sz : nat) (n : N), @eq (word (S sz)) (NToWord (S sz) (N.mul (Npos (xO xH)) n)) (@WS false sz (NToWord sz n)) *) destruct n; intros; [reflexivity|]. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.mul (Npos (xO xH)) (Npos p))) (@WS false sz (NToWord sz (Npos p))) *) replace (2 * N.pos p)%N with (N.pos (p~0)) by reflexivity. (* Goal: @eq (word (S sz)) (NToWord (S sz) (Npos (xO p))) (@WS false sz (NToWord sz (Npos p))) *) reflexivity. Qed. Lemma NToWord_WS_1: forall sz n, NToWord (S sz) (2 * n + 1) = (NToWord sz n)~1. Proof. (* Goal: forall (sz : nat) (n : N), @eq (word (S sz)) (NToWord (S sz) (N.add (N.mul (Npos (xO xH)) n) (Npos xH))) (@WS true sz (NToWord sz n)) *) destruct n; intros; [reflexivity|]. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.add (N.mul (Npos (xO xH)) (Npos p)) (Npos xH))) (@WS true sz (NToWord sz (Npos p))) *) replace (2 * N.pos p)%N with (N.pos (p~0)) by reflexivity. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.add (Npos (xO p)) (Npos xH))) (@WS true sz (NToWord sz (Npos p))) *) reflexivity. Qed. Lemma wneg_WS_0: forall sz (w: word sz), wneg w~0 = (wneg w)~0. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word (S sz)) (@wneg (S sz) (@WS false sz w)) (@WS false sz (@wneg sz w)) *) unfold wneg; intros. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS false sz w)))) (@WS false sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w)))) *) rewrite wordToN_WS_0. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.sub (Npow2 (S sz)) (N.mul (Npos (xO xH)) (@wordToN sz w)))) (@WS false sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w)))) *) replace (Npow2 (S sz)) with (2 * Npow2 sz)%N by reflexivity. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.sub (N.mul (Npos (xO xH)) (Npow2 sz)) (N.mul (Npos (xO xH)) (@wordToN sz w)))) (@WS false sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w)))) *) rewrite <-N.mul_sub_distr_l. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.mul (Npos (xO xH)) (N.sub (Npow2 sz) (@wordToN sz w)))) (@WS false sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w)))) *) apply NToWord_WS_0. Qed. Lemma NToWord_wordToN: forall sz (w: word sz), NToWord sz (wordToN w) = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (NToWord sz (@wordToN sz w)) w *) intros. (* Goal: @eq (word sz) (NToWord sz (@wordToN sz w)) w *) rewrite wordToN_nat, NToWord_nat. (* Goal: @eq (word sz) (natToWord sz (N.to_nat (N.of_nat (@wordToNat sz w)))) w *) rewrite Nat2N.id. (* Goal: @eq (word sz) (natToWord sz (@wordToNat sz w)) w *) apply natToWord_wordToNat. Qed. Lemma roundTripN_0: forall sz, wordToN (NToWord sz 0) = 0%N. Proof. (* Goal: forall sz : nat, @eq N (@wordToN sz (NToWord sz N0)) N0 *) intros. (* Goal: @eq N (@wordToN sz (NToWord sz N0)) N0 *) rewrite wordToN_nat, NToWord_nat. (* Goal: @eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat N0)))) N0 *) rewrite roundTrip_0; reflexivity. Qed. Lemma wordToN_NToWord: forall sz n, exists k, wordToN (NToWord sz n) = (n - k * Npow2 sz)%N /\ (k * Npow2 sz <= n)%N. Proof. (* Goal: forall (sz : nat) (n : N), @ex N (fun k : N => and (@eq N (@wordToN sz (NToWord sz n)) (N.sub n (N.mul k (Npow2 sz)))) (N.le (N.mul k (Npow2 sz)) n)) *) intros. (* Goal: @ex N (fun k : N => and (@eq N (@wordToN sz (NToWord sz n)) (N.sub n (N.mul k (Npow2 sz)))) (N.le (N.mul k (Npow2 sz)) n)) *) rewrite wordToN_nat, NToWord_nat. (* Goal: @ex N (fun k : N => and (@eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n)))) (N.sub n (N.mul k (Npow2 sz)))) (N.le (N.mul k (Npow2 sz)) n)) *) pose proof (wordToNat_natToWord sz (N.to_nat n)). (* Goal: @ex N (fun k : N => and (@eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n)))) (N.sub n (N.mul k (Npow2 sz)))) (N.le (N.mul k (Npow2 sz)) n)) *) destruct H as [k [? ?]]. (* Goal: @ex N (fun k : N => and (@eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n)))) (N.sub n (N.mul k (Npow2 sz)))) (N.le (N.mul k (Npow2 sz)) n)) *) exists (N.of_nat k). (* Goal: and (@eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n)))) (N.sub n (N.mul (N.of_nat k) (Npow2 sz)))) (N.le (N.mul (N.of_nat k) (Npow2 sz)) n) *) split. (* Goal: N.le (N.mul (N.of_nat k) (Npow2 sz)) n *) (* Goal: @eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n)))) (N.sub n (N.mul (N.of_nat k) (Npow2 sz))) *) - (* Goal: @eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n)))) (N.sub n (N.mul (N.of_nat k) (Npow2 sz))) *) apply N2Nat.inj. (* Goal: @eq nat (N.to_nat (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n))))) (N.to_nat (N.sub n (N.mul (N.of_nat k) (Npow2 sz)))) *) rewrite Nat2N.id, N2Nat.inj_sub, N2Nat.inj_mul. (* Goal: @eq nat (@wordToNat sz (natToWord sz (N.to_nat n))) (Init.Nat.sub (N.to_nat n) (Init.Nat.mul (N.to_nat (N.of_nat k)) (N.to_nat (Npow2 sz)))) *) rewrite Nat2N.id. (* Goal: @eq nat (@wordToNat sz (natToWord sz (N.to_nat n))) (Init.Nat.sub (N.to_nat n) (Init.Nat.mul k (N.to_nat (Npow2 sz)))) *) rewrite Npow2_nat. (* Goal: @eq nat (@wordToNat sz (natToWord sz (N.to_nat n))) (Init.Nat.sub (N.to_nat n) (Init.Nat.mul k (Nat.pow (S (S O)) sz))) *) assumption. (* BG Goal: N.le (N.mul (N.of_nat k) (Npow2 sz)) n *) - (* Goal: N.le (N.mul (N.of_nat k) (Npow2 sz)) n *) rewrite nat_compare_le, Nat2N.inj_compare in H0. (* Goal: N.le (N.mul (N.of_nat k) (Npow2 sz)) n *) rewrite Nat2N.inj_mul, <-Npow2_nat in H0. (* Goal: N.le (N.mul (N.of_nat k) (Npow2 sz)) n *) do 2 rewrite N2Nat.id in H0. (* Goal: N.le (N.mul (N.of_nat k) (Npow2 sz)) n *) assumption. Qed. Lemma wordToN_NToWord_2: forall sz n, (n < Npow2 sz)%N -> wordToN (NToWord sz n) = n. Proof. (* Goal: forall (sz : nat) (n : N) (_ : N.lt n (Npow2 sz)), @eq N (@wordToN sz (NToWord sz n)) n *) intros. (* Goal: @eq N (@wordToN sz (NToWord sz n)) n *) rewrite wordToN_nat, NToWord_nat. (* Goal: @eq N (N.of_nat (@wordToNat sz (natToWord sz (N.to_nat n)))) n *) rewrite wordToNat_natToWord_2. (* Goal: lt (N.to_nat n) (Nat.pow (S (S O)) sz) *) (* Goal: @eq N (N.of_nat (N.to_nat n)) n *) - (* Goal: @eq N (N.of_nat (N.to_nat n)) n *) apply N2Nat.id. (* BG Goal: lt (N.to_nat n) (Nat.pow (S (S O)) sz) *) - (* Goal: lt (N.to_nat n) (Nat.pow (S (S O)) sz) *) rewrite <-Npow2_nat. (* Goal: lt (N.to_nat n) (N.to_nat (Npow2 sz)) *) apply Nlt_out; auto. Qed. Lemma wordToN_bound: forall sz (w: word sz), (wordToN w < Npow2 sz)%N. Proof. (* Goal: forall (sz : nat) (w : word sz), N.lt (@wordToN sz w) (Npow2 sz) *) intros. (* Goal: N.lt (@wordToN sz w) (Npow2 sz) *) rewrite wordToN_nat. (* Goal: N.lt (N.of_nat (@wordToNat sz w)) (Npow2 sz) *) apply Nlt_in. (* Goal: lt (N.to_nat (N.of_nat (@wordToNat sz w))) (N.to_nat (Npow2 sz)) *) rewrite Npow2_nat, Nat2N.id. (* Goal: lt (@wordToNat sz w) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. Qed. Lemma wordToN_plus: forall sz (a b: word sz), (wordToN a + wordToN b < Npow2 sz)%N -> wordToN (a ^+ b) = (wordToN a + wordToN b)%N. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : N.lt (N.add (@wordToN sz a) (@wordToN sz b)) (Npow2 sz)), @eq N (@wordToN sz (@wplus sz a b)) (N.add (@wordToN sz a) (@wordToN sz b)) *) intros. (* Goal: @eq N (@wordToN sz (@wplus sz a b)) (N.add (@wordToN sz a) (@wordToN sz b)) *) unfold wplus, wordBin. (* Goal: @eq N (@wordToN sz (NToWord sz (N.add (@wordToN sz a) (@wordToN sz b)))) (N.add (@wordToN sz a) (@wordToN sz b)) *) rewrite wordToN_NToWord_2 by assumption. (* Goal: @eq N (N.add (@wordToN sz a) (@wordToN sz b)) (N.add (@wordToN sz a) (@wordToN sz b)) *) reflexivity. Qed. Lemma wordToN_mult: forall sz (a b: word sz), (wordToN a * wordToN b < Npow2 sz)%N -> wordToN (a ^* b) = (wordToN a * wordToN b)%N. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : N.lt (N.mul (@wordToN sz a) (@wordToN sz b)) (Npow2 sz)), @eq N (@wordToN sz (@wmult sz a b)) (N.mul (@wordToN sz a) (@wordToN sz b)) *) intros. (* Goal: @eq N (@wordToN sz (@wmult sz a b)) (N.mul (@wordToN sz a) (@wordToN sz b)) *) unfold wmult, wordBin. (* Goal: @eq N (@wordToN sz (NToWord sz (N.mul (@wordToN sz a) (@wordToN sz b)))) (N.mul (@wordToN sz a) (@wordToN sz b)) *) rewrite wordToN_NToWord_2 by assumption. (* Goal: @eq N (N.mul (@wordToN sz a) (@wordToN sz b)) (N.mul (@wordToN sz a) (@wordToN sz b)) *) reflexivity. Qed. Lemma wnot_def: forall sz (w: word sz), wnot w = NToWord sz (Npow2 sz - wordToN w - 1). Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wnot sz w) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) *) dependent induction w; cbn; [reflexivity|]. (* Goal: @eq (word (S n)) (@WS (negb b) n (@wnot n w)) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end (if b then N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end else match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end)) (Npos xH))) *) destruct b; cbn. (* Goal: @eq (word (S n)) (@WS true n (@wnot n w)) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH))) *) (* Goal: @eq (word (S n)) (@WS false n (@wnot n w)) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end (N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end)) (Npos xH))) *) - (* Goal: @eq (word (S n)) (@WS false n (@wnot n w)) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end (N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end)) (Npos xH))) *) rewrite IHw; clear IHw. (* Goal: @eq (word (S n)) (@WS false n (NToWord n (N.sub (N.sub (Npow2 n) (@wordToN n w)) (Npos xH)))) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end (N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end)) (Npos xH))) *) rewrite <-NToWord_WS_0. (* Goal: @eq (word (S n)) (NToWord (S n) (N.mul (Npos (xO xH)) (N.sub (N.sub (Npow2 n) (@wordToN n w)) (Npos xH)))) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end (N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end)) (Npos xH))) *) f_equal. (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npow2 n) (@wordToN n w)) (Npos xH))) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end (N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end)) (Npos xH)) *) destruct (Npow2 n); [reflexivity|]. (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (@wordToN n w)) (Npos xH))) (N.sub (N.sub (Npos (xO p)) (N.succ match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end)) (Npos xH)) *) destruct (wordToN w). (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (N.sub (N.sub (Npos (xO p)) (N.succ (Npos (xO p0)))) (Npos xH)) *) (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) N0) (Npos xH))) (N.sub (N.sub (Npos (xO p)) (N.succ N0)) (Npos xH)) *) + (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) N0) (Npos xH))) (N.sub (N.sub (Npos (xO p)) (N.succ N0)) (Npos xH)) *) change (N.pos p~0) with (2 * N.pos p)%N. (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) N0) (Npos xH))) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.succ N0)) (Npos xH)) *) do 2 rewrite N.mul_sub_distr_l. (* Goal: @eq N (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.mul (Npos (xO xH)) N0)) (N.mul (Npos (xO xH)) (Npos xH))) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.succ N0)) (Npos xH)) *) do 2 rewrite <-N.sub_add_distr. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.mul (Npos (xO xH)) N0) (N.mul (Npos (xO xH)) (Npos xH)))) (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.succ N0) (Npos xH))) *) reflexivity. (* BG Goal: @eq (word (S n)) (@WS true n (@wnot n w)) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH))) *) (* BG Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (N.sub (N.sub (Npos (xO p)) (N.succ (Npos (xO p0)))) (Npos xH)) *) + (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (N.sub (N.sub (Npos (xO p)) (N.succ (Npos (xO p0)))) (Npos xH)) *) change (N.pos p~0) with (2 * N.pos p)%N. (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.succ (Npos (xO p0)))) (Npos xH)) *) change (N.pos p0~0) with (2 * N.pos p0)%N. (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.succ (N.mul (Npos (xO xH)) (Npos p0)))) (Npos xH)) *) rewrite <-N.add_1_l. (* Goal: @eq N (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (Npos xH) (N.mul (Npos (xO xH)) (Npos p0)))) (Npos xH)) *) do 2 rewrite N.mul_sub_distr_l. (* Goal: @eq N (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.mul (Npos (xO xH)) (Npos p0))) (N.mul (Npos (xO xH)) (Npos xH))) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (Npos xH) (N.mul (Npos (xO xH)) (Npos p0)))) (Npos xH)) *) do 2 rewrite <-N.sub_add_distr. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.mul (Npos (xO xH)) (Npos p0)) (N.mul (Npos (xO xH)) (Npos xH)))) (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.add (Npos xH) (N.mul (Npos (xO xH)) (Npos p0))) (Npos xH))) *) rewrite N.add_comm with (n:= 1%N). (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.mul (Npos (xO xH)) (Npos p0)) (N.mul (Npos (xO xH)) (Npos xH)))) (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.add (N.mul (Npos (xO xH)) (Npos p0)) (Npos xH)) (Npos xH))) *) rewrite <-N.add_assoc. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.mul (Npos (xO xH)) (Npos p0)) (N.mul (Npos (xO xH)) (Npos xH)))) (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.mul (Npos (xO xH)) (Npos p0)) (N.add (Npos xH) (Npos xH)))) *) reflexivity. (* BG Goal: @eq (word (S n)) (@WS true n (@wnot n w)) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH))) *) - (* Goal: @eq (word (S n)) (@WS true n (@wnot n w)) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH))) *) rewrite IHw; clear IHw. (* Goal: @eq (word (S n)) (@WS true n (NToWord n (N.sub (N.sub (Npow2 n) (@wordToN n w)) (Npos xH)))) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH))) *) rewrite <-NToWord_WS_1. (* Goal: @eq (word (S n)) (NToWord (S n) (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npow2 n) (@wordToN n w)) (Npos xH))) (Npos xH))) (NToWord (S n) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH))) *) f_equal. (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npow2 n) (@wordToN n w)) (Npos xH))) (Npos xH)) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH)) *) pose proof (wordToN_bound w). (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npow2 n) (@wordToN n w)) (Npos xH))) (Npos xH)) (N.sub (N.sub match Npow2 n with | N0 => N0 | Npos q => Npos (xO q) end match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH)) *) remember (Npow2 n) as pn; destruct pn; [exfalso; eapply Npow2_not_zero; eauto|clear Heqpn]. (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (@wordToN n w)) (Npos xH))) (Npos xH)) (N.sub (N.sub (Npos (xO p)) match @wordToN n w with | N0 => N0 | Npos q => Npos (xO q) end) (Npos xH)) *) destruct (wordToN w). (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (Npos xH)) (N.sub (N.sub (Npos (xO p)) (Npos (xO p0))) (Npos xH)) *) (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) N0) (Npos xH))) (Npos xH)) (N.sub (N.sub (Npos (xO p)) N0) (Npos xH)) *) + (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) N0) (Npos xH))) (Npos xH)) (N.sub (N.sub (Npos (xO p)) N0) (Npos xH)) *) change (N.pos p~0) with (2 * N.pos p)%N. (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) N0) (Npos xH))) (Npos xH)) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) N0) (Npos xH)) *) do 2 rewrite N.mul_sub_distr_l. (* Goal: @eq N (N.add (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.mul (Npos (xO xH)) N0)) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) N0) (Npos xH)) *) do 2 rewrite <-N.sub_add_distr. (* Goal: @eq N (N.add (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add (N.mul (Npos (xO xH)) N0) (N.mul (Npos (xO xH)) (Npos xH)))) (Npos xH)) (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.add N0 (Npos xH))) *) destruct p; cbn; reflexivity. (* BG Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (Npos xH)) (N.sub (N.sub (Npos (xO p)) (Npos (xO p0))) (Npos xH)) *) + (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (Npos xH)) (N.sub (N.sub (Npos (xO p)) (Npos (xO p0))) (Npos xH)) *) change (N.pos p~0) with (2 * N.pos p)%N. (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (Npos xH)) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos (xO p0))) (Npos xH)) *) change (N.pos p0~0) with (2 * N.pos p0)%N. (* Goal: @eq N (N.add (N.mul (Npos (xO xH)) (N.sub (N.sub (Npos p) (Npos p0)) (Npos xH))) (Npos xH)) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.mul (Npos (xO xH)) (Npos p0))) (Npos xH)) *) rewrite N.mul_sub_distr_l. (* Goal: @eq N (N.add (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) (N.sub (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.mul (Npos (xO xH)) (Npos p0))) (Npos xH)) *) rewrite <-N.mul_sub_distr_l with (n:= N.pos p). (* Goal: @eq N (N.add (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (Npos xH)) *) assert (exists pp, N.pos p - N.pos p0 = N.pos pp)%N. (* Goal: @eq N (N.add (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (Npos xH)) *) (* Goal: @ex positive (fun pp : positive => @eq N (N.sub (Npos p) (Npos p0)) (Npos pp)) *) { (* Goal: @ex positive (fun pp : positive => @eq N (N.sub (Npos p) (Npos p0)) (Npos pp)) *) apply N.sub_gt in H. (* Goal: @ex positive (fun pp : positive => @eq N (N.sub (Npos p) (Npos p0)) (Npos pp)) *) destruct (N.pos p - N.pos p0)%N; [intuition idtac|]. (* Goal: @ex positive (fun pp : positive => @eq N (Npos p1) (Npos pp)) *) eexists; reflexivity. (* BG Goal: @eq N (N.add (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (Npos xH)) *) } (* Goal: @eq N (N.add (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) (N.sub (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos p0))) (Npos xH)) *) destruct H0; rewrite H0. (* Goal: @eq N (N.add (N.sub (N.mul (Npos (xO xH)) (Npos x)) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) (N.sub (N.mul (Npos (xO xH)) (Npos x)) (Npos xH)) *) destruct x; cbn; reflexivity. Qed. Lemma wneg_wnot: forall sz (w: word sz), wnot w = wneg w ^- (natToWord _ 1). Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wnot sz w) (@wminus sz (@wneg sz w) (natToWord sz (S O))) *) unfold wneg; intros. (* Goal: @eq (word sz) (@wnot sz w) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) rewrite wnot_def. (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) destruct (weq w (wzero _)); subst. (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz (wzero sz))) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz (wzero sz)))) (natToWord sz (S O))) *) - (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz (wzero sz))) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz (wzero sz)))) (natToWord sz (S O))) *) rewrite wordToN_nat. (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (N.of_nat (@wordToNat sz (wzero sz)))) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (N.of_nat (@wordToNat sz (wzero sz))))) (natToWord sz (S O))) *) unfold wzero; rewrite roundTrip_0; cbn. (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) N0) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) N0)) (natToWord sz (S O))) *) rewrite N.sub_0_r. (* Goal: @eq (word sz) (NToWord sz (N.sub (Npow2 sz) (Npos xH))) (@wminus sz (NToWord sz (Npow2 sz)) (natToWord sz (S O))) *) do 2 rewrite NToWord_nat. (* Goal: @eq (word sz) (natToWord sz (N.to_nat (N.sub (Npow2 sz) (Npos xH)))) (@wminus sz (natToWord sz (N.to_nat (Npow2 sz))) (natToWord sz (S O))) *) rewrite Npow2_nat, natToWord_pow2, N2Nat.inj_sub. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (N.to_nat (Npow2 sz)) (N.to_nat (Npos xH)))) (@wminus sz (natToWord sz O) (natToWord sz (S O))) *) change (N.to_nat 1%N) with 1. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (N.to_nat (Npow2 sz)) (S O))) (@wminus sz (natToWord sz O) (natToWord sz (S O))) *) rewrite Npow2_nat. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O))) (@wminus sz (natToWord sz O) (natToWord sz (S O))) *) apply wordToNat_inj. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)))) (@wordToNat sz (@wminus sz (natToWord sz O) (natToWord sz (S O)))) *) rewrite wordToNat_natToWord_2 by (pose proof (zero_lt_pow2 sz); omega). (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz (@wminus sz (natToWord sz O) (natToWord sz (S O)))) *) unfold wminus. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz (@wplus sz (natToWord sz O) (@wneg sz (natToWord sz (S O))))) *) rewrite wplus_unit, <-wones_wneg_one. (* Goal: @eq nat (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz (wones sz)) *) apply eq_sym, wones_pow2_minus_one. (* BG Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) - (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) pose proof (wordToN_bound w). (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) assert (Npow2 sz - wordToN w < Npow2 sz)%N. (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) (* Goal: N.lt (N.sub (Npow2 sz) (@wordToN sz w)) (Npow2 sz) *) { (* Goal: N.lt (N.sub (Npow2 sz) (@wordToN sz w)) (Npow2 sz) *) apply N.sub_lt. (* Goal: N.lt N0 (@wordToN sz w) *) (* Goal: N.le (@wordToN sz w) (Npow2 sz) *) { (* Goal: N.le (@wordToN sz w) (Npow2 sz) *) apply N.lt_le_incl; auto. (* BG Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) (* BG Goal: N.lt N0 (@wordToN sz w) *) } (* Goal: N.lt N0 (@wordToN sz w) *) { (* Goal: N.lt N0 (@wordToN sz w) *) assert (wordToN w <> 0)%N. (* Goal: N.lt N0 (@wordToN sz w) *) (* Goal: not (@eq N (@wordToN sz w) N0) *) { (* Goal: not (@eq N (@wordToN sz w) N0) *) replace 0%N with (wordToN (wzero sz)). (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) (* Goal: not (@eq N (@wordToN sz w) (@wordToN sz (wzero sz))) *) { (* Goal: not (@eq N (@wordToN sz w) (@wordToN sz (wzero sz))) *) intro Hx; elim n. (* Goal: @eq (word sz) w (wzero sz) *) apply wordToN_inj; auto. (* BG Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) (* BG Goal: N.lt N0 (@wordToN sz w) *) (* BG Goal: @eq N (@wordToN sz (wzero sz)) N0 *) } (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) { (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) rewrite wordToN_nat. (* Goal: @eq N (N.of_nat (@wordToNat sz (wzero sz))) N0 *) unfold wzero; rewrite roundTrip_0; reflexivity. (* BG Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) (* BG Goal: N.lt N0 (@wordToN sz w) *) } (* BG Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) (* BG Goal: N.lt N0 (@wordToN sz w) *) } (* Goal: N.lt N0 (@wordToN sz w) *) nomega. (* BG Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) } (* BG Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) } (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) apply N.sub_gt in H. (* Goal: @eq (word sz) (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) (@wminus sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w))) (natToWord sz (S O))) *) remember (Npow2 sz - wordToN w)%N as p; clear Heqp. (* Goal: @eq (word sz) (NToWord sz (N.sub p (Npos xH))) (@wminus sz (NToWord sz p) (natToWord sz (S O))) *) do 2 rewrite NToWord_nat. (* Goal: @eq (word sz) (natToWord sz (N.to_nat (N.sub p (Npos xH)))) (@wminus sz (natToWord sz (N.to_nat p)) (natToWord sz (S O))) *) rewrite N2Nat.inj_sub. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (N.to_nat p) (N.to_nat (Npos xH)))) (@wminus sz (natToWord sz (N.to_nat p)) (natToWord sz (S O))) *) change (N.to_nat 1%N) with 1. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (N.to_nat p) (S O))) (@wminus sz (natToWord sz (N.to_nat p)) (natToWord sz (S O))) *) assert (N.to_nat p < pow2 sz)%nat by (rewrite <-Npow2_nat; apply Nlt_out; auto); clear H0. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (N.to_nat p) (S O))) (@wminus sz (natToWord sz (N.to_nat p)) (natToWord sz (S O))) *) assert (N.to_nat p <> 0) by (change 0 with (N.to_nat 0%N); intro Hx; elim H; apply N2Nat.inj; auto); clear H. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.sub (N.to_nat p) (S O))) (@wminus sz (natToWord sz (N.to_nat p)) (natToWord sz (S O))) *) apply wordToNat_inj. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (N.to_nat p) (S O)))) (@wordToNat sz (@wminus sz (natToWord sz (N.to_nat p)) (natToWord sz (S O)))) *) rewrite <-wordToNat_natToWord_pred. (* Goal: not (@eq (word sz) (natToWord sz (N.to_nat p)) (wzero sz)) *) (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (N.to_nat p) (S O)))) (Init.Nat.pred (@wordToNat sz (natToWord sz (N.to_nat p)))) *) + (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (N.to_nat p) (S O)))) (Init.Nat.pred (@wordToNat sz (natToWord sz (N.to_nat p)))) *) do 2 rewrite wordToNat_natToWord_2 by omega. (* Goal: @eq nat (Init.Nat.sub (N.to_nat p) (S O)) (Init.Nat.pred (N.to_nat p)) *) omega. (* BG Goal: not (@eq (word sz) (natToWord sz (N.to_nat p)) (wzero sz)) *) + (* Goal: not (@eq (word sz) (natToWord sz (N.to_nat p)) (wzero sz)) *) intro Hx; elim H0. (* Goal: @eq nat (N.to_nat p) O *) apply natToWord_inj with (sz:= sz); try omega. (* Goal: @eq (word sz) (natToWord sz (N.to_nat p)) (natToWord sz O) *) assumption. Qed. Lemma wzero_wneg: forall n, wneg (wzero n) = wzero n. Proof. (* Goal: forall n : nat, @eq (word n) (@wneg n (wzero n)) (wzero n) *) intros. (* Goal: @eq (word n) (@wneg n (wzero n)) (wzero n) *) pose proof (wminus_inv (wzero n)). (* Goal: @eq (word n) (@wneg n (wzero n)) (wzero n) *) rewrite wplus_unit in H; auto. Qed. Lemma pow2_wneg: forall sz, wneg (natToWord (S sz) (pow2 sz)) = natToWord (S sz) (pow2 sz). Proof. (* Goal: forall sz : nat, @eq (word (S sz)) (@wneg (S sz) (natToWord (S sz) (Nat.pow (S (S O)) sz))) (natToWord (S sz) (Nat.pow (S (S O)) sz)) *) unfold wneg; intros. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (natToWord (S sz) (Nat.pow (S (S O)) sz))))) (natToWord (S sz) (Nat.pow (S (S O)) sz)) *) rewrite <-Npow2_nat, <-NToWord_nat. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (NToWord (S sz) (Npow2 sz))))) (NToWord (S sz) (Npow2 sz)) *) rewrite wordToN_NToWord_2 by (apply Nlt_in; do 2 rewrite Npow2_nat; pose proof (zero_lt_pow2 sz); simpl; omega). (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.sub (Npow2 (S sz)) (Npow2 sz))) (NToWord (S sz) (Npow2 sz)) *) rewrite Npow2_S. (* Goal: @eq (word (S sz)) (NToWord (S sz) (N.sub (N.add (Npow2 sz) (Npow2 sz)) (Npow2 sz))) (NToWord (S sz) (Npow2 sz)) *) f_equal; nomega. Qed. Lemma wneg_WS_1: forall sz (w: word sz), wneg w~1 = (wnot w)~1. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word (S sz)) (@wneg (S sz) (@WS true sz w)) (@WS true sz (@wnot sz w)) *) intros. (* Goal: @eq (word (S sz)) (@wneg (S sz) (@WS true sz w)) (@WS true sz (@wnot sz w)) *) apply wordToN_inj. (* Goal: @eq N (@wordToN (S sz) (@wneg (S sz) (@WS true sz w))) (@wordToN (S sz) (@WS true sz (@wnot sz w))) *) simpl; rewrite wnot_def. (* Goal: @eq N (@wordToN (S sz) (@wneg (S sz) (@WS true sz w))) (N.succ match @wordToN sz (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) with | N0 => N0 | Npos q => Npos (xO q) end) *) unfold wneg. (* Goal: @eq N (@wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS true sz w))))) (N.succ match @wordToN sz (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) with | N0 => N0 | Npos q => Npos (xO q) end) *) rewrite wordToN_NToWord_2 by (apply N.sub_lt; [apply N.lt_le_incl, wordToN_bound|nomega]). (* Goal: @eq N (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS true sz w))) (N.succ match @wordToN sz (NToWord sz (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH))) with | N0 => N0 | Npos q => Npos (xO q) end) *) rewrite wordToN_NToWord_2. (* Goal: N.lt (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH)) (Npow2 sz) *) (* Goal: @eq N (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS true sz w))) (N.succ match N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) - (* Goal: @eq N (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS true sz w))) (N.succ match N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) rewrite wordToN_WS_1. (* Goal: @eq N (N.sub (Npow2 (S sz)) (N.add (N.mul (Npos (xO xH)) (@wordToN sz w)) (Npos xH))) (N.succ match N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) change (Npow2 (S sz)) with (2 * Npow2 sz)%N. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npow2 sz)) (N.add (N.mul (Npos (xO xH)) (@wordToN sz w)) (Npos xH))) (N.succ match N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) rewrite N.sub_add_distr. (* Goal: @eq N (N.sub (N.sub (N.mul (Npos (xO xH)) (Npow2 sz)) (N.mul (Npos (xO xH)) (@wordToN sz w))) (Npos xH)) (N.succ match N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) rewrite <-N.mul_sub_distr_l. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (N.sub (Npow2 sz) (@wordToN sz w))) (Npos xH)) (N.succ match N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) assert (Npow2 sz - wordToN w <> 0)%N by (pose proof (wordToN_bound w); nomega). (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (N.sub (Npow2 sz) (@wordToN sz w))) (Npos xH)) (N.succ match N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) remember (Npow2 sz - wordToN w)%N as n; clear Heqn. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) n) (Npos xH)) (N.succ match N.sub n (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) destruct n; [intuition idtac|]. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ match N.sub (Npos p) (Npos xH) with | N0 => N0 | Npos q => Npos (xO q) end) *) remember (N.pos p - 1)%N as pp; destruct pp. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ (Npos (xO p0))) *) (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ N0) *) + (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ N0) *) apply eq_sym, N.sub_0_le in Heqpp. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ N0) *) apply N.le_1_r in Heqpp; destruct Heqpp; [discriminate|]. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ N0) *) rewrite H0; reflexivity. (* BG Goal: N.lt (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH)) (Npow2 sz) *) (* BG Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ (Npos (xO p0))) *) + (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ (Npos (xO p0))) *) change (N.pos p0~0) with (2 * N.pos p0)%N. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ (N.mul (Npos (xO xH)) (Npos p0))) *) rewrite Heqpp. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.succ (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos xH)))) *) rewrite <-N.add_1_r. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.add (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos xH))) (Npos xH)) *) rewrite N.mul_sub_distr_l. (* Goal: @eq N (N.sub (N.mul (Npos (xO xH)) (Npos p)) (Npos xH)) (N.add (N.sub (N.mul (Npos (xO xH)) (Npos p)) (N.mul (Npos (xO xH)) (Npos xH))) (Npos xH)) *) clear; destruct p; cbn; reflexivity. (* BG Goal: N.lt (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH)) (Npow2 sz) *) - (* Goal: N.lt (N.sub (N.sub (Npow2 sz) (@wordToN sz w)) (Npos xH)) (Npow2 sz) *) rewrite <-N.sub_add_distr. (* Goal: N.lt (N.sub (Npow2 sz) (N.add (@wordToN sz w) (Npos xH))) (Npow2 sz) *) apply N.sub_lt; [|nomega]. (* Goal: N.le (N.add (@wordToN sz w) (Npos xH)) (Npow2 sz) *) pose proof (wordToN_bound w). (* Goal: N.le (N.add (@wordToN sz w) (Npos xH)) (Npow2 sz) *) apply N.le_succ_l in H. (* Goal: N.le (N.add (@wordToN sz w) (Npos xH)) (Npow2 sz) *) rewrite N.add_1_r; assumption. Qed. Lemma wordToZ_WS_0: forall sz (w: word sz), wordToZ w~0 = (2 * wordToZ w)%Z. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq Z (@wordToZ (S sz) (@WS false sz w)) (Z.mul (Zpos (xO xH)) (@wordToZ sz w)) *) dependent destruction w; [reflexivity|]. (* Goal: @eq Z (@wordToZ (S (S n)) (@WS false (S n) (@WS b n w))) (Z.mul (Zpos (xO xH)) (@wordToZ (S n) (@WS b n w))) *) unfold wordToZ. (* Goal: @eq Z (if @wmsb (S (S n)) (@WS false (S n) (@WS b n w)) false then match @wordToN (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b n w))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S (S n)) (@WS false (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zpos x end) (Z.mul (Zpos (xO xH)) (if @wmsb (S n) (@WS b n w) false then match @wordToN (S n) (@wneg (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S n) (@WS b n w) with | N0 => Z0 | Npos x => Zpos x end)) *) rewrite wmsb_ws. (* Goal: @eq Z (if @wmsb (S n) (@WS b n w) false then match @wordToN (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b n w))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S (S n)) (@WS false (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zpos x end) (Z.mul (Zpos (xO xH)) (if @wmsb (S n) (@WS b n w) false then match @wordToN (S n) (@wneg (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S n) (@WS b n w) with | N0 => Z0 | Npos x => Zpos x end)) *) destruct (wmsb (WS b w) false). (* Goal: @eq Z match @wordToN (S (S n)) (@WS false (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zpos x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@WS b n w) with | N0 => Z0 | Npos x => Zpos x end) *) (* Goal: @eq Z match @wordToN (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b n w))) with | N0 => Z0 | Npos x => Zneg x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@wneg (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zneg x end) *) - (* Goal: @eq Z match @wordToN (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b n w))) with | N0 => Z0 | Npos x => Zneg x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@wneg (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zneg x end) *) rewrite wneg_WS_0. (* Goal: @eq Z match @wordToN (S (S n)) (@WS false (S n) (@wneg (S n) (@WS b n w))) with | N0 => Z0 | Npos x => Zneg x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@wneg (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zneg x end) *) rewrite wordToN_WS_0. (* Goal: @eq Z match N.mul (Npos (xO xH)) (@wordToN (S n) (@wneg (S n) (@WS b n w))) with | N0 => Z0 | Npos x => Zneg x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@wneg (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zneg x end) *) destruct (wordToN (wneg (WS b w))); cbn; omega. (* BG Goal: @eq Z match @wordToN (S (S n)) (@WS false (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zpos x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@WS b n w) with | N0 => Z0 | Npos x => Zpos x end) *) - (* Goal: @eq Z match @wordToN (S (S n)) (@WS false (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zpos x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@WS b n w) with | N0 => Z0 | Npos x => Zpos x end) *) rewrite wordToN_WS_0. (* Goal: @eq Z match N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b n w)) with | N0 => Z0 | Npos x => Zpos x end (Z.mul (Zpos (xO xH)) match @wordToN (S n) (@WS b n w) with | N0 => Z0 | Npos x => Zpos x end) *) destruct (wordToN (WS b w)); cbn; omega. Qed. Lemma wordToZ_WS_1: forall sz (w: word (S sz)), wordToZ w~1 = (2 * wordToZ w + 1)%Z. Proof. (* Goal: forall (sz : nat) (w : word (S sz)), @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) w)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) w)) (Zpos xH)) *) intros. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) w)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) w)) (Zpos xH)) *) destruct (destruct_word_S w) as [v [b E]]. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) w)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) w)) (Zpos xH)) *) rewrite E. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) (@WS b sz v))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@WS b sz v))) (Zpos xH)) *) clear w E. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) (@WS b sz v))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@WS b sz v))) (Zpos xH)) *) rename v into w. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) (@WS b sz w))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@WS b sz w))) (Zpos xH)) *) unfold wordToZ. (* Goal: @eq Z (if @wmsb (S (S sz)) (@WS true (S sz) (@WS b sz w)) false then match @wordToN (S (S sz)) (@wneg (S (S sz)) (@WS true (S sz) (@WS b sz w))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end) (Z.add (Z.mul (Zpos (xO xH)) (if @wmsb (S sz) (@WS b sz w) false then match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end)) (Zpos xH)) *) rewrite wmsb_ws. (* Goal: @eq Z (if @wmsb (S sz) (@WS b sz w) false then match @wordToN (S (S sz)) (@wneg (S (S sz)) (@WS true (S sz) (@WS b sz w))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end) (Z.add (Z.mul (Zpos (xO xH)) (if @wmsb (S sz) (@WS b sz w) false then match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end)) (Zpos xH)) *) remember (wmsb (WS b w) false) as msb. (* Goal: @eq Z (if msb then match @wordToN (S (S sz)) (@wneg (S (S sz)) (@WS true (S sz) (@WS b sz w))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end) (Z.add (Z.mul (Zpos (xO xH)) (if msb then match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end)) (Zpos xH)) *) destruct msb. (* Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* Goal: @eq Z match @wordToN (S (S sz)) (@wneg (S (S sz)) (@WS true (S sz) (@WS b sz w))) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) - (* Goal: @eq Z match @wordToN (S (S sz)) (@wneg (S (S sz)) (@WS true (S sz) (@WS b sz w))) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) rewrite wneg_WS_1. (* Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@wnot (S sz) (@WS b sz w))) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) rewrite wordToN_WS_1. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (@wnot (S sz) (@WS b sz w)))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) rewrite wnot_def. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@wneg (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) unfold wneg. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) assert (Npow2 (S sz) - wordToN (WS b w) <> 0)%N. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) (* Goal: not (@eq N (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) N0) *) { (* Goal: not (@eq N (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) N0) *) pose proof (wordToN_bound (WS b w)); nomega. (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* BG Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) } (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) assert (Npow2 (S sz) - wordToN (WS b w) < Npow2 (S sz))%N. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) (* Goal: N.lt (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npow2 (S sz)) *) { (* Goal: N.lt (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npow2 (S sz)) *) apply N.sub_lt. (* Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) (* Goal: N.le (@wordToN (S sz) (@WS b sz w)) (Npow2 (S sz)) *) { (* Goal: N.le (@wordToN (S sz) (@WS b sz w)) (Npow2 (S sz)) *) apply N.lt_le_incl, wordToN_bound. (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* BG Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) (* BG Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) } (* Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) { (* Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) assert (wordToN (WS b w) <> 0)%N. (* Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) (* Goal: not (@eq N (@wordToN (S sz) (@WS b sz w)) N0) *) { (* Goal: not (@eq N (@wordToN (S sz) (@WS b sz w)) N0) *) replace 0%N with (wordToN (wzero (S sz))). (* Goal: @eq N (@wordToN (S sz) (wzero (S sz))) N0 *) (* Goal: not (@eq N (@wordToN (S sz) (@WS b sz w)) (@wordToN (S sz) (wzero (S sz)))) *) { (* Goal: not (@eq N (@wordToN (S sz) (@WS b sz w)) (@wordToN (S sz) (wzero (S sz)))) *) intro Hx. (* Goal: False *) apply wordToN_inj in Hx. (* Goal: False *) rewrite Hx in Heqmsb. (* Goal: False *) rewrite wmsb_wzero in Heqmsb; discriminate. (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* BG Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) (* BG Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) (* BG Goal: @eq N (@wordToN (S sz) (wzero (S sz))) N0 *) } (* Goal: @eq N (@wordToN (S sz) (wzero (S sz))) N0 *) { (* Goal: @eq N (@wordToN (S sz) (wzero (S sz))) N0 *) rewrite wordToN_nat. (* Goal: @eq N (N.of_nat (@wordToNat (S sz) (wzero (S sz)))) N0 *) unfold wzero; rewrite roundTrip_0; reflexivity. (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* BG Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) (* BG Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) } (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* BG Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) (* BG Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) } (* Goal: N.lt N0 (@wordToN (S sz) (@WS b sz w)) *) nomega. (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* BG Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) } (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) (* BG Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) } (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w))) (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) (N.sub (Npow2 (S sz)) (@wordToN (S sz) (@WS b sz w)))) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) remember (Npow2 (S sz) - wordToN (WS b w))%N as n; clear Heqn. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (NToWord (S sz) (N.sub n (Npos xH))))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) n) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) rewrite wordToN_NToWord_2 by nomega. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (N.sub n (Npos xH))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (NToWord (S sz) n) with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) rewrite wordToN_NToWord_2 by nomega. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (N.sub n (Npos xH))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) match n with | N0 => Z0 | Npos x => Zneg x end) (Zpos xH)) *) destruct n; [intuition idtac|]. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (N.sub (Npos p) (Npos xH))) (Npos xH) with | N0 => Z0 | Npos x => Zneg x end (Z.add (Z.mul (Zpos (xO xH)) (Zneg p)) (Zpos xH)) *) destruct p; cbn; reflexivity. (* BG Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) - (* Goal: @eq Z match @wordToN (S (S sz)) (@WS true (S sz) (@WS b sz w)) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) rewrite wordToN_WS_1. (* Goal: @eq Z match N.add (N.mul (Npos (xO xH)) (@wordToN (S sz) (@WS b sz w))) (Npos xH) with | N0 => Z0 | Npos x => Zpos x end (Z.add (Z.mul (Zpos (xO xH)) match @wordToN (S sz) (@WS b sz w) with | N0 => Z0 | Npos x => Zpos x end) (Zpos xH)) *) destruct (wordToN (WS b w)); cbn; omega. Qed. Lemma wordToZ_WS_1': forall sz (w: word (sz + 1)), wordToZ w~1 = (2 * wordToZ w + 1)%Z. Proof. (* Goal: forall (sz : nat) (w : word (Init.Nat.add sz (S O))), @eq Z (@wordToZ (S (Init.Nat.add sz (S O))) (@WS true (Init.Nat.add sz (S O)) w)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (Init.Nat.add sz (S O)) w)) (Zpos xH)) *) intro sz. (* Goal: forall w : word (Init.Nat.add sz (S O)), @eq Z (@wordToZ (S (Init.Nat.add sz (S O))) (@WS true (Init.Nat.add sz (S O)) w)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (Init.Nat.add sz (S O)) w)) (Zpos xH)) *) replace (sz + 1) with (S sz) by omega. (* Goal: forall w : word (S sz), @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) w)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) w)) (Zpos xH)) *) intros. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) w)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) w)) (Zpos xH)) *) apply wordToZ_WS_1. Qed. Lemma wordToZ_inj: forall sz (w1 w2: word sz), wordToZ w1 = wordToZ w2 -> w1 = w2. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (_ : @eq Z (@wordToZ sz w1) (@wordToZ sz w2)), @eq (word sz) w1 w2 *) unfold wordToZ; intros. (* Goal: @eq (word sz) w1 w2 *) remember (wmsb w1 false) as msb1. (* Goal: @eq (word sz) w1 w2 *) remember (wmsb w2 false) as msb2. (* Goal: @eq (word sz) w1 w2 *) destruct msb1, msb2. (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) w1 w2 *) - (* Goal: @eq (word sz) w1 w2 *) remember (wordToN (wneg w1)) as wn1. (* Goal: @eq (word sz) w1 w2 *) remember (wordToN (wneg w2)) as wn2. (* Goal: @eq (word sz) w1 w2 *) destruct wn1, wn2; try discriminate. (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) w1 w2 *) + (* Goal: @eq (word sz) w1 w2 *) assert (wneg w1 = wneg w2). (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) (@wneg sz w1) (@wneg sz w2) *) { (* Goal: @eq (word sz) (@wneg sz w1) (@wneg sz w2) *) apply wordToN_inj. (* Goal: @eq N (@wordToN sz (@wneg sz w1)) (@wordToN sz (@wneg sz w2)) *) rewrite <-Heqwn1, <-Heqwn2; reflexivity. (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) } (* Goal: @eq (word sz) w1 w2 *) rewrite <-wneg_idempotent with (w:= w1). (* Goal: @eq (word sz) (@wneg sz (@wneg sz w1)) w2 *) rewrite <-wneg_idempotent with (w:= w2). (* Goal: @eq (word sz) (@wneg sz (@wneg sz w1)) (@wneg sz (@wneg sz w2)) *) rewrite H0; reflexivity. (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) + (* Goal: @eq (word sz) w1 w2 *) inversion H; subst; clear H. (* Goal: @eq (word sz) w1 w2 *) assert (wneg w1 = wneg w2). (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) (@wneg sz w1) (@wneg sz w2) *) { (* Goal: @eq (word sz) (@wneg sz w1) (@wneg sz w2) *) apply wordToN_inj. (* Goal: @eq N (@wordToN sz (@wneg sz w1)) (@wordToN sz (@wneg sz w2)) *) rewrite <-Heqwn1, <-Heqwn2; reflexivity. (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) } (* Goal: @eq (word sz) w1 w2 *) rewrite <-wneg_idempotent with (w:= w1). (* Goal: @eq (word sz) (@wneg sz (@wneg sz w1)) w2 *) rewrite <-wneg_idempotent with (w:= w2). (* Goal: @eq (word sz) (@wneg sz (@wneg sz w1)) (@wneg sz (@wneg sz w2)) *) rewrite H; reflexivity. (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) - (* Goal: @eq (word sz) w1 w2 *) remember (wordToN (wneg w1)) as wn1. (* Goal: @eq (word sz) w1 w2 *) remember (wordToN w2) as wn2. (* Goal: @eq (word sz) w1 w2 *) destruct wn1, wn2; try discriminate. (* Goal: @eq (word sz) w1 w2 *) rewrite <-wordToN_wzero with (sz:= sz) in Heqwn1, Heqwn2. (* Goal: @eq (word sz) w1 w2 *) apply wordToN_inj in Heqwn1. (* Goal: @eq (word sz) w1 w2 *) apply wordToN_inj in Heqwn2. (* Goal: @eq (word sz) w1 w2 *) assert (w1 = wzero sz). (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) w1 (wzero sz) *) { (* Goal: @eq (word sz) w1 (wzero sz) *) rewrite <-wneg_idempotent with (w:= w1), <-Heqwn1. (* Goal: @eq (word sz) (@wneg sz (wzero sz)) (wzero sz) *) apply wzero_wneg. (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) } (* Goal: @eq (word sz) w1 w2 *) subst; reflexivity. (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) - (* Goal: @eq (word sz) w1 w2 *) remember (wordToN w1) as wn1. (* Goal: @eq (word sz) w1 w2 *) remember (wordToN (wneg w2)) as wn2. (* Goal: @eq (word sz) w1 w2 *) destruct wn1, wn2; try discriminate. (* Goal: @eq (word sz) w1 w2 *) rewrite <-wordToN_wzero with (sz:= sz) in Heqwn1, Heqwn2. (* Goal: @eq (word sz) w1 w2 *) apply wordToN_inj in Heqwn1. (* Goal: @eq (word sz) w1 w2 *) apply wordToN_inj in Heqwn2. (* Goal: @eq (word sz) w1 w2 *) assert (w2 = wzero sz). (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) w2 (wzero sz) *) { (* Goal: @eq (word sz) w2 (wzero sz) *) rewrite <-wneg_idempotent with (w:= w2), <-Heqwn2. (* Goal: @eq (word sz) (@wneg sz (wzero sz)) (wzero sz) *) apply wzero_wneg. (* BG Goal: @eq (word sz) w1 w2 *) (* BG Goal: @eq (word sz) w1 w2 *) } (* Goal: @eq (word sz) w1 w2 *) subst; reflexivity. (* BG Goal: @eq (word sz) w1 w2 *) - (* Goal: @eq (word sz) w1 w2 *) remember (wordToN w1) as wn1. (* Goal: @eq (word sz) w1 w2 *) remember (wordToN w2) as wn2. (* Goal: @eq (word sz) w1 w2 *) destruct wn1, wn2; try discriminate. (* Goal: @eq (word sz) w1 w2 *) (* Goal: @eq (word sz) w1 w2 *) + (* Goal: @eq (word sz) w1 w2 *) rewrite <-wordToN_wzero with (sz:= sz) in Heqwn1, Heqwn2. (* Goal: @eq (word sz) w1 w2 *) rewrite Heqwn1 in Heqwn2. (* Goal: @eq (word sz) w1 w2 *) apply wordToN_inj in Heqwn2; auto. (* BG Goal: @eq (word sz) w1 w2 *) + (* Goal: @eq (word sz) w1 w2 *) inversion H; subst; clear H. (* Goal: @eq (word sz) w1 w2 *) rewrite Heqwn1 in Heqwn2. (* Goal: @eq (word sz) w1 w2 *) apply wordToN_inj in Heqwn2; auto. Qed. Lemma wordToZ_wones: forall sz, sz <> 0 -> wordToZ (wones sz) = (-1)%Z. Proof. (* Goal: forall (sz : nat) (_ : not (@eq nat sz O)), @eq Z (@wordToZ sz (wones sz)) (Zneg xH) *) induction sz; intros; [elim H; reflexivity|]. (* Goal: @eq Z (@wordToZ (S sz) (wones (S sz))) (Zneg xH) *) simpl; destruct sz; [reflexivity|]. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) (wones (S sz)))) (Zneg xH) *) rewrite wordToZ_WS_1. (* Goal: @eq Z (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (wones (S sz)))) (Zpos xH)) (Zneg xH) *) rewrite IHsz by discriminate. (* Goal: @eq Z (Z.add (Z.mul (Zpos (xO xH)) (Zneg xH)) (Zpos xH)) (Zneg xH) *) reflexivity. Qed. Lemma wordToNat_eq_rect: forall sz (w: word sz) nsz Hsz, wordToNat (eq_rect _ word w nsz Hsz) = wordToNat w. Proof. (* Goal: forall (sz : nat) (w : word sz) (nsz : nat) (Hsz : @eq nat sz nsz), @eq nat (@wordToNat nsz (@eq_rect nat sz word w nsz Hsz)) (@wordToNat sz w) *) intros; subst; simpl; reflexivity. Qed. Lemma wordToNat_existT: forall sz1 (w1: word sz1) sz2 (w2: word sz2) (Hsz: sz1 = sz2), wordToNat w1 = wordToNat w2 -> existT word _ w1 = existT word _ w2. Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (_ : @eq nat sz1 sz2) (_ : @eq nat (@wordToNat sz1 w1) (@wordToNat sz2 w2)), @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2) *) intros; subst. (* Goal: @eq (@sigT nat word) (@existT nat word sz2 w1) (@existT nat word sz2 w2) *) apply wordToNat_inj in H; subst. (* Goal: @eq (@sigT nat word) (@existT nat word sz2 w2) (@existT nat word sz2 w2) *) reflexivity. Qed. Lemma existT_wordToNat: forall sz1 (w1: word sz1) sz2 (w2: word sz2), existT word _ w1 = existT word _ w2 -> wordToNat w1 = wordToNat w2. Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (_ : @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2)), @eq nat (@wordToNat sz1 w1) (@wordToNat sz2 w2) *) intros. (* Goal: @eq nat (@wordToNat sz1 w1) (@wordToNat sz2 w2) *) pose proof (eq_sigT_fst H); subst. (* Goal: @eq nat (@wordToNat sz2 w1) (@wordToNat sz2 w2) *) destruct_existT; reflexivity. Qed. Lemma wordToZ_eq_rect: forall sz (w: word sz) nsz Hsz, wordToZ (eq_rect _ word w nsz Hsz) = wordToZ w. Proof. (* Goal: forall (sz : nat) (w : word sz) (nsz : nat) (Hsz : @eq nat sz nsz), @eq Z (@wordToZ nsz (@eq_rect nat sz word w nsz Hsz)) (@wordToZ sz w) *) intros; subst; simpl; reflexivity. Qed. Lemma wordToZ_existT: forall sz1 (w1: word sz1) sz2 (w2: word sz2) (Hsz: sz1 = sz2), wordToZ w1 = wordToZ w2 -> existT word _ w1 = existT word _ w2. Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (_ : @eq nat sz1 sz2) (_ : @eq Z (@wordToZ sz1 w1) (@wordToZ sz2 w2)), @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2) *) intros; subst. (* Goal: @eq (@sigT nat word) (@existT nat word sz2 w1) (@existT nat word sz2 w2) *) apply wordToZ_inj in H; subst. (* Goal: @eq (@sigT nat word) (@existT nat word sz2 w2) (@existT nat word sz2 w2) *) reflexivity. Qed. Lemma existT_wordToZ: forall sz1 (w1: word sz1) sz2 (w2: word sz2), existT word _ w1 = existT word _ w2 -> wordToZ w1 = wordToZ w2. Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (_ : @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2)), @eq Z (@wordToZ sz1 w1) (@wordToZ sz2 w2) *) intros. (* Goal: @eq Z (@wordToZ sz1 w1) (@wordToZ sz2 w2) *) pose proof (eq_sigT_fst H); subst. (* Goal: @eq Z (@wordToZ sz2 w1) (@wordToZ sz2 w2) *) destruct_existT. (* Goal: @eq Z (@wordToZ sz2 w2) (@wordToZ sz2 w2) *) reflexivity. Qed. Lemma wplus_WS_0: forall sz (w1 w2: word sz) b, WS b (w1 ^+ w2) = WS b w1 ^+ w2~0. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (b : bool), @eq (word (S sz)) (@WS b sz (@wplus sz w1 w2)) (@wplus (S sz) (@WS b sz w1) (@WS false sz w2)) *) intros. (* Goal: @eq (word (S sz)) (@WS b sz (@wplus sz w1 w2)) (@wplus (S sz) (@WS b sz w1) (@WS false sz w2)) *) unfold wplus, wordBin; intros. (* Goal: @eq (word (S sz)) (@WS b sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (@wordToN (S sz) (@WS b sz w1)) (@wordToN (S sz) (@WS false sz w2)))) *) rewrite wordToN_WS_0. (* Goal: @eq (word (S sz)) (@WS b sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (@wordToN (S sz) (@WS b sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) destruct b. (* Goal: @eq (word (S sz)) (@WS false sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (@wordToN (S sz) (@WS false sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) (* Goal: @eq (word (S sz)) (@WS true sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (@wordToN (S sz) (@WS true sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) - (* Goal: @eq (word (S sz)) (@WS true sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (@wordToN (S sz) (@WS true sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) rewrite wordToN_WS_1. (* Goal: @eq (word (S sz)) (@WS true sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (N.add (N.mul (Npos (xO xH)) (@wordToN sz w1)) (Npos xH)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) rewrite <-N.add_assoc. (* Goal: @eq (word (S sz)) (@WS true sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (N.mul (Npos (xO xH)) (@wordToN sz w1)) (N.add (Npos xH) (N.mul (Npos (xO xH)) (@wordToN sz w2))))) *) rewrite N.add_comm with (n:= 1%N). (* Goal: @eq (word (S sz)) (@WS true sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (N.mul (Npos (xO xH)) (@wordToN sz w1)) (N.add (N.mul (Npos (xO xH)) (@wordToN sz w2)) (Npos xH)))) *) rewrite N.add_assoc. (* Goal: @eq (word (S sz)) (@WS true sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (N.add (N.mul (Npos (xO xH)) (@wordToN sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2))) (Npos xH))) *) rewrite <-N.mul_add_distr_l. (* Goal: @eq (word (S sz)) (@WS true sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (N.mul (Npos (xO xH)) (N.add (@wordToN sz w1) (@wordToN sz w2))) (Npos xH))) *) apply eq_sym, NToWord_WS_1. (* BG Goal: @eq (word (S sz)) (@WS false sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (@wordToN (S sz) (@WS false sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) - (* Goal: @eq (word (S sz)) (@WS false sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (@wordToN (S sz) (@WS false sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) rewrite wordToN_WS_0. (* Goal: @eq (word (S sz)) (@WS false sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.add (N.mul (Npos (xO xH)) (@wordToN sz w1)) (N.mul (Npos (xO xH)) (@wordToN sz w2)))) *) rewrite <-N.mul_add_distr_l. (* Goal: @eq (word (S sz)) (@WS false sz (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2)))) (NToWord (S sz) (N.mul (Npos (xO xH)) (N.add (@wordToN sz w1) (@wordToN sz w2)))) *) apply eq_sym, NToWord_WS_0. Qed. Corollary wplus_WS_0': forall sz (w1 w2: word sz) b, WS b (w1 ^+ w2) = w1~0 ^+ WS b w2. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (b : bool), @eq (word (S sz)) (@WS b sz (@wplus sz w1 w2)) (@wplus (S sz) (@WS false sz w1) (@WS b sz w2)) *) intros. (* Goal: @eq (word (S sz)) (@WS b sz (@wplus sz w1 w2)) (@wplus (S sz) (@WS false sz w1) (@WS b sz w2)) *) rewrite wplus_comm with (x:= w1). (* Goal: @eq (word (S sz)) (@WS b sz (@wplus sz w2 w1)) (@wplus (S sz) (@WS false sz w1) (@WS b sz w2)) *) rewrite wplus_comm with (x:= w1~0). (* Goal: @eq (word (S sz)) (@WS b sz (@wplus sz w2 w1)) (@wplus (S sz) (@WS b sz w2) (@WS false sz w1)) *) apply wplus_WS_0. Qed. Lemma wpow2_pow2: forall sz, wordToNat (wpow2 sz) = pow2 sz. Proof. (* Goal: forall sz : nat, @eq nat (@wordToNat (S sz) (wpow2 sz)) (Nat.pow (S (S O)) sz) *) induction sz; simpl; intros; [reflexivity|]. (* Goal: @eq nat (Init.Nat.mul (@wordToNat (S sz) (wpow2 sz)) (S (S O))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) *) rewrite IHsz. (* Goal: @eq nat (Init.Nat.mul (Nat.pow (S (S O)) sz) (S (S O))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) *) omega. Qed. Lemma wpow2_Npow2: forall sz, wordToN (wpow2 sz) = Npow2 sz. Proof. (* Goal: forall sz : nat, @eq N (@wordToN (S sz) (wpow2 sz)) (Npow2 sz) *) induction sz; simpl; intros; [reflexivity|]. (* Goal: @eq N match @wordToN (S sz) (wpow2 sz) with | N0 => N0 | Npos q => Npos (xO q) end match Npow2 sz with | N0 => N0 | Npos q => Npos (xO q) end *) rewrite IHsz; reflexivity. Qed. Lemma wpow2_wneg: forall sz, wneg (wpow2 sz) = wpow2 sz. Proof. (* Goal: forall sz : nat, @eq (word (S sz)) (@wneg (S sz) (wpow2 sz)) (wpow2 sz) *) induction sz; simpl; intros; [reflexivity|]. (* Goal: @eq (word (S (S sz))) (@wneg (S (S sz)) (@WS false (S sz) (wpow2 sz))) (@WS false (S sz) (wpow2 sz)) *) rewrite wneg_WS_0. (* Goal: @eq (word (S (S sz))) (@WS false (S sz) (@wneg (S sz) (wpow2 sz))) (@WS false (S sz) (wpow2 sz)) *) rewrite IHsz; reflexivity. Qed. Lemma wpow2_wmsb: forall sz, wmsb (wpow2 sz) false = true. Proof. (* Goal: forall sz : nat, @eq bool (@wmsb (S sz) (wpow2 sz) false) true *) induction sz; simpl; intros; auto. Qed. Lemma wmsb_wnot: forall sz (w: word (S sz)) b1 b2, wmsb (wnot w) b1 = negb (wmsb w b2). Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (b1 b2 : bool), @eq bool (@wmsb (S sz) (@wnot (S sz) w) b1) (negb (@wmsb (S sz) w b2)) *) apply (induct_word_S (fun sz w => forall b1 b2, wmsb (wnot w) b1 = negb (wmsb w b2))); intros. (* Goal: @eq bool (@wmsb (S (S n)) (@wnot (S (S n)) (@WS b (S n) (@WS b0 n w))) b1) (negb (@wmsb (S (S n)) (@WS b (S n) (@WS b0 n w)) b2)) *) (* Goal: @eq bool (@wmsb (S O) (@wnot (S O) (@WS b O WO)) b1) (negb (@wmsb (S O) (@WS b O WO) b2)) *) - (* Goal: @eq bool (@wmsb (S O) (@wnot (S O) (@WS b O WO)) b1) (negb (@wmsb (S O) (@WS b O WO) b2)) *) reflexivity. (* BG Goal: @eq bool (@wmsb (S (S n)) (@wnot (S (S n)) (@WS b (S n) (@WS b0 n w))) b1) (negb (@wmsb (S (S n)) (@WS b (S n) (@WS b0 n w)) b2)) *) - (* Goal: @eq bool (@wmsb (S (S n)) (@wnot (S (S n)) (@WS b (S n) (@WS b0 n w))) b1) (negb (@wmsb (S (S n)) (@WS b (S n) (@WS b0 n w)) b2)) *) simpl. (* Goal: @eq bool (@wmsb n (@wnot n w) (negb b0)) (negb (@wmsb n w b0)) *) apply (H true true). Qed. Lemma wmsb_wneg_true: forall sz (w: word (S sz)), w <> wpow2 sz -> forall b1 b2, wmsb w b1 = true -> wmsb (wneg w) b2 = false. Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (_ : not (@eq (word (S sz)) w (wpow2 sz))) (b1 b2 : bool) (_ : @eq bool (@wmsb (S sz) w b1) true), @eq bool (@wmsb (S sz) (@wneg (S sz) w) b2) false *) apply (induct_word_S (fun sz w => w <> wpow2 sz -> forall b1 b2, wmsb w b1 = true -> wmsb (^~ w) b2 = false)); intros; [simpl in *; subst; elim H; reflexivity|]. (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS b (S n) (@WS b0 n w))) b2) false *) destruct b. (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b0 n w))) b2) false *) (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS true (S n) (@WS b0 n w))) b2) false *) - (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS true (S n) (@WS b0 n w))) b2) false *) rewrite wneg_WS_1. (* Goal: @eq bool (@wmsb (S (S n)) (@WS true (S n) (@wnot (S n) (@WS b0 n w))) b2) false *) rewrite wmsb_ws. (* Goal: @eq bool (@wmsb (S n) (@wnot (S n) (@WS b0 n w)) b2) false *) rewrite wmsb_wnot with (b2:= false). (* Goal: @eq bool (negb (@wmsb (S n) (@WS b0 n w) false)) false *) simpl; apply negb_false_iff; assumption. (* BG Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b0 n w))) b2) false *) - (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b0 n w))) b2) false *) rewrite wneg_WS_0. (* Goal: @eq bool (@wmsb (S (S n)) (@WS false (S n) (@wneg (S n) (@WS b0 n w))) b2) false *) eapply H with (b1 := false); eauto. (* Goal: not (@eq (word (S n)) (@WS b0 n w) (wpow2 n)) *) intro Hx. (* Goal: False *) elim H0. (* Goal: @eq (word (S (S n))) (@WS false (S n) (@WS b0 n w)) (wpow2 (S n)) *) clear -Hx. (* Goal: @eq (word (S (S n))) (@WS false (S n) (@WS b0 n w)) (wpow2 (S n)) *) simpl; rewrite Hx; reflexivity. Qed. Lemma wmsb_wneg_false: forall sz (w: word (S sz)), wordToNat w <> 0 -> forall b1 b2, wmsb w b1 = false -> wmsb (wneg w) b2 = true. Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (_ : not (@eq nat (@wordToNat (S sz) w) O)) (b1 b2 : bool) (_ : @eq bool (@wmsb (S sz) w b1) false), @eq bool (@wmsb (S sz) (@wneg (S sz) w) b2) true *) apply (induct_word_S (fun sz w => #w <> 0 -> forall b1 b2, wmsb w b1 = false -> wmsb (^~ w) b2 = true)); intros; [simpl in *; subst; elim H; reflexivity|]. (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS b (S n) (@WS b0 n w))) b2) true *) destruct b. (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b0 n w))) b2) true *) (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS true (S n) (@WS b0 n w))) b2) true *) - (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS true (S n) (@WS b0 n w))) b2) true *) rewrite wneg_WS_1. (* Goal: @eq bool (@wmsb (S (S n)) (@WS true (S n) (@wnot (S n) (@WS b0 n w))) b2) true *) rewrite wmsb_ws. (* Goal: @eq bool (@wmsb (S n) (@wnot (S n) (@WS b0 n w)) b2) true *) rewrite wmsb_ws in H1. (* Goal: @eq bool (@wmsb (S n) (@wnot (S n) (@WS b0 n w)) b2) true *) rewrite wmsb_wnot with (b2:= false). (* Goal: @eq bool (negb (@wmsb (S n) (@WS b0 n w) false)) true *) apply negb_true_iff; assumption. (* BG Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b0 n w))) b2) true *) - (* Goal: @eq bool (@wmsb (S (S n)) (@wneg (S (S n)) (@WS false (S n) (@WS b0 n w))) b2) true *) rewrite wneg_WS_0. (* Goal: @eq bool (@wmsb (S (S n)) (@WS false (S n) (@wneg (S n) (@WS b0 n w))) b2) true *) eapply H with (b1:= false); eauto. (* Goal: not (@eq nat (@wordToNat (S n) (@WS b0 n w)) O) *) intro Hx; elim H0. (* Goal: @eq nat (@wordToNat (S (S n)) (@WS false (S n) (@WS b0 n w))) O *) clear -Hx. (* Goal: @eq nat (@wordToNat (S (S n)) (@WS false (S n) (@WS b0 n w))) O *) simpl in *; omega. Qed. Lemma zext_WO_wzero: forall n, zext WO n = wzero n. Proof. (* Goal: forall n : nat, @eq (word (Init.Nat.add O n)) (@zext O WO n) (wzero n) *) reflexivity. Qed. Lemma wmsb_wneg_zext: forall sz (w: word sz) b n, n <> 0 -> wordToNat w <> 0 -> wmsb (wneg (zext w n)) b = true. Proof. (* Goal: forall (sz : nat) (w : word sz) (b : bool) (n : nat) (_ : not (@eq nat n O)) (_ : not (@eq nat (@wordToNat sz w) O)), @eq bool (@wmsb (Init.Nat.add sz n) (@wneg (Init.Nat.add sz n) (@zext sz w n)) b) true *) intros. (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@wneg (Init.Nat.add sz n) (@zext sz w n)) b) true *) dependent destruction w; [elim H0; reflexivity|]. (* Goal: @eq bool (@wmsb (Init.Nat.add (S n) n0) (@wneg (Init.Nat.add (S n) n0) (@zext (S n) (@WS b n w) n0)) b0) true *) apply wmsb_wneg_false with (b1:= false). (* Goal: @eq bool (@wmsb (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n n0)) (@zext (S n) (@WS b n w) n0) false) false *) (* Goal: not (@eq nat (@wordToNat (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n n0)) (@zext (S n) (@WS b n w) n0)) O) *) - (* Goal: not (@eq nat (@wordToNat (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n n0)) (@zext (S n) (@WS b n w) n0)) O) *) rewrite <-wordToNat_zext with (n:= n0) in H0. (* Goal: not (@eq nat (@wordToNat (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n n0)) (@zext (S n) (@WS b n w) n0)) O) *) assumption. (* BG Goal: @eq bool (@wmsb (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n n0)) (@zext (S n) (@WS b n w) n0) false) false *) - (* Goal: @eq bool (@wmsb (S ((fix add (n m : nat) {struct n} : nat := match n with | O => m | S p => S (add p m) end) n n0)) (@zext (S n) (@WS b n w) n0) false) false *) apply wmsb_zext; assumption. Qed. Lemma wminus_WS_pos: forall sz (w1 w2: word (S sz)), wordToZ (WS true w1 ^- WS false w2) = (2 * wordToZ (w1 ^- w2) + 1)%Z. Proof. (* Goal: forall (sz : nat) (w1 w2 : word (S sz)), @eq Z (@wordToZ (S (S sz)) (@wminus (S (S sz)) (@WS true (S sz) w1) (@WS false (S sz) w2))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@wminus (S sz) w1 w2))) (Zpos xH)) *) unfold wminus; intros. (* Goal: @eq Z (@wordToZ (S (S sz)) (@wplus (S (S sz)) (@WS true (S sz) w1) (@wneg (S (S sz)) (@WS false (S sz) w2)))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@wplus (S sz) w1 (@wneg (S sz) w2)))) (Zpos xH)) *) cbn. (* Goal: @eq Z (@wordToZ (S (S sz)) (@wplus (S (S sz)) (@WS true (S sz) w1) (@wneg (S (S sz)) (@WS false (S sz) w2)))) (Z.add match @wordToZ (S sz) (@wplus (S sz) w1 (@wneg (S sz) w2)) with | Z0 => Z0 | Zpos y' => Zpos (xO y') | Zneg y' => Zneg (xO y') end (Zpos xH)) *) rewrite wneg_WS_0. (* Goal: @eq Z (@wordToZ (S (S sz)) (@wplus (S (S sz)) (@WS true (S sz) w1) (@WS false (S sz) (@wneg (S sz) w2)))) (Z.add match @wordToZ (S sz) (@wplus (S sz) w1 (@wneg (S sz) w2)) with | Z0 => Z0 | Zpos y' => Zpos (xO y') | Zneg y' => Zneg (xO y') end (Zpos xH)) *) rewrite <-wplus_WS_0. (* Goal: @eq Z (@wordToZ (S (S sz)) (@WS true (S sz) (@wplus (S sz) w1 (@wneg (S sz) w2)))) (Z.add match @wordToZ (S sz) (@wplus (S sz) w1 (@wneg (S sz) w2)) with | Z0 => Z0 | Zpos y' => Zpos (xO y') | Zneg y' => Zneg (xO y') end (Zpos xH)) *) rewrite wordToZ_WS_1. (* Goal: @eq Z (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@wplus (S sz) w1 (@wneg (S sz) w2)))) (Zpos xH)) (Z.add match @wordToZ (S sz) (@wplus (S sz) w1 (@wneg (S sz) w2)) with | Z0 => Z0 | Zpos y' => Zpos (xO y') | Zneg y' => Zneg (xO y') end (Zpos xH)) *) reflexivity. Qed. Lemma wminus_WS_pos': forall sz (w1 w2: word (sz + 1)), wordToZ (WS true w1 ^- WS false w2) = (2 * wordToZ (w1 ^- w2) + 1)%Z. Proof. (* Goal: forall (sz : nat) (w1 w2 : word (Init.Nat.add sz (S O))), @eq Z (@wordToZ (S (Init.Nat.add sz (S O))) (@wminus (S (Init.Nat.add sz (S O))) (@WS true (Init.Nat.add sz (S O)) w1) (@WS false (Init.Nat.add sz (S O)) w2))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w1 w2))) (Zpos xH)) *) intro sz. (* Goal: forall w1 w2 : word (Init.Nat.add sz (S O)), @eq Z (@wordToZ (S (Init.Nat.add sz (S O))) (@wminus (S (Init.Nat.add sz (S O))) (@WS true (Init.Nat.add sz (S O)) w1) (@WS false (Init.Nat.add sz (S O)) w2))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w1 w2))) (Zpos xH)) *) replace (sz + 1) with (S sz) by omega. (* Goal: forall w1 w2 : word (S sz), @eq Z (@wordToZ (S (S sz)) (@wminus (S (S sz)) (@WS true (S sz) w1) (@WS false (S sz) w2))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@wminus (S sz) w1 w2))) (Zpos xH)) *) intros. (* Goal: @eq Z (@wordToZ (S (S sz)) (@wminus (S (S sz)) (@WS true (S sz) w1) (@WS false (S sz) w2))) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (@wminus (S sz) w1 w2))) (Zpos xH)) *) apply wminus_WS_pos. Qed. Lemma wtl_combine: forall (x: word 1) sz (y: word sz), wtl (combine x y) = y. Proof. (* Goal: forall (x : word (S O)) (sz : nat) (y : word sz), @eq (word sz) (@wtl sz (@combine (S O) x sz y)) y *) intros. (* Goal: @eq (word sz) (@wtl sz (@combine (S O) x sz y)) y *) destruct (destruct_word_S x) as [v [b E]]. (* Goal: @eq (word sz) (@wtl sz (@combine (S O) x sz y)) y *) subst x. (* Goal: @eq (word sz) (@wtl sz (@combine (S O) (@WS b O v) sz y)) y *) rewrite (word0 v). (* Goal: @eq (word sz) (@wtl sz (@combine (S O) (@WS b O WO) sz y)) y *) reflexivity. Qed. Lemma extz_combine: forall sz (w: word sz) n, extz w n = combine (natToWord n 0) w. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq (word (Init.Nat.add n sz)) (@extz sz w n) (@combine n (natToWord n O) sz w) *) reflexivity. Qed. Lemma combine_assoc_existT: forall sz1 (w1: word sz1) sz2 (w2: word sz2) sz3 (w3: word sz3), existT word (sz1 + (sz2 + sz3)) (combine w1 (combine w2 w3)) = existT word (sz1 + sz2 + sz3) (combine (combine w1 w2) w3). Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (sz3 : nat) (w3 : word sz3), @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) (@combine sz1 w1 (Init.Nat.add sz2 sz3) (@combine sz2 w2 sz3 w3))) (@existT nat word (Init.Nat.add (Init.Nat.add sz1 sz2) sz3) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) sz3 w3)) *) intros; apply EqdepFacts.eq_sigT_sig_eq. (* Goal: @sig (@eq nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3)) (fun H : @eq nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3) => @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) sz3)) (@eq_rect nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) word (@combine sz1 w1 (Init.Nat.add sz2 sz3) (@combine sz2 w2 sz3 w3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3) H) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) sz3 w3)) *) assert (Hsz: sz1 + (sz2 + sz3) = sz1 + sz2 + sz3) by omega. (* Goal: @sig (@eq nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3)) (fun H : @eq nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3) => @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) sz3)) (@eq_rect nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) word (@combine sz1 w1 (Init.Nat.add sz2 sz3) (@combine sz2 w2 sz3 w3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3) H) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) sz3 w3)) *) exists Hsz. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) sz3)) (@eq_rect nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) word (@combine sz1 w1 (Init.Nat.add sz2 sz3) (@combine sz2 w2 sz3 w3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3) Hsz) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) sz3 w3) *) rewrite (combine_assoc w1 w2 w3 Hsz). (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) sz3)) (@eq_rect nat (Init.Nat.add sz1 (Init.Nat.add sz2 sz3)) word (@combine sz1 w1 (Init.Nat.add sz2 sz3) (@combine sz2 w2 sz3 w3)) (Init.Nat.add (Init.Nat.add sz1 sz2) sz3) Hsz) match Hsz in (eq _ N) return (word N) with | eq_refl => @combine sz1 w1 (Init.Nat.add sz2 sz3) (@combine sz2 w2 sz3 w3) end *) reflexivity. Qed. Proof. intros; apply EqdepFacts.eq_sigT_sig_eq. Lemma sext_combine: forall sz n (w: word (sz + n)) sz1 (w1: word sz1) sz2 (Hsz2: sz2 <> 0) (w2: word sz2), existT word _ w = existT word _ (combine w1 (sext w2 n)) -> exists sw, w = sext sw n /\ existT word _ sw = existT word _ (combine w1 w2). Proof. (* Goal: forall (sz n : nat) (w : word (Init.Nat.add sz n)) (sz1 : nat) (w1 : word sz1) (sz2 : nat) (_ : not (@eq nat sz2 O)) (w2 : word sz2) (_ : @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz n) w) (@existT nat word (Init.Nat.add sz1 (Init.Nat.add sz2 n)) (@combine sz1 w1 (Init.Nat.add sz2 n) (@sext sz2 w2 n)))), @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) intros; unfold sext in H. (* Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) remember (wmsb w2 false) as msb2; destruct msb2. (* Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) (* Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) - (* Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) rewrite combine_assoc_existT in H. (* Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) assert (sz = sz1 + sz2) by (apply eq_sigT_fst in H; omega); subst. (* Goal: @ex (word (Init.Nat.add sz1 sz2)) (fun sw : word (Init.Nat.add sz1 sz2) => and (@eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) w (@sext (Init.Nat.add sz1 sz2) sw n)) (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 sz2) sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) destruct_existT. (* Goal: @ex (word (Init.Nat.add sz1 sz2)) (fun sw : word (Init.Nat.add sz1 sz2) => and (@eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wones n)) (@sext (Init.Nat.add sz1 sz2) sw n)) (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 sz2) sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) exists (combine w1 w2). (* Goal: and (@eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wones n)) (@sext (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n)) (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2))) *) split; [|reflexivity]. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wones n)) (@sext (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n) *) unfold sext. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wones n)) (if @wmsb (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) false then @combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wones n) else @combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wzero n)) *) dependent destruction w2; [discriminate|]. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 (S n0)) n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n)) (if @wmsb (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) false then @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n) else @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) *) rewrite wmsb_combine with (b2:= false) by discriminate. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 (S n0)) n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n)) (if @wmsb (S n0) (@WS b n0 w2) false then @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n) else @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) *) rewrite <-Heqmsb2. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 (S n0)) n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n)) *) reflexivity. (* BG Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) - (* Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) rewrite combine_assoc_existT in H. (* Goal: @ex (word sz) (fun sw : word sz => and (@eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) (@eq (@sigT nat word) (@existT nat word sz sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) assert (sz = sz1 + sz2) by (apply eq_sigT_fst in H; omega); subst. (* Goal: @ex (word (Init.Nat.add sz1 sz2)) (fun sw : word (Init.Nat.add sz1 sz2) => and (@eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) w (@sext (Init.Nat.add sz1 sz2) sw n)) (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 sz2) sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) destruct_existT. (* Goal: @ex (word (Init.Nat.add sz1 sz2)) (fun sw : word (Init.Nat.add sz1 sz2) => and (@eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wzero n)) (@sext (Init.Nat.add sz1 sz2) sw n)) (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 sz2) sw) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)))) *) exists (combine w1 w2). (* Goal: and (@eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wzero n)) (@sext (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n)) (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (@existT nat word (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2))) *) split; [|reflexivity]. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wzero n)) (@sext (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n) *) unfold sext. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 sz2) n)) (@combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wzero n)) (if @wmsb (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) false then @combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wones n) else @combine (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2) n (wzero n)) *) dependent destruction w2; [intuition idtac|]. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 (S n0)) n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) (if @wmsb (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) false then @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n) else @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) *) rewrite wmsb_combine with (b2:= false) by discriminate. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 (S n0)) n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) (if @wmsb (S n0) (@WS b n0 w2) false then @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wones n) else @combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) *) rewrite <-Heqmsb2. (* Goal: @eq (word (Init.Nat.add (Init.Nat.add sz1 (S n0)) n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) (@combine (Init.Nat.add sz1 (S n0)) (@combine sz1 w1 (S n0) (@WS b n0 w2)) n (wzero n)) *) reflexivity. Qed. Lemma wplus_wzero_1: forall sz (w: word sz), w ^+ (wzero _) = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wplus sz w (wzero sz)) w *) unfold wplus, wordBin; intros. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w) (@wordToN sz (wzero sz)))) w *) rewrite wordToN_wzero. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w) N0)) w *) rewrite N.add_0_r. (* Goal: @eq (word sz) (NToWord sz (@wordToN sz w)) w *) apply NToWord_wordToN. Qed. Lemma wplus_wzero_2: forall sz (w: word sz), (wzero _) ^+ w = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wplus sz (wzero sz) w) w *) unfold wplus, wordBin; intros. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz (wzero sz)) (@wordToN sz w))) w *) rewrite wordToN_wzero. (* Goal: @eq (word sz) (NToWord sz (N.add N0 (@wordToN sz w))) w *) rewrite N.add_0_l. (* Goal: @eq (word sz) (NToWord sz (@wordToN sz w)) w *) apply NToWord_wordToN. Qed. Lemma combine_wplus_1: forall sl (w1: word sl) su (w2 w3: word su), combine w1 (w2 ^+ w3) = combine w1 w2 ^+ extz w3 sl. Proof. (* Goal: forall (sl : nat) (w1 : word sl) (su : nat) (w2 w3 : word su), @eq (word (Init.Nat.add sl su)) (@combine sl w1 su (@wplus su w2 w3)) (@wplus (Init.Nat.add sl su) (@combine sl w1 su w2) (@extz su w3 sl)) *) dependent induction w1; intros; [reflexivity|]. (* Goal: @eq (word (Init.Nat.add (S n) su)) (@combine (S n) (@WS b n w1) su (@wplus su w2 w3)) (@wplus (Init.Nat.add (S n) su) (@combine (S n) (@WS b n w1) su w2) (@extz su w3 (S n))) *) cbn; rewrite IHw1. (* Goal: @eq (word (S (Init.Nat.add n su))) (@WS b (Init.Nat.add n su) (@wplus (Init.Nat.add n su) (@combine n w1 su w2) (@extz su w3 n))) (@wplus (S (Init.Nat.add n su)) (@WS b (Init.Nat.add n su) (@combine n w1 su w2)) (@WS false (Init.Nat.add n su) (@combine n (natToWord n O) su w3))) *) rewrite <-wplus_WS_0. (* Goal: @eq (word (S (Init.Nat.add n su))) (@WS b (Init.Nat.add n su) (@wplus (Init.Nat.add n su) (@combine n w1 su w2) (@extz su w3 n))) (@WS b (Init.Nat.add n su) (@wplus (Init.Nat.add n su) (@combine n w1 su w2) (@combine n (natToWord n O) su w3))) *) rewrite extz_combine; reflexivity. Qed. Lemma combine_wplus_2: forall sl (w1: word sl) su (w2 w3: word su), combine w1 (w2 ^+ w3) = extz w2 sl ^+ combine w1 w3. Proof. (* Goal: forall (sl : nat) (w1 : word sl) (su : nat) (w2 w3 : word su), @eq (word (Init.Nat.add sl su)) (@combine sl w1 su (@wplus su w2 w3)) (@wplus (Init.Nat.add sl su) (@extz su w2 sl) (@combine sl w1 su w3)) *) intros. (* Goal: @eq (word (Init.Nat.add sl su)) (@combine sl w1 su (@wplus su w2 w3)) (@wplus (Init.Nat.add sl su) (@extz su w2 sl) (@combine sl w1 su w3)) *) rewrite wplus_comm. (* Goal: @eq (word (Init.Nat.add sl su)) (@combine sl w1 su (@wplus su w3 w2)) (@wplus (Init.Nat.add sl su) (@extz su w2 sl) (@combine sl w1 su w3)) *) rewrite combine_wplus_1. (* Goal: @eq (word (Init.Nat.add sl su)) (@wplus (Init.Nat.add sl su) (@combine sl w1 su w3) (@extz su w2 sl)) (@wplus (Init.Nat.add sl su) (@extz su w2 sl) (@combine sl w1 su w3)) *) apply wplus_comm. Qed. Lemma existT_wplus: forall sz (w1 w2: word sz) sz' (w3 w4: word sz'), existT word _ w1 = existT word _ w3 -> existT word _ w2 = existT word _ w4 -> existT word _ (w1 ^+ w2) = existT word _ (w3 ^+ w4). Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (sz' : nat) (w3 w4 : word sz') (_ : @eq (@sigT nat word) (@existT nat word sz w1) (@existT nat word sz' w3)) (_ : @eq (@sigT nat word) (@existT nat word sz w2) (@existT nat word sz' w4)), @eq (@sigT nat word) (@existT nat word sz (@wplus sz w1 w2)) (@existT nat word sz' (@wplus sz' w3 w4)) *) intros. (* Goal: @eq (@sigT nat word) (@existT nat word sz (@wplus sz w1 w2)) (@existT nat word sz' (@wplus sz' w3 w4)) *) rewrite eq_sigT_sig_eq in H; destruct H as [Hsz1 ?]. (* Goal: @eq (@sigT nat word) (@existT nat word sz (@wplus sz w1 w2)) (@existT nat word sz' (@wplus sz' w3 w4)) *) rewrite eq_sigT_sig_eq in H0; destruct H0 as [Hsz2 ?]. (* Goal: @eq (@sigT nat word) (@existT nat word sz (@wplus sz w1 w2)) (@existT nat word sz' (@wplus sz' w3 w4)) *) subst; do 2 rewrite <-(eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (@sigT nat word) (@existT nat word sz' (@wplus sz' w1 w2)) (@existT nat word sz' (@wplus sz' w1 w2)) *) reflexivity. Qed. Lemma existT_wminus: forall sz (w1 w2: word sz) sz' (w3 w4: word sz'), existT word _ w1 = existT word _ w3 -> existT word _ w2 = existT word _ w4 -> existT word _ (w1 ^- w2) = existT word _ (w3 ^- w4). Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (sz' : nat) (w3 w4 : word sz') (_ : @eq (@sigT nat word) (@existT nat word sz w1) (@existT nat word sz' w3)) (_ : @eq (@sigT nat word) (@existT nat word sz w2) (@existT nat word sz' w4)), @eq (@sigT nat word) (@existT nat word sz (@wminus sz w1 w2)) (@existT nat word sz' (@wminus sz' w3 w4)) *) intros. (* Goal: @eq (@sigT nat word) (@existT nat word sz (@wminus sz w1 w2)) (@existT nat word sz' (@wminus sz' w3 w4)) *) rewrite eq_sigT_sig_eq in H; destruct H as [Hsz1 ?]. (* Goal: @eq (@sigT nat word) (@existT nat word sz (@wminus sz w1 w2)) (@existT nat word sz' (@wminus sz' w3 w4)) *) rewrite eq_sigT_sig_eq in H0; destruct H0 as [Hsz2 ?]. (* Goal: @eq (@sigT nat word) (@existT nat word sz (@wminus sz w1 w2)) (@existT nat word sz' (@wminus sz' w3 w4)) *) subst; do 2 rewrite <-(eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (@sigT nat word) (@existT nat word sz' (@wminus sz' w1 w2)) (@existT nat word sz' (@wminus sz' w1 w2)) *) reflexivity. Qed. Lemma existT_sext: forall sz1 (w1: word sz1) sz2 (w2: word sz2) n, existT word _ w1 = existT word _ w2 -> existT word _ (sext w1 n) = existT word _ (sext w2 n). Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (n : nat) (_ : @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2)), @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 n) (@sext sz1 w1 n)) (@existT nat word (Init.Nat.add sz2 n) (@sext sz2 w2 n)) *) intros; inversion H; reflexivity. Qed. Lemma existT_extz: forall sz1 (w1: word sz1) sz2 (w2: word sz2) n, existT word _ w1 = existT word _ w2 -> existT word _ (extz w1 n) = existT word _ (extz w2 n). Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (n : nat) (_ : @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2)), @eq (@sigT nat word) (@existT nat word (Init.Nat.add n sz1) (@extz sz1 w1 n)) (@existT nat word (Init.Nat.add n sz2) (@extz sz2 w2 n)) *) intros; inversion H; reflexivity. Qed. Lemma existT_wrshifta: forall sz1 (w1: word sz1) sz2 (w2: word sz2) n, existT word _ w1 = existT word _ w2 -> existT word _ (wrshifta w1 n) = existT word _ (wrshifta w2 n). Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (n : nat) (_ : @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2)), @eq (@sigT nat word) (@existT nat word sz1 (@wrshifta sz1 w1 n)) (@existT nat word sz2 (@wrshifta sz2 w2 n)) *) intros; inversion H; reflexivity. Qed. Lemma existT_wlshift: forall sz1 (w1: word sz1) sz2 (w2: word sz2) n, existT word _ w1 = existT word _ w2 -> existT word _ (wlshift w1 n) = existT word _ (wlshift w2 n). Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (n : nat) (_ : @eq (@sigT nat word) (@existT nat word sz1 w1) (@existT nat word sz2 w2)), @eq (@sigT nat word) (@existT nat word sz1 (@wlshift sz1 w1 n)) (@existT nat word sz2 (@wlshift sz2 w2 n)) *) intros; inversion H; reflexivity. Qed. Lemma eq_rect_wplus: forall sz (w1 w2: word sz) sz' Hsz, eq_rect sz word (w1 ^+ w2) sz' Hsz = (eq_rect sz word w1 sz' Hsz) ^+ (eq_rect sz word w2 sz' Hsz). Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (sz' : nat) (Hsz : @eq nat sz sz'), @eq (word sz') (@eq_rect nat sz word (@wplus sz w1 w2) sz' Hsz) (@wplus sz' (@eq_rect nat sz word w1 sz' Hsz) (@eq_rect nat sz word w2 sz' Hsz)) *) intros; subst. (* Goal: @eq (word sz') (@eq_rect nat sz' word (@wplus sz' w1 w2) sz' (@eq_refl nat sz')) (@wplus sz' (@eq_rect nat sz' word w1 sz' (@eq_refl nat sz')) (@eq_rect nat sz' word w2 sz' (@eq_refl nat sz'))) *) eq_rect_simpl; reflexivity. Qed. Lemma eq_rect_2: forall sz (pa: word sz) sz' Heq1 Heq2, eq_rect sz' word (eq_rect sz word pa sz' Heq1) sz Heq2 = pa. Proof. (* Goal: forall (sz : nat) (pa : word sz) (sz' : nat) (Heq1 : @eq nat sz sz') (Heq2 : @eq nat sz' sz), @eq (word sz) (@eq_rect nat sz' word (@eq_rect nat sz word pa sz' Heq1) sz Heq2) pa *) intros; subst. (* Goal: @eq (word sz') (@eq_rect nat sz' word (@eq_rect nat sz' word pa sz' (@eq_refl nat sz')) sz' Heq2) pa *) do 2 rewrite <-(eq_rect_eq_dec eq_nat_dec). (* Goal: @eq (word sz') pa pa *) reflexivity. Qed. Lemma wzero_eq_rect: forall sz1 sz2 Heq, eq_rect sz1 word (wzero sz1) sz2 Heq = wzero sz2. Proof. (* Goal: forall (sz1 sz2 : nat) (Heq : @eq nat sz1 sz2), @eq (word sz2) (@eq_rect nat sz1 word (wzero sz1) sz2 Heq) (wzero sz2) *) intros; subst. (* Goal: @eq (word sz2) (@eq_rect nat sz2 word (wzero sz2) sz2 (@eq_refl nat sz2)) (wzero sz2) *) apply eq_sym, (eq_rect_eq_dec eq_nat_dec). Qed. Lemma wrshifta_0: forall sz (w: word sz), wrshifta w 0 = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wrshifta sz w O) w *) unfold wrshifta; intros; simpl. (* Goal: @eq (word sz) (@eq_rec_r nat (Nat.add sz O) (fun n : nat => word n) (@sext sz w O) sz (Nat.add_comm O sz)) w *) unfold eq_rec_r, eq_rec. (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@sext sz w O) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) unfold sext. (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (if @wmsb sz w false then @combine sz w O (wones O) else @combine sz w O (wzero O)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) destruct (wmsb w false). (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@combine sz w O (wzero O)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@combine sz w O (wones O)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) - (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@combine sz w O (wones O)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) cbn; rewrite combine_n_0. (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@eq_rect nat sz word w (Init.Nat.add sz O) (plus_n_O sz)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) rewrite eq_rect_2; reflexivity. (* BG Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@combine sz w O (wzero O)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) - (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@combine sz w O (wzero O)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) cbn; rewrite combine_n_0. (* Goal: @eq (word sz) (@eq_rect nat (Nat.add sz O) (fun y : nat => word y) (@eq_rect nat sz word w (Init.Nat.add sz O) (plus_n_O sz)) sz (@eq_sym nat sz (Nat.add sz O) (Nat.add_comm O sz))) w *) rewrite eq_rect_2; reflexivity. Qed. Lemma wrshifta_WO: forall n, wrshifta WO n = WO. Proof. (* Goal: forall n : nat, @eq (word O) (@wrshifta O WO n) WO *) unfold wrshifta; cbn; intros. (* Goal: @eq (word O) (split2 n O (@eq_rec_r nat n (fun n : nat => word n) (wzero n) (Nat.add n O) (Nat.add_comm n O))) WO *) unfold eq_rec_r, eq_rec. (* Goal: @eq (word O) (split2 n O (@eq_rect nat n (fun y : nat => word y) (wzero n) (Nat.add n O) (@eq_sym nat (Nat.add n O) n (Nat.add_comm n O)))) WO *) rewrite wzero_eq_rect. (* Goal: @eq (word O) (split2 n O (wzero (Nat.add n O))) WO *) rewrite <-combine_wzero. (* Goal: @eq (word O) (split2 n O (@combine n (wzero n) O (wzero O))) WO *) rewrite split2_combine. (* Goal: @eq (word O) (wzero O) WO *) reflexivity. Qed. Lemma split2_WO: forall n w, split2 n 0 w = WO. Proof. (* Goal: forall (n : nat) (w : word (Init.Nat.add n O)), @eq (word O) (split2 n O w) WO *) induction n; cbn; intros; auto. Qed. Lemma sext_wzero: forall sz n, sext (wzero sz) n = wzero (sz + n). Proof. (* Goal: forall sz n : nat, @eq (word (Init.Nat.add sz n)) (@sext sz (wzero sz) n) (wzero (Init.Nat.add sz n)) *) unfold sext; intros. (* Goal: @eq (word (Init.Nat.add sz n)) (if @wmsb sz (wzero sz) false then @combine sz (wzero sz) n (wones n) else @combine sz (wzero sz) n (wzero n)) (wzero (Init.Nat.add sz n)) *) rewrite wmsb_wzero. (* Goal: @eq (word (Init.Nat.add sz n)) (@combine sz (wzero sz) n (wzero n)) (wzero (Init.Nat.add sz n)) *) apply combine_wzero. Qed. Lemma wrshifta_wzero: forall sz n, wrshifta (wzero sz) n = wzero _. Proof. (* Goal: forall sz n : nat, @eq (word sz) (@wrshifta sz (wzero sz) n) (wzero sz) *) intros. (* Goal: @eq (word sz) (@wrshifta sz (wzero sz) n) (wzero sz) *) unfold wrshifta; cbn. (* Goal: @eq (word sz) (split2 n sz (@eq_rec_r nat (Nat.add sz n) (fun n : nat => word n) (@sext sz (wzero sz) n) (Nat.add n sz) (Nat.add_comm n sz))) (wzero sz) *) rewrite sext_wzero. (* Goal: @eq (word sz) (split2 n sz (@eq_rec_r nat (Nat.add sz n) (fun n : nat => word n) (wzero (Init.Nat.add sz n)) (Nat.add n sz) (Nat.add_comm n sz))) (wzero sz) *) unfold eq_rec_r, eq_rec. (* Goal: @eq (word sz) (split2 n sz (@eq_rect nat (Nat.add sz n) (fun y : nat => word y) (wzero (Init.Nat.add sz n)) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) (wzero sz) *) rewrite wzero_eq_rect. (* Goal: @eq (word sz) (split2 n sz (wzero (Nat.add n sz))) (wzero sz) *) rewrite <-combine_wzero. (* Goal: @eq (word sz) (split2 n sz (@combine n (wzero n) sz (wzero sz))) (wzero sz) *) rewrite split2_combine. (* Goal: @eq (word sz) (wzero sz) (wzero sz) *) reflexivity. Qed. Lemma extz_sext: forall sz (w: word sz) n1 n2, existT word _ (extz (sext w n1) n2) = existT word _ (sext (extz w n2) n1). Proof. (* Goal: forall (sz : nat) (w : word sz) (n1 n2 : nat), @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 sz) n1) (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1)) *) dependent destruction w; cbn; intros. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (S (Init.Nat.add n n1))) (@extz (S (Init.Nat.add n n1)) (@sext (S n) (@WS b n w) n1) n2)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 (S n)) n1) (@sext (Init.Nat.add n2 (S n)) (@extz (S n) (@WS b n w) n2) n1)) *) (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (@extz n1 (wzero n1) n2)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 O) n1) (@sext (Init.Nat.add n2 O) (@extz O WO n2) n1)) *) - (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (@extz n1 (wzero n1) n2)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 O) n1) (@sext (Init.Nat.add n2 O) (@extz O WO n2) n1)) *) unfold wzero, extz, sext. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (@combine n2 (wzero n2) n1 (natToWord n1 O))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 O) n1) (if @wmsb (Init.Nat.add n2 O) (@combine n2 (wzero n2) O WO) false then @combine (Init.Nat.add n2 O) (@combine n2 (wzero n2) O WO) n1 (wones n1) else @combine (Init.Nat.add n2 O) (@combine n2 (wzero n2) O WO) n1 (wzero n1))) *) rewrite combine_wzero. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 O) n1) (if @wmsb (Init.Nat.add n2 O) (@combine n2 (wzero n2) O WO) false then @combine (Init.Nat.add n2 O) (@combine n2 (wzero n2) O WO) n1 (wones n1) else @combine (Init.Nat.add n2 O) (@combine n2 (wzero n2) O WO) n1 (wzero n1))) *) rewrite combine_wzero. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 O) n1) (if @wmsb (Init.Nat.add n2 O) (wzero (Init.Nat.add n2 O)) false then @combine (Init.Nat.add n2 O) (wzero (Init.Nat.add n2 O)) n1 (wones n1) else @combine (Init.Nat.add n2 O) (wzero (Init.Nat.add n2 O)) n1 (wzero n1))) *) rewrite wmsb_wzero. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 O) n1) (@combine (Init.Nat.add n2 O) (wzero (Init.Nat.add n2 O)) n1 (wzero n1))) *) rewrite combine_wzero. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 O) n1) (wzero (Init.Nat.add (Init.Nat.add n2 O) n1))) *) replace (n2 + 0 + n1) with (n2 + n1) by omega. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1))) (@existT nat word (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1))) *) reflexivity. (* BG Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (S (Init.Nat.add n n1))) (@extz (S (Init.Nat.add n n1)) (@sext (S n) (@WS b n w) n1) n2)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 (S n)) n1) (@sext (Init.Nat.add n2 (S n)) (@extz (S n) (@WS b n w) n2) n1)) *) - (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (S (Init.Nat.add n n1))) (@extz (S (Init.Nat.add n n1)) (@sext (S n) (@WS b n w) n1) n2)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 (S n)) n1) (@sext (Init.Nat.add n2 (S n)) (@extz (S n) (@WS b n w) n2) n1)) *) unfold wzero, extz, sext. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (S (Init.Nat.add n n1))) (@combine n2 (wzero n2) (S (Init.Nat.add n n1)) (if @wmsb (S n) (@WS b n w) false then @combine (S n) (@WS b n w) n1 (wones n1) else @combine (S n) (@WS b n w) n1 (wzero n1)))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 (S n)) n1) (if @wmsb (Init.Nat.add n2 (S n)) (@combine n2 (wzero n2) (S n) (@WS b n w)) false then @combine (Init.Nat.add n2 (S n)) (@combine n2 (wzero n2) (S n) (@WS b n w)) n1 (wones n1) else @combine (Init.Nat.add n2 (S n)) (@combine n2 (wzero n2) (S n) (@WS b n w)) n1 (wzero n1))) *) rewrite wmsb_combine with (b2:= false) by discriminate. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (S (Init.Nat.add n n1))) (@combine n2 (wzero n2) (S (Init.Nat.add n n1)) (if @wmsb (S n) (@WS b n w) false then @combine (S n) (@WS b n w) n1 (wones n1) else @combine (S n) (@WS b n w) n1 (wzero n1)))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 (S n)) n1) (if @wmsb (S n) (@WS b n w) false then @combine (Init.Nat.add n2 (S n)) (@combine n2 (wzero n2) (S n) (@WS b n w)) n1 (wones n1) else @combine (Init.Nat.add n2 (S n)) (@combine n2 (wzero n2) (S n) (@WS b n w)) n1 (wzero n1))) *) destruct (wmsb (WS b w) false); try (rewrite <-combine_assoc_existT; reflexivity). Qed. Lemma sext_WS: forall sz (w: word (S sz)) b n, sext (WS b w) n = WS b (sext w n). Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (b : bool) (n : nat), @eq (word (Init.Nat.add (S (S sz)) n)) (@sext (S (S sz)) (@WS b (S sz) w) n) (@WS b (Init.Nat.add (S sz) n) (@sext (S sz) w n)) *) unfold sext; intros. (* Goal: @eq (word (Init.Nat.add (S (S sz)) n)) (if @wmsb (S (S sz)) (@WS b (S sz) w) false then @combine (S (S sz)) (@WS b (S sz) w) n (wones n) else @combine (S (S sz)) (@WS b (S sz) w) n (wzero n)) (@WS b (Init.Nat.add (S sz) n) (if @wmsb (S sz) w false then @combine (S sz) w n (wones n) else @combine (S sz) w n (wzero n))) *) rewrite wmsb_ws. (* Goal: @eq (word (Init.Nat.add (S (S sz)) n)) (if @wmsb (S sz) w false then @combine (S (S sz)) (@WS b (S sz) w) n (wones n) else @combine (S (S sz)) (@WS b (S sz) w) n (wzero n)) (@WS b (Init.Nat.add (S sz) n) (if @wmsb (S sz) w false then @combine (S sz) w n (wones n) else @combine (S sz) w n (wzero n))) *) destruct (wmsb w false); reflexivity. Qed. Lemma sext_wordToZ: forall sz n (w: word sz), wordToZ (sext w n) = wordToZ w. Proof. (* Goal: forall (sz n : nat) (w : word sz), @eq Z (@wordToZ (Init.Nat.add sz n) (@sext sz w n)) (@wordToZ sz w) *) dependent induction w; cbn; intros; [apply wordToZ_wzero|]. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add n0 n)) (@sext (S n0) (@WS b n0 w) n)) (@wordToZ (S n0) (@WS b n0 w)) *) dependent destruction w. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@sext (S (S n0)) (@WS b (S n0) (@WS b0 n0 w)) n)) (@wordToZ (S (S n0)) (@WS b (S n0) (@WS b0 n0 w))) *) (* Goal: @eq Z (@wordToZ (S (Init.Nat.add O n)) (@sext (S O) (@WS b O WO) n)) (@wordToZ (S O) (@WS b O WO)) *) - (* Goal: @eq Z (@wordToZ (S (Init.Nat.add O n)) (@sext (S O) (@WS b O WO) n)) (@wordToZ (S O) (@WS b O WO)) *) unfold sext; simpl. (* Goal: @eq Z (@wordToZ (S n) (if b then @WS b n (wones n) else @WS b n (wzero n))) (@wordToZ (S O) (@WS b O WO)) *) destruct b; cbn. (* Goal: @eq Z (@wordToZ (S n) (@WS false n (wzero n))) Z0 *) (* Goal: @eq Z (@wordToZ (S n) (@WS true n (wones n))) (Zneg xH) *) + (* Goal: @eq Z (@wordToZ (S n) (@WS true n (wones n))) (Zneg xH) *) rewrite wordToZ_wones by discriminate. (* Goal: @eq Z (Zneg xH) (Zneg xH) *) reflexivity. (* BG Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@sext (S (S n0)) (@WS b (S n0) (@WS b0 n0 w)) n)) (@wordToZ (S (S n0)) (@WS b (S n0) (@WS b0 n0 w))) *) (* BG Goal: @eq Z (@wordToZ (S n) (@WS false n (wzero n))) Z0 *) + (* Goal: @eq Z (@wordToZ (S n) (@WS false n (wzero n))) Z0 *) rewrite wordToZ_wzero; reflexivity. (* BG Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@sext (S (S n0)) (@WS b (S n0) (@WS b0 n0 w)) n)) (@wordToZ (S (S n0)) (@WS b (S n0) (@WS b0 n0 w))) *) - (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@sext (S (S n0)) (@WS b (S n0) (@WS b0 n0 w)) n)) (@wordToZ (S (S n0)) (@WS b (S n0) (@WS b0 n0 w))) *) remember (WS b0 w) as ww; clear Heqww. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@sext (S (S n0)) (@WS b (S n0) ww) n)) (@wordToZ (S (S n0)) (@WS b (S n0) ww)) *) rewrite sext_WS. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@WS b (Init.Nat.add (S n0) n) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS b (S n0) ww)) *) destruct b. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@WS false (Init.Nat.add (S n0) n) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS false (S n0) ww)) *) (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@WS true (Init.Nat.add (S n0) n) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS true (S n0) ww)) *) + (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@WS true (Init.Nat.add (S n0) n) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS true (S n0) ww)) *) change (S n0 + n) with (S (n0 + n)) in *. (* Goal: @eq Z (@wordToZ (S (S (Init.Nat.add n0 n))) (@WS true (S (Init.Nat.add n0 n)) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS true (S n0) ww)) *) repeat rewrite wordToZ_WS_1. (* Goal: @eq Z (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S (Init.Nat.add n0 n)) (@sext (S n0) ww n))) (Zpos xH)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S n0) ww)) (Zpos xH)) *) rewrite IHw. (* Goal: @eq Z (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S n0) ww)) (Zpos xH)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S n0) ww)) (Zpos xH)) *) reflexivity. (* BG Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@WS false (Init.Nat.add (S n0) n) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS false (S n0) ww)) *) + (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n0) n)) (@WS false (Init.Nat.add (S n0) n) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS false (S n0) ww)) *) change (S n0 + n) with (S (n0 + n)) in *. (* Goal: @eq Z (@wordToZ (S (S (Init.Nat.add n0 n))) (@WS false (S (Init.Nat.add n0 n)) (@sext (S n0) ww n))) (@wordToZ (S (S n0)) (@WS false (S n0) ww)) *) repeat rewrite wordToZ_WS_0. (* Goal: @eq Z (Z.mul (Zpos (xO xH)) (@wordToZ (S (Init.Nat.add n0 n)) (@sext (S n0) ww n))) (Z.mul (Zpos (xO xH)) (@wordToZ (S n0) ww)) *) rewrite IHw. (* Goal: @eq Z (Z.mul (Zpos (xO xH)) (@wordToZ (S n0) ww)) (Z.mul (Zpos (xO xH)) (@wordToZ (S n0) ww)) *) reflexivity. Qed. Lemma sext_natToWord': forall sz1 sz2 n, (2 * n < pow2 sz1)%nat -> sext (natToWord sz1 n) sz2 = natToWord (sz1 + sz2) n. Proof. (* Goal: forall (sz1 sz2 n : nat) (_ : lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1)), @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 n) sz2) (natToWord (Init.Nat.add sz1 sz2) n) *) induction sz1; intros. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@sext (S sz1) (natToWord (S sz1) n) sz2) (natToWord (Init.Nat.add (S sz1) sz2) n) *) (* Goal: @eq (word (Init.Nat.add O sz2)) (@sext O (natToWord O n) sz2) (natToWord (Init.Nat.add O sz2) n) *) - (* Goal: @eq (word (Init.Nat.add O sz2)) (@sext O (natToWord O n) sz2) (natToWord (Init.Nat.add O sz2) n) *) simpl. (* Goal: @eq (word sz2) (@sext O WO sz2) (natToWord sz2 n) *) unfold sext. (* Goal: @eq (word sz2) (if @wmsb O WO false then @combine O WO sz2 (wones sz2) else @combine O WO sz2 (wzero sz2)) (natToWord sz2 n) *) simpl. (* Goal: @eq (word sz2) (wzero sz2) (natToWord sz2 n) *) unfold wzero. (* Goal: @eq (word sz2) (natToWord sz2 O) (natToWord sz2 n) *) unfold pow2 in *. (* Goal: @eq (word sz2) (natToWord sz2 O) (natToWord sz2 n) *) assert (n=0) by omega. (* Goal: @eq (word sz2) (natToWord sz2 O) (natToWord sz2 n) *) subst n. (* Goal: @eq (word sz2) (natToWord sz2 O) (natToWord sz2 O) *) reflexivity. (* BG Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@sext (S sz1) (natToWord (S sz1) n) sz2) (natToWord (Init.Nat.add (S sz1) sz2) n) *) - (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@sext (S sz1) (natToWord (S sz1) n) sz2) (natToWord (Init.Nat.add (S sz1) sz2) n) *) unfold sext in *. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (if @wmsb (S sz1) (natToWord (S sz1) n) false then @combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2) else @combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) n) *) assert (@wmsb (S sz1) (natToWord (S sz1) n) false = false) as E by (apply wmsb_0_natToWord; assumption). (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (if @wmsb (S sz1) (natToWord (S sz1) n) false then @combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2) else @combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) n) *) rewrite E. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) n) *) clear E. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) n) *) simpl. (* Goal: @eq (word (S (Init.Nat.add sz1 sz2))) (@WS (mod2 n) (Init.Nat.add sz1 sz2) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2))) (@WS (mod2 n) (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 n))) *) unfold natToWord. (* Goal: @eq (word (S (Init.Nat.add sz1 sz2))) (@WS (mod2 n) (Init.Nat.add sz1 sz2) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wzero sz2))) (@WS (mod2 n) (Init.Nat.add sz1 sz2) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 n))) *) f_equal. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wzero sz2)) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 n)) *) fold natToWord. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 n)) *) specialize (IHsz1 sz2 (Nat.div2 n)). (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 n)) *) rewrite <- IHsz1. (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (if @wmsb sz1 (natToWord sz1 (Nat.div2 n)) false then @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2) else @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) + (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (if @wmsb sz1 (natToWord sz1 (Nat.div2 n)) false then @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2) else @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) assert (@wmsb sz1 (natToWord sz1 (Nat.div2 n)) false = false) as E. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (if @wmsb sz1 (natToWord sz1 (Nat.div2 n)) false then @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2) else @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) (* Goal: @eq bool (@wmsb sz1 (natToWord sz1 (Nat.div2 n)) false) false *) { (* Goal: @eq bool (@wmsb sz1 (natToWord sz1 (Nat.div2 n)) false) false *) destruct sz1. (* Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) (Nat.div2 n)) false) false *) (* Goal: @eq bool (@wmsb O (natToWord O (Nat.div2 n)) false) false *) - (* Goal: @eq bool (@wmsb O (natToWord O (Nat.div2 n)) false) false *) reflexivity. (* BG Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (if @wmsb sz1 (natToWord sz1 (Nat.div2 n)) false then @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2) else @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) (* BG Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) (Nat.div2 n)) false) false *) - (* Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) (Nat.div2 n)) false) false *) apply wmsb_0_natToWord. (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S sz1)) *) unfold pow2 in *. (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1)) *) fold pow2 in *. (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) *) assert ((2 * Nat.div2 n <= n)%nat) by apply two_times_div2_bound. (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) *) omega. (* BG Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (if @wmsb sz1 (natToWord sz1 (Nat.div2 n)) false then @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2) else @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) } (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (if @wmsb sz1 (natToWord sz1 (Nat.div2 n)) false then @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2) else @combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) rewrite E. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) clear E. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wzero sz2)) *) reflexivity. (* BG Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) + (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) replace (pow2 (S sz1)) with (2 * (pow2 sz1)) in H. (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.pow (S (S O)) (S sz1)) *) (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) * (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) assert ((2 * Nat.div2 n <= n)%nat) by apply two_times_div2_bound. (* Goal: lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) sz1) *) omega. (* BG Goal: @eq nat (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.pow (S (S O)) (S sz1)) *) * (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.pow (S (S O)) (S sz1)) *) reflexivity. Qed. Lemma sext_natToWord: forall sz2 sz1 sz n (e: sz1 + sz2 = sz), (2 * n < pow2 sz1)%nat -> eq_rect (sz1 + sz2) word (sext (natToWord sz1 n) sz2) sz e = natToWord sz n. Proof. (* Goal: forall (sz2 sz1 sz n : nat) (e : @eq nat (Init.Nat.add sz1 sz2) sz) (_ : lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1)), @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (@sext sz1 (natToWord sz1 n) sz2) sz e) (natToWord sz n) *) intros. (* Goal: @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (@sext sz1 (natToWord sz1 n) sz2) sz e) (natToWord sz n) *) rewrite sext_natToWord' by assumption. (* Goal: @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (natToWord (Init.Nat.add sz1 sz2) n) sz e) (natToWord sz n) *) rewrite e. (* Goal: @eq (word sz) (@eq_rect nat sz word (natToWord sz n) sz (@eq_refl nat sz)) (natToWord sz n) *) reflexivity. Qed. Lemma sext_wneg_natToWord'': forall sz1 sz2 n, pow2 sz1 <= 2 * n < pow2 (S sz1) -> sext (natToWord sz1 n) sz2 = natToWord (sz1 + sz2) (pow2 (sz1+sz2) - (pow2 sz1 - n)). Proof. (* Goal: forall (sz1 sz2 n : nat) (_ : and (le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (S (S O)) n)) (lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) (S sz1)))), @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 n) sz2) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) n))) *) induction sz1; intros. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@sext (S sz1) (natToWord (S sz1) n) sz2) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) (* Goal: @eq (word (Init.Nat.add O sz2)) (@sext O (natToWord O n) sz2) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) n))) *) - (* Goal: @eq (word (Init.Nat.add O sz2)) (@sext O (natToWord O n) sz2) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) n))) *) unfold pow2 in H. (* Goal: @eq (word (Init.Nat.add O sz2)) (@sext O (natToWord O n) sz2) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) n))) *) omega. (* BG Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@sext (S sz1) (natToWord (S sz1) n) sz2) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) - (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@sext (S sz1) (natToWord (S sz1) n) sz2) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) unfold sext in *. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (if @wmsb (S sz1) (natToWord (S sz1) n) false then @combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2) else @combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) assert (@wmsb (S sz1) (natToWord (S sz1) n) false = true) as E. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (if @wmsb (S sz1) (natToWord (S sz1) n) false then @combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2) else @combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) (* Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) n) false) true *) { (* Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) n) false) true *) apply wmsb_1. (* Goal: and (le (Nat.pow (S (S O)) sz1) (@wordToNat (S sz1) (natToWord (S sz1) n))) (lt (@wordToNat (S sz1) (natToWord (S sz1) n)) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite wordToNat_natToWord_idempotent'; (unfold pow2 in *; fold pow2 in *; omega). (* BG Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (if @wmsb (S sz1) (natToWord (S sz1) n) false then @combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2) else @combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) } (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (if @wmsb (S sz1) (natToWord (S sz1) n) false then @combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2) else @combine (S sz1) (natToWord (S sz1) n) sz2 (wzero sz2)) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) rewrite E. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1) sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) match goal with | |- _ = $ ?a => remember a as b end. (* Goal: @eq (word (Init.Nat.add (S sz1) sz2)) (@combine (S sz1) (natToWord (S sz1) n) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1) sz2) b) *) simpl. (* Goal: @eq (word (S (Init.Nat.add sz1 sz2))) (@WS (mod2 n) (Init.Nat.add sz1 sz2) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2))) (@WS (mod2 b) (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b))) *) unfold natToWord. (* Goal: @eq (word (S (Init.Nat.add sz1 sz2))) (@WS (mod2 n) (Init.Nat.add sz1 sz2) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wones sz2))) (@WS (mod2 b) (Init.Nat.add sz1 sz2) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 b))) *) f_equal. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wones sz2)) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) (* Goal: @eq bool (mod2 n) (mod2 b) *) + (* Goal: @eq bool (mod2 n) (mod2 b) *) subst b. (* Goal: @eq bool (mod2 n) (mod2 (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) rewrite mod2sub. (* Goal: le (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n) (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) *) (* Goal: @eq bool (mod2 n) (xorb (mod2 (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2))) (mod2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) * (* Goal: @eq bool (mod2 n) (xorb (mod2 (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2))) (mod2 (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) *) rewrite mod2sub. (* Goal: le n (Nat.pow (S (S O)) (S sz1)) *) (* Goal: @eq bool (mod2 n) (xorb (mod2 (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2))) (xorb (mod2 (Nat.pow (S (S O)) (S sz1))) (mod2 n))) *) { (* Goal: @eq bool (mod2 n) (xorb (mod2 (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2))) (xorb (mod2 (Nat.pow (S (S O)) (S sz1))) (mod2 n))) *) replace (S sz1 + sz2) with (S (sz1 + sz2)) by omega. (* Goal: @eq bool (mod2 n) (xorb (mod2 (Nat.pow (S (S O)) (S (Init.Nat.add sz1 sz2)))) (xorb (mod2 (Nat.pow (S (S O)) (S sz1))) (mod2 n))) *) simpl. (* Goal: @eq bool (mod2 n) (xorb (mod2 (Nat.add (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.add (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) O))) (xorb (mod2 (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) (mod2 n))) *) do 2 rewrite mod2_pow2_twice. (* Goal: @eq bool (mod2 n) (xorb false (xorb false (mod2 n))) *) do 2 rewrite Bool.xorb_false_l. (* Goal: @eq bool (mod2 n) (mod2 n) *) reflexivity. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wones sz2)) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) (* BG Goal: le (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n) (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) *) (* BG Goal: le n (Nat.pow (S (S O)) (S sz1)) *) } (* Goal: le n (Nat.pow (S (S O)) (S sz1)) *) simpl in *. (* Goal: le n (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O)) *) omega. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wones sz2)) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) (* BG Goal: le (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n) (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) *) * (* Goal: le (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n) (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) *) rewrite pow2_add_mul in *. (* Goal: le (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n) (Init.Nat.mul (Nat.pow (S (S O)) (S sz1)) (Nat.pow (S (S O)) sz2)) *) unfold pow2 in *. (* Goal: le (Init.Nat.sub (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1)) n) (Init.Nat.mul (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz2)) *) fold pow2 in *. (* Goal: le (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) n) (Init.Nat.mul (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.pow (S (S O)) sz2)) *) apply Nat.le_trans with (m := 2 * pow2 sz1); [omega|]. (* Goal: le (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Init.Nat.mul (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.pow (S (S O)) sz2)) *) rewrite <- mult_assoc. (* Goal: le (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2))) *) apply mult_le_compat_l. (* Goal: le (Nat.pow (S (S O)) sz1) (Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) rewrite <- Nat.mul_1_r at 1. (* Goal: le (Nat.mul (Nat.pow (S (S O)) sz1) (S O)) (Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) apply mult_le_compat_l. (* Goal: le (S O) (Nat.pow (S (S O)) sz2) *) apply one_le_pow2. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wones sz2)) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) + (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) sz1 (Nat.div2 n)) sz2 (wones sz2)) ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) fold natToWord. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) specialize (IHsz1 sz2 (Nat.div2 n)). (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) assert (Nat.div2 b = pow2 (sz1 + sz2) - (pow2 sz1 - (Nat.div2 n))) as D2. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) (* Goal: @eq nat (Nat.div2 b) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Nat.div2 n))) *) { (* Goal: @eq nat (Nat.div2 b) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Nat.div2 n))) *) rewrite minus_minus. (* Goal: and (le (Nat.div2 n) (Nat.pow (S (S O)) sz1)) (le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) *) (* Goal: @eq nat (Nat.div2 b) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) - (* Goal: @eq nat (Nat.div2 b) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) subst b. (* Goal: @eq nat (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1) sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) replace (S sz1 + sz2) with (S (sz1 + sz2)) by omega. (* Goal: @eq nat (Nat.div2 (Init.Nat.sub (Nat.pow (S (S O)) (S (Init.Nat.add sz1 sz2))) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1)) n))) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) unfold pow2. (* Goal: @eq nat (Nat.div2 (Init.Nat.sub (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) (Init.Nat.add sz1 sz2))) (Init.Nat.sub (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1)) n))) (Init.Nat.add (Init.Nat.sub ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) (Init.Nat.add sz1 sz2)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1)) (Nat.div2 n)) *) fold pow2. (* Goal: @eq nat (Nat.div2 (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) n))) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) rewrite minus_minus. (* Goal: and (le n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)))) *) (* Goal: @eq nat (Nat.div2 (Init.Nat.add (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) n)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) * (* Goal: @eq nat (Nat.div2 (Init.Nat.add (Init.Nat.sub (Nat.mul (S (S O)) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) n)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) rewrite <- Nat.mul_sub_distr_l. (* Goal: @eq nat (Nat.div2 (Init.Nat.add (Nat.mul (S (S O)) (Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1))) n)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) rewrite <- (Nat.add_comm n). (* Goal: @eq nat (Nat.div2 (Nat.add n (Nat.mul (S (S O)) (Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1))))) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) rewrite div2_plus_2. (* Goal: @eq nat (Init.Nat.add (Nat.div2 n) (Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1))) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Nat.pow (S (S O)) sz1)) (Nat.div2 n)) *) apply Nat.add_comm. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) (* BG Goal: and (le (Nat.div2 n) (Nat.pow (S (S O)) sz1)) (le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) *) (* BG Goal: and (le n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)))) *) * (* Goal: and (le n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)))) *) rewrite pow2_add_mul. (* Goal: and (le n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)))) *) clear IHsz1. (* Goal: and (le n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)))) *) unfold pow2 in *. (* Goal: and (le n (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1))) (le (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1)) (Nat.mul (S (S O)) (Init.Nat.mul ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz2)))) *) fold pow2 in *. (* Goal: and (le n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)))) *) split; [omega|]. (* Goal: le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) (Nat.mul (S (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2))) *) apply mult_le_compat_l. (* Goal: le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) rewrite <- Nat.mul_1_r at 1. (* Goal: le (Nat.mul (Nat.pow (S (S O)) sz1) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) apply mult_le_compat_l. (* Goal: le (S O) (Nat.pow (S (S O)) sz2) *) apply one_le_pow2. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) (* BG Goal: and (le (Nat.div2 n) (Nat.pow (S (S O)) sz1)) (le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) *) - (* Goal: and (le (Nat.div2 n) (Nat.pow (S (S O)) sz1)) (le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) *) unfold pow2 in H. (* Goal: and (le (Nat.div2 n) (Nat.pow (S (S O)) sz1)) (le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) *) fold pow2 in H. (* Goal: and (le (Nat.div2 n) (Nat.pow (S (S O)) sz1)) (le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) *) split. (* Goal: le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) *) (* Goal: le (Nat.div2 n) (Nat.pow (S (S O)) sz1) *) * (* Goal: le (Nat.div2 n) (Nat.pow (S (S O)) sz1) *) pose proof (@div2_compat_lt_l (pow2 sz1) n) as P. (* Goal: le (Nat.div2 n) (Nat.pow (S (S O)) sz1) *) omega. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) (* BG Goal: le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) *) * (* Goal: le (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) *) rewrite pow2_add_mul. (* Goal: le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) clear IHsz1. (* Goal: le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) rewrite <- Nat.mul_1_r at 1. (* Goal: le (Nat.mul (Nat.pow (S (S O)) sz1) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) apply mult_le_compat_l. (* Goal: le (S O) (Nat.pow (S (S O)) sz2) *) apply one_le_pow2. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) } (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Nat.div2 b)) *) rewrite D2. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Nat.div2 n)))) *) destruct sz1 as [|sz1']. (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1') sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1') sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1')) (Nat.div2 n)))) *) (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O (natToWord O (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) (Nat.div2 n)))) *) * (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O (natToWord O (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) (Nat.div2 n)))) *) simpl in H. (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O (natToWord O (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) (Nat.div2 n)))) *) assert (n=1) by omega. (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O (natToWord O (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) (Nat.div2 n)))) *) subst n. (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O (natToWord O (Nat.div2 (S O))) sz2 (wones sz2)) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) (Nat.div2 (S O))))) *) simpl in D2. (* Goal: @eq (word (Init.Nat.add O sz2)) (@combine O (natToWord O (Nat.div2 (S O))) sz2 (wones sz2)) (natToWord (Init.Nat.add O sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add O sz2)) (Init.Nat.sub (Nat.pow (S (S O)) O) (Nat.div2 (S O))))) *) simpl. (* Goal: @eq (word sz2) (wones sz2) (natToWord sz2 (Init.Nat.sub (Nat.pow (S (S O)) sz2) (S O))) *) apply wones_natToWord. (* BG Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1') sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1') sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1')) (Nat.div2 n)))) *) * (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1') sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1') sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1')) (Nat.div2 n)))) *) assert (n <= S (2 * Nat.div2 n))%nat. (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1') sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1') sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1')) (Nat.div2 n)))) *) (* Goal: le n (S (Init.Nat.mul (S (S O)) (Nat.div2 n))) *) { (* Goal: le n (S (Init.Nat.mul (S (S O)) (Nat.div2 n))) *) destruct (even_odd_destruct n) as [[m C]|[m C]]; subst n. (* Goal: le (Init.Nat.add (Init.Nat.mul (S (S O)) m) (S O)) (S (Init.Nat.mul (S (S O)) (Nat.div2 (Init.Nat.add (Init.Nat.mul (S (S O)) m) (S O))))) *) (* Goal: le (Init.Nat.mul (S (S O)) m) (S (Init.Nat.mul (S (S O)) (Nat.div2 (Init.Nat.mul (S (S O)) m)))) *) - (* Goal: le (Init.Nat.mul (S (S O)) m) (S (Init.Nat.mul (S (S O)) (Nat.div2 (Init.Nat.mul (S (S O)) m)))) *) rewrite Nat.div2_double. (* Goal: le (Init.Nat.mul (S (S O)) m) (S (Init.Nat.mul (S (S O)) m)) *) constructor. (* Goal: le (Init.Nat.mul (S (S O)) m) (Init.Nat.mul (S (S O)) m) *) constructor. (* BG Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1') sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1') sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1')) (Nat.div2 n)))) *) (* BG Goal: le (Init.Nat.add (Init.Nat.mul (S (S O)) m) (S O)) (S (Init.Nat.mul (S (S O)) (Nat.div2 (Init.Nat.add (Init.Nat.mul (S (S O)) m) (S O))))) *) - (* Goal: le (Init.Nat.add (Init.Nat.mul (S (S O)) m) (S O)) (S (Init.Nat.mul (S (S O)) (Nat.div2 (Init.Nat.add (Init.Nat.mul (S (S O)) m) (S O))))) *) replace (2 * m + 1) with (S (2 * m)) by omega. (* Goal: le (S (Init.Nat.mul (S (S O)) m)) (S (Init.Nat.mul (S (S O)) (Nat.div2 (S (Init.Nat.mul (S (S O)) m))))) *) rewrite Nat.div2_succ_double. (* Goal: le (S (Init.Nat.mul (S (S O)) m)) (S (Init.Nat.mul (S (S O)) m)) *) constructor. (* BG Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1') sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1') sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1')) (Nat.div2 n)))) *) } (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (natToWord (Init.Nat.add (S sz1') sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add (S sz1') sz2)) (Init.Nat.sub (Nat.pow (S (S O)) (S sz1')) (Nat.div2 n)))) *) rewrite <- IHsz1. (* Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (if @wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false then @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2) else @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wzero sz2)) *) { (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (if @wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false then @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2) else @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wzero sz2)) *) assert (@wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false = true) as F. (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (if @wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false then @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2) else @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wzero sz2)) *) (* Goal: @eq bool (@wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false) true *) { (* Goal: @eq bool (@wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false) true *) apply wmsb_1_natToWord. (* Goal: and (le (Nat.pow (S (S O)) sz1') (Nat.div2 n)) (lt (Nat.div2 n) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1'))) *) unfold pow2 in *. (* Goal: and (le ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1') (Nat.div2 n)) (lt (Nat.div2 n) (Init.Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1'))) *) fold pow2 in *. (* Goal: and (le (Nat.pow (S (S O)) sz1') (Nat.div2 n)) (lt (Nat.div2 n) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1'))) *) assert (2 * Nat.div2 n <= n)%nat by apply two_times_div2_bound. (* Goal: and (le (Nat.pow (S (S O)) sz1') (Nat.div2 n)) (lt (Nat.div2 n) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1'))) *) clear -H H0 H1. (* Goal: and (le (Nat.pow (S (S O)) sz1') (Nat.div2 n)) (lt (Nat.div2 n) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1'))) *) omega. (* BG Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) (* BG Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (if @wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false then @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2) else @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wzero sz2)) *) } (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (if @wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false then @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2) else @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wzero sz2)) *) { (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (if @wmsb (S sz1') (natToWord (S sz1') (Nat.div2 n)) false then @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2) else @combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wzero sz2)) *) rewrite F. (* Goal: @eq (word (Init.Nat.add (S sz1') sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) (@combine (S sz1') (natToWord (S sz1') (Nat.div2 n)) sz2 (wones sz2)) *) reflexivity. (* BG Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) } (* BG Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) } (* Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) { (* Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) assert (2 * Nat.div2 n <= n)%nat by apply two_times_div2_bound. (* Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) clear -H H0 H1. (* Goal: and (le (Nat.pow (S (S O)) (S sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.pow (S (S O)) (S (S sz1')))) *) unfold pow2 in *. (* Goal: and (le (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.mul (S (S O)) (Nat.mul (S (S O)) ((fix pow (n m : nat) {struct m} : nat := match m with | O => S O | S m0 => Nat.mul n (pow n m0) end) (S (S O)) sz1')))) *) fold pow2 in *. (* Goal: and (le (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1')) (Init.Nat.mul (S (S O)) (Nat.div2 n))) (lt (Init.Nat.mul (S (S O)) (Nat.div2 n)) (Nat.mul (S (S O)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1')))) *) omega. Qed. Lemma sext_wneg_natToWord': forall sz1 sz2 n, (2 * n < pow2 sz1)%nat -> sext (wneg (natToWord sz1 n)) sz2 = wneg (natToWord (sz1 + sz2) n). Proof. (* Goal: forall (sz1 sz2 n : nat) (_ : lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1)), @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (@wneg sz1 (natToWord sz1 n)) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) n)) *) intros. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (@wneg sz1 (natToWord sz1 n)) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) n)) *) rewrite wneg_alt. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (@wnegN sz1 (natToWord sz1 n)) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) n)) *) unfold wnegN. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 n)))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) n)) *) destruct n as [|n]. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 O)))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) - (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 O)))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) rewrite roundTrip_0. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) O)) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) rewrite Nat.sub_0_r. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Nat.pow (S (S O)) sz1)) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) rewrite natToWord_pow2. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 O) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) unfold sext. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (if @wmsb sz1 (natToWord sz1 O) false then @combine sz1 (natToWord sz1 O) sz2 (wones sz2) else @combine sz1 (natToWord sz1 O) sz2 (wzero sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) assert (wmsb (natToWord sz1 0) false = false) as W. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (if @wmsb sz1 (natToWord sz1 O) false then @combine sz1 (natToWord sz1 O) sz2 (wones sz2) else @combine sz1 (natToWord sz1 O) sz2 (wzero sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) (* Goal: @eq bool (@wmsb sz1 (natToWord sz1 O) false) false *) { (* Goal: @eq bool (@wmsb sz1 (natToWord sz1 O) false) false *) destruct sz1. (* Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) O) false) false *) (* Goal: @eq bool (@wmsb O (natToWord O O) false) false *) + (* Goal: @eq bool (@wmsb O (natToWord O O) false) false *) simpl. (* Goal: @eq bool false false *) reflexivity. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (if @wmsb sz1 (natToWord sz1 O) false then @combine sz1 (natToWord sz1 O) sz2 (wones sz2) else @combine sz1 (natToWord sz1 O) sz2 (wzero sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) (* BG Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) O) false) false *) + (* Goal: @eq bool (@wmsb (S sz1) (natToWord (S sz1) O) false) false *) apply wmsb_0_natToWord. (* Goal: lt (Init.Nat.mul (S (S O)) O) (Nat.pow (S (S O)) (S sz1)) *) assumption. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (if @wmsb sz1 (natToWord sz1 O) false then @combine sz1 (natToWord sz1 O) sz2 (wones sz2) else @combine sz1 (natToWord sz1 O) sz2 (wzero sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) } (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (if @wmsb sz1 (natToWord sz1 O) false then @combine sz1 (natToWord sz1 O) sz2 (wones sz2) else @combine sz1 (natToWord sz1 O) sz2 (wzero sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) rewrite W. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 (natToWord sz1 O) sz2 (wzero sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) rewrite combine_wzero. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (wzero (Init.Nat.add sz1 sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) *) symmetry. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) O)) (wzero (Init.Nat.add sz1 sz2)) *) apply wneg_zero'. (* BG Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) - (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (@sext sz1 (natToWord sz1 (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) sz2) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) rewrite sext_wneg_natToWord''. (* Goal: and (le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n)))))) (lt (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) (Nat.pow (S (S O)) (S sz1))) *) (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))))) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) + (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))))) (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) rewrite wneg_alt. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))))) (@wnegN (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))) *) unfold wnegN. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))))) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (@wordToNat (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))))) *) rewrite wordToNat_natToWord_idempotent' by omega. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n))))) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (@wordToNat (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (S n))))) *) rewrite wordToNat_natToWord_idempotent'. (* Goal: lt (S n) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) *) (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n))))) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (S n))) *) * (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n))))) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (S n))) *) replace (pow2 sz1 - (pow2 sz1 - S n)) with (S n) by omega. (* Goal: @eq (word (Init.Nat.add sz1 sz2)) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (S n))) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) (S n))) *) reflexivity. (* BG Goal: and (le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n)))))) (lt (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) (Nat.pow (S (S O)) (S sz1))) *) (* BG Goal: lt (S n) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) *) * (* Goal: lt (S n) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2)) *) rewrite pow2_add_mul. (* Goal: lt (S n) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) apply Nat.le_trans with (m := pow2 sz1); [omega|]. (* Goal: le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) rewrite <- Nat.mul_1_r at 1. (* Goal: le (Nat.mul (Nat.pow (S (S O)) sz1) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2)) *) apply mult_le_compat_l. (* Goal: le (S O) (Nat.pow (S (S O)) sz2) *) apply one_le_pow2. (* BG Goal: and (le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n)))))) (lt (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) (Nat.pow (S (S O)) (S sz1))) *) + (* Goal: and (le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n)))))) (lt (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (@wordToNat sz1 (natToWord sz1 (S n))))) (Nat.pow (S (S O)) (S sz1))) *) rewrite wordToNat_natToWord_idempotent' by omega. (* Goal: and (le (Nat.pow (S (S O)) sz1) (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n)))) (lt (Init.Nat.mul (S (S O)) (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n))) (Nat.pow (S (S O)) (S sz1))) *) simpl. (* Goal: and (le (Nat.pow (S (S O)) sz1) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n)) O))) (lt (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz1) (S n)) O)) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) omega. Qed. Lemma sext_wneg_natToWord: forall sz2 sz1 sz n (e: sz1 + sz2 = sz), (2 * n < pow2 sz1)%nat -> eq_rect (sz1 + sz2) word (sext (wneg (natToWord sz1 n)) sz2) sz e = wneg (natToWord sz n). Proof. (* Goal: forall (sz2 sz1 sz n : nat) (e : @eq nat (Init.Nat.add sz1 sz2) sz) (_ : lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1)), @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (@sext sz1 (@wneg sz1 (natToWord sz1 n)) sz2) sz e) (@wneg sz (natToWord sz n)) *) intros. (* Goal: @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (@sext sz1 (@wneg sz1 (natToWord sz1 n)) sz2) sz e) (@wneg sz (natToWord sz n)) *) rewrite sext_wneg_natToWord' by assumption. (* Goal: @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (@wneg (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) n)) sz e) (@wneg sz (natToWord sz n)) *) rewrite e. (* Goal: @eq (word sz) (@eq_rect nat sz word (@wneg sz (natToWord sz n)) sz (@eq_refl nat sz)) (@wneg sz (natToWord sz n)) *) reflexivity. Qed. Lemma wordToNat_split1: forall sz1 sz2 (w: word (sz1 + sz2)), wordToNat (split1 _ _ w) = Nat.modulo (wordToNat w) (pow2 sz1). Proof. (* Goal: forall (sz1 sz2 : nat) (w : word (Init.Nat.add sz1 sz2)), @eq nat (@wordToNat sz1 (split1 sz1 sz2 w)) (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) *) induction sz1; intros; [reflexivity|]. (* Goal: @eq nat (@wordToNat (S sz1) (split1 (S sz1) sz2 w)) (Nat.modulo (@wordToNat (Init.Nat.add (S sz1) sz2) w) (Nat.pow (S (S O)) (S sz1))) *) destruct (destruct_word_S w) as [v [b E]]. (* Goal: @eq nat (@wordToNat (S sz1) (split1 (S sz1) sz2 w)) (Nat.modulo (@wordToNat (Init.Nat.add (S sz1) sz2) w) (Nat.pow (S (S O)) (S sz1))) *) match type of v with | word ?x => change x with (sz1 + sz2) in * end. (* Goal: @eq nat (@wordToNat (S sz1) (split1 (S sz1) sz2 w)) (Nat.modulo (@wordToNat (Init.Nat.add (S sz1) sz2) w) (Nat.pow (S (S O)) (S sz1))) *) subst w. (* Goal: @eq nat (@wordToNat (S sz1) (split1 (S sz1) sz2 (@WS b (Init.Nat.add sz1 sz2) v))) (Nat.modulo (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS b (Init.Nat.add sz1 sz2) v)) (Nat.pow (S (S O)) (S sz1))) *) rename v into w. (* Goal: @eq nat (@wordToNat (S sz1) (split1 (S sz1) sz2 (@WS b (Init.Nat.add sz1 sz2) w))) (Nat.modulo (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS b (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) simpl; rewrite IHsz1. (* Goal: @eq nat (if b then S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) else Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.modulo (if b then S (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) else Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) pose proof (zero_lt_pow2 sz1). (* Goal: @eq nat (if b then S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) else Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.modulo (if b then S (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) else Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) destruct b. (* Goal: @eq nat (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.modulo (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (S (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O)))) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) - (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (S (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O)))) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) change (pow2 sz1 + (pow2 sz1 + 0)) with (2 * pow2 sz1). (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (S (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) replace (S (wordToNat w * 2)) with (1 + 2 * wordToNat w) by omega. (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (@wordToNat (Init.Nat.add sz1 sz2) w))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite Nat.add_mod by omega. (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (Nat.add (Nat.modulo (S O) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (Nat.modulo (Init.Nat.mul (S (S O)) (@wordToNat (Init.Nat.add sz1 sz2) w)) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite Nat.mul_mod_distr_l; [|omega|discriminate]. (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (Nat.add (Nat.modulo (S O) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) (Nat.mul (S (S O)) (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite Nat.mod_1_l by omega. (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (Nat.add (S O) (Nat.mul (S (S O)) (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite Nat.mul_comm with (n:= 2). (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (Nat.add (S O) (Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) change (1 + wordToNat w mod pow2 sz1 * 2) with (S (wordToNat w mod pow2 sz1 * 2)). (* Goal: @eq nat (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Nat.modulo (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) apply eq_sym, Nat.mod_small. (* Goal: lt (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) *) assert (pow2 sz1 <> 0) by omega. (* Goal: lt (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) *) pose proof (Nat.mod_upper_bound (wordToNat w) (pow2 sz1) H0). (* Goal: lt (S (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O)))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1)) *) omega. (* BG Goal: @eq nat (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.modulo (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) - (* Goal: @eq nat (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.modulo (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) (Nat.add (Nat.pow (S (S O)) sz1) (Nat.add (Nat.pow (S (S O)) sz1) O))) *) change (pow2 sz1 + (pow2 sz1 + 0)) with (2 * pow2 sz1). (* Goal: @eq nat (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.modulo (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite Nat.mul_comm with (n:= 2). (* Goal: @eq nat (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.modulo (Init.Nat.mul (@wordToNat (Init.Nat.add sz1 sz2) w) (S (S O))) (Nat.mul (Nat.pow (S (S O)) sz1) (S (S O)))) *) rewrite Nat.mul_mod_distr_r; [|omega|discriminate]. (* Goal: @eq nat (Init.Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) (Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (S (S O))) *) reflexivity. Qed. Lemma wordToNat_split2: forall sz1 sz2 (w: word (sz1 + sz2)), wordToNat (split2 _ _ w) = Nat.div (wordToNat w) (pow2 sz1). Proof. (* Goal: forall (sz1 sz2 : nat) (w : word (Init.Nat.add sz1 sz2)), @eq nat (@wordToNat sz2 (split2 sz1 sz2 w)) (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) *) induction sz1; intros; [rewrite Nat.div_1_r; reflexivity|]. (* Goal: @eq nat (@wordToNat sz2 (split2 (S sz1) sz2 w)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) w) (Nat.pow (S (S O)) (S sz1))) *) destruct (destruct_word_S w) as [v [b E]]. (* Goal: @eq nat (@wordToNat sz2 (split2 (S sz1) sz2 w)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) w) (Nat.pow (S (S O)) (S sz1))) *) match type of v with | word ?x => change x with (sz1 + sz2) in * end. (* Goal: @eq nat (@wordToNat sz2 (split2 (S sz1) sz2 w)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) w) (Nat.pow (S (S O)) (S sz1))) *) subst w. (* Goal: @eq nat (@wordToNat sz2 (split2 (S sz1) sz2 (@WS b (Init.Nat.add sz1 sz2) v))) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS b (Init.Nat.add sz1 sz2) v)) (Nat.pow (S (S O)) (S sz1))) *) rename v into w. (* Goal: @eq nat (@wordToNat sz2 (split2 (S sz1) sz2 (@WS b (Init.Nat.add sz1 sz2) w))) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS b (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) change (split2 (S sz1) sz2 (WS b w)) with (split2 sz1 sz2 w). (* Goal: @eq nat (@wordToNat sz2 (split2 sz1 sz2 w)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS b (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) rewrite IHsz1. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS b (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) destruct b. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS false (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS true (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) - (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS true (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) unfold pow2; fold pow2. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS true (Init.Nat.add sz1 sz2) w)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) replace (@wordToNat (S sz1 + sz2) w~1) with (1 + 2 * wordToNat w) by (simpl; omega). (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (@wordToNat (Init.Nat.add sz1 sz2) w))) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite <-Nat.div_div; [|discriminate|pose proof (zero_lt_pow2 sz1); omega]. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (Nat.div (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (@wordToNat (Init.Nat.add sz1 sz2) w))) (S (S O))) (Nat.pow (S (S O)) sz1)) *) rewrite Nat.mul_comm, Nat.div_add by discriminate. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (Nat.add (Nat.div (S O) (S (S O))) (@wordToNat (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) sz1)) *) rewrite Nat.div_small with (b := 2) by omega. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (Nat.add O (@wordToNat (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) sz1)) *) reflexivity. (* BG Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS false (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) - (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS false (Init.Nat.add sz1 sz2) w)) (Nat.pow (S (S O)) (S sz1))) *) unfold pow2; fold pow2. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add (S sz1) sz2) (@WS false (Init.Nat.add sz1 sz2) w)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) replace (@wordToNat (S sz1 + sz2) w~0) with (2 * wordToNat w) by (simpl; omega). (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (Init.Nat.mul (S (S O)) (@wordToNat (Init.Nat.add sz1 sz2) w)) (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz1))) *) rewrite Nat.div_mul_cancel_l; [|pose proof (zero_lt_pow2 sz1); omega|discriminate]. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w) (Nat.pow (S (S O)) sz1)) *) reflexivity. Qed. Lemma wordToNat_wrshifta: forall sz (w: word sz) n, wordToNat (wrshifta w n) = Nat.div (wordToNat (sext w n)) (pow2 n). Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq nat (@wordToNat sz (@wrshifta sz w n)) (Nat.div (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) n)) *) unfold wrshifta; intros. (* Goal: @eq nat (@wordToNat sz (split2 n sz (@eq_rec_r nat (Nat.add sz n) (fun n : nat => word n) (@sext sz w n) (Nat.add n sz) (Nat.add_comm n sz)))) (Nat.div (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) n)) *) rewrite wordToNat_split2. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add n sz) (@eq_rec_r nat (Nat.add sz n) (fun n : nat => word n) (@sext sz w n) (Nat.add n sz) (Nat.add_comm n sz))) (Nat.pow (S (S O)) n)) (Nat.div (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) n)) *) unfold eq_rec_r, eq_rec. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add n sz) (@eq_rect nat (Nat.add sz n) (fun y : nat => word y) (@sext sz w n) (Nat.add n sz) (@eq_sym nat (Nat.add n sz) (Nat.add sz n) (Nat.add_comm n sz)))) (Nat.pow (S (S O)) n)) (Nat.div (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) n)) *) rewrite wordToNat_eq_rect. (* Goal: @eq nat (Nat.div (@wordToNat (Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) n)) (Nat.div (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) n)) *) reflexivity. Qed. Lemma wordToNat_combine: forall sz1 (w1: word sz1) sz2 (w2: word sz2), wordToNat (combine w1 w2) = wordToNat w1 + pow2 sz1 * wordToNat w2. Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2), @eq nat (@wordToNat (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (Init.Nat.add (@wordToNat sz1 w1) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w2))) *) dependent induction w1; intros; [simpl; omega|]. (* Goal: @eq nat (@wordToNat (Init.Nat.add (S n) sz2) (@combine (S n) (@WS b n w1) sz2 w2)) (Init.Nat.add (@wordToNat (S n) (@WS b n w1)) (Init.Nat.mul (Nat.pow (S (S O)) (S n)) (@wordToNat sz2 w2))) *) unfold pow2; fold pow2. (* Goal: @eq nat (@wordToNat (Init.Nat.add (S n) sz2) (@combine (S n) (@WS b n w1) sz2 w2)) (Init.Nat.add (@wordToNat (S n) (@WS b n w1)) (Init.Nat.mul (Nat.mul (S (S O)) (Nat.pow (S (S O)) n)) (@wordToNat sz2 w2))) *) rewrite Nat.mul_comm with (n:= 2). (* Goal: @eq nat (@wordToNat (Init.Nat.add (S n) sz2) (@combine (S n) (@WS b n w1) sz2 w2)) (Init.Nat.add (@wordToNat (S n) (@WS b n w1)) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2))) *) simpl; destruct b. (* Goal: @eq nat (Init.Nat.mul (@wordToNat (Init.Nat.add n sz2) (@combine n w1 sz2 w2)) (S (S O))) (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2))) *) (* Goal: @eq nat (S (Init.Nat.mul (@wordToNat (Init.Nat.add n sz2) (@combine n w1 sz2 w2)) (S (S O)))) (Init.Nat.add (S (Init.Nat.mul (@wordToNat n w1) (S (S O)))) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2))) *) - (* Goal: @eq nat (S (Init.Nat.mul (@wordToNat (Init.Nat.add n sz2) (@combine n w1 sz2 w2)) (S (S O)))) (Init.Nat.add (S (Init.Nat.mul (@wordToNat n w1) (S (S O)))) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2))) *) rewrite IHw1; simpl. (* Goal: @eq nat (S (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O)))) (S (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2)))) *) rewrite Nat.mul_comm with (n:= pow2 n * 2). (* Goal: @eq nat (S (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O)))) (S (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Nat.mul (@wordToNat sz2 w2) (Init.Nat.mul (Nat.pow (S (S O)) n) (S (S O)))))) *) rewrite Nat.mul_assoc. (* Goal: @eq nat (S (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O)))) (S (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Nat.mul (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n)) (S (S O))))) *) rewrite <-Nat.mul_add_distr_r. (* Goal: @eq nat (S (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O)))) (S (Nat.mul (Nat.add (@wordToNat n w1) (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n))) (S (S O)))) *) rewrite Nat.mul_comm with (n:= pow2 n). (* Goal: @eq nat (S (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n))) (S (S O)))) (S (Nat.mul (Nat.add (@wordToNat n w1) (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n))) (S (S O)))) *) reflexivity. (* BG Goal: @eq nat (Init.Nat.mul (@wordToNat (Init.Nat.add n sz2) (@combine n w1 sz2 w2)) (S (S O))) (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2))) *) - (* Goal: @eq nat (Init.Nat.mul (@wordToNat (Init.Nat.add n sz2) (@combine n w1 sz2 w2)) (S (S O))) (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2))) *) rewrite IHw1. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O))) (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Init.Nat.mul (Nat.mul (Nat.pow (S (S O)) n) (S (S O))) (@wordToNat sz2 w2))) *) rewrite Nat.mul_comm with (n:= pow2 n * 2). (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O))) (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Nat.mul (@wordToNat sz2 w2) (Init.Nat.mul (Nat.pow (S (S O)) n) (S (S O))))) *) rewrite Nat.mul_assoc. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O))) (Init.Nat.add (Init.Nat.mul (@wordToNat n w1) (S (S O))) (Nat.mul (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n)) (S (S O)))) *) rewrite <-Nat.mul_add_distr_r. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz2 w2))) (S (S O))) (Nat.mul (Nat.add (@wordToNat n w1) (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n))) (S (S O))) *) rewrite Nat.mul_comm with (n:= pow2 n). (* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (@wordToNat n w1) (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n))) (S (S O))) (Nat.mul (Nat.add (@wordToNat n w1) (Nat.mul (@wordToNat sz2 w2) (Nat.pow (S (S O)) n))) (S (S O))) *) reflexivity. Qed. Lemma wordToNat_wlshift: forall sz (w: word sz) n, wordToNat (wlshift w n) = Nat.mul (Nat.modulo (wordToNat w) (pow2 (sz - n))) (pow2 n). Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq nat (@wordToNat sz (@wlshift sz w n)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) intros; destruct (le_dec n sz). (* Goal: @eq nat (@wordToNat sz (@wlshift sz w n)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) (* Goal: @eq nat (@wordToNat sz (@wlshift sz w n)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) - (* Goal: @eq nat (@wordToNat sz (@wlshift sz w n)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) unfold wlshift; intros. (* Goal: @eq nat (@wordToNat sz (split1 sz n (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz w) (Nat.add sz n) (Nat.add_comm sz n)))) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite wordToNat_split1. (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz w) (Nat.add sz n) (Nat.add_comm sz n))) (Nat.pow (S (S O)) sz)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) unfold eq_rec_r, eq_rec. (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@eq_rect nat (Nat.add n sz) (fun y : nat => word y) (@combine n (wzero n) sz w) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) (Nat.pow (S (S O)) sz)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite wordToNat_eq_rect. (* Goal: @eq nat (Nat.modulo (@wordToNat (Nat.add n sz) (@combine n (wzero n) sz w)) (Nat.pow (S (S O)) sz)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite wordToNat_combine. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat n (wzero n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w))) (Nat.pow (S (S O)) sz)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite wordToNat_wzero; simpl. (* Goal: @eq nat (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) (Nat.pow (S (S O)) sz)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) replace (pow2 sz) with (pow2 (sz - n + n)) by (f_equal; omega). (* Goal: @eq nat (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) (Nat.pow (S (S O)) (Init.Nat.add (Init.Nat.sub sz n) n))) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite pow2_add_mul. (* Goal: @eq nat (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) (Init.Nat.mul (Nat.pow (S (S O)) (Init.Nat.sub sz n)) (Nat.pow (S (S O)) n))) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite Nat.mul_comm with (n:= pow2 (sz - n)). (* Goal: @eq nat (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) (Nat.mul (Nat.pow (S (S O)) n) (Nat.pow (S (S O)) (Init.Nat.sub sz n)))) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite Nat.mul_mod_distr_l; [|pose proof (zero_lt_pow2 (sz - n)); omega |pose proof (zero_lt_pow2 n); omega]. (* Goal: @eq nat (Nat.mul (Nat.pow (S (S O)) n) (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n)))) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) apply Nat.mul_comm. (* BG Goal: @eq nat (@wordToNat sz (@wlshift sz w n)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) - (* Goal: @eq nat (@wordToNat sz (@wlshift sz w n)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) assert (n > sz)%nat by omega. (* Goal: @eq nat (@wordToNat sz (@wlshift sz w n)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) rewrite wlshift_gt by assumption. (* Goal: @eq nat (@wordToNat sz (wzero sz)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) (Init.Nat.sub sz n))) (Nat.pow (S (S O)) n)) *) replace (sz - n) with 0 by omega. (* Goal: @eq nat (@wordToNat sz (wzero sz)) (Nat.mul (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) O)) (Nat.pow (S (S O)) n)) *) rewrite wordToNat_wzero; simpl; reflexivity. Qed. Lemma wordToNat_extz: forall sz (w: word sz) n, wordToNat (extz w n) = pow2 n * wordToNat w. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq nat (@wordToNat (Init.Nat.add n sz) (@extz sz w n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) *) unfold extz; intros. (* Goal: @eq nat (@wordToNat (Init.Nat.add n sz) (@combine n (wzero n) sz w)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) *) rewrite wordToNat_combine. (* Goal: @eq nat (Init.Nat.add (@wordToNat n (wzero n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w))) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) *) rewrite wordToNat_wzero. (* Goal: @eq nat (Init.Nat.add O (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w))) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) *) reflexivity. Qed. Lemma extz_is_mult_pow2: forall sz n d, extz (natToWord sz n) d = natToWord (d + sz) (pow2 d * n). Proof. (* Goal: forall sz n d : nat, @eq (word (Init.Nat.add d sz)) (@extz sz (natToWord sz n) d) (natToWord (Init.Nat.add d sz) (Init.Nat.mul (Nat.pow (S (S O)) d) n)) *) intros. (* Goal: @eq (word (Init.Nat.add d sz)) (@extz sz (natToWord sz n) d) (natToWord (Init.Nat.add d sz) (Init.Nat.mul (Nat.pow (S (S O)) d) n)) *) induction d. (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@extz sz (natToWord sz n) (S d)) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n)) *) (* Goal: @eq (word (Init.Nat.add O sz)) (@extz sz (natToWord sz n) O) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n)) *) - (* Goal: @eq (word (Init.Nat.add O sz)) (@extz sz (natToWord sz n) O) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n)) *) unfold extz. (* Goal: @eq (word (Init.Nat.add O sz)) (@combine O (wzero O) sz (natToWord sz n)) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n)) *) rewrite combine_0_n. (* Goal: @eq (word (Init.Nat.add O sz)) (natToWord sz n) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n)) *) simpl. (* Goal: @eq (word sz) (natToWord sz n) (natToWord sz (Init.Nat.add n O)) *) f_equal. (* Goal: @eq nat n (Init.Nat.add n O) *) omega. (* BG Goal: @eq (word (Init.Nat.add (S d) sz)) (@extz sz (natToWord sz n) (S d)) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n)) *) - (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@extz sz (natToWord sz n) (S d)) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n)) *) unfold extz in *. (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@combine (S d) (wzero (S d)) sz (natToWord sz n)) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n)) *) change (pow2 (S d) * n) with (2 * pow2 d * n). (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@combine (S d) (wzero (S d)) sz (natToWord sz n)) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) d)) n)) *) rewrite <- Nat.mul_assoc. (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@combine (S d) (wzero (S d)) sz (natToWord sz n)) (natToWord (Init.Nat.add (S d) sz) (Nat.mul (S (S O)) (Nat.mul (Nat.pow (S (S O)) d) n))) *) change ((S d) + sz) with (S (d + sz)) in *. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@combine (S d) (wzero (S d)) sz (natToWord sz n)) (natToWord (S (Init.Nat.add d sz)) (Nat.mul (S (S O)) (Nat.mul (Nat.pow (S (S O)) d) n))) *) rewrite <- natToWord_times2. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@combine (S d) (wzero (S d)) sz (natToWord sz n)) (@WS false (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n))) *) simpl. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@WS false (Init.Nat.add d sz) (@combine d (natToWord d O) sz (natToWord sz n))) (@WS false (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n))) *) fold natToWord. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@WS false (Init.Nat.add d sz) (@combine d (natToWord d O) sz (natToWord sz n))) (@WS false (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n))) *) f_equal. (* Goal: @eq (word (Init.Nat.add d sz)) (@combine d (natToWord d O) sz (natToWord sz n)) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n)) *) exact IHd. Qed. Lemma extz_is_mult_pow2_neg: forall sz n d, extz (wneg (natToWord sz n)) d = wneg (natToWord (d + sz) (pow2 d * n)). Proof. (* Goal: forall sz n d : nat, @eq (word (Init.Nat.add d sz)) (@extz sz (@wneg sz (natToWord sz n)) d) (@wneg (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Init.Nat.mul (Nat.pow (S (S O)) d) n))) *) intros. (* Goal: @eq (word (Init.Nat.add d sz)) (@extz sz (@wneg sz (natToWord sz n)) d) (@wneg (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Init.Nat.mul (Nat.pow (S (S O)) d) n))) *) induction d. (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@extz sz (@wneg sz (natToWord sz n)) (S d)) (@wneg (Init.Nat.add (S d) sz) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n))) *) (* Goal: @eq (word (Init.Nat.add O sz)) (@extz sz (@wneg sz (natToWord sz n)) O) (@wneg (Init.Nat.add O sz) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n))) *) - (* Goal: @eq (word (Init.Nat.add O sz)) (@extz sz (@wneg sz (natToWord sz n)) O) (@wneg (Init.Nat.add O sz) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n))) *) unfold extz. (* Goal: @eq (word (Init.Nat.add O sz)) (@combine O (wzero O) sz (@wneg sz (natToWord sz n))) (@wneg (Init.Nat.add O sz) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n))) *) rewrite combine_0_n. (* Goal: @eq (word (Init.Nat.add O sz)) (@wneg sz (natToWord sz n)) (@wneg (Init.Nat.add O sz) (natToWord (Init.Nat.add O sz) (Init.Nat.mul (Nat.pow (S (S O)) O) n))) *) simpl. (* Goal: @eq (word sz) (@wneg sz (natToWord sz n)) (@wneg sz (natToWord sz (Init.Nat.add n O))) *) f_equal. (* Goal: @eq (word sz) (natToWord sz n) (natToWord sz (Init.Nat.add n O)) *) f_equal. (* Goal: @eq nat n (Init.Nat.add n O) *) omega. (* BG Goal: @eq (word (Init.Nat.add (S d) sz)) (@extz sz (@wneg sz (natToWord sz n)) (S d)) (@wneg (Init.Nat.add (S d) sz) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n))) *) - (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@extz sz (@wneg sz (natToWord sz n)) (S d)) (@wneg (Init.Nat.add (S d) sz) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n))) *) unfold extz in *. (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@combine (S d) (wzero (S d)) sz (@wneg sz (natToWord sz n))) (@wneg (Init.Nat.add (S d) sz) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Nat.pow (S (S O)) (S d)) n))) *) change (pow2 (S d) * n) with (2 * pow2 d * n). (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@combine (S d) (wzero (S d)) sz (@wneg sz (natToWord sz n))) (@wneg (Init.Nat.add (S d) sz) (natToWord (Init.Nat.add (S d) sz) (Init.Nat.mul (Init.Nat.mul (S (S O)) (Nat.pow (S (S O)) d)) n))) *) rewrite <- Nat.mul_assoc. (* Goal: @eq (word (Init.Nat.add (S d) sz)) (@combine (S d) (wzero (S d)) sz (@wneg sz (natToWord sz n))) (@wneg (Init.Nat.add (S d) sz) (natToWord (Init.Nat.add (S d) sz) (Nat.mul (S (S O)) (Nat.mul (Nat.pow (S (S O)) d) n)))) *) change ((S d) + sz) with (S (d + sz)) in *. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@combine (S d) (wzero (S d)) sz (@wneg sz (natToWord sz n))) (@wneg (S (Init.Nat.add d sz)) (natToWord (S (Init.Nat.add d sz)) (Nat.mul (S (S O)) (Nat.mul (Nat.pow (S (S O)) d) n)))) *) rewrite <- natToWord_times2. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@combine (S d) (wzero (S d)) sz (@wneg sz (natToWord sz n))) (@wneg (S (Init.Nat.add d sz)) (@WS false (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n)))) *) simpl. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@WS false (Init.Nat.add d sz) (@combine d (natToWord d O) sz (@wneg sz (natToWord sz n)))) (@wneg (S (Init.Nat.add d sz)) (@WS false (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n)))) *) fold natToWord. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@WS false (Init.Nat.add d sz) (@combine d (natToWord d O) sz (@wneg sz (natToWord sz n)))) (@wneg (S (Init.Nat.add d sz)) (@WS false (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n)))) *) f_equal. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@WS false (Init.Nat.add d sz) (@combine d (natToWord d O) sz (@wneg sz (natToWord sz n)))) (@wneg (S (Init.Nat.add d sz)) (@WS false (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n)))) *) rewrite wneg_WS_0. (* Goal: @eq (word (S (Init.Nat.add d sz))) (@WS false (Init.Nat.add d sz) (@combine d (natToWord d O) sz (@wneg sz (natToWord sz n)))) (@WS false (Init.Nat.add d sz) (@wneg (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n)))) *) f_equal. (* Goal: @eq (word (Init.Nat.add d sz)) (@combine d (natToWord d O) sz (@wneg sz (natToWord sz n))) (@wneg (Init.Nat.add d sz) (natToWord (Init.Nat.add d sz) (Nat.mul (Nat.pow (S (S O)) d) n))) *) exact IHd. Qed. Lemma wordToNat_sext_bypass: forall sz1 (w1: word sz1) sz2 (w2: word sz2) (Hsz: sz1 = sz2) n, wordToNat w1 = wordToNat w2 -> wordToNat (sext w1 n) = wordToNat (sext w2 n). Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2) (_ : @eq nat sz1 sz2) (n : nat) (_ : @eq nat (@wordToNat sz1 w1) (@wordToNat sz2 w2)), @eq nat (@wordToNat (Init.Nat.add sz1 n) (@sext sz1 w1 n)) (@wordToNat (Init.Nat.add sz2 n) (@sext sz2 w2 n)) *) intros; subst. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz2 n) (@sext sz2 w1 n)) (@wordToNat (Init.Nat.add sz2 n) (@sext sz2 w2 n)) *) apply wordToNat_inj in H; subst. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz2 n) (@sext sz2 w2 n)) (@wordToNat (Init.Nat.add sz2 n) (@sext sz2 w2 n)) *) reflexivity. Qed. Lemma combine_sext: forall sz1 (w1: word sz1) sz2 (w2: word (S sz2)) n, existT word _ (combine w1 (sext w2 n)) = existT word _ (sext (combine w1 w2) n). Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word (S sz2)) (n : nat), @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 (Init.Nat.add (S sz2) n)) (@combine sz1 w1 (Init.Nat.add (S sz2) n) (@sext (S sz2) w2 n))) (@existT nat word (Init.Nat.add (Init.Nat.add sz1 (S sz2)) n) (@sext (Init.Nat.add sz1 (S sz2)) (@combine sz1 w1 (S sz2) w2) n)) *) unfold sext; intros. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 (Init.Nat.add (S sz2) n)) (@combine sz1 w1 (Init.Nat.add (S sz2) n) (if @wmsb (S sz2) w2 false then @combine (S sz2) w2 n (wones n) else @combine (S sz2) w2 n (wzero n)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz1 (S sz2)) n) (if @wmsb (Init.Nat.add sz1 (S sz2)) (@combine sz1 w1 (S sz2) w2) false then @combine (Init.Nat.add sz1 (S sz2)) (@combine sz1 w1 (S sz2) w2) n (wones n) else @combine (Init.Nat.add sz1 (S sz2)) (@combine sz1 w1 (S sz2) w2) n (wzero n))) *) rewrite wmsb_combine with (b2:= false) by discriminate. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz1 (Init.Nat.add (S sz2) n)) (@combine sz1 w1 (Init.Nat.add (S sz2) n) (if @wmsb (S sz2) w2 false then @combine (S sz2) w2 n (wones n) else @combine (S sz2) w2 n (wzero n)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz1 (S sz2)) n) (if @wmsb (S sz2) w2 false then @combine (Init.Nat.add sz1 (S sz2)) (@combine sz1 w1 (S sz2) w2) n (wones n) else @combine (Init.Nat.add sz1 (S sz2)) (@combine sz1 w1 (S sz2) w2) n (wzero n))) *) destruct (wmsb w2 false); apply combine_assoc_existT. Qed. Lemma extz_extz: forall sz (w: word sz) n1 n2, existT word _ (extz (extz w n1) n2) = existT word _ (extz w (n2 + n1)). Proof. (* Goal: forall (sz : nat) (w : word sz) (n1 n2 : nat), @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (Init.Nat.add n1 sz)) (@extz (Init.Nat.add n1 sz) (@extz sz w n1) n2)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 n1) sz) (@extz sz w (Init.Nat.add n2 n1))) *) unfold extz; cbn; intros. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n2 (Init.Nat.add n1 sz)) (@combine n2 (wzero n2) (Init.Nat.add n1 sz) (@combine n1 (wzero n1) sz w))) (@existT nat word (Init.Nat.add (Init.Nat.add n2 n1) sz) (@combine (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1)) sz w)) *) rewrite combine_assoc_existT. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add (Init.Nat.add n2 n1) sz) (@combine (Init.Nat.add n2 n1) (@combine n2 (wzero n2) n1 (wzero n1)) sz w)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 n1) sz) (@combine (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1)) sz w)) *) rewrite combine_wzero. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add (Init.Nat.add n2 n1) sz) (@combine (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1)) sz w)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 n1) sz) (@combine (Init.Nat.add n2 n1) (wzero (Init.Nat.add n2 n1)) sz w)) *) reflexivity. Qed. Lemma wrshifta_extz_sext: forall sz (w: word sz) n1 n2, existT word _ (wrshifta (extz w (n1 + n2)) n1) = existT word _ (sext (extz w n2) n1). Proof. (* Goal: forall (sz : nat) (w : word sz) (n1 n2 : nat), @eq (@sigT nat word) (@existT nat word (Init.Nat.add (Init.Nat.add n1 n2) sz) (@wrshifta (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 sz) n1) (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1)) *) intros. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add (Init.Nat.add n1 n2) sz) (@wrshifta (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) (@existT nat word (Init.Nat.add (Init.Nat.add n2 sz) n1) (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1)) *) rewrite <-extz_sext. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add (Init.Nat.add n1 n2) sz) (@wrshifta (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) (@existT nat word (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) *) apply wordToNat_existT; [omega|]. (* Goal: @eq nat (@wordToNat (Init.Nat.add (Init.Nat.add n1 n2) sz) (@wrshifta (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) (@wordToNat (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) *) rewrite wordToNat_wrshifta. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add (Init.Nat.add (Init.Nat.add n1 n2) sz) n1) (@sext (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) (Nat.pow (S (S O)) n1)) (@wordToNat (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) *) replace (wordToNat (sext (extz w (n1 + n2)) n1)) with (wordToNat (sext (extz (extz w n2) n1) n1)). (* Goal: @eq nat (@wordToNat (Init.Nat.add (Init.Nat.add n1 (Init.Nat.add n2 sz)) n1) (@sext (Init.Nat.add n1 (Init.Nat.add n2 sz)) (@extz (Init.Nat.add n2 sz) (@extz sz w n2) n1) n1)) (@wordToNat (Init.Nat.add (Init.Nat.add (Init.Nat.add n1 n2) sz) n1) (@sext (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) *) (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add (Init.Nat.add n1 (Init.Nat.add n2 sz)) n1) (@sext (Init.Nat.add n1 (Init.Nat.add n2 sz)) (@extz (Init.Nat.add n2 sz) (@extz sz w n2) n1) n1)) (Nat.pow (S (S O)) n1)) (@wordToNat (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) *) - (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add (Init.Nat.add n1 (Init.Nat.add n2 sz)) n1) (@sext (Init.Nat.add n1 (Init.Nat.add n2 sz)) (@extz (Init.Nat.add n2 sz) (@extz sz w n2) n1) n1)) (Nat.pow (S (S O)) n1)) (@wordToNat (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) *) replace (wordToNat (sext (extz (extz w n2) n1) n1)) with (wordToNat (extz (sext (extz w n2) n1) n1)) by apply existT_wordToNat, extz_sext. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add n1 (Init.Nat.add (Init.Nat.add n2 sz) n1)) (@extz (Init.Nat.add (Init.Nat.add n2 sz) n1) (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) n1)) (Nat.pow (S (S O)) n1)) (@wordToNat (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) *) do 2 rewrite wordToNat_extz. (* Goal: @eq nat (Nat.div (Init.Nat.mul (Nat.pow (S (S O)) n1) (@wordToNat (Init.Nat.add (Init.Nat.add n2 sz) n1) (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1))) (Nat.pow (S (S O)) n1)) (Init.Nat.mul (Nat.pow (S (S O)) n2) (@wordToNat (Init.Nat.add sz n1) (@sext sz w n1))) *) rewrite Nat.mul_comm, Nat.div_mul by (pose proof (zero_lt_pow2 n1); omega). (* Goal: @eq nat (@wordToNat (Init.Nat.add (Init.Nat.add n2 sz) n1) (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1)) (Init.Nat.mul (Nat.pow (S (S O)) n2) (@wordToNat (Init.Nat.add sz n1) (@sext sz w n1))) *) replace (wordToNat (sext (extz w n2) n1)) with (wordToNat (extz (sext w n1) n2)) by apply existT_wordToNat, extz_sext. (* Goal: @eq nat (@wordToNat (Init.Nat.add n2 (Init.Nat.add sz n1)) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2)) (Init.Nat.mul (Nat.pow (S (S O)) n2) (@wordToNat (Init.Nat.add sz n1) (@sext sz w n1))) *) rewrite wordToNat_extz. (* Goal: @eq nat (Init.Nat.mul (Nat.pow (S (S O)) n2) (@wordToNat (Init.Nat.add sz n1) (@sext sz w n1))) (Init.Nat.mul (Nat.pow (S (S O)) n2) (@wordToNat (Init.Nat.add sz n1) (@sext sz w n1))) *) reflexivity. (* BG Goal: @eq nat (@wordToNat (Init.Nat.add (Init.Nat.add n1 (Init.Nat.add n2 sz)) n1) (@sext (Init.Nat.add n1 (Init.Nat.add n2 sz)) (@extz (Init.Nat.add n2 sz) (@extz sz w n2) n1) n1)) (@wordToNat (Init.Nat.add (Init.Nat.add (Init.Nat.add n1 n2) sz) n1) (@sext (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) *) - (* Goal: @eq nat (@wordToNat (Init.Nat.add (Init.Nat.add n1 (Init.Nat.add n2 sz)) n1) (@sext (Init.Nat.add n1 (Init.Nat.add n2 sz)) (@extz (Init.Nat.add n2 sz) (@extz sz w n2) n1) n1)) (@wordToNat (Init.Nat.add (Init.Nat.add (Init.Nat.add n1 n2) sz) n1) (@sext (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2)) n1)) *) apply wordToNat_sext_bypass; [omega|]. (* Goal: @eq nat (@wordToNat (Init.Nat.add n1 (Init.Nat.add n2 sz)) (@extz (Init.Nat.add n2 sz) (@extz sz w n2) n1)) (@wordToNat (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2))) *) apply existT_wordToNat. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add n1 (Init.Nat.add n2 sz)) (@extz (Init.Nat.add n2 sz) (@extz sz w n2) n1)) (@existT nat word (Init.Nat.add (Init.Nat.add n1 n2) sz) (@extz sz w (Init.Nat.add n1 n2))) *) apply extz_extz. Qed. Lemma wordToNat_sext_modulo: forall sz (w: word sz) n, Nat.modulo (wordToNat (sext w n)) (pow2 sz) = wordToNat w. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) unfold sext; intros. (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (if @wmsb sz w false then @combine sz w n (wones n) else @combine sz w n (wzero n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) pose proof (zero_lt_pow2 sz). (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (if @wmsb sz w false then @combine sz w n (wones n) else @combine sz w n (wzero n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) destruct (wmsb w false). (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@combine sz w n (wzero n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@combine sz w n (wones n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) - (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@combine sz w n (wones n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) rewrite wordToNat_combine. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat n (wones n)))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) rewrite Nat.mul_comm, Nat.mod_add by omega. (* Goal: @eq nat (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) apply Nat.mod_small. (* Goal: lt (@wordToNat sz w) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. (* BG Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@combine sz w n (wzero n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) - (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@combine sz w n (wzero n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) rewrite wordToNat_combine. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat n (wzero n)))) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) rewrite Nat.mul_comm, Nat.mod_add by omega. (* Goal: @eq nat (Nat.modulo (@wordToNat sz w) (Nat.pow (S (S O)) sz)) (@wordToNat sz w) *) apply Nat.mod_small. (* Goal: lt (@wordToNat sz w) (Nat.pow (S (S O)) sz) *) apply wordToNat_bound. Qed. Lemma wlshift_sext_extz: forall sz (w: word sz) n, existT word _ (wlshift (sext w n) n) = existT word _ (extz w n). Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz n) (@wlshift (Init.Nat.add sz n) (@sext sz w n) n)) (@existT nat word (Init.Nat.add n sz) (@extz sz w n)) *) intros; apply wordToNat_existT; [omega|]. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz n) (@wlshift (Init.Nat.add sz n) (@sext sz w n) n)) (@wordToNat (Init.Nat.add n sz) (@extz sz w n)) *) rewrite wordToNat_wlshift. (* Goal: @eq nat (Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) (Init.Nat.sub (Init.Nat.add sz n) n))) (Nat.pow (S (S O)) n)) (@wordToNat (Init.Nat.add n sz) (@extz sz w n)) *) rewrite wordToNat_extz. (* Goal: @eq nat (Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) (Init.Nat.sub (Init.Nat.add sz n) n))) (Nat.pow (S (S O)) n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) *) replace (sz + n - n) with sz by omega. (* Goal: @eq nat (Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@sext sz w n)) (Nat.pow (S (S O)) sz)) (Nat.pow (S (S O)) n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) *) rewrite wordToNat_sext_modulo. (* Goal: @eq nat (Nat.mul (@wordToNat sz w) (Nat.pow (S (S O)) n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz w)) *) apply Nat.mul_comm. Qed. Lemma wlshift_combine_extz: forall sn sl (wl: word sl) ssu (wu: word (ssu + sn)), existT word (sl + (ssu + sn)) (wlshift (combine wl wu) sn) = existT word (sn + (sl + ssu)) (extz (combine wl (split1 ssu _ wu)) sn). Proof. (* Goal: forall (sn sl : nat) (wl : word sl) (ssu : nat) (wu : word (Init.Nat.add ssu sn)), @eq (@sigT nat word) (@existT nat word (Init.Nat.add sl (Init.Nat.add ssu sn)) (@wlshift (Init.Nat.add sl (Init.Nat.add ssu sn)) (@combine sl wl (Init.Nat.add ssu sn) wu) sn)) (@existT nat word (Init.Nat.add sn (Init.Nat.add sl ssu)) (@extz (Init.Nat.add sl ssu) (@combine sl wl ssu (split1 ssu sn wu)) sn)) *) intros; apply wordToNat_existT; [omega|]. (* Goal: @eq nat (@wordToNat (Init.Nat.add sl (Init.Nat.add ssu sn)) (@wlshift (Init.Nat.add sl (Init.Nat.add ssu sn)) (@combine sl wl (Init.Nat.add ssu sn) wu) sn)) (@wordToNat (Init.Nat.add sn (Init.Nat.add sl ssu)) (@extz (Init.Nat.add sl ssu) (@combine sl wl ssu (split1 ssu sn wu)) sn)) *) rewrite wordToNat_wlshift. (* Goal: @eq nat (Nat.mul (Nat.modulo (@wordToNat (Init.Nat.add sl (Init.Nat.add ssu sn)) (@combine sl wl (Init.Nat.add ssu sn) wu)) (Nat.pow (S (S O)) (Init.Nat.sub (Init.Nat.add sl (Init.Nat.add ssu sn)) sn))) (Nat.pow (S (S O)) sn)) (@wordToNat (Init.Nat.add sn (Init.Nat.add sl ssu)) (@extz (Init.Nat.add sl ssu) (@combine sl wl ssu (split1 ssu sn wu)) sn)) *) rewrite wordToNat_combine. (* Goal: @eq nat (Nat.mul (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) (Init.Nat.sub (Init.Nat.add sl (Init.Nat.add ssu sn)) sn))) (Nat.pow (S (S O)) sn)) (@wordToNat (Init.Nat.add sn (Init.Nat.add sl ssu)) (@extz (Init.Nat.add sl ssu) (@combine sl wl ssu (split1 ssu sn wu)) sn)) *) rewrite wordToNat_extz. (* Goal: @eq nat (Nat.mul (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) (Init.Nat.sub (Init.Nat.add sl (Init.Nat.add ssu sn)) sn))) (Nat.pow (S (S O)) sn)) (Init.Nat.mul (Nat.pow (S (S O)) sn) (@wordToNat (Init.Nat.add sl ssu) (@combine sl wl ssu (split1 ssu sn wu)))) *) rewrite wordToNat_combine. (* Goal: @eq nat (Nat.mul (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) (Init.Nat.sub (Init.Nat.add sl (Init.Nat.add ssu sn)) sn))) (Nat.pow (S (S O)) sn)) (Init.Nat.mul (Nat.pow (S (S O)) sn) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat ssu (split1 ssu sn wu))))) *) rewrite wordToNat_split1. (* Goal: @eq nat (Nat.mul (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) (Init.Nat.sub (Init.Nat.add sl (Init.Nat.add ssu sn)) sn))) (Nat.pow (S (S O)) sn)) (Init.Nat.mul (Nat.pow (S (S O)) sn) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu))))) *) replace (sl + (ssu + sn) - sn) with (sl + ssu) by omega. (* Goal: @eq nat (Nat.mul (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) (Init.Nat.add sl ssu))) (Nat.pow (S (S O)) sn)) (Init.Nat.mul (Nat.pow (S (S O)) sn) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu))))) *) rewrite Nat.mul_comm; f_equal. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) (Init.Nat.add sl ssu))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) rewrite pow2_add_mul. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.pow (S (S O)) ssu))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) pose proof (zero_lt_pow2 sl). (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.pow (S (S O)) ssu))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) pose proof (zero_lt_pow2 ssu). (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.pow (S (S O)) ssu))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) rewrite Nat.mod_mul_r; try omega. (* Goal: @eq nat (Nat.add (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) sl)) (Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (Nat.div (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) sl)) (Nat.pow (S (S O)) ssu)))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) rewrite Nat.mul_comm with (n:= pow2 sl) at 1. (* Goal: @eq nat (Nat.add (Nat.modulo (Init.Nat.add (@wordToNat sl wl) (Nat.mul (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) sl))) (Nat.pow (S (S O)) sl)) (Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (Nat.div (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) sl)) (Nat.pow (S (S O)) ssu)))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) rewrite Nat.mod_add; [|omega]. (* Goal: @eq nat (Nat.add (Nat.modulo (@wordToNat sl wl) (Nat.pow (S (S O)) sl)) (Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (Nat.div (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) sl)) (Nat.pow (S (S O)) ssu)))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) rewrite Nat.mod_small by apply wordToNat_bound. (* Goal: @eq nat (Nat.add (@wordToNat sl wl) (Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (Nat.div (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) sl)) (Nat.pow (S (S O)) ssu)))) (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (Nat.modulo (@wordToNat (Init.Nat.add ssu sn) wu) (Nat.pow (S (S O)) ssu)))) *) do 3 f_equal. (* Goal: @eq nat (Nat.div (Init.Nat.add (@wordToNat sl wl) (Init.Nat.mul (Nat.pow (S (S O)) sl) (@wordToNat (Init.Nat.add ssu sn) wu))) (Nat.pow (S (S O)) sl)) (@wordToNat (Init.Nat.add ssu sn) wu) *) rewrite Nat.mul_comm, Nat.div_add; [|omega]. (* Goal: @eq nat (Nat.add (Nat.div (@wordToNat sl wl) (Nat.pow (S (S O)) sl)) (@wordToNat (Init.Nat.add ssu sn) wu)) (@wordToNat (Init.Nat.add ssu sn) wu) *) rewrite Nat.div_small by apply wordToNat_bound. (* Goal: @eq nat (Nat.add O (@wordToNat (Init.Nat.add ssu sn) wu)) (@wordToNat (Init.Nat.add ssu sn) wu) *) reflexivity. Qed. Lemma extz_sext_eq_rect: forall sz (w: word sz) n1 n2 nsz Hnsz1, exists Hnsz2, eq_rect (n2 + (sz + n1)) word (extz (sext w n1) n2) nsz Hnsz1 = eq_rect (n2 + sz + n1) word (sext (extz w n2) n1) nsz Hnsz2. Proof. (* Goal: forall (sz : nat) (w : word sz) (n1 n2 nsz : nat) (Hnsz1 : @eq nat (Init.Nat.add n2 (Init.Nat.add sz n1)) nsz), @ex (@eq nat (Init.Nat.add (Init.Nat.add n2 sz) n1) nsz) (fun Hnsz2 : @eq nat (Init.Nat.add (Init.Nat.add n2 sz) n1) nsz => @eq (word nsz) (@eq_rect nat (Init.Nat.add n2 (Init.Nat.add sz n1)) word (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) nsz Hnsz1) (@eq_rect nat (Init.Nat.add (Init.Nat.add n2 sz) n1) word (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) nsz Hnsz2)) *) intros; subst; simpl. (* Goal: @ex (@eq nat (Init.Nat.add (Init.Nat.add n2 sz) n1) (Init.Nat.add n2 (Init.Nat.add sz n1))) (fun Hnsz2 : @eq nat (Init.Nat.add (Init.Nat.add n2 sz) n1) (Init.Nat.add n2 (Init.Nat.add sz n1)) => @eq (word (Init.Nat.add n2 (Init.Nat.add sz n1))) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@eq_rect nat (Init.Nat.add (Init.Nat.add n2 sz) n1) word (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) (Init.Nat.add n2 (Init.Nat.add sz n1)) Hnsz2)) *) assert (Hsz: n2 + sz + n1 = n2 + (sz + n1)) by omega. (* Goal: @ex (@eq nat (Init.Nat.add (Init.Nat.add n2 sz) n1) (Init.Nat.add n2 (Init.Nat.add sz n1))) (fun Hnsz2 : @eq nat (Init.Nat.add (Init.Nat.add n2 sz) n1) (Init.Nat.add n2 (Init.Nat.add sz n1)) => @eq (word (Init.Nat.add n2 (Init.Nat.add sz n1))) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@eq_rect nat (Init.Nat.add (Init.Nat.add n2 sz) n1) word (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) (Init.Nat.add n2 (Init.Nat.add sz n1)) Hnsz2)) *) exists Hsz. (* Goal: @eq (word (Init.Nat.add n2 (Init.Nat.add sz n1))) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@eq_rect nat (Init.Nat.add (Init.Nat.add n2 sz) n1) word (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) (Init.Nat.add n2 (Init.Nat.add sz n1)) Hsz) *) pose proof (extz_sext w n1 n2). (* Goal: @eq (word (Init.Nat.add n2 (Init.Nat.add sz n1))) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@eq_rect nat (Init.Nat.add (Init.Nat.add n2 sz) n1) word (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) (Init.Nat.add n2 (Init.Nat.add sz n1)) Hsz) *) pose proof (eq_sigT_snd H). (* Goal: @eq (word (Init.Nat.add n2 (Init.Nat.add sz n1))) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@eq_rect nat (Init.Nat.add (Init.Nat.add n2 sz) n1) word (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) (Init.Nat.add n2 (Init.Nat.add sz n1)) Hsz) *) rewrite <-H0. (* Goal: @eq (word (Init.Nat.add n2 (Init.Nat.add sz n1))) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@eq_rect nat (Init.Nat.add (Init.Nat.add n2 sz) n1) word (@eq_rect nat (Init.Nat.add n2 (Init.Nat.add sz n1)) word (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (Init.Nat.add (Init.Nat.add n2 sz) n1) (@eq_sigT_fst nat word (Init.Nat.add n2 (Init.Nat.add sz n1)) (Init.Nat.add (Init.Nat.add n2 sz) n1) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@sext (Init.Nat.add n2 sz) (@extz sz w n2) n1) H)) (Init.Nat.add n2 (Init.Nat.add sz n1)) Hsz) *) eq_rect_simpl. (* Goal: @eq (word (Init.Nat.add n2 (Init.Nat.add sz n1))) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) (@extz (Init.Nat.add sz n1) (@sext sz w n1) n2) *) reflexivity. Qed. Lemma sext_zero: forall n m, sext (natToWord n 0) m = natToWord _ 0. Proof. (* Goal: forall n m : nat, @eq (word (Init.Nat.add n m)) (@sext n (natToWord n O) m) (natToWord (Init.Nat.add n m) O) *) unfold sext; intros. (* Goal: @eq (word (Init.Nat.add n m)) (if @wmsb n (natToWord n O) false then @combine n (natToWord n O) m (wones m) else @combine n (natToWord n O) m (wzero m)) (natToWord (Init.Nat.add n m) O) *) rewrite wmsb_wzero. (* Goal: @eq (word (Init.Nat.add n m)) (@combine n (natToWord n O) m (wzero m)) (natToWord (Init.Nat.add n m) O) *) rewrite combine_wzero. (* Goal: @eq (word (Init.Nat.add n m)) (wzero (Init.Nat.add n m)) (natToWord (Init.Nat.add n m) O) *) reflexivity. Qed. Lemma sext_split1: forall sz (w: word sz) n, split1 sz _ (sext w n) = w. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq (word sz) (split1 sz n (@sext sz w n)) w *) unfold sext; intros. (* Goal: @eq (word sz) (split1 sz n (if @wmsb sz w false then @combine sz w n (wones n) else @combine sz w n (wzero n))) w *) destruct (wmsb w false); apply split1_combine. Qed. Lemma sext_sext: forall sz (w: word sz) n1 n2, existT word _ (sext w (n1 + n2)) = existT word _ (sext (sext w n1) n2). Proof. (* Goal: forall (sz : nat) (w : word sz) (n1 n2 : nat), @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (@sext sz w (Init.Nat.add n1 n2))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (@sext (Init.Nat.add sz n1) (@sext sz w n1) n2)) *) unfold sext; intros. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (if @wmsb sz w false then @combine sz w (Init.Nat.add n1 n2) (wones (Init.Nat.add n1 n2)) else @combine sz w (Init.Nat.add n1 n2) (wzero (Init.Nat.add n1 n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (if @wmsb (Init.Nat.add sz n1) (if @wmsb sz w false then @combine sz w n1 (wones n1) else @combine sz w n1 (wzero n1)) false then @combine (Init.Nat.add sz n1) (if @wmsb sz w false then @combine sz w n1 (wones n1) else @combine sz w n1 (wzero n1)) n2 (wones n2) else @combine (Init.Nat.add sz n1) (if @wmsb sz w false then @combine sz w n1 (wones n1) else @combine sz w n1 (wzero n1)) n2 (wzero n2))) *) remember (wmsb w false) as wmsb; destruct wmsb. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (@combine sz w (Init.Nat.add n1 n2) (wzero (Init.Nat.add n1 n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (if @wmsb (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) false then @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wones n2) else @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wzero n2))) *) (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (@combine sz w (Init.Nat.add n1 n2) (wones (Init.Nat.add n1 n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (if @wmsb (Init.Nat.add sz n1) (@combine sz w n1 (wones n1)) false then @combine (Init.Nat.add sz n1) (@combine sz w n1 (wones n1)) n2 (wones n2) else @combine (Init.Nat.add sz n1) (@combine sz w n1 (wones n1)) n2 (wzero n2))) *) - (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (@combine sz w (Init.Nat.add n1 n2) (wones (Init.Nat.add n1 n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (if @wmsb (Init.Nat.add sz n1) (@combine sz w n1 (wones n1)) false then @combine (Init.Nat.add sz n1) (@combine sz w n1 (wones n1)) n2 (wones n2) else @combine (Init.Nat.add sz n1) (@combine sz w n1 (wones n1)) n2 (wzero n2))) *) destruct n1 as [|n1]. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wzero n2))) *) (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add O n2)) (@combine sz w (Init.Nat.add O n2) (wones (Init.Nat.add O n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz O) n2) (if @wmsb (Init.Nat.add sz O) (@combine sz w O (wones O)) false then @combine (Init.Nat.add sz O) (@combine sz w O (wones O)) n2 (wones n2) else @combine (Init.Nat.add sz O) (@combine sz w O (wones O)) n2 (wzero n2))) *) + (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add O n2)) (@combine sz w (Init.Nat.add O n2) (wones (Init.Nat.add O n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz O) n2) (if @wmsb (Init.Nat.add sz O) (@combine sz w O (wones O)) false then @combine (Init.Nat.add sz O) (@combine sz w O (wones O)) n2 (wones n2) else @combine (Init.Nat.add sz O) (@combine sz w O (wones O)) n2 (wzero n2))) *) cbn; rewrite wmsb_combine_WO, <-Heqwmsb. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz n2) (@combine sz w n2 (wones n2))) (@existT nat word (Init.Nat.add (Init.Nat.add sz O) n2) (@combine (Init.Nat.add sz O) (@combine sz w O WO) n2 (wones n2))) *) rewrite <-combine_assoc_existT. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz n2) (@combine sz w n2 (wones n2))) (@existT nat word (Init.Nat.add sz (Init.Nat.add O n2)) (@combine sz w (Init.Nat.add O n2) (@combine O WO n2 (wones n2)))) *) reflexivity. (* BG Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (@combine sz w (Init.Nat.add n1 n2) (wzero (Init.Nat.add n1 n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (if @wmsb (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) false then @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wones n2) else @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wzero n2))) *) (* BG Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wzero n2))) *) + (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wzero n2))) *) rewrite wmsb_combine with (b2:= false) by discriminate. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (S n1) (wones (S n1)) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wzero n2))) *) rewrite wmsb_wones. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (@combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wones (S n1))) n2 (wones n2))) *) rewrite <-combine_assoc_existT. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (@combine (S n1) (wones (S n1)) n2 (wones n2)))) *) rewrite combine_wones. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wones (Init.Nat.add (S n1) n2)))) *) reflexivity. (* BG Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (@combine sz w (Init.Nat.add n1 n2) (wzero (Init.Nat.add n1 n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (if @wmsb (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) false then @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wones n2) else @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wzero n2))) *) - (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add n1 n2)) (@combine sz w (Init.Nat.add n1 n2) (wzero (Init.Nat.add n1 n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz n1) n2) (if @wmsb (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) false then @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wones n2) else @combine (Init.Nat.add sz n1) (@combine sz w n1 (wzero n1)) n2 (wzero n2))) *) destruct n1 as [|n1]. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wzero n2))) *) (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add O n2)) (@combine sz w (Init.Nat.add O n2) (wzero (Init.Nat.add O n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz O) n2) (if @wmsb (Init.Nat.add sz O) (@combine sz w O (wzero O)) false then @combine (Init.Nat.add sz O) (@combine sz w O (wzero O)) n2 (wones n2) else @combine (Init.Nat.add sz O) (@combine sz w O (wzero O)) n2 (wzero n2))) *) + (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add O n2)) (@combine sz w (Init.Nat.add O n2) (wzero (Init.Nat.add O n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz O) n2) (if @wmsb (Init.Nat.add sz O) (@combine sz w O (wzero O)) false then @combine (Init.Nat.add sz O) (@combine sz w O (wzero O)) n2 (wones n2) else @combine (Init.Nat.add sz O) (@combine sz w O (wzero O)) n2 (wzero n2))) *) cbn; rewrite wmsb_combine_WO, <-Heqwmsb. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz n2) (@combine sz w n2 (natToWord n2 O))) (@existT nat word (Init.Nat.add (Init.Nat.add sz O) n2) (@combine (Init.Nat.add sz O) (@combine sz w O WO) n2 (wzero n2))) *) rewrite <-combine_assoc_existT. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz n2) (@combine sz w n2 (natToWord n2 O))) (@existT nat word (Init.Nat.add sz (Init.Nat.add O n2)) (@combine sz w (Init.Nat.add O n2) (@combine O WO n2 (wzero n2)))) *) reflexivity. (* BG Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wzero n2))) *) + (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wzero n2))) *) rewrite wmsb_combine with (b2:= false) by discriminate. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (if @wmsb (S n1) (wzero (S n1)) false then @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wones n2) else @combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wzero n2))) *) rewrite wmsb_wzero. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add (Init.Nat.add sz (S n1)) n2) (@combine (Init.Nat.add sz (S n1)) (@combine sz w (S n1) (wzero (S n1))) n2 (wzero n2))) *) rewrite <-combine_assoc_existT. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (@combine (S n1) (wzero (S n1)) n2 (wzero n2)))) *) rewrite combine_wzero. (* Goal: @eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) (@existT nat word (Init.Nat.add sz (Init.Nat.add (S n1) n2)) (@combine sz w (Init.Nat.add (S n1) n2) (wzero (Init.Nat.add (S n1) n2)))) *) reflexivity. Qed. Lemma wneg_wordToN: forall sz (w: word sz), wordToN w <> 0%N -> wordToN (wneg w) = (Npow2 sz - wordToN w)%N. Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : not (@eq N (@wordToN sz w) N0)), @eq N (@wordToN sz (@wneg sz w)) (N.sub (Npow2 sz) (@wordToN sz w)) *) unfold wneg; intros. (* Goal: @eq N (@wordToN sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz w)))) (N.sub (Npow2 sz) (@wordToN sz w)) *) rewrite wordToN_NToWord_2. (* Goal: N.lt (N.sub (Npow2 sz) (@wordToN sz w)) (Npow2 sz) *) (* Goal: @eq N (N.sub (Npow2 sz) (@wordToN sz w)) (N.sub (Npow2 sz) (@wordToN sz w)) *) - (* Goal: @eq N (N.sub (Npow2 sz) (@wordToN sz w)) (N.sub (Npow2 sz) (@wordToN sz w)) *) reflexivity. (* BG Goal: N.lt (N.sub (Npow2 sz) (@wordToN sz w)) (Npow2 sz) *) - (* Goal: N.lt (N.sub (Npow2 sz) (@wordToN sz w)) (Npow2 sz) *) pose proof (wordToN_bound w). (* Goal: N.lt (N.sub (Npow2 sz) (@wordToN sz w)) (Npow2 sz) *) nomega. Qed. Lemma Nmul_two: forall n, (n + n = 2 * n)%N. Proof. (* Goal: forall n : N, @eq N (N.add n n) (N.mul (Npos (xO xH)) n) *) intros. (* Goal: @eq N (N.add n n) (N.mul (Npos (xO xH)) n) *) destruct n; simpl; auto. (* Goal: @eq N (Npos (Pos.add p p)) (Npos (xO p)) *) rewrite Pos.add_diag. (* Goal: @eq N (Npos (xO p)) (Npos (xO p)) *) reflexivity. Qed. Lemma wmsb_false_bound: forall sz (w: word (S sz)), wmsb w false = false -> (wordToN w < Npow2 sz)%N. Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (_ : @eq bool (@wmsb (S sz) w false) false), N.lt (@wordToN (S sz) w) (Npow2 sz) *) apply (induct_word_S (fun sz w => wmsb w false = false -> (wordToN w < Npow2 sz)%N)); [simpl; intros; subst; nomega|]. (* Goal: forall (b b0 : bool) (n : nat) (w : word n) (_ : forall _ : @eq bool (@wmsb (S n) (@WS b0 n w) false) false, N.lt (@wordToN (S n) (@WS b0 n w)) (Npow2 n)) (_ : @eq bool (@wmsb (S (S n)) (@WS b (S n) (@WS b0 n w)) false) false), N.lt (@wordToN (S (S n)) (@WS b (S n) (@WS b0 n w))) (Npow2 (S n)) *) intros; rewrite Npow2_S, Nmul_two. (* Goal: N.lt (@wordToN (S (S n)) (@WS b (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) specialize (H H0). (* Goal: N.lt (@wordToN (S (S n)) (@WS b (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) destruct b. (* Goal: N.lt (@wordToN (S (S n)) (@WS false (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) (* Goal: N.lt (@wordToN (S (S n)) (@WS true (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) - (* Goal: N.lt (@wordToN (S (S n)) (@WS true (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) rewrite wordToN_WS_1. (* Goal: N.lt (N.add (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w))) (Npos xH)) (N.mul (Npos (xO xH)) (Npow2 n)) *) rewrite N.add_comm. (* Goal: N.lt (N.add (Npos xH) (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w)))) (N.mul (Npos (xO xH)) (Npow2 n)) *) apply N.mul_2_mono_l; auto. (* BG Goal: N.lt (@wordToN (S (S n)) (@WS false (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) - (* Goal: N.lt (@wordToN (S (S n)) (@WS false (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) rewrite wordToN_WS_0. (* Goal: N.lt (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w))) (N.mul (Npos (xO xH)) (Npow2 n)) *) apply N.mul_lt_mono_pos_l; [nomega|]. (* Goal: N.lt (@wordToN (S n) (@WS b0 n w)) (Npow2 n) *) assumption. Qed. Lemma wmsb_true_bound: forall sz (w: word (S sz)), wmsb w false = true -> (Npow2 sz <= wordToN w)%N. Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (_ : @eq bool (@wmsb (S sz) w false) true), N.le (Npow2 sz) (@wordToN (S sz) w) *) apply (induct_word_S (fun sz w => wmsb w false = true -> (Npow2 sz <= wordToN w)%N)); [simpl; intros; subst; reflexivity|]. (* Goal: forall (b b0 : bool) (n : nat) (w : word n) (_ : forall _ : @eq bool (@wmsb (S n) (@WS b0 n w) false) true, N.le (Npow2 n) (@wordToN (S n) (@WS b0 n w))) (_ : @eq bool (@wmsb (S (S n)) (@WS b (S n) (@WS b0 n w)) false) true), N.le (Npow2 (S n)) (@wordToN (S (S n)) (@WS b (S n) (@WS b0 n w))) *) intros; rewrite Npow2_S, Nmul_two. (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (@wordToN (S (S n)) (@WS b (S n) (@WS b0 n w))) *) specialize (H H0). (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (@wordToN (S (S n)) (@WS b (S n) (@WS b0 n w))) *) destruct b. (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (@wordToN (S (S n)) (@WS false (S n) (@WS b0 n w))) *) (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (@wordToN (S (S n)) (@WS true (S n) (@WS b0 n w))) *) - (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (@wordToN (S (S n)) (@WS true (S n) (@WS b0 n w))) *) rewrite wordToN_WS_1. (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (N.add (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w))) (Npos xH)) *) apply N.mul_le_mono_nonneg_l with (p:= 2%N) in H; [|compute; discriminate]. (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (N.add (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w))) (Npos xH)) *) rewrite N.add_1_r. (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (N.succ (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w)))) *) apply N.le_le_succ_r. (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w))) *) assumption. (* BG Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (@wordToN (S (S n)) (@WS false (S n) (@WS b0 n w))) *) - (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (@wordToN (S (S n)) (@WS false (S n) (@WS b0 n w))) *) rewrite wordToN_WS_0. (* Goal: N.le (N.mul (Npos (xO xH)) (Npow2 n)) (N.mul (Npos (xO xH)) (@wordToN (S n) (@WS b0 n w))) *) apply N.mul_le_mono_nonneg_l; [compute; discriminate|]. (* Goal: N.le (Npow2 n) (@wordToN (S n) (@WS b0 n w)) *) assumption. Qed. Lemma ZToWord_wordToZ: forall sz (w: word sz), ZToWord sz (wordToZ w) = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (ZToWord sz (@wordToZ sz w)) w *) unfold ZToWord, wordToZ; intros. (* Goal: @eq (word sz) match (if @wmsb sz w false then match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end) with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) remember (wmsb w false) as msb; destruct msb. (* Goal: @eq (word sz) match match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) (* Goal: @eq (word sz) match match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) - (* Goal: @eq (word sz) match match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) remember (wordToN (wneg w)) as ww. (* Goal: @eq (word sz) match match ww with | N0 => Z0 | Npos x => Zneg x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) destruct ww. (* Goal: @eq (word sz) (@wneg sz (posToWord sz p)) w *) (* Goal: @eq (word sz) (wzero' sz) w *) + (* Goal: @eq (word sz) (wzero' sz) w *) assert (wneg w = wzero _). (* Goal: @eq (word sz) (wzero' sz) w *) (* Goal: @eq (word sz) (@wneg sz w) (wzero sz) *) { (* Goal: @eq (word sz) (@wneg sz w) (wzero sz) *) apply wordToN_inj; rewrite <-Heqww. (* Goal: @eq N N0 (@wordToN sz (wzero sz)) *) rewrite wordToN_nat. (* Goal: @eq N N0 (N.of_nat (@wordToNat sz (wzero sz))) *) rewrite roundTrip_0. (* Goal: @eq N N0 (N.of_nat O) *) reflexivity. (* BG Goal: @eq (word sz) match match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) (* BG Goal: @eq (word sz) (@wneg sz (posToWord sz p)) w *) (* BG Goal: @eq (word sz) (wzero' sz) w *) } (* Goal: @eq (word sz) (wzero' sz) w *) rewrite wzero'_def. (* Goal: @eq (word sz) (wzero sz) w *) rewrite <-wneg_idempotent, H. (* Goal: @eq (word sz) (wzero sz) (@wneg sz (wzero sz)) *) apply eq_sym, wzero_wneg. (* BG Goal: @eq (word sz) match match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) (* BG Goal: @eq (word sz) (@wneg sz (posToWord sz p)) w *) + (* Goal: @eq (word sz) (@wneg sz (posToWord sz p)) w *) assert (wneg w = NToWord _ (N.pos p)). (* Goal: @eq (word sz) (@wneg sz (posToWord sz p)) w *) (* Goal: @eq (word sz) (@wneg sz w) (NToWord sz (Npos p)) *) { (* Goal: @eq (word sz) (@wneg sz w) (NToWord sz (Npos p)) *) apply wordToN_inj; rewrite Heqww. (* Goal: @eq N (@wordToN sz (@wneg sz w)) (@wordToN sz (NToWord sz (@wordToN sz (@wneg sz w)))) *) rewrite NToWord_wordToN. (* Goal: @eq N (@wordToN sz (@wneg sz w)) (@wordToN sz (@wneg sz w)) *) reflexivity. (* BG Goal: @eq (word sz) match match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) (* BG Goal: @eq (word sz) (@wneg sz (posToWord sz p)) w *) } (* Goal: @eq (word sz) (@wneg sz (posToWord sz p)) w *) rewrite <-wneg_idempotent, H. (* Goal: @eq (word sz) (@wneg sz (posToWord sz p)) (@wneg sz (NToWord sz (Npos p))) *) reflexivity. (* BG Goal: @eq (word sz) match match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) - (* Goal: @eq (word sz) match match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) remember (wordToN w) as ww. (* Goal: @eq (word sz) match match ww with | N0 => Z0 | Npos x => Zpos x end with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end w *) destruct ww. (* Goal: @eq (word sz) (posToWord sz p) w *) (* Goal: @eq (word sz) (wzero' sz) w *) + (* Goal: @eq (word sz) (wzero' sz) w *) assert (w = wzero _); subst. (* Goal: @eq (word sz) (wzero' sz) (wzero sz) *) (* Goal: @eq (word sz) w (wzero sz) *) { (* Goal: @eq (word sz) w (wzero sz) *) apply wordToN_inj; rewrite <-Heqww. (* Goal: @eq N N0 (@wordToN sz (wzero sz)) *) rewrite wordToN_nat. (* Goal: @eq N N0 (N.of_nat (@wordToNat sz (wzero sz))) *) rewrite roundTrip_0. (* Goal: @eq N N0 (N.of_nat O) *) reflexivity. (* BG Goal: @eq (word sz) (posToWord sz p) w *) (* BG Goal: @eq (word sz) (wzero' sz) (wzero sz) *) } (* Goal: @eq (word sz) (wzero' sz) (wzero sz) *) apply wzero'_def. (* BG Goal: @eq (word sz) (posToWord sz p) w *) + (* Goal: @eq (word sz) (posToWord sz p) w *) assert (w = NToWord _ (N.pos p)); subst. (* Goal: @eq (word sz) (posToWord sz p) (NToWord sz (Npos p)) *) (* Goal: @eq (word sz) w (NToWord sz (Npos p)) *) { (* Goal: @eq (word sz) w (NToWord sz (Npos p)) *) apply wordToN_inj; rewrite Heqww. (* Goal: @eq N (@wordToN sz w) (@wordToN sz (NToWord sz (@wordToN sz w))) *) rewrite NToWord_wordToN. (* Goal: @eq N (@wordToN sz w) (@wordToN sz w) *) reflexivity. (* BG Goal: @eq (word sz) (posToWord sz p) (NToWord sz (Npos p)) *) } (* Goal: @eq (word sz) (posToWord sz p) (NToWord sz (Npos p)) *) reflexivity. Qed. Lemma wordToZ_ZToWord: forall z sz, (- Z.of_nat (pow2 sz) <= z < Z.of_nat (pow2 sz))%Z -> Proof. (* Goal: forall (z : Z) (sz : nat) (_ : and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) z) (Z.lt z (Z.of_nat (Nat.pow (S (S O)) sz)))), @eq Z (@wordToZ (S sz) (ZToWord (S sz) z)) z *) unfold wordToZ, ZToWord; intros. (* Goal: @eq Z (if @wmsb (S sz) match z with | Z0 => wzero' (S sz) | Zpos x => posToWord (S sz) x | Zneg x => @wneg (S sz) (posToWord (S sz) x) end false then match @wordToN (S sz) (@wneg (S sz) match z with | Z0 => wzero' (S sz) | Zpos x => posToWord (S sz) x | Zneg x => @wneg (S sz) (posToWord (S sz) x) end) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) match z with | Z0 => wzero' (S sz) | Zpos x => posToWord (S sz) x | Zneg x => @wneg (S sz) (posToWord (S sz) x) end with | N0 => Z0 | Npos x => Zpos x end) z *) destruct z. (* Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (posToWord (S sz) p)) false then match @wordToN (S sz) (@wneg (S sz) (@wneg (S sz) (posToWord (S sz) p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) (* Goal: @eq Z (if @wmsb (S sz) (posToWord (S sz) p) false then match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (posToWord (S sz) p) with | N0 => Z0 | Npos x => Zpos x end) (Zpos p) *) (* Goal: @eq Z (if @wmsb (S sz) (wzero' (S sz)) false then match @wordToN (S sz) (@wneg (S sz) (wzero' (S sz))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (wzero' (S sz)) with | N0 => Z0 | Npos x => Zpos x end) Z0 *) - (* Goal: @eq Z (if @wmsb (S sz) (wzero' (S sz)) false then match @wordToN (S sz) (@wneg (S sz) (wzero' (S sz))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (wzero' (S sz)) with | N0 => Z0 | Npos x => Zpos x end) Z0 *) rewrite wmsb_wzero'. (* Goal: @eq Z match @wordToN (S sz) (wzero' (S sz)) with | N0 => Z0 | Npos x => Zpos x end Z0 *) rewrite wordToN_wzero'. (* Goal: @eq Z Z0 Z0 *) reflexivity. (* BG Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (posToWord (S sz) p)) false then match @wordToN (S sz) (@wneg (S sz) (@wneg (S sz) (posToWord (S sz) p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) (* BG Goal: @eq Z (if @wmsb (S sz) (posToWord (S sz) p) false then match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (posToWord (S sz) p) with | N0 => Z0 | Npos x => Zpos x end) (Zpos p) *) - (* Goal: @eq Z (if @wmsb (S sz) (posToWord (S sz) p) false then match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (posToWord (S sz) p) with | N0 => Z0 | Npos x => Zpos x end) (Zpos p) *) rewrite posToWord_nat. (* Goal: @eq Z (if @wmsb (S sz) (natToWord (S sz) (Pos.to_nat p)) false then match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zpos x end) (Zpos p) *) remember (wmsb (natToWord (S sz) (Pos.to_nat p)) false) as msb. (* Goal: @eq Z (if msb then match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zpos x end) (Zpos p) *) destruct msb. (* Goal: @eq Z match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zpos x end (Zpos p) *) (* Goal: @eq Z match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zneg x end (Zpos p) *) + (* Goal: @eq Z match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zneg x end (Zpos p) *) exfalso. (* Goal: False *) simpl in H; destruct H. (* Goal: False *) apply eq_sym, wmsb_true_bound in Heqmsb. (* Goal: False *) rewrite <-positive_N_nat, <-NToWord_nat in Heqmsb. (* Goal: False *) rewrite <-positive_nat_Z in H0. (* Goal: False *) apply Nat2Z.inj_lt in H0. (* Goal: False *) rewrite <-positive_N_nat, <-Npow2_nat in H0. (* Goal: False *) apply Nlt_in in H0. (* Goal: False *) pose proof (wordToN_NToWord (S sz) (N.pos p)). (* Goal: False *) destruct H1 as [k [? ?]]. (* Goal: False *) rewrite H1 in Heqmsb. (* Goal: False *) assert (N.pos p - k * Npow2 (S sz) <= N.pos p)%N by apply N.le_sub_l. (* Goal: False *) assert (Npow2 sz <= N.pos p)%N by (etransitivity; eassumption). (* Goal: False *) apply N.le_ngt in H4; auto. (* BG Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (posToWord (S sz) p)) false then match @wordToN (S sz) (@wneg (S sz) (@wneg (S sz) (posToWord (S sz) p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) (* BG Goal: @eq Z match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zpos x end (Zpos p) *) + (* Goal: @eq Z match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zpos x end (Zpos p) *) rewrite wordToN_nat, wordToNat_natToWord_2. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) (* Goal: @eq Z match N.of_nat (Pos.to_nat p) with | N0 => Z0 | Npos x => Zpos x end (Zpos p) *) * (* Goal: @eq Z match N.of_nat (Pos.to_nat p) with | N0 => Z0 | Npos x => Zpos x end (Zpos p) *) rewrite positive_nat_N; reflexivity. (* BG Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (posToWord (S sz) p)) false then match @wordToN (S sz) (@wneg (S sz) (@wneg (S sz) (posToWord (S sz) p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) (* BG Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) * (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) rewrite <-Npow2_nat, <-positive_N_nat. (* Goal: lt (N.to_nat (Npos p)) (N.to_nat (Npow2 (S sz))) *) apply Nlt_out. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) destruct H. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) rewrite <-N2Z.inj_pos, <-N_nat_Z in H0. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) apply Nat2Z.inj_lt in H0. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) rewrite <-Npow2_nat in H0. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) apply Nlt_in. (* Goal: lt (N.to_nat (Npos p)) (N.to_nat (Npow2 (S sz))) *) rewrite Npow2_S, N2Nat.inj_add. (* Goal: lt (N.to_nat (Npos p)) (Init.Nat.add (N.to_nat (Npow2 sz)) (N.to_nat (Npow2 sz))) *) omega. (* BG Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (posToWord (S sz) p)) false then match @wordToN (S sz) (@wneg (S sz) (@wneg (S sz) (posToWord (S sz) p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) - (* Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (posToWord (S sz) p)) false then match @wordToN (S sz) (@wneg (S sz) (@wneg (S sz) (posToWord (S sz) p))) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) rewrite wneg_idempotent. (* Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (posToWord (S sz) p)) false then match @wordToN (S sz) (posToWord (S sz) p) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (posToWord (S sz) p)) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) rewrite posToWord_nat. (* Goal: @eq Z (if @wmsb (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) false then match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) remember (wmsb (wneg (natToWord (S sz) (Pos.to_nat p))) false) as msb. (* Goal: @eq Z (if msb then match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zpos x end) (Zneg p) *) destruct msb. (* Goal: @eq Z match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zpos x end (Zneg p) *) (* Goal: @eq Z match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zneg x end (Zneg p) *) + (* Goal: @eq Z match @wordToN (S sz) (natToWord (S sz) (Pos.to_nat p)) with | N0 => Z0 | Npos x => Zneg x end (Zneg p) *) rewrite wordToN_nat, wordToNat_natToWord_2. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) (* Goal: @eq Z match N.of_nat (Pos.to_nat p) with | N0 => Z0 | Npos x => Zneg x end (Zneg p) *) * (* Goal: @eq Z match N.of_nat (Pos.to_nat p) with | N0 => Z0 | Npos x => Zneg x end (Zneg p) *) rewrite positive_nat_N; reflexivity. (* BG Goal: @eq Z match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zpos x end (Zneg p) *) (* BG Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) * (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) rewrite <-Npow2_nat, <-positive_N_nat. (* Goal: lt (N.to_nat (Npos p)) (N.to_nat (Npow2 (S sz))) *) apply Nlt_out. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) destruct H. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) apply Z.opp_le_mono in H. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) rewrite Pos2Z.opp_neg, Z.opp_involutive in H. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) rewrite <-N2Z.inj_pos, <-N_nat_Z in H. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) apply Nat2Z.inj_le in H. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) rewrite <-Npow2_nat in H. (* Goal: N.lt (Npos p) (Npow2 (S sz)) *) apply Nlt_in. (* Goal: lt (N.to_nat (Npos p)) (N.to_nat (Npow2 (S sz))) *) rewrite Npow2_S, N2Nat.inj_add. (* Goal: lt (N.to_nat (Npos p)) (Init.Nat.add (N.to_nat (Npow2 sz)) (N.to_nat (Npow2 sz))) *) assert (N.to_nat (Npow2 sz) > 0)%nat by (rewrite Npow2_nat; apply pow2_zero). (* Goal: lt (N.to_nat (Npos p)) (Init.Nat.add (N.to_nat (Npow2 sz)) (N.to_nat (Npow2 sz))) *) omega. (* BG Goal: @eq Z match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zpos x end (Zneg p) *) + (* Goal: @eq Z match @wordToN (S sz) (@wneg (S sz) (natToWord (S sz) (Pos.to_nat p))) with | N0 => Z0 | Npos x => Zpos x end (Zneg p) *) exfalso. (* Goal: False *) simpl in H. (* Goal: False *) apply eq_sym, wmsb_false_bound in Heqmsb. (* Goal: False *) rewrite wneg_wordToN in Heqmsb. (* Goal: not (@eq N (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) N0) *) (* Goal: False *) * (* Goal: False *) rewrite Npow2_S in Heqmsb. (* Goal: False *) rewrite <-N.add_0_r in Heqmsb. (* Goal: False *) rewrite <-N.add_sub_assoc in Heqmsb. (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) (* Goal: False *) { (* Goal: False *) apply N.add_lt_mono_l in Heqmsb. (* Goal: False *) exfalso; eapply N.nlt_0_r; eauto. (* BG Goal: not (@eq N (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) N0) *) (* BG Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) } (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) { (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) destruct H. (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) apply Z.opp_le_mono in H. (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) rewrite Pos2Z.opp_neg, Z.opp_involutive in H. (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) rewrite <-N2Z.inj_pos, <-N_nat_Z in H. (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) apply Nat2Z.inj_le in H. (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) rewrite positive_N_nat in H. (* Goal: N.le (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) (Npow2 sz) *) rewrite <-positive_N_nat, <-NToWord_nat. (* Goal: N.le (@wordToN (S sz) (NToWord (S sz) (Npos p))) (Npow2 sz) *) pose proof (wordToN_NToWord (S sz) (N.pos p)). (* Goal: N.le (@wordToN (S sz) (NToWord (S sz) (Npos p))) (Npow2 sz) *) destruct H1 as [k [? ?]]; rewrite H1. (* Goal: N.le (N.sub (Npos p) (N.mul k (Npow2 (S sz)))) (Npow2 sz) *) etransitivity; [apply N.le_sub_l|]. (* Goal: N.le (Npos p) (Npow2 sz) *) rewrite <-Npow2_nat in H. (* Goal: N.le (Npos p) (Npow2 sz) *) rewrite <-positive_N_nat in H. (* Goal: N.le (Npos p) (Npow2 sz) *) unfold N.le; rewrite N2Nat.inj_compare. (* Goal: not (@eq comparison (Nat.compare (N.to_nat (Npos p)) (N.to_nat (Npow2 sz))) Gt) *) apply nat_compare_le; auto. (* BG Goal: not (@eq N (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) N0) *) } (* BG Goal: not (@eq N (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) N0) *) * (* Goal: not (@eq N (@wordToN (S sz) (natToWord (S sz) (Pos.to_nat p))) N0) *) intro Hx. (* Goal: False *) replace 0%N with (wordToN (wzero (S sz))) in Hx by apply wordToN_wzero. (* Goal: False *) apply wordToN_inj in Hx. (* Goal: False *) assert (wordToNat (natToWord (S sz) (Pos.to_nat p)) = 0) by (rewrite Hx; apply wordToNat_wzero). (* Goal: False *) rewrite wordToNat_natToWord_2 in H0. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) (* Goal: False *) { (* Goal: False *) clear -H0. (* Goal: False *) induction p; simpl in H0; try discriminate. (* Goal: False *) elim IHp; rewrite Pos2Nat.inj_xO in H0; omega. (* BG Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) } (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) { (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) destruct H. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) apply Z.opp_le_mono in H. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) rewrite Pos2Z.opp_neg, Z.opp_involutive in H. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) rewrite <-N2Z.inj_pos, <-N_nat_Z in H. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) apply Nat2Z.inj_le in H. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) rewrite positive_N_nat in H. (* Goal: lt (Pos.to_nat p) (Nat.pow (S (S O)) (S sz)) *) simpl. (* Goal: lt (Pos.to_nat p) (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) *) pose proof (pow2_zero sz). (* Goal: lt (Pos.to_nat p) (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) *) omega. Qed. Lemma wordToZ_ZToWord'': forall (sz: nat), (0 < sz)%nat -> forall n: Z, (- 2 ^ (Z.of_nat sz - 1) <= n < 2 ^ (Z.of_nat sz - 1))%Z -> Proof. (* Goal: forall (sz : nat) (_ : lt O sz) (n : Z) (_ : and (Z.le (Z.opp (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat sz) (Zpos xH)))) n) (Z.lt n (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat sz) (Zpos xH))))), @eq Z (@wordToZ sz (ZToWord sz n)) n *) intros. (* Goal: @eq Z (@wordToZ sz (ZToWord sz n)) n *) destruct sz; [lia|]. (* Goal: @eq Z (@wordToZ (S sz) (ZToWord (S sz) n)) n *) apply wordToZ_ZToWord. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) n) (Z.lt n (Z.of_nat (Nat.pow (S (S O)) sz))) *) replace (Z.of_nat (S sz) - 1)%Z with (Z.of_nat sz) in * by lia. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) n) (Z.lt n (Z.of_nat (Nat.pow (S (S O)) sz))) *) rewrite Nat2Z.inj_pow. (* Goal: and (Z.le (Z.opp (Z.pow (Z.of_nat (S (S O))) (Z.of_nat sz))) n) (Z.lt n (Z.pow (Z.of_nat (S (S O))) (Z.of_nat sz))) *) assumption. Qed. Lemma wordToZ_wordToN: forall sz (w: word sz), wordToZ w = (Z.of_N (wordToN w) - Z.of_N (if wmsb w false then Npow2 sz else 0))%Z. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq Z (@wordToZ sz w) (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (if @wmsb sz w false then Npow2 sz else N0))) *) unfold wordToZ; intros. (* Goal: @eq Z (if @wmsb sz w false then match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end) (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (if @wmsb sz w false then Npow2 sz else N0))) *) remember (wmsb w false) as msb; destruct msb; [|simpl; rewrite Z.sub_0_r; reflexivity]. (* Goal: @eq Z match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (Npow2 sz))) *) destruct (weq w (wzero _)); subst; [rewrite wmsb_wzero in Heqmsb; discriminate|]. (* Goal: @eq Z match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (Npow2 sz))) *) rewrite wneg_wordToN. (* Goal: not (@eq N (@wordToN sz w) N0) *) (* Goal: @eq Z match N.sub (Npow2 sz) (@wordToN sz w) with | N0 => Z0 | Npos x => Zneg x end (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (Npow2 sz))) *) - (* Goal: @eq Z match N.sub (Npow2 sz) (@wordToN sz w) with | N0 => Z0 | Npos x => Zneg x end (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (Npow2 sz))) *) pose proof (wordToN_bound w). (* Goal: @eq Z match N.sub (Npow2 sz) (@wordToN sz w) with | N0 => Z0 | Npos x => Zneg x end (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (Npow2 sz))) *) replace (Z.of_N (wordToN w) - Z.of_N (Npow2 sz))%Z with (- (Z.of_N (Npow2 sz) - Z.of_N (wordToN w)))%Z by omega. (* Goal: @eq Z match N.sub (Npow2 sz) (@wordToN sz w) with | N0 => Z0 | Npos x => Zneg x end (Z.opp (Z.sub (Z.of_N (Npow2 sz)) (Z.of_N (@wordToN sz w)))) *) rewrite <-N2Z.inj_sub by (apply N.lt_le_incl; assumption). (* Goal: @eq Z match N.sub (Npow2 sz) (@wordToN sz w) with | N0 => Z0 | Npos x => Zneg x end (Z.opp (Z.of_N (N.sub (Npow2 sz) (@wordToN sz w)))) *) clear; destruct (Npow2 sz - wordToN w)%N; reflexivity. (* BG Goal: not (@eq N (@wordToN sz w) N0) *) - (* Goal: not (@eq N (@wordToN sz w) N0) *) intro Hx; elim n. (* Goal: @eq (word sz) w (wzero sz) *) rewrite <-wordToN_wzero with (sz:= sz) in Hx. (* Goal: @eq (word sz) w (wzero sz) *) apply wordToN_inj in Hx; auto. Qed. Lemma ZToWord_Z_of_N: forall sz n, ZToWord sz (Z.of_N n) = NToWord sz n. Proof. (* Goal: forall (sz : nat) (n : N), @eq (word sz) (ZToWord sz (Z.of_N n)) (NToWord sz n) *) unfold ZToWord, NToWord; intros. (* Goal: @eq (word sz) match Z.of_N n with | Z0 => wzero' sz | Zpos x => posToWord sz x | Zneg x => @wneg sz (posToWord sz x) end match n with | N0 => wzero' sz | Npos p => posToWord sz p end *) destruct n; reflexivity. Qed. Lemma ZToWord_Z_of_nat: forall sz x, ZToWord sz (Z.of_nat x) = natToWord sz x. Proof. (* Goal: forall sz x : nat, @eq (word sz) (ZToWord sz (Z.of_nat x)) (natToWord sz x) *) intros. (* Goal: @eq (word sz) (ZToWord sz (Z.of_nat x)) (natToWord sz x) *) rewrite <- nat_N_Z. (* Goal: @eq (word sz) (ZToWord sz (Z.of_N (N.of_nat x))) (natToWord sz x) *) rewrite ZToWord_Z_of_N. (* Goal: @eq (word sz) (NToWord sz (N.of_nat x)) (natToWord sz x) *) rewrite NToWord_nat. (* Goal: @eq (word sz) (natToWord sz (N.to_nat (N.of_nat x))) (natToWord sz x) *) rewrite Nnat.Nat2N.id. (* Goal: @eq (word sz) (natToWord sz x) (natToWord sz x) *) reflexivity. Qed. Lemma natToWord_Z_to_nat: forall sz n, (0 <= n)%Z -> natToWord sz (Z.to_nat n) = ZToWord sz n. Proof. (* Goal: forall (sz : nat) (n : Z) (_ : Z.le Z0 n), @eq (word sz) (natToWord sz (Z.to_nat n)) (ZToWord sz n) *) intros. (* Goal: @eq (word sz) (natToWord sz (Z.to_nat n)) (ZToWord sz n) *) rewrite <- ZToWord_Z_of_nat. (* Goal: @eq (word sz) (ZToWord sz (Z.of_nat (Z.to_nat n))) (ZToWord sz n) *) rewrite Z2Nat.id by assumption. (* Goal: @eq (word sz) (ZToWord sz n) (ZToWord sz n) *) reflexivity. Qed. Lemma ZToWord_sz0: forall z, ZToWord 0 z = $0. Proof. (* Goal: forall z : Z, @eq (word O) (ZToWord O z) (natToWord O O) *) intros. (* Goal: @eq (word O) (ZToWord O z) (natToWord O O) *) unfold ZToWord. (* Goal: @eq (word O) match z with | Z0 => wzero' O | Zpos x => posToWord O x | Zneg x => @wneg O (posToWord O x) end (natToWord O O) *) destruct z; try rewrite posToWord_sz0; reflexivity. Qed. Lemma ZToWord_0: forall sz, ZToWord sz 0 = wzero sz. Proof. (* Goal: forall sz : nat, @eq (word sz) (ZToWord sz Z0) (wzero sz) *) intros. (* Goal: @eq (word sz) (ZToWord sz Z0) (wzero sz) *) unfold ZToWord. (* Goal: @eq (word sz) (wzero' sz) (wzero sz) *) apply wzero'_def. Qed. Lemma ZToWord_1{sz : nat}: ZToWord sz 1 = wone sz. Lemma natToWord_pow2_add: forall sz n, natToWord sz (n + pow2 sz) = natToWord sz n. Proof. (* Goal: forall sz n : nat, @eq (word sz) (natToWord sz (Init.Nat.add n (Nat.pow (S (S O)) sz))) (natToWord sz n) *) induction sz; intros; [reflexivity|]. (* Goal: @eq (word (S sz)) (natToWord (S sz) (Init.Nat.add n (Nat.pow (S (S O)) (S sz)))) (natToWord (S sz) n) *) unfold natToWord, pow2; fold natToWord pow2. (* Goal: @eq (word (S sz)) (@WS (mod2 (Init.Nat.add n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))) sz (natToWord sz (Nat.div2 (Init.Nat.add n (Nat.mul (S (S O)) (Nat.pow (S (S O)) sz)))))) (@WS (mod2 n) sz (natToWord sz (Nat.div2 n))) *) rewrite drop_mod2_add, div2_plus_2, IHsz. (* Goal: @eq (word (S sz)) (@WS (mod2 n) sz (natToWord sz (Nat.div2 n))) (@WS (mod2 n) sz (natToWord sz (Nat.div2 n))) *) reflexivity. Qed. Lemma nat_add_pow2_wzero: forall sz n1 n2, n1 + n2 = pow2 sz -> natToWord sz n1 ^+ natToWord sz n2 = wzero sz. Proof. (* Goal: forall (sz n1 n2 : nat) (_ : @eq nat (Init.Nat.add n1 n2) (Nat.pow (S (S O)) sz)), @eq (word sz) (@wplus sz (natToWord sz n1) (natToWord sz n2)) (wzero sz) *) intros. (* Goal: @eq (word sz) (@wplus sz (natToWord sz n1) (natToWord sz n2)) (wzero sz) *) rewrite <-natToWord_plus, H. (* Goal: @eq (word sz) (natToWord sz (Nat.pow (S (S O)) sz)) (wzero sz) *) rewrite natToWord_pow2. (* Goal: @eq (word sz) (natToWord sz O) (wzero sz) *) reflexivity. Qed. Lemma Npos_Npow2_wzero: forall sz p1 p2, N.pos (p1 + p2) = Npow2 sz -> Proof. (* Goal: forall (sz : nat) (p1 p2 : positive) (_ : @eq N (Npos (Pos.add p1 p2)) (Npow2 sz)), @eq (word sz) (@wplus sz (posToWord sz p1) (posToWord sz p2)) (wzero sz) *) intros. (* Goal: @eq (word sz) (@wplus sz (posToWord sz p1) (posToWord sz p2)) (wzero sz) *) do 2 rewrite posToWord_nat. (* Goal: @eq (word sz) (@wplus sz (natToWord sz (Pos.to_nat p1)) (natToWord sz (Pos.to_nat p2))) (wzero sz) *) assert (Pos.to_nat p1 + Pos.to_nat p2 = pow2 sz). (* Goal: @eq (word sz) (@wplus sz (natToWord sz (Pos.to_nat p1)) (natToWord sz (Pos.to_nat p2))) (wzero sz) *) (* Goal: @eq nat (Init.Nat.add (Pos.to_nat p1) (Pos.to_nat p2)) (Nat.pow (S (S O)) sz) *) { (* Goal: @eq nat (Init.Nat.add (Pos.to_nat p1) (Pos.to_nat p2)) (Nat.pow (S (S O)) sz) *) rewrite <-Pos2Nat.inj_add, <-Npow2_nat. (* Goal: @eq nat (Pos.to_nat (Pos.add p1 p2)) (N.to_nat (Npow2 sz)) *) rewrite <-positive_N_nat. (* Goal: @eq nat (N.to_nat (Npos (Pos.add p1 p2))) (N.to_nat (Npow2 sz)) *) rewrite H; reflexivity. (* BG Goal: @eq (word sz) (@wplus sz (natToWord sz (Pos.to_nat p1)) (natToWord sz (Pos.to_nat p2))) (wzero sz) *) } (* Goal: @eq (word sz) (@wplus sz (natToWord sz (Pos.to_nat p1)) (natToWord sz (Pos.to_nat p2))) (wzero sz) *) apply nat_add_pow2_wzero; auto. Qed. Lemma ZToWord_Npow2_sub: forall sz z, ZToWord sz (z - Z.of_N (Npow2 sz)) = ZToWord sz z. Lemma wplus_wplusZ: forall sz (w1 w2: word sz), w1 ^+ w2 = wplusZ w1 w2. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (@wplus sz w1 w2) (@wplusZ sz w1 w2) *) unfold wplus, wplusZ, wordBin, wordBinZ; intros. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.add (@wordToZ sz w1) (@wordToZ sz w2))) *) do 2 rewrite wordToZ_wordToN. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.add (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (if @wmsb sz w1 false then Npow2 sz else N0))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0))))) *) match goal with | [ |- context[(?z1 - ?z2 + (?z3 - ?z4))%Z] ] => replace (z1 - z2 + (z3 - z4))%Z with (z1 + z3 - z2 - z4)%Z by omega end. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.add (Z.of_N (@wordToN sz w1)) (Z.of_N (@wordToN sz w2))) (Z.of_N (if @wmsb sz w1 false then Npow2 sz else N0))) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0)))) *) rewrite <-N2Z.inj_add. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N (if @wmsb sz w1 false then Npow2 sz else N0))) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0)))) *) destruct (wmsb w1 false); destruct (wmsb w2 false). (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N N0))) *) (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N (Npow2 sz)))) *) (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N (Npow2 sz))) (Z.of_N N0))) *) (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N (Npow2 sz))) (Z.of_N (Npow2 sz)))) *) - (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N (Npow2 sz))) (Z.of_N (Npow2 sz)))) *) simpl; do 2 rewrite ZToWord_Npow2_sub. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2)))) *) apply eq_sym, ZToWord_Z_of_N. (* BG Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N N0))) *) (* BG Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N (Npow2 sz)))) *) (* BG Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N (Npow2 sz))) (Z.of_N N0))) *) - (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N (Npow2 sz))) (Z.of_N N0))) *) simpl; rewrite Z.sub_0_r, ZToWord_Npow2_sub. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2)))) *) apply eq_sym, ZToWord_Z_of_N. (* BG Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N N0))) *) (* BG Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N (Npow2 sz)))) *) - (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N (Npow2 sz)))) *) simpl; rewrite Z.sub_0_r, ZToWord_Npow2_sub. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2)))) *) apply eq_sym, ZToWord_Z_of_N. (* BG Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N N0))) *) - (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.sub (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2))) (Z.of_N N0)) (Z.of_N N0))) *) simpl; do 2 rewrite Z.sub_0_r. (* Goal: @eq (word sz) (NToWord sz (N.add (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.of_N (N.add (@wordToN sz w1) (@wordToN sz w2)))) *) apply eq_sym, ZToWord_Z_of_N. Qed. Lemma ZToWord_Npow2_sub_k : forall (sz : nat) (z : Z) (k: nat), ZToWord sz (z - Z.of_nat k * Z.of_N (Npow2 sz)) = ZToWord sz z. Proof. (* Goal: forall (sz : nat) (z : Z) (k : nat), @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) intros. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) induction k. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat (S k)) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat O) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) - (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat O) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) simpl. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z Z0)) (ZToWord sz z) *) f_equal. (* Goal: @eq Z (Z.sub z Z0) z *) omega. (* BG Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat (S k)) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) - (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat (S k)) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) rewrite <- IHk. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat (S k)) (Z.of_N (Npow2 sz))))) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) *) replace (z - Z.of_nat (S k) * Z.of_N (Npow2 sz))%Z with ((z - Z.of_nat k * Z.of_N (Npow2 sz)) - Z.of_N (Npow2 sz))%Z by nia. (* Goal: @eq (word sz) (ZToWord sz (Z.sub (Z.sub z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz)))) (Z.of_N (Npow2 sz)))) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) *) apply ZToWord_Npow2_sub. Qed. Lemma ZToWord_Npow2_add_k : forall (sz : nat) (z : Z) (k: nat), ZToWord sz (z + Z.of_nat k * Z.of_N (Npow2 sz)) = ZToWord sz z. Proof. (* Goal: forall (sz : nat) (z : Z) (k : nat), @eq (word sz) (ZToWord sz (Z.add z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) intros. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) replace z with (z + Z.of_nat k * Z.of_N (Npow2 sz) - Z.of_nat k * Z.of_N (Npow2 sz))%Z at 2 by omega. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) (ZToWord sz (Z.sub (Z.add z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz)))) (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) *) symmetry. (* Goal: @eq (word sz) (ZToWord sz (Z.sub (Z.add z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz)))) (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) (ZToWord sz (Z.add z (Z.mul (Z.of_nat k) (Z.of_N (Npow2 sz))))) *) apply ZToWord_Npow2_sub_k. Qed. Lemma ZToWord_Npow2_sub_z : forall (sz : nat) (z : Z) (k: Z), ZToWord sz (z - k * Z.of_N (Npow2 sz)) = ZToWord sz z. Proof. (* Goal: forall (sz : nat) (z k : Z), @eq (word sz) (ZToWord sz (Z.sub z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) intros. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) destruct k. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Zneg p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Zpos p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul Z0 (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) - (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul Z0 (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) simpl. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z Z0)) (ZToWord sz z) *) f_equal. (* Goal: @eq Z (Z.sub z Z0) z *) omega. (* BG Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Zneg p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) (* BG Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Zpos p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) - (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Zpos p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) rewrite <- positive_nat_Z. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.of_nat (Pos.to_nat p)) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) apply ZToWord_Npow2_sub_k. (* BG Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Zneg p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) - (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Zneg p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) rewrite <- Pos2Z.opp_pos. (* Goal: @eq (word sz) (ZToWord sz (Z.sub z (Z.mul (Z.opp (Zpos p)) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) replace (z - - Z.pos p * Z.of_N (Npow2 sz))%Z with (z + Z.pos p * Z.of_N (Npow2 sz))%Z by nia. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul (Zpos p) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) rewrite <- positive_nat_Z. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul (Z.of_nat (Pos.to_nat p)) (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) apply ZToWord_Npow2_add_k. Qed. Lemma ZToWord_Npow2_add_k': forall sz z k, ZToWord sz (z + k * Z.of_N (Npow2 sz)) = ZToWord sz z. Proof. (* Goal: forall (sz : nat) (z k : Z), @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) intros. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) assert (0 <= k \/ k < 0)%Z as C by lia. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) destruct C as [C | C]. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) - (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) pose proof (ZToWord_Npow2_add_k sz z (Z.to_nat k)) as Q. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) rewrite Znat.Z2Nat.id in Q; assumption. (* BG Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) - (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) pose proof (ZToWord_Npow2_sub_k sz z (Z.to_nat (- k))) as Q. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) rewrite Znat.Z2Nat.id in Q by lia. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz z) *) rewrite <- Q. (* Goal: @eq (word sz) (ZToWord sz (Z.add z (Z.mul k (Z.of_N (Npow2 sz))))) (ZToWord sz (Z.sub z (Z.mul (Z.opp k) (Z.of_N (Npow2 sz))))) *) f_equal. (* Goal: @eq Z (Z.add z (Z.mul k (Z.of_N (Npow2 sz)))) (Z.sub z (Z.mul (Z.opp k) (Z.of_N (Npow2 sz)))) *) lia. Qed. Lemma wordToZ_ZToWord': forall sz w, exists k, wordToZ (ZToWord sz w) = (w - k * Z.of_N (Npow2 sz))%Z. Lemma ZToWord_plus: forall sz a b, ZToWord sz (a + b) = ZToWord sz a ^+ ZToWord sz b. Proof. (* Goal: forall (sz : nat) (a b : Z), @eq (word sz) (ZToWord sz (Z.add a b)) (@wplus sz (ZToWord sz a) (ZToWord sz b)) *) destruct sz as [|sz]; intros n m; intuition. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (@wplus (S sz) (ZToWord (S sz) n) (ZToWord (S sz) m)) *) rewrite wplus_wplusZ. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (@wplusZ (S sz) (ZToWord (S sz) n) (ZToWord (S sz) m)) *) unfold wplusZ, wordBinZ. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) (ZToWord (S sz) n)) (@wordToZ (S sz) (ZToWord (S sz) m)))) *) destruct (wordToZ_ZToWord' (S sz) n) as [k1 D1]. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) (ZToWord (S sz) n)) (@wordToZ (S sz) (ZToWord (S sz) m)))) *) destruct (wordToZ_ZToWord' (S sz) m) as [k2 D2]. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) (ZToWord (S sz) n)) (@wordToZ (S sz) (ZToWord (S sz) m)))) *) rewrite D1. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (ZToWord (S sz) (Z.add (Z.sub n (Z.mul k1 (Z.of_N (Npow2 (S sz))))) (@wordToZ (S sz) (ZToWord (S sz) m)))) *) rewrite D2. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (ZToWord (S sz) (Z.add (Z.sub n (Z.mul k1 (Z.of_N (Npow2 (S sz))))) (Z.sub m (Z.mul k2 (Z.of_N (Npow2 (S sz))))))) *) replace (n - k1 * Z.of_N (Npow2 (S sz)) + (m - k2 * Z.of_N (Npow2 (S sz))))%Z with (n + m - (k1 + k2) * Z.of_N (Npow2 (S sz)))%Z by nia. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add n m)) (ZToWord (S sz) (Z.sub (Z.add n m) (Z.mul (Z.add k1 k2) (Z.of_N (Npow2 (S sz)))))) *) symmetry. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.sub (Z.add n m) (Z.mul (Z.add k1 k2) (Z.of_N (Npow2 (S sz)))))) (ZToWord (S sz) (Z.add n m)) *) apply ZToWord_Npow2_sub_z. Qed. Lemma wplus_Z: forall sz (a b : word sz), a ^+ b = ZToWord sz (wordToZ a + wordToZ b). Proof. (* Goal: forall (sz : nat) (a b : word sz), @eq (word sz) (@wplus sz a b) (ZToWord sz (Z.add (@wordToZ sz a) (@wordToZ sz b))) *) intros. (* Goal: @eq (word sz) (@wplus sz a b) (ZToWord sz (Z.add (@wordToZ sz a) (@wordToZ sz b))) *) rewrite ZToWord_plus. (* Goal: @eq (word sz) (@wplus sz a b) (@wplus sz (ZToWord sz (@wordToZ sz a)) (ZToWord sz (@wordToZ sz b))) *) rewrite! ZToWord_wordToZ. (* Goal: @eq (word sz) (@wplus sz a b) (@wplus sz a b) *) reflexivity. Qed. Lemma else_0_to_ex_N: forall (b: bool) (a: N), exists k, (if b then a else 0%N) = (k * a)%N. Proof. (* Goal: forall (b : bool) (a : N), @ex N (fun k : N => @eq N (if b then a else N0) (N.mul k a)) *) intros. (* Goal: @ex N (fun k : N => @eq N (if b then a else N0) (N.mul k a)) *) destruct b. (* Goal: @ex N (fun k : N => @eq N N0 (N.mul k a)) *) (* Goal: @ex N (fun k : N => @eq N a (N.mul k a)) *) - (* Goal: @ex N (fun k : N => @eq N a (N.mul k a)) *) exists 1%N. (* Goal: @eq N a (N.mul (Npos xH) a) *) nia. (* BG Goal: @ex N (fun k : N => @eq N N0 (N.mul k a)) *) - (* Goal: @ex N (fun k : N => @eq N N0 (N.mul k a)) *) exists 0%N. (* Goal: @eq N N0 (N.mul N0 a) *) reflexivity. Qed. Local Lemma wmultZ_helper: forall a b k1 k2 p, ((a - k1 * p) * (b - k2 * p) = a * b - (k1 * b + k2 * a - k1 * k2 * p) * p)%Z. Lemma wmult_wmultZ: forall (sz : nat) (w1 w2 : word sz), w1 ^* w2 = wmultZ w1 w2. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (@wmult sz w1 w2) (@wmultZ sz w1 w2) *) unfold wmultZ, wmult, wordBinZ, wordBin. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (@wordToZ sz w1) (@wordToZ sz w2))) *) intros. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (@wordToZ sz w1) (@wordToZ sz w2))) *) do 2 rewrite wordToZ_wordToN. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (if @wmsb sz w1 false then Npow2 sz else N0))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0))))) *) destruct (else_0_to_ex_N (wmsb w1 false) (Npow2 sz)) as [k1 E1]. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (if @wmsb sz w1 false then Npow2 sz else N0))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0))))) *) rewrite E1. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (N.mul k1 (Npow2 sz)))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0))))) *) clear E1. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (N.mul k1 (Npow2 sz)))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0))))) *) destruct (else_0_to_ex_N (wmsb w2 false) (Npow2 sz)) as [k2 E2]. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (N.mul k1 (Npow2 sz)))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (if @wmsb sz w2 false then Npow2 sz else N0))))) *) rewrite E2. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (N.mul k1 (Npow2 sz)))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (N.mul k2 (Npow2 sz)))))) *) clear E2. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.of_N (N.mul k1 (Npow2 sz)))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.of_N (N.mul k2 (Npow2 sz)))))) *) do 2 rewrite N2Z.inj_mul. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.mul (Z.sub (Z.of_N (@wordToN sz w1)) (Z.mul (Z.of_N k1) (Z.of_N (Npow2 sz)))) (Z.sub (Z.of_N (@wordToN sz w2)) (Z.mul (Z.of_N k2) (Z.of_N (Npow2 sz)))))) *) rewrite wmultZ_helper. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.mul (Z.of_N (@wordToN sz w1)) (Z.of_N (@wordToN sz w2))) (Z.mul (Z.sub (Z.add (Z.mul (Z.of_N k1) (Z.of_N (@wordToN sz w2))) (Z.mul (Z.of_N k2) (Z.of_N (@wordToN sz w1)))) (Z.mul (Z.mul (Z.of_N k1) (Z.of_N k2)) (Z.of_N (Npow2 sz)))) (Z.of_N (Npow2 sz))))) *) rewrite <- N2Z.inj_mul. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.sub (Z.of_N (N.mul (@wordToN sz w1) (@wordToN sz w2))) (Z.mul (Z.sub (Z.add (Z.mul (Z.of_N k1) (Z.of_N (@wordToN sz w2))) (Z.mul (Z.of_N k2) (Z.of_N (@wordToN sz w1)))) (Z.mul (Z.mul (Z.of_N k1) (Z.of_N k2)) (Z.of_N (Npow2 sz)))) (Z.of_N (Npow2 sz))))) *) rewrite ZToWord_Npow2_sub_z. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (ZToWord sz (Z.of_N (N.mul (@wordToN sz w1) (@wordToN sz w2)))) *) rewrite ZToWord_Z_of_N. (* Goal: @eq (word sz) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) (NToWord sz (N.mul (@wordToN sz w1) (@wordToN sz w2))) *) reflexivity. Qed. Lemma ZToWord_mult: forall sz a b, ZToWord sz (a * b) = ZToWord sz a ^* ZToWord sz b. Proof. (* Goal: forall (sz : nat) (a b : Z), @eq (word sz) (ZToWord sz (Z.mul a b)) (@wmult sz (ZToWord sz a) (ZToWord sz b)) *) intros. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (@wmult sz (ZToWord sz a) (ZToWord sz b)) *) rewrite wmult_wmultZ. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (@wmultZ sz (ZToWord sz a) (ZToWord sz b)) *) unfold wmultZ, wordBinZ. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.mul (@wordToZ sz (ZToWord sz a)) (@wordToZ sz (ZToWord sz b)))) *) destruct (wordToZ_ZToWord' sz a) as [k1 D1]. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.mul (@wordToZ sz (ZToWord sz a)) (@wordToZ sz (ZToWord sz b)))) *) rewrite D1. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.mul (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (@wordToZ sz (ZToWord sz b)))) *) clear D1. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.mul (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (@wordToZ sz (ZToWord sz b)))) *) destruct (wordToZ_ZToWord' sz b) as [k2 D2]. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.mul (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (@wordToZ sz (ZToWord sz b)))) *) rewrite D2. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.mul (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (Z.sub b (Z.mul k2 (Z.of_N (Npow2 sz)))))) *) clear D2. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.mul (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (Z.sub b (Z.mul k2 (Z.of_N (Npow2 sz)))))) *) rewrite wmultZ_helper. (* Goal: @eq (word sz) (ZToWord sz (Z.mul a b)) (ZToWord sz (Z.sub (Z.mul a b) (Z.mul (Z.sub (Z.add (Z.mul k1 b) (Z.mul k2 a)) (Z.mul (Z.mul k1 k2) (Z.of_N (Npow2 sz)))) (Z.of_N (Npow2 sz))))) *) symmetry. (* Goal: @eq (word sz) (ZToWord sz (Z.sub (Z.mul a b) (Z.mul (Z.sub (Z.add (Z.mul k1 b) (Z.mul k2 a)) (Z.mul (Z.mul k1 k2) (Z.of_N (Npow2 sz)))) (Z.of_N (Npow2 sz))))) (ZToWord sz (Z.mul a b)) *) apply ZToWord_Npow2_sub_z. Qed. Lemma wmult_Z: forall sz (a b : word sz), a ^* b = ZToWord sz (wordToZ a * wordToZ b). Proof. (* Goal: forall (sz : nat) (a b : word sz), @eq (word sz) (@wmult sz a b) (ZToWord sz (Z.mul (@wordToZ sz a) (@wordToZ sz b))) *) intros. (* Goal: @eq (word sz) (@wmult sz a b) (ZToWord sz (Z.mul (@wordToZ sz a) (@wordToZ sz b))) *) rewrite ZToWord_mult. (* Goal: @eq (word sz) (@wmult sz a b) (@wmult sz (ZToWord sz (@wordToZ sz a)) (ZToWord sz (@wordToZ sz b))) *) rewrite! ZToWord_wordToZ. (* Goal: @eq (word sz) (@wmult sz a b) (@wmult sz a b) *) reflexivity. Qed. Lemma wordToZ_wplus_bound: forall sz (w1 w2: word (S sz)), (- Z.of_nat (pow2 sz) <= wordToZ w1 + wordToZ w2 < Z.of_nat (pow2 sz))%Z -> Proof. (* Goal: forall (sz : nat) (w1 w2 : word (S sz)) (_ : and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz)))), @eq Z (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (@wordToZ (S sz) (@wplus (S sz) w1 w2)) *) intros. (* Goal: @eq Z (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (@wordToZ (S sz) (@wplus (S sz) w1 w2)) *) rewrite wplus_wplusZ. (* Goal: @eq Z (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (@wordToZ (S sz) (@wplusZ (S sz) w1 w2)) *) unfold wplusZ, wordBinZ. (* Goal: @eq Z (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (@wordToZ (S sz) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)))) *) remember (wordToZ w1 + wordToZ w2)%Z as z; clear Heqz. (* Goal: @eq Z z (@wordToZ (S sz) (ZToWord (S sz) z)) *) apply eq_sym, wordToZ_ZToWord; assumption. Qed. Lemma wordToZ_wplus_bound': forall sz (w1 w2: word sz), sz <> 0 -> (- Z.of_nat (pow2 (pred sz)) <= wordToZ w1 + wordToZ w2 < Z.of_nat (pow2 (pred sz)))%Z -> Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (_ : not (@eq nat sz O)) (_ : and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred sz)))) (Z.add (@wordToZ sz w1) (@wordToZ sz w2))) (Z.lt (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred sz))))), @eq Z (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) (@wordToZ sz (@wplus sz w1 w2)) *) intros. (* Goal: @eq Z (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) (@wordToZ sz (@wplus sz w1 w2)) *) destruct sz; [exfalso; auto|clear H]. (* Goal: @eq Z (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (@wordToZ (S sz) (@wplus (S sz) w1 w2)) *) apply wordToZ_wplus_bound; auto. Qed. Lemma wordToZ_size': forall sz (w: word (S sz)), (- Z.of_nat (pow2 sz) <= wordToZ w < Z.of_nat (pow2 sz))%Z. Lemma wordToZ_size: forall sz (w: word (S sz)), (Z.abs (wordToZ w) <= Z.of_nat (pow2 sz))%Z. Proof. (* Goal: forall (sz : nat) (w : word (S sz)), Z.le (Z.abs (@wordToZ (S sz) w)) (Z.of_nat (Nat.pow (S (S O)) sz)) *) intros. (* Goal: Z.le (Z.abs (@wordToZ (S sz) w)) (Z.of_nat (Nat.pow (S (S O)) sz)) *) pose proof (wordToZ_size' w). (* Goal: Z.le (Z.abs (@wordToZ (S sz) w)) (Z.of_nat (Nat.pow (S (S O)) sz)) *) destruct H. (* Goal: Z.le (Z.abs (@wordToZ (S sz) w)) (Z.of_nat (Nat.pow (S (S O)) sz)) *) apply Z.abs_le. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (@wordToZ (S sz) w)) (Z.le (@wordToZ (S sz) w) (Z.of_nat (Nat.pow (S (S O)) sz))) *) split; omega. Qed. Lemma wordToZ_size'': forall (sz : nat), (0 < sz)%nat -> forall w : word sz, (- 2 ^ (Z.of_nat sz - 1) <= wordToZ w < 2 ^ (Z.of_nat sz - 1))%Z. Proof. (* Goal: forall (sz : nat) (_ : lt O sz) (w : word sz), and (Z.le (Z.opp (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat sz) (Zpos xH)))) (@wordToZ sz w)) (Z.lt (@wordToZ sz w) (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat sz) (Zpos xH)))) *) intros. (* Goal: and (Z.le (Z.opp (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat sz) (Zpos xH)))) (@wordToZ sz w)) (Z.lt (@wordToZ sz w) (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat sz) (Zpos xH)))) *) destruct sz; [lia|]. (* Goal: and (Z.le (Z.opp (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat (S sz)) (Zpos xH)))) (@wordToZ (S sz) w)) (Z.lt (@wordToZ (S sz) w) (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat (S sz)) (Zpos xH)))) *) pose proof (@wordToZ_size' sz w) as P. (* Goal: and (Z.le (Z.opp (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat (S sz)) (Zpos xH)))) (@wordToZ (S sz) w)) (Z.lt (@wordToZ (S sz) w) (Z.pow (Zpos (xO xH)) (Z.sub (Z.of_nat (S sz)) (Zpos xH)))) *) replace (Z.of_nat (S sz) - 1)%Z with (Z.of_nat sz) by lia. (* Goal: and (Z.le (Z.opp (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (@wordToZ (S sz) w)) (Z.lt (@wordToZ (S sz) w) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) rewrite Nat2Z.inj_pow in P. (* Goal: and (Z.le (Z.opp (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (@wordToZ (S sz) w)) (Z.lt (@wordToZ (S sz) w) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) exact P. Qed. Lemma wneg_wzero: forall sz (w: word sz), wneg w = wzero sz -> w = wzero sz. Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : @eq (word sz) (@wneg sz w) (wzero sz)), @eq (word sz) w (wzero sz) *) intros. (* Goal: @eq (word sz) w (wzero sz) *) pose proof (wminus_inv w). (* Goal: @eq (word sz) w (wzero sz) *) rewrite H in H0. (* Goal: @eq (word sz) w (wzero sz) *) rewrite wplus_comm, wplus_unit in H0; subst. (* Goal: @eq (word sz) (wzero sz) (wzero sz) *) reflexivity. Qed. Lemma wmsb_false_pos: forall sz (w: word sz), wmsb w false = false <-> (wordToZ w >= 0)%Z. Proof. (* Goal: forall (sz : nat) (w : word sz), iff (@eq bool (@wmsb sz w false) false) (Z.ge (@wordToZ sz w) Z0) *) unfold wordToZ; split; intros. (* Goal: @eq bool (@wmsb sz w false) false *) (* Goal: Z.ge (if @wmsb sz w false then match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end) Z0 *) - (* Goal: Z.ge (if @wmsb sz w false then match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end) Z0 *) rewrite H. (* Goal: Z.ge match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end Z0 *) destruct (wordToN w). (* Goal: Z.ge (Zpos p) Z0 *) (* Goal: Z.ge Z0 Z0 *) + (* Goal: Z.ge Z0 Z0 *) omega. (* BG Goal: @eq bool (@wmsb sz w false) false *) (* BG Goal: Z.ge (Zpos p) Z0 *) + (* Goal: Z.ge (Zpos p) Z0 *) pose proof (Zgt_pos_0 p); omega. (* BG Goal: @eq bool (@wmsb sz w false) false *) - (* Goal: @eq bool (@wmsb sz w false) false *) remember (wmsb w false) as b; destruct b; auto. (* Goal: @eq bool true false *) remember (wordToN (wneg w)) as n; destruct n. (* Goal: @eq bool true false *) (* Goal: @eq bool true false *) + (* Goal: @eq bool true false *) replace 0%N with (wordToN (wzero sz)) in Heqn. (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) (* Goal: @eq bool true false *) * (* Goal: @eq bool true false *) apply wordToN_inj in Heqn. (* Goal: @eq bool true false *) apply eq_sym, wneg_wzero in Heqn; subst. (* Goal: @eq bool true false *) rewrite wmsb_wzero in Heqb; discriminate. (* BG Goal: @eq bool true false *) (* BG Goal: @eq N (@wordToN sz (wzero sz)) N0 *) * (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) rewrite <-wzero'_def. (* Goal: @eq N (@wordToN sz (wzero' sz)) N0 *) apply wordToN_wzero'. (* BG Goal: @eq bool true false *) + (* Goal: @eq bool true false *) exfalso; pose proof (Zlt_neg_0 p); omega. Qed. Lemma wmsb_true_neg: forall sz (w: word sz), wmsb w false = true <-> (wordToZ w < 0)%Z. Proof. (* Goal: forall (sz : nat) (w : word sz), iff (@eq bool (@wmsb sz w false) true) (Z.lt (@wordToZ sz w) Z0) *) unfold wordToZ; split; intros. (* Goal: @eq bool (@wmsb sz w false) true *) (* Goal: Z.lt (if @wmsb sz w false then match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end) Z0 *) - (* Goal: Z.lt (if @wmsb sz w false then match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end) Z0 *) rewrite H. (* Goal: Z.lt match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end Z0 *) remember (wordToN (wneg w)) as n; destruct n. (* Goal: Z.lt (Zneg p) Z0 *) (* Goal: Z.lt Z0 Z0 *) + (* Goal: Z.lt Z0 Z0 *) replace 0%N with (wordToN (wzero sz)) in Heqn. (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) (* Goal: Z.lt Z0 Z0 *) * (* Goal: Z.lt Z0 Z0 *) apply wordToN_inj in Heqn. (* Goal: Z.lt Z0 Z0 *) apply eq_sym, wneg_wzero in Heqn; subst. (* Goal: Z.lt Z0 Z0 *) rewrite wmsb_wzero in H; discriminate. (* BG Goal: @eq bool (@wmsb sz w false) true *) (* BG Goal: Z.lt (Zneg p) Z0 *) (* BG Goal: @eq N (@wordToN sz (wzero sz)) N0 *) * (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) rewrite <-wzero'_def. (* Goal: @eq N (@wordToN sz (wzero' sz)) N0 *) apply wordToN_wzero'. (* BG Goal: @eq bool (@wmsb sz w false) true *) (* BG Goal: Z.lt (Zneg p) Z0 *) + (* Goal: Z.lt (Zneg p) Z0 *) pose proof (Zlt_neg_0 p); omega. (* BG Goal: @eq bool (@wmsb sz w false) true *) - (* Goal: @eq bool (@wmsb sz w false) true *) remember (wmsb w false) as b; destruct b; auto. (* Goal: @eq bool false true *) remember (wordToN w) as n; destruct n. (* Goal: @eq bool false true *) (* Goal: @eq bool false true *) + (* Goal: @eq bool false true *) omega. (* BG Goal: @eq bool false true *) + (* Goal: @eq bool false true *) pose proof (Zgt_pos_0 p); omega. Qed. Lemma wordToZ_distr_diff_wmsb: forall sz (w1 w2: word sz), wmsb w1 false = negb (wmsb w2 false) -> wordToZ (w1 ^+ w2) = (wordToZ w1 + wordToZ w2)%Z. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (_ : @eq bool (@wmsb sz w1 false) (negb (@wmsb sz w2 false))), @eq Z (@wordToZ sz (@wplus sz w1 w2)) (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) *) intros. (* Goal: @eq Z (@wordToZ sz (@wplus sz w1 w2)) (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) *) destruct sz; [rewrite (shatter_word w1), (shatter_word w2); reflexivity|]. (* Goal: @eq Z (@wordToZ (S sz) (@wplus (S sz) w1 w2)) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) *) eapply eq_sym, wordToZ_wplus_bound. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) pose proof (wordToZ_size' w1). (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) pose proof (wordToZ_size' w2). (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) remember (wmsb w1 false) as msb1; destruct msb1. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) - (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) apply eq_sym, wmsb_true_neg in Heqmsb1. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) apply eq_sym, negb_true_iff, wmsb_false_pos in H. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) destruct H0, H1. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) split; omega. (* BG Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) - (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) apply eq_sym, wmsb_false_pos in Heqmsb1. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) apply eq_sym, negb_false_iff, wmsb_true_neg in H. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) destruct H0, H1. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) split; omega. Qed. Lemma sext_wplus_wordToZ_distr: forall sz (w1 w2: word sz) n, n <> 0 -> wordToZ (sext w1 n ^+ sext w2 n) = (wordToZ (sext w1 n) + wordToZ (sext w2 n))%Z. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (n : nat) (_ : not (@eq nat n O)), @eq Z (@wordToZ (Init.Nat.add sz n) (@wplus (Init.Nat.add sz n) (@sext sz w1 n) (@sext sz w2 n))) (Z.add (@wordToZ (Init.Nat.add sz n) (@sext sz w1 n)) (@wordToZ (Init.Nat.add sz n) (@sext sz w2 n))) *) intros. (* Goal: @eq Z (@wordToZ (Init.Nat.add sz n) (@wplus (Init.Nat.add sz n) (@sext sz w1 n) (@sext sz w2 n))) (Z.add (@wordToZ (Init.Nat.add sz n) (@sext sz w1 n)) (@wordToZ (Init.Nat.add sz n) (@sext sz w2 n))) *) destruct n; [exfalso; auto|clear H]. (* Goal: @eq Z (@wordToZ (Init.Nat.add sz (S n)) (@wplus (Init.Nat.add sz (S n)) (@sext sz w1 (S n)) (@sext sz w2 (S n)))) (Z.add (@wordToZ (Init.Nat.add sz (S n)) (@sext sz w1 (S n))) (@wordToZ (Init.Nat.add sz (S n)) (@sext sz w2 (S n)))) *) apply eq_sym, wordToZ_wplus_bound'; [omega|]. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add sz (S n)))))) (Z.add (@wordToZ (Init.Nat.add sz (S n)) (@sext sz w1 (S n))) (@wordToZ (Init.Nat.add sz (S n)) (@sext sz w2 (S n))))) (Z.lt (Z.add (@wordToZ (Init.Nat.add sz (S n)) (@sext sz w1 (S n))) (@wordToZ (Init.Nat.add sz (S n)) (@sext sz w2 (S n)))) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add sz (S n)))))) *) do 2 rewrite sext_wordToZ. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add sz (S n)))))) (Z.add (@wordToZ sz w1) (@wordToZ sz w2))) (Z.lt (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add sz (S n)))))) *) destruct sz. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add (S sz) (S n)))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add (S sz) (S n)))))) *) (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add O (S n)))))) (Z.add (@wordToZ O w1) (@wordToZ O w2))) (Z.lt (Z.add (@wordToZ O w1) (@wordToZ O w2)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add O (S n)))))) *) - (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add O (S n)))))) (Z.add (@wordToZ O w1) (@wordToZ O w2))) (Z.lt (Z.add (@wordToZ O w1) (@wordToZ O w2)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add O (S n)))))) *) rewrite (shatter_word w1), (shatter_word w2). (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add O (S n)))))) (Z.add (@wordToZ O WO) (@wordToZ O WO))) (Z.lt (Z.add (@wordToZ O WO) (@wordToZ O WO)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add O (S n)))))) *) cbn; split; try (pose proof (pow2_zero n); omega). (* BG Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add (S sz) (S n)))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add (S sz) (S n)))))) *) - (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add (S sz) (S n)))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.pred (Init.Nat.add (S sz) (S n)))))) *) replace (pred (S sz + S n)) with (S (sz + n)) by omega. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) *) pose proof (wordToZ_size' w1); destruct H. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) *) pose proof (wordToZ_size' w2); destruct H1. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2))) (Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) *) split. (* Goal: Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n)))) *) (* Goal: Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) *) + (* Goal: Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) *) rewrite pow2_S_z. (* Goal: Z.le (Z.opp (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n))))) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) *) etransitivity; [|apply Z.add_le_mono; eassumption]. (* Goal: Z.le (Z.opp (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n))))) (Z.add (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz)))) *) rewrite <-Z.add_diag, Z.opp_add_distr. (* Goal: Z.le (Z.add (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n)))) (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n))))) (Z.add (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz)))) *) apply Z.add_le_mono; rewrite <-Z.opp_le_mono; apply Nat2Z.inj_le, pow2_le; omega. (* BG Goal: Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n)))) *) + (* Goal: Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.of_nat (Nat.pow (S (S O)) (S (Init.Nat.add sz n)))) *) rewrite pow2_S_z. (* Goal: Z.lt (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) w2)) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n)))) *) eapply Z.lt_le_trans; [apply Z.add_lt_mono; eassumption|]. (* Goal: Z.le (Z.add (Z.of_nat (Nat.pow (S (S O)) sz)) (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n)))) *) rewrite <-Z.add_diag. (* Goal: Z.le (Z.add (Z.of_nat (Nat.pow (S (S O)) sz)) (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.add (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n))) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.add sz n)))) *) apply Z.add_le_mono; apply Nat2Z.inj_le, pow2_le; omega. Qed. Lemma sext_wplus_wordToZ_distr_existT: forall sz (w1 w2: word sz) ssz (sw1 sw2: word ssz) n, existT word _ w1 = existT word _ (sext sw1 n) -> existT word _ w2 = existT word _ (sext sw2 n) -> n <> 0 -> wordToZ (w1 ^+ w2) = (wordToZ w1 + wordToZ w2)%Z. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz) (ssz : nat) (sw1 sw2 : word ssz) (n : nat) (_ : @eq (@sigT nat word) (@existT nat word sz w1) (@existT nat word (Init.Nat.add ssz n) (@sext ssz sw1 n))) (_ : @eq (@sigT nat word) (@existT nat word sz w2) (@existT nat word (Init.Nat.add ssz n) (@sext ssz sw2 n))) (_ : not (@eq nat n O)), @eq Z (@wordToZ sz (@wplus sz w1 w2)) (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) *) intros. (* Goal: @eq Z (@wordToZ sz (@wplus sz w1 w2)) (Z.add (@wordToZ sz w1) (@wordToZ sz w2)) *) assert (sz = ssz + n) by (apply eq_sigT_fst in H; auto); subst. (* Goal: @eq Z (@wordToZ (Init.Nat.add ssz n) (@wplus (Init.Nat.add ssz n) w1 w2)) (Z.add (@wordToZ (Init.Nat.add ssz n) w1) (@wordToZ (Init.Nat.add ssz n) w2)) *) destruct_existT. (* Goal: @eq Z (@wordToZ (Init.Nat.add ssz n) (@wplus (Init.Nat.add ssz n) (@sext ssz sw1 n) (@sext ssz sw2 n))) (Z.add (@wordToZ (Init.Nat.add ssz n) (@sext ssz sw1 n)) (@wordToZ (Init.Nat.add ssz n) (@sext ssz sw2 n))) *) apply sext_wplus_wordToZ_distr; auto. Qed. Lemma split1_existT: forall n sz1 (w1: word (n + sz1)) sz2 (w2: word (n + sz2)), existT word _ w1 = existT word _ w2 -> split1 n _ w1 = split1 n _ w2. Proof. (* Goal: forall (n sz1 : nat) (w1 : word (Init.Nat.add n sz1)) (sz2 : nat) (w2 : word (Init.Nat.add n sz2)) (_ : @eq (@sigT nat word) (@existT nat word (Init.Nat.add n sz1) w1) (@existT nat word (Init.Nat.add n sz2) w2)), @eq (word n) (split1 n sz1 w1) (split1 n sz2 w2) *) intros. (* Goal: @eq (word n) (split1 n sz1 w1) (split1 n sz2 w2) *) assert (sz1 = sz2) by (apply eq_sigT_fst in H; omega); subst. (* Goal: @eq (word n) (split1 n sz2 w1) (split1 n sz2 w2) *) destruct_existT. (* Goal: @eq (word n) (split1 n sz2 w2) (split1 n sz2 w2) *) reflexivity. Qed. Lemma word_combinable: forall sz1 sz2 (w: word (sz1 + sz2)), exists w1 w2, w = combine w1 w2. Proof. (* Goal: forall (sz1 sz2 : nat) (w : word (Init.Nat.add sz1 sz2)), @ex (word sz1) (fun w1 : word sz1 => @ex (word sz2) (fun w2 : word sz2 => @eq (word (Init.Nat.add sz1 sz2)) w (@combine sz1 w1 sz2 w2))) *) intros. (* Goal: @ex (word sz1) (fun w1 : word sz1 => @ex (word sz2) (fun w2 : word sz2 => @eq (word (Init.Nat.add sz1 sz2)) w (@combine sz1 w1 sz2 w2))) *) exists (split1 _ _ w), (split2 _ _ w). (* Goal: @eq (word (Init.Nat.add sz1 sz2)) w (@combine sz1 (split1 sz1 sz2 w) sz2 (split2 sz1 sz2 w)) *) apply eq_sym, combine_split. Qed. Lemma split1_combine_existT: forall sz n (w: word (n + sz)) sl (wl: word (n + sl)) su (wu: word su), existT word _ w = existT word _ (combine wl wu) -> split1 n _ w = split1 n _ wl. Proof. (* Goal: forall (sz n : nat) (w : word (Init.Nat.add n sz)) (sl : nat) (wl : word (Init.Nat.add n sl)) (su : nat) (wu : word su) (_ : @eq (@sigT nat word) (@existT nat word (Init.Nat.add n sz) w) (@existT nat word (Init.Nat.add (Init.Nat.add n sl) su) (@combine (Init.Nat.add n sl) wl su wu))), @eq (word n) (split1 n sz w) (split1 n sl wl) *) intros. (* Goal: @eq (word n) (split1 n sz w) (split1 n sl wl) *) pose proof (word_combinable _ _ w). (* Goal: @eq (word n) (split1 n sz w) (split1 n sl wl) *) destruct H0 as [? [? ?]]; subst. (* Goal: @eq (word n) (split1 n sz (@combine n x sz x0)) (split1 n sl wl) *) pose proof (word_combinable _ _ wl). (* Goal: @eq (word n) (split1 n sz (@combine n x sz x0)) (split1 n sl wl) *) destruct H0 as [? [? ?]]; subst. (* Goal: @eq (word n) (split1 n sz (@combine n x sz x0)) (split1 n sl (@combine n x1 sl x2)) *) assert (sz = sl + su) by (apply eq_sigT_fst in H; omega); subst. (* Goal: @eq (word n) (split1 n (Init.Nat.add sl su) (@combine n x (Init.Nat.add sl su) x0)) (split1 n sl (@combine n x1 sl x2)) *) pose proof (word_combinable _ _ x0). (* Goal: @eq (word n) (split1 n (Init.Nat.add sl su) (@combine n x (Init.Nat.add sl su) x0)) (split1 n sl (@combine n x1 sl x2)) *) destruct H0 as [? [? ?]]; subst. (* Goal: @eq (word n) (split1 n (Init.Nat.add sl su) (@combine n x (Init.Nat.add sl su) (@combine sl x3 su x4))) (split1 n sl (@combine n x1 sl x2)) *) do 2 rewrite split1_combine. (* Goal: @eq (word n) x x1 *) rewrite combine_assoc_existT in H. (* Goal: @eq (word n) x x1 *) destruct_existT. (* Goal: @eq (word n) x x1 *) assert (split1 _ _ (split1 _ _ (combine (combine x x3) x4)) = split1 _ _ (split1 _ _ (combine (combine x1 x2) wu))) by (rewrite H; reflexivity). (* Goal: @eq (word n) x x1 *) repeat rewrite split1_combine in H0. (* Goal: @eq (word n) x x1 *) assumption. Qed. Lemma extz_pow2_wordToZ: forall sz (w: word sz) n, wordToZ (extz w n) = (wordToZ w * Z.of_nat (pow2 n))%Z. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq Z (@wordToZ (Init.Nat.add n sz) (@extz sz w n)) (Z.mul (@wordToZ sz w) (Z.of_nat (Nat.pow (S (S O)) n))) *) induction n; [cbn; omega|]. (* Goal: @eq Z (@wordToZ (Init.Nat.add (S n) sz) (@extz sz w (S n))) (Z.mul (@wordToZ sz w) (Z.of_nat (Nat.pow (S (S O)) (S n)))) *) rewrite pow2_S_z. (* Goal: @eq Z (@wordToZ (Init.Nat.add (S n) sz) (@extz sz w (S n))) (Z.mul (@wordToZ sz w) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) n)))) *) change (wordToZ (extz w (S n))) with (wordToZ (combine (natToWord n 0) w)~0). (* Goal: @eq Z (@wordToZ (S (Init.Nat.add n sz)) (@WS false (Init.Nat.add n sz) (@combine n (natToWord n O) sz w))) (Z.mul (@wordToZ sz w) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) n)))) *) rewrite wordToZ_WS_0. (* Goal: @eq Z (Z.mul (Zpos (xO xH)) (@wordToZ (Init.Nat.add n sz) (@combine n (natToWord n O) sz w))) (Z.mul (@wordToZ sz w) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) n)))) *) unfold extz, wzero in IHn. (* Goal: @eq Z (Z.mul (Zpos (xO xH)) (@wordToZ (Init.Nat.add n sz) (@combine n (natToWord n O) sz w))) (Z.mul (@wordToZ sz w) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) n)))) *) rewrite IHn. (* Goal: @eq Z (Z.mul (Zpos (xO xH)) (Z.mul (@wordToZ sz w) (Z.of_nat (Nat.pow (S (S O)) n)))) (Z.mul (@wordToZ sz w) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) n)))) *) rewrite Z.mul_assoc. (* Goal: @eq Z (Z.mul (Z.mul (Zpos (xO xH)) (@wordToZ sz w)) (Z.of_nat (Nat.pow (S (S O)) n))) (Z.mul (@wordToZ sz w) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) n)))) *) rewrite Z.mul_comm with (n:= 2%Z). (* Goal: @eq Z (Z.mul (Z.mul (@wordToZ sz w) (Zpos (xO xH))) (Z.of_nat (Nat.pow (S (S O)) n))) (Z.mul (@wordToZ sz w) (Z.mul (Zpos (xO xH)) (Z.of_nat (Nat.pow (S (S O)) n)))) *) apply eq_sym, Z.mul_assoc. Qed. Lemma extz_wneg: forall sz (w: word sz) n, extz (wneg w) n = wneg (extz w n). Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq (word (Init.Nat.add n sz)) (@extz sz (@wneg sz w) n) (@wneg (Init.Nat.add n sz) (@extz sz w n)) *) induction n; intros; [reflexivity|]. (* Goal: @eq (word (Init.Nat.add (S n) sz)) (@extz sz (@wneg sz w) (S n)) (@wneg (Init.Nat.add (S n) sz) (@extz sz w (S n))) *) cbn; rewrite wneg_WS_0. (* Goal: @eq (word (S (Init.Nat.add n sz))) (@WS false (Init.Nat.add n sz) (@combine n (natToWord n O) sz (@wneg sz w))) (@WS false (Init.Nat.add n sz) (@wneg (Init.Nat.add n sz) (@combine n (natToWord n O) sz w))) *) unfold extz, wzero in IHn. (* Goal: @eq (word (S (Init.Nat.add n sz))) (@WS false (Init.Nat.add n sz) (@combine n (natToWord n O) sz (@wneg sz w))) (@WS false (Init.Nat.add n sz) (@wneg (Init.Nat.add n sz) (@combine n (natToWord n O) sz w))) *) rewrite IHn. (* Goal: @eq (word (S (Init.Nat.add n sz))) (@WS false (Init.Nat.add n sz) (@wneg (Init.Nat.add n sz) (@combine n (natToWord n O) sz w))) (@WS false (Init.Nat.add n sz) (@wneg (Init.Nat.add n sz) (@combine n (natToWord n O) sz w))) *) reflexivity. Qed. Lemma wneg_wordToZ: forall sz (w: word (S sz)), w <> wpow2 sz -> wordToZ (wneg w) = (- wordToZ w)%Z. Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (_ : not (@eq (word (S sz)) w (wpow2 sz))), @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) intros. (* Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) assert (wordToZ (wneg w) + wordToZ w = 0)%Z. (* Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) (* Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) { (* Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) destruct (weq w (wzero _)). (* Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) (* Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) { (* Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) subst; rewrite wzero_wneg, wordToZ_wzero. (* Goal: @eq Z (Z.add Z0 Z0) Z0 *) reflexivity. (* BG Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) (* BG Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) } (* Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) { (* Goal: @eq Z (Z.add (@wordToZ (S sz) (@wneg (S sz) w)) (@wordToZ (S sz) w)) Z0 *) rewrite <-wordToZ_distr_diff_wmsb. (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb (@wmsb (S sz) w false)) *) (* Goal: @eq Z (@wordToZ (S sz) (@wplus (S sz) (@wneg (S sz) w) w)) Z0 *) { (* Goal: @eq Z (@wordToZ (S sz) (@wplus (S sz) (@wneg (S sz) w) w)) Z0 *) rewrite wplus_comm, wminus_inv. (* Goal: @eq Z (@wordToZ (S sz) (wzero (S sz))) Z0 *) apply wordToZ_wzero. (* BG Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) (* BG Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb (@wmsb (S sz) w false)) *) } (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb (@wmsb (S sz) w false)) *) { (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb (@wmsb (S sz) w false)) *) remember (wmsb w false) as msb; destruct msb. (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb false) *) (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb true) *) { (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb true) *) eapply wmsb_wneg_true; eauto. (* BG Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) (* BG Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb false) *) } (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb false) *) { (* Goal: @eq bool (@wmsb (S sz) (@wneg (S sz) w) false) (negb false) *) eapply wmsb_wneg_false; eauto. (* Goal: not (@eq nat (@wordToNat (S sz) w) O) *) intro Hx; elim n. (* Goal: @eq (word (S sz)) w (wzero (S sz)) *) apply wordToNat_inj. (* Goal: @eq nat (@wordToNat (S sz) w) (@wordToNat (S sz) (wzero (S sz))) *) rewrite wordToNat_wzero, Hx; reflexivity. (* BG Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) } (* BG Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) } (* BG Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) } (* BG Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) } (* Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) w)) (Z.opp (@wordToZ (S sz) w)) *) omega. Qed. Lemma wneg_wordToZ': forall sz (w: word (S sz)) z, w <> wpow2 sz -> (z + wordToZ (wneg w))%Z = (z - wordToZ w)%Z. Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (z : Z) (_ : not (@eq (word (S sz)) w (wpow2 sz))), @eq Z (Z.add z (@wordToZ (S sz) (@wneg (S sz) w))) (Z.sub z (@wordToZ (S sz) w)) *) intros. (* Goal: @eq Z (Z.add z (@wordToZ (S sz) (@wneg (S sz) w))) (Z.sub z (@wordToZ (S sz) w)) *) rewrite wneg_wordToZ by assumption. (* Goal: @eq Z (Z.add z (Z.opp (@wordToZ (S sz) w))) (Z.sub z (@wordToZ (S sz) w)) *) omega. Qed. Lemma wneg_wplus_distr: forall sz (w1 w2: word sz), wneg (w1 ^+ w2) = wneg w1 ^+ wneg w2. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (@wneg sz (@wplus sz w1 w2)) (@wplus sz (@wneg sz w1) (@wneg sz w2)) *) intros. (* Goal: @eq (word sz) (@wneg sz (@wplus sz w1 w2)) (@wplus sz (@wneg sz w1) (@wneg sz w2)) *) apply wplus_cancel with (c:= w1 ^+ w2). (* Goal: @eq (word sz) (@wplus sz (@wneg sz (@wplus sz w1 w2)) (@wplus sz w1 w2)) (@wplus sz (@wplus sz (@wneg sz w1) (@wneg sz w2)) (@wplus sz w1 w2)) *) rewrite wplus_comm, wminus_inv. (* Goal: @eq (word sz) (wzero sz) (@wplus sz (@wplus sz (@wneg sz w1) (@wneg sz w2)) (@wplus sz w1 w2)) *) rewrite wplus_comm, wplus_assoc. (* Goal: @eq (word sz) (wzero sz) (@wplus sz (@wplus sz (@wplus sz w1 w2) (@wneg sz w1)) (@wneg sz w2)) *) rewrite <-wplus_assoc with (x:= w1). (* Goal: @eq (word sz) (wzero sz) (@wplus sz (@wplus sz w1 (@wplus sz w2 (@wneg sz w1))) (@wneg sz w2)) *) rewrite wplus_comm with (x:= w2). (* Goal: @eq (word sz) (wzero sz) (@wplus sz (@wplus sz w1 (@wplus sz (@wneg sz w1) w2)) (@wneg sz w2)) *) rewrite wplus_assoc. (* Goal: @eq (word sz) (wzero sz) (@wplus sz (@wplus sz (@wplus sz w1 (@wneg sz w1)) w2) (@wneg sz w2)) *) rewrite wminus_inv. (* Goal: @eq (word sz) (wzero sz) (@wplus sz (@wplus sz (wzero sz) w2) (@wneg sz w2)) *) rewrite wplus_wzero_2. (* Goal: @eq (word sz) (wzero sz) (@wplus sz w2 (@wneg sz w2)) *) rewrite wminus_inv. (* Goal: @eq (word sz) (wzero sz) (wzero sz) *) reflexivity. Qed. Lemma wminus_wneg: forall sz (w1 w2: word sz), wneg (w1 ^- w2) = w2 ^- w1. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (@wneg sz (@wminus sz w1 w2)) (@wminus sz w2 w1) *) unfold wminus; intros. (* Goal: @eq (word sz) (@wneg sz (@wplus sz w1 (@wneg sz w2))) (@wplus sz w2 (@wneg sz w1)) *) rewrite wneg_wplus_distr. (* Goal: @eq (word sz) (@wplus sz (@wneg sz w1) (@wneg sz (@wneg sz w2))) (@wplus sz w2 (@wneg sz w1)) *) rewrite wneg_idempotent. (* Goal: @eq (word sz) (@wplus sz (@wneg sz w1) w2) (@wplus sz w2 (@wneg sz w1)) *) apply wplus_comm. Qed. Lemma wminus_wordToZ: forall sz (w1 w2: word (S sz)), w2 ^- w1 <> wpow2 sz -> wordToZ (w1 ^- w2) = (- wordToZ (w2 ^- w1))%Z. Proof. (* Goal: forall (sz : nat) (w1 w2 : word (S sz)) (_ : not (@eq (word (S sz)) (@wminus (S sz) w2 w1) (wpow2 sz))), @eq Z (@wordToZ (S sz) (@wminus (S sz) w1 w2)) (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) *) intros. (* Goal: @eq Z (@wordToZ (S sz) (@wminus (S sz) w1 w2)) (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) *) rewrite <-wneg_idempotent with (w:= w1 ^- w2). (* Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) (@wneg (S sz) (@wminus (S sz) w1 w2)))) (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) *) rewrite wminus_wneg. (* Goal: @eq Z (@wordToZ (S sz) (@wneg (S sz) (@wminus (S sz) w2 w1))) (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) *) rewrite wneg_wordToZ by assumption. (* Goal: @eq Z (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) *) reflexivity. Qed. Lemma wminus_wordToZ': forall sz (w1 w2: word (sz + 1)), existT word _ (w2 ^- w1) <> existT word _ (wpow2 sz) -> wordToZ (w1 ^- w2) = (- wordToZ (w2 ^- w1))%Z. Proof. (* Goal: forall (sz : nat) (w1 w2 : word (Init.Nat.add sz (S O))) (_ : not (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w2 w1)) (@existT nat word (S sz) (wpow2 sz)))), @eq Z (@wordToZ (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w1 w2)) (Z.opp (@wordToZ (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w2 w1))) *) intro sz. (* Goal: forall (w1 w2 : word (Init.Nat.add sz (S O))) (_ : not (@eq (@sigT nat word) (@existT nat word (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w2 w1)) (@existT nat word (S sz) (wpow2 sz)))), @eq Z (@wordToZ (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w1 w2)) (Z.opp (@wordToZ (Init.Nat.add sz (S O)) (@wminus (Init.Nat.add sz (S O)) w2 w1))) *) replace (sz + 1) with (S sz) by omega. (* Goal: forall (w1 w2 : word (S sz)) (_ : not (@eq (@sigT nat word) (@existT nat word (S sz) (@wminus (S sz) w2 w1)) (@existT nat word (S sz) (wpow2 sz)))), @eq Z (@wordToZ (S sz) (@wminus (S sz) w1 w2)) (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) *) intros. (* Goal: @eq Z (@wordToZ (S sz) (@wminus (S sz) w1 w2)) (Z.opp (@wordToZ (S sz) (@wminus (S sz) w2 w1))) *) apply wminus_wordToZ. (* Goal: not (@eq (word (S sz)) (@wminus (S sz) w2 w1) (wpow2 sz)) *) intro Hx; elim H. (* Goal: @eq (@sigT nat word) (@existT nat word (S sz) (@wminus (S sz) w2 w1)) (@existT nat word (S sz) (wpow2 sz)) *) rewrite Hx; reflexivity. Qed. Lemma wminus_wminusZ: forall (sz : nat) (w1 w2 : word sz), w1 ^- w2 = wminusZ w1 w2. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (@wminus sz w1 w2) (@wminusZ sz w1 w2) *) unfold wminusZ, wminus, wordBinZ. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq (word sz) (@wplus sz w1 (@wneg sz w2)) (ZToWord sz (Z.sub (@wordToZ sz w1) (@wordToZ sz w2))) *) intros. (* Goal: @eq (word sz) (@wplus sz w1 (@wneg sz w2)) (ZToWord sz (Z.sub (@wordToZ sz w1) (@wordToZ sz w2))) *) rewrite <- Z.add_opp_r. (* Goal: @eq (word sz) (@wplus sz w1 (@wneg sz w2)) (ZToWord sz (Z.add (@wordToZ sz w1) (Z.opp (@wordToZ sz w2)))) *) rewrite wplus_wplusZ. (* Goal: @eq (word sz) (@wplusZ sz w1 (@wneg sz w2)) (ZToWord sz (Z.add (@wordToZ sz w1) (Z.opp (@wordToZ sz w2)))) *) unfold wplusZ, wordBinZ. (* Goal: @eq (word sz) (ZToWord sz (Z.add (@wordToZ sz w1) (@wordToZ sz (@wneg sz w2)))) (ZToWord sz (Z.add (@wordToZ sz w1) (Z.opp (@wordToZ sz w2)))) *) destruct sz. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) (* Goal: @eq (word O) (ZToWord O (Z.add (@wordToZ O w1) (@wordToZ O (@wneg O w2)))) (ZToWord O (Z.add (@wordToZ O w1) (Z.opp (@wordToZ O w2)))) *) - (* Goal: @eq (word O) (ZToWord O (Z.add (@wordToZ O w1) (@wordToZ O (@wneg O w2)))) (ZToWord O (Z.add (@wordToZ O w1) (Z.opp (@wordToZ O w2)))) *) do 2 rewrite ZToWord_sz0. (* Goal: @eq (word O) (natToWord O O) (natToWord O O) *) reflexivity. (* BG Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) - (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) destruct (weq w2 (wpow2 sz)). (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) + (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) subst. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) (wpow2 sz))))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) (wpow2 sz))))) *) rewrite wpow2_wneg. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) (wpow2 sz))))) *) replace (wordToZ w1 + - wordToZ (wpow2 sz))%Z with (wordToZ w1 + wordToZ (wpow2 sz) - 2 * wordToZ (wpow2 sz))%Z by omega. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz)))) (ZToWord (S sz) (Z.sub (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz))) (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (wpow2 sz))))) *) replace (2 * wordToZ (wpow2 sz))%Z with (- 1 * Z.of_N (Npow2 (S sz)))%Z. (* Goal: @eq Z (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))) (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (wpow2 sz))) *) (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz)))) (ZToWord (S sz) (Z.sub (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz))) (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))))) *) * (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz)))) (ZToWord (S sz) (Z.sub (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz))) (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))))) *) symmetry. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.sub (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz))) (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (wpow2 sz)))) *) apply ZToWord_Npow2_sub_z. (* BG Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) (* BG Goal: @eq Z (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))) (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (wpow2 sz))) *) * (* Goal: @eq Z (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))) (Z.mul (Zpos (xO xH)) (@wordToZ (S sz) (wpow2 sz))) *) rewrite wordToZ_wordToN. (* Goal: @eq Z (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))) (Z.mul (Zpos (xO xH)) (Z.sub (Z.of_N (@wordToN (S sz) (wpow2 sz))) (Z.of_N (if @wmsb (S sz) (wpow2 sz) false then Npow2 (S sz) else N0)))) *) rewrite wpow2_wmsb. (* Goal: @eq Z (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))) (Z.mul (Zpos (xO xH)) (Z.sub (Z.of_N (@wordToN (S sz) (wpow2 sz))) (Z.of_N (Npow2 (S sz))))) *) rewrite wpow2_Npow2. (* Goal: @eq Z (Z.mul (Zneg xH) (Z.of_N (Npow2 (S sz)))) (Z.mul (Zpos (xO xH)) (Z.sub (Z.of_N (Npow2 sz)) (Z.of_N (Npow2 (S sz))))) *) rewrite Npow2_S. (* Goal: @eq Z (Z.mul (Zneg xH) (Z.of_N (N.add (Npow2 sz) (Npow2 sz)))) (Z.mul (Zpos (xO xH)) (Z.sub (Z.of_N (Npow2 sz)) (Z.of_N (N.add (Npow2 sz) (Npow2 sz))))) *) rewrite N2Z.inj_add. (* Goal: @eq Z (Z.mul (Zneg xH) (Z.add (Z.of_N (Npow2 sz)) (Z.of_N (Npow2 sz)))) (Z.mul (Zpos (xO xH)) (Z.sub (Z.of_N (Npow2 sz)) (Z.add (Z.of_N (Npow2 sz)) (Z.of_N (Npow2 sz))))) *) omega. (* BG Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) + (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (@wordToZ (S sz) (@wneg (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) rewrite wneg_wordToZ by assumption. (* Goal: @eq (word (S sz)) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) (ZToWord (S sz) (Z.add (@wordToZ (S sz) w1) (Z.opp (@wordToZ (S sz) w2)))) *) reflexivity. Qed. Local Lemma wminusZ_helper: forall a b k1 k2 p, ((a - k1 * p) - (b - k2 * p) = a - b - (k1 - k2) * p)%Z. Lemma ZToWord_minus: forall sz a b, ZToWord sz (a - b) = ZToWord sz a ^- ZToWord sz b. Proof. (* Goal: forall (sz : nat) (a b : Z), @eq (word sz) (ZToWord sz (Z.sub a b)) (@wminus sz (ZToWord sz a) (ZToWord sz b)) *) intros. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (@wminus sz (ZToWord sz a) (ZToWord sz b)) *) rewrite wminus_wminusZ. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (@wminusZ sz (ZToWord sz a) (ZToWord sz b)) *) unfold wminusZ, wordBinZ. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (@wordToZ sz (ZToWord sz a)) (@wordToZ sz (ZToWord sz b)))) *) destruct (wordToZ_ZToWord' sz a) as [k1 D1]. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (@wordToZ sz (ZToWord sz a)) (@wordToZ sz (ZToWord sz b)))) *) rewrite D1. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (@wordToZ sz (ZToWord sz b)))) *) clear D1. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (@wordToZ sz (ZToWord sz b)))) *) destruct (wordToZ_ZToWord' sz b) as [k2 D2]. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (@wordToZ sz (ZToWord sz b)))) *) rewrite D2. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (Z.sub b (Z.mul k2 (Z.of_N (Npow2 sz)))))) *) clear D2. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (Z.sub a (Z.mul k1 (Z.of_N (Npow2 sz)))) (Z.sub b (Z.mul k2 (Z.of_N (Npow2 sz)))))) *) rewrite wminusZ_helper. (* Goal: @eq (word sz) (ZToWord sz (Z.sub a b)) (ZToWord sz (Z.sub (Z.sub a b) (Z.mul (Z.sub k1 k2) (Z.of_N (Npow2 sz))))) *) symmetry. (* Goal: @eq (word sz) (ZToWord sz (Z.sub (Z.sub a b) (Z.mul (Z.sub k1 k2) (Z.of_N (Npow2 sz))))) (ZToWord sz (Z.sub a b)) *) apply ZToWord_Npow2_sub_z. Qed. Lemma wminus_Z: forall sz (a b : word sz), a ^- b = ZToWord sz (wordToZ a - wordToZ b). Proof. (* Goal: forall (sz : nat) (a b : word sz), @eq (word sz) (@wminus sz a b) (ZToWord sz (Z.sub (@wordToZ sz a) (@wordToZ sz b))) *) intros. (* Goal: @eq (word sz) (@wminus sz a b) (ZToWord sz (Z.sub (@wordToZ sz a) (@wordToZ sz b))) *) rewrite ZToWord_minus. (* Goal: @eq (word sz) (@wminus sz a b) (@wminus sz (ZToWord sz (@wordToZ sz a)) (ZToWord sz (@wordToZ sz b))) *) rewrite! ZToWord_wordToZ. (* Goal: @eq (word sz) (@wminus sz a b) (@wminus sz a b) *) reflexivity. Qed. Lemma ZToWord_opp_wneg{sz: nat}: forall (x: Z), ZToWord sz (- x) = ^~ (ZToWord sz x). Lemma Zeqb_true_ZToWord: forall {sz: nat} (x y: Z), (x =? y)%Z = true -> ZToWord sz x = ZToWord sz y. Proof. (* Goal: forall (sz : nat) (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) intros. (* Goal: @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) apply Z.eqb_eq in H. (* Goal: @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) congruence. Qed. Lemma word_ring_theory_Z: forall (sz: nat), ring_theory (ZToWord sz 0) (ZToWord sz 1) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) eq. Proof. (* Goal: forall sz : nat, @ring_theory (word sz) (ZToWord sz Z0) (ZToWord sz (Zpos xH)) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (@eq (word sz)) *) intros. (* Goal: @ring_theory (word sz) (ZToWord sz Z0) (ZToWord sz (Zpos xH)) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (@eq (word sz)) *) rewrite ZToWord_0. (* Goal: @ring_theory (word sz) (wzero sz) (ZToWord sz (Zpos xH)) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (@eq (word sz)) *) rewrite ZToWord_1. (* Goal: @ring_theory (word sz) (wzero sz) (wone sz) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (@eq (word sz)) *) apply wring. Qed. Lemma word_ring_morph_Z: forall (sz: nat), ring_morph (ZToWord sz 0) (ZToWord sz 1) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) eq 0%Z 1%Z Z.add Z.mul Z.sub Z.opp Z.eqb Proof. (* Goal: forall sz : nat, @ring_morph (word sz) (ZToWord sz Z0) (ZToWord sz (Zpos xH)) (@wplus sz) (@wmult sz) (@wminus sz) (@wneg sz) (@eq (word sz)) Z Z0 (Zpos xH) Z.add Z.mul Z.sub Z.opp Z.eqb (ZToWord sz) *) constructor. (* Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) (* Goal: forall x : Z, @eq (word sz) (ZToWord sz (Z.opp x)) (@wneg sz (ZToWord sz x)) *) (* Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.mul x y)) (@wmult sz (ZToWord sz x) (ZToWord sz y)) *) (* Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.sub x y)) (@wminus sz (ZToWord sz x) (ZToWord sz y)) *) (* Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.add x y)) (@wplus sz (ZToWord sz x) (ZToWord sz y)) *) (* Goal: @eq (word sz) (ZToWord sz (Zpos xH)) (ZToWord sz (Zpos xH)) *) (* Goal: @eq (word sz) (ZToWord sz Z0) (ZToWord sz Z0) *) + (* Goal: @eq (word sz) (ZToWord sz Z0) (ZToWord sz Z0) *) reflexivity. (* BG Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) (* BG Goal: forall x : Z, @eq (word sz) (ZToWord sz (Z.opp x)) (@wneg sz (ZToWord sz x)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.mul x y)) (@wmult sz (ZToWord sz x) (ZToWord sz y)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.sub x y)) (@wminus sz (ZToWord sz x) (ZToWord sz y)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.add x y)) (@wplus sz (ZToWord sz x) (ZToWord sz y)) *) (* BG Goal: @eq (word sz) (ZToWord sz (Zpos xH)) (ZToWord sz (Zpos xH)) *) + (* Goal: @eq (word sz) (ZToWord sz (Zpos xH)) (ZToWord sz (Zpos xH)) *) reflexivity. (* BG Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) (* BG Goal: forall x : Z, @eq (word sz) (ZToWord sz (Z.opp x)) (@wneg sz (ZToWord sz x)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.mul x y)) (@wmult sz (ZToWord sz x) (ZToWord sz y)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.sub x y)) (@wminus sz (ZToWord sz x) (ZToWord sz y)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.add x y)) (@wplus sz (ZToWord sz x) (ZToWord sz y)) *) + (* Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.add x y)) (@wplus sz (ZToWord sz x) (ZToWord sz y)) *) exact (@ZToWord_plus sz). (* BG Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) (* BG Goal: forall x : Z, @eq (word sz) (ZToWord sz (Z.opp x)) (@wneg sz (ZToWord sz x)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.mul x y)) (@wmult sz (ZToWord sz x) (ZToWord sz y)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.sub x y)) (@wminus sz (ZToWord sz x) (ZToWord sz y)) *) + (* Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.sub x y)) (@wminus sz (ZToWord sz x) (ZToWord sz y)) *) exact (@ZToWord_minus sz). (* BG Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) (* BG Goal: forall x : Z, @eq (word sz) (ZToWord sz (Z.opp x)) (@wneg sz (ZToWord sz x)) *) (* BG Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.mul x y)) (@wmult sz (ZToWord sz x) (ZToWord sz y)) *) + (* Goal: forall x y : Z, @eq (word sz) (ZToWord sz (Z.mul x y)) (@wmult sz (ZToWord sz x) (ZToWord sz y)) *) exact (@ZToWord_mult sz). (* BG Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) (* BG Goal: forall x : Z, @eq (word sz) (ZToWord sz (Z.opp x)) (@wneg sz (ZToWord sz x)) *) + (* Goal: forall x : Z, @eq (word sz) (ZToWord sz (Z.opp x)) (@wneg sz (ZToWord sz x)) *) exact (@ZToWord_opp_wneg sz). (* BG Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) + (* Goal: forall (x y : Z) (_ : @eq bool (Z.eqb x y) true), @eq (word sz) (ZToWord sz x) (ZToWord sz y) *) exact (@Zeqb_true_ZToWord sz). Qed. Lemma extz_zero: forall sz n, extz (natToWord sz 0) n = wzero _. Proof. (* Goal: forall sz n : nat, @eq (word (Init.Nat.add n sz)) (@extz sz (natToWord sz O) n) (wzero (Init.Nat.add n sz)) *) unfold wzero; intros. (* Goal: @eq (word (Init.Nat.add n sz)) (@extz sz (natToWord sz O) n) (natToWord (Init.Nat.add n sz) O) *) rewrite extz_combine. (* Goal: @eq (word (Init.Nat.add n sz)) (@combine n (natToWord n O) sz (natToWord sz O)) (natToWord (Init.Nat.add n sz) O) *) apply combine_zero. Qed. Lemma sext_eq_rect: forall sz (w: word sz) n nsz Hsz1, exists Hsz2, eq_rect (sz + n) word (sext w n) (nsz + n) Hsz1 = sext (eq_rect sz word w nsz Hsz2) n. Proof. (* Goal: forall (sz : nat) (w : word sz) (n nsz : nat) (Hsz1 : @eq nat (Init.Nat.add sz n) (Init.Nat.add nsz n)), @ex (@eq nat sz nsz) (fun Hsz2 : @eq nat sz nsz => @eq (word (Init.Nat.add nsz n)) (@eq_rect nat (Init.Nat.add sz n) word (@sext sz w n) (Init.Nat.add nsz n) Hsz1) (@sext nsz (@eq_rect nat sz word w nsz Hsz2) n)) *) intros. (* Goal: @ex (@eq nat sz nsz) (fun Hsz2 : @eq nat sz nsz => @eq (word (Init.Nat.add nsz n)) (@eq_rect nat (Init.Nat.add sz n) word (@sext sz w n) (Init.Nat.add nsz n) Hsz1) (@sext nsz (@eq_rect nat sz word w nsz Hsz2) n)) *) assert (Hsz: sz = nsz) by omega. (* Goal: @ex (@eq nat sz nsz) (fun Hsz2 : @eq nat sz nsz => @eq (word (Init.Nat.add nsz n)) (@eq_rect nat (Init.Nat.add sz n) word (@sext sz w n) (Init.Nat.add nsz n) Hsz1) (@sext nsz (@eq_rect nat sz word w nsz Hsz2) n)) *) exists Hsz. (* Goal: @eq (word (Init.Nat.add nsz n)) (@eq_rect nat (Init.Nat.add sz n) word (@sext sz w n) (Init.Nat.add nsz n) Hsz1) (@sext nsz (@eq_rect nat sz word w nsz Hsz) n) *) subst; simpl. (* Goal: @eq (word (Init.Nat.add nsz n)) (@eq_rect nat (Init.Nat.add nsz n) word (@sext nsz w n) (Init.Nat.add nsz n) Hsz1) (@sext nsz w n) *) eq_rect_simpl. (* Goal: @eq (word (Init.Nat.add nsz n)) (@sext nsz w n) (@sext nsz w n) *) reflexivity. Qed. Lemma wmsb_sext: forall sz (w: word sz) n, wmsb (sext w n) false = wmsb w false. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq bool (@wmsb (Init.Nat.add sz n) (@sext sz w n) false) (@wmsb sz w false) *) unfold sext; intros. (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (if @wmsb sz w false then @combine sz w n (wones n) else @combine sz w n (wzero n)) false) (@wmsb sz w false) *) remember (wmsb w false) as ww; destruct ww. (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@combine sz w n (wzero n)) false) false *) (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@combine sz w n (wones n)) false) true *) - (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@combine sz w n (wones n)) false) true *) destruct n; cbn. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@combine sz w (S n) (@WS true n (wones n))) false) true *) (* Goal: @eq bool (@wmsb (Init.Nat.add sz O) (@combine sz w O WO) false) true *) + (* Goal: @eq bool (@wmsb (Init.Nat.add sz O) (@combine sz w O WO) false) true *) rewrite wmsb_combine_WO; auto. (* BG Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@combine sz w n (wzero n)) false) false *) (* BG Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@combine sz w (S n) (@WS true n (wones n))) false) true *) + (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@combine sz w (S n) (@WS true n (wones n))) false) true *) rewrite wmsb_combine with (b2:= false) by discriminate; cbn. (* Goal: @eq bool (@wmsb n (wones n) true) true *) clear; induction n; cbn; auto. (* BG Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@combine sz w n (wzero n)) false) false *) - (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@combine sz w n (wzero n)) false) false *) destruct n; cbn. (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@combine sz w (S n) (@WS false n (natToWord n O))) false) false *) (* Goal: @eq bool (@wmsb (Init.Nat.add sz O) (@combine sz w O WO) false) false *) + (* Goal: @eq bool (@wmsb (Init.Nat.add sz O) (@combine sz w O WO) false) false *) rewrite wmsb_combine_WO; auto. (* BG Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@combine sz w (S n) (@WS false n (natToWord n O))) false) false *) + (* Goal: @eq bool (@wmsb (Init.Nat.add sz (S n)) (@combine sz w (S n) (@WS false n (natToWord n O))) false) false *) rewrite wmsb_combine with (b2:= false) by discriminate; cbn. (* Goal: @eq bool (@wmsb n (natToWord n O) false) false *) clear; induction n; cbn; auto. Qed. Lemma wmsb_wlshift_sext: forall sz (w: word sz) n, wmsb (sext w n) false = wmsb (wlshift (sext w n) n) false. Proof. (* Goal: forall (sz : nat) (w : word sz) (n : nat), @eq bool (@wmsb (Init.Nat.add sz n) (@sext sz w n) false) (@wmsb (Init.Nat.add sz n) (@wlshift (Init.Nat.add sz n) (@sext sz w n) n) false) *) intros. (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@sext sz w n) false) (@wmsb (Init.Nat.add sz n) (@wlshift (Init.Nat.add sz n) (@sext sz w n) n) false) *) pose proof (wlshift_sext_extz w n). (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@sext sz w n) false) (@wmsb (Init.Nat.add sz n) (@wlshift (Init.Nat.add sz n) (@sext sz w n) n) false) *) apply wmsb_existT with (b:= false) in H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@sext sz w n) false) (@wmsb (Init.Nat.add sz n) (@wlshift (Init.Nat.add sz n) (@sext sz w n) n) false) *) rewrite H. (* Goal: @eq bool (@wmsb (Init.Nat.add sz n) (@sext sz w n) false) (@wmsb (Init.Nat.add n sz) (@extz sz w n) false) *) rewrite wmsb_sext. (* Goal: @eq bool (@wmsb sz w false) (@wmsb (Init.Nat.add n sz) (@extz sz w n) false) *) rewrite wmsb_extz. (* Goal: @eq bool (@wmsb sz w false) (@wmsb sz w false) *) reflexivity. Qed. Lemma wordToZ_wordToNat_pos: forall sz (w: word sz), wmsb w false = false -> Z.of_nat (wordToNat w) = wordToZ w. Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : @eq bool (@wmsb sz w false) false), @eq Z (Z.of_nat (@wordToNat sz w)) (@wordToZ sz w) *) unfold wordToZ; intros. (* Goal: @eq Z (Z.of_nat (@wordToNat sz w)) (if @wmsb sz w false then match @wordToN sz (@wneg sz w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end) *) rewrite H. (* Goal: @eq Z (Z.of_nat (@wordToNat sz w)) match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end *) rewrite <-wordToN_to_nat. (* Goal: @eq Z (Z.of_nat (N.to_nat (@wordToN sz w))) match @wordToN sz w with | N0 => Z0 | Npos x => Zpos x end *) destruct (wordToN w). (* Goal: @eq Z (Z.of_nat (N.to_nat (Npos p))) (Zpos p) *) (* Goal: @eq Z (Z.of_nat (N.to_nat N0)) Z0 *) - (* Goal: @eq Z (Z.of_nat (N.to_nat N0)) Z0 *) reflexivity. (* BG Goal: @eq Z (Z.of_nat (N.to_nat (Npos p))) (Zpos p) *) - (* Goal: @eq Z (Z.of_nat (N.to_nat (Npos p))) (Zpos p) *) simpl; apply positive_nat_Z. Qed. Corollary wmsb_Zabs_pos: forall sz (w: word sz), wmsb w false = false -> Z.abs (wordToZ w) = wordToZ w. Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : @eq bool (@wmsb sz w false) false), @eq Z (Z.abs (@wordToZ sz w)) (@wordToZ sz w) *) intros. (* Goal: @eq Z (Z.abs (@wordToZ sz w)) (@wordToZ sz w) *) apply wmsb_false_pos in H. (* Goal: @eq Z (Z.abs (@wordToZ sz w)) (@wordToZ sz w) *) unfold Z.abs. (* Goal: @eq Z match @wordToZ sz w with | Z0 => Z0 | Zpos p => Zpos p | Zneg p => Zpos p end (@wordToZ sz w) *) destruct (wordToZ w); auto. (* Goal: @eq Z (Zpos p) (Zneg p) *) pose proof (Zlt_neg_0 p); omega. Qed. Corollary wmsb_Zabs_neg: forall sz (w: word sz), wmsb w false = true -> (Z.abs (wordToZ w) = - wordToZ w)%Z. Proof. (* Goal: forall (sz : nat) (w : word sz) (_ : @eq bool (@wmsb sz w false) true), @eq Z (Z.abs (@wordToZ sz w)) (Z.opp (@wordToZ sz w)) *) intros. (* Goal: @eq Z (Z.abs (@wordToZ sz w)) (Z.opp (@wordToZ sz w)) *) apply wmsb_true_neg in H. (* Goal: @eq Z (Z.abs (@wordToZ sz w)) (Z.opp (@wordToZ sz w)) *) unfold Z.abs. (* Goal: @eq Z match @wordToZ sz w with | Z0 => Z0 | Zpos p => Zpos p | Zneg p => Zpos p end (Z.opp (@wordToZ sz w)) *) destruct (wordToZ w); auto. (* Goal: @eq Z (Zpos p) (Z.opp (Zpos p)) *) pose proof (Zgt_pos_0 p); omega. Qed. Lemma wordToN_combine: forall sz1 (w1: word sz1) sz2 (w2: word sz2), wordToN (combine w1 w2) = (wordToN w1 + Npow2 sz1 * wordToN w2)%N. Proof. (* Goal: forall (sz1 : nat) (w1 : word sz1) (sz2 : nat) (w2 : word sz2), @eq N (@wordToN (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (N.add (@wordToN sz1 w1) (N.mul (Npow2 sz1) (@wordToN sz2 w2))) *) intros. (* Goal: @eq N (@wordToN (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2)) (N.add (@wordToN sz1 w1) (N.mul (Npow2 sz1) (@wordToN sz2 w2))) *) repeat rewrite wordToN_nat. (* Goal: @eq N (N.of_nat (@wordToNat (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2))) (N.add (N.of_nat (@wordToNat sz1 w1)) (N.mul (Npow2 sz1) (N.of_nat (@wordToNat sz2 w2)))) *) rewrite pow2_N. (* Goal: @eq N (N.of_nat (@wordToNat (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2))) (N.add (N.of_nat (@wordToNat sz1 w1)) (N.mul (N.of_nat (Nat.pow (S (S O)) sz1)) (N.of_nat (@wordToNat sz2 w2)))) *) rewrite <-Nat2N.inj_mul, <-Nat2N.inj_add. (* Goal: @eq N (N.of_nat (@wordToNat (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 w2))) (N.of_nat (Init.Nat.add (@wordToNat sz1 w1) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w2)))) *) rewrite wordToNat_combine; reflexivity. Qed. Lemma word_exists_bound: forall sz z, (- Z.of_nat (pow2 sz) <= z < Z.of_nat (pow2 sz))%Z -> Proof. (* Goal: forall (sz : nat) (z : Z) (_ : and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) z) (Z.lt z (Z.of_nat (Nat.pow (S (S O)) sz)))), @ex (word (S sz)) (fun w : word (S sz) => @eq Z (@wordToZ (S sz) w) z) *) intros. (* Goal: @ex (word (S sz)) (fun w : word (S sz) => @eq Z (@wordToZ (S sz) w) z) *) exists (ZToWord (S sz) z). (* Goal: @eq Z (@wordToZ (S sz) (ZToWord (S sz) z)) z *) apply wordToZ_ZToWord; assumption. Qed. Lemma sext_size: forall sz n (w: word (sz + n)), sz <> 0 -> (- Z.of_nat (pow2 (sz - 1)) <= wordToZ w < Z.of_nat (pow2 (sz - 1)))%Z -> Proof. (* Goal: forall (sz n : nat) (w : word (Init.Nat.add sz n)) (_ : not (@eq nat sz O)) (_ : and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.sub sz (S O))))) (@wordToZ (Init.Nat.add sz n) w)) (Z.lt (@wordToZ (Init.Nat.add sz n) w) (Z.of_nat (Nat.pow (S (S O)) (Init.Nat.sub sz (S O)))))), @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) *) intros. (* Goal: @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz n)) w (@sext sz sw n)) *) destruct sz; [exfalso; auto|clear H]. (* Goal: @ex (word (S sz)) (fun sw : word (S sz) => @eq (word (Init.Nat.add (S sz) n)) w (@sext (S sz) sw n)) *) simpl in *. (* Goal: @ex (word (S sz)) (fun sw : word (S sz) => @eq (word (S (Init.Nat.add sz n))) w (@sext (S sz) sw n)) *) replace (sz - 0) with sz in H0 by omega. (* Goal: @ex (word (S sz)) (fun sw : word (S sz) => @eq (word (S (Init.Nat.add sz n))) w (@sext (S sz) sw n)) *) apply word_exists_bound in H0. (* Goal: @ex (word (S sz)) (fun sw : word (S sz) => @eq (word (S (Init.Nat.add sz n))) w (@sext (S sz) sw n)) *) destruct H0 as [sw ?]. (* Goal: @ex (word (S sz)) (fun sw : word (S sz) => @eq (word (S (Init.Nat.add sz n))) w (@sext (S sz) sw n)) *) exists sw. (* Goal: @eq (word (S (Init.Nat.add sz n))) w (@sext (S sz) sw n) *) apply wordToZ_inj. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add sz n)) w) (@wordToZ (S (Init.Nat.add sz n)) (@sext (S sz) sw n)) *) change (S (sz + n)) with (S sz + n). (* Goal: @eq Z (@wordToZ (Init.Nat.add (S sz) n) w) (@wordToZ (Init.Nat.add (S sz) n) (@sext (S sz) sw n)) *) rewrite sext_wordToZ. (* Goal: @eq Z (@wordToZ (Init.Nat.add (S sz) n) w) (@wordToZ (S sz) sw) *) auto. Qed. Lemma wordToZ_combine_WO: forall sz (w: word sz), wordToZ (combine w WO) = wordToZ w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq Z (@wordToZ (Init.Nat.add sz O) (@combine sz w O WO)) (@wordToZ sz w) *) dependent induction w; [reflexivity|]. (* Goal: @eq Z (@wordToZ (Init.Nat.add (S n) O) (@combine (S n) (@WS b n w) O WO)) (@wordToZ (S n) (@WS b n w)) *) simpl; destruct b. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add n O)) (@WS false (Init.Nat.add n O) (@combine n w O WO))) (@wordToZ (S n) (@WS false n w)) *) (* Goal: @eq Z (@wordToZ (S (Init.Nat.add n O)) (@WS true (Init.Nat.add n O) (@combine n w O WO))) (@wordToZ (S n) (@WS true n w)) *) - (* Goal: @eq Z (@wordToZ (S (Init.Nat.add n O)) (@WS true (Init.Nat.add n O) (@combine n w O WO))) (@wordToZ (S n) (@WS true n w)) *) destruct n; [rewrite (shatter_word w); reflexivity|]. (* Goal: @eq Z (@wordToZ (S (Init.Nat.add (S n) O)) (@WS true (Init.Nat.add (S n) O) (@combine (S n) w O WO))) (@wordToZ (S (S n)) (@WS true (S n) w)) *) change (S n + 0) with (S (n + 0)) in *. (* Goal: @eq Z (@wordToZ (S (S (Init.Nat.add n O))) (@WS true (S (Init.Nat.add n O)) (@combine (S n) w O WO))) (@wordToZ (S (S n)) (@WS true (S n) w)) *) do 2 rewrite wordToZ_WS_1. (* Goal: @eq Z (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S (Init.Nat.add n O)) (@combine (S n) w O WO))) (Zpos xH)) (Z.add (Z.mul (Zpos (xO xH)) (@wordToZ (S n) w)) (Zpos xH)) *) rewrite IHw; reflexivity. (* BG Goal: @eq Z (@wordToZ (S (Init.Nat.add n O)) (@WS false (Init.Nat.add n O) (@combine n w O WO))) (@wordToZ (S n) (@WS false n w)) *) - (* Goal: @eq Z (@wordToZ (S (Init.Nat.add n O)) (@WS false (Init.Nat.add n O) (@combine n w O WO))) (@wordToZ (S n) (@WS false n w)) *) do 2 rewrite wordToZ_WS_0. (* Goal: @eq Z (Z.mul (Zpos (xO xH)) (@wordToZ (Init.Nat.add n O) (@combine n w O WO))) (Z.mul (Zpos (xO xH)) (@wordToZ n w)) *) rewrite IHw; reflexivity. Qed. Lemma combine_WO: forall sz (w: word sz), combine w WO = eq_rect _ word w _ (Nat.add_comm 0 sz). Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word (Init.Nat.add sz O)) (@combine sz w O WO) (@eq_rect nat sz word w (Nat.add sz O) (Nat.add_comm O sz)) *) intros. (* Goal: @eq (word (Init.Nat.add sz O)) (@combine sz w O WO) (@eq_rect nat sz word w (Nat.add sz O) (Nat.add_comm O sz)) *) apply wordToZ_inj. (* Goal: @eq Z (@wordToZ (Init.Nat.add sz O) (@combine sz w O WO)) (@wordToZ (Init.Nat.add sz O) (@eq_rect nat sz word w (Nat.add sz O) (Nat.add_comm O sz))) *) rewrite wordToZ_eq_rect. (* Goal: @eq Z (@wordToZ (Init.Nat.add sz O) (@combine sz w O WO)) (@wordToZ sz w) *) apply wordToZ_combine_WO. Qed. Lemma zext_zero: forall sz (w: word sz), zext w 0 = eq_rect _ word w _ (Nat.add_comm 0 sz). Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word (Init.Nat.add sz O)) (@zext sz w O) (@eq_rect nat sz word w (Nat.add sz O) (Nat.add_comm O sz)) *) unfold zext; intros. (* Goal: @eq (word (Init.Nat.add sz O)) (@combine sz w O (wzero O)) (@eq_rect nat sz word w (Nat.add sz O) (Nat.add_comm O sz)) *) apply combine_WO. Qed. Lemma wmsb_false_wordToNat_eq: forall sz (w: word (S sz)), wmsb w false = false -> wordToNat w = wordToNat (split1 sz _ (eq_rect _ word w _ (Nat.add_comm 1 sz))). Proof. (* Goal: forall (sz : nat) (w : word (S sz)) (_ : @eq bool (@wmsb (S sz) w false) false), @eq nat (@wordToNat (S sz) w) (@wordToNat sz (split1 sz (S O) (@eq_rect nat (S sz) word w (Nat.add sz (S O)) (Nat.add_comm (S O) sz)))) *) intros. (* Goal: @eq nat (@wordToNat (S sz) w) (@wordToNat sz (split1 sz (S O) (@eq_rect nat (S sz) word w (Nat.add sz (S O)) (Nat.add_comm (S O) sz)))) *) remember (eq_rect _ word w _ (Nat.add_comm 1 sz)) as ww. (* Goal: @eq nat (@wordToNat (S sz) w) (@wordToNat sz (split1 sz (S O) ww)) *) assert (wmsb ww false = false) by (subst; rewrite <-wmsb_eq_rect; assumption). (* Goal: @eq nat (@wordToNat (S sz) w) (@wordToNat sz (split1 sz (S O) ww)) *) replace (wordToNat w) with (wordToNat ww) by (subst; rewrite wordToNat_eq_rect; reflexivity). (* Goal: @eq nat (@wordToNat (Nat.add sz (S O)) ww) (@wordToNat sz (split1 sz (S O) ww)) *) clear Heqww H w. (* Goal: @eq nat (@wordToNat (Nat.add sz (S O)) ww) (@wordToNat sz (split1 sz (S O) ww)) *) apply wmsb_false_split2_wzero in H0. (* Goal: @eq nat (@wordToNat (Nat.add sz (S O)) ww) (@wordToNat sz (split1 sz (S O) ww)) *) rewrite <-combine_split with (w:= ww) at 1. (* Goal: @eq nat (@wordToNat (Nat.add sz (S O)) (@combine sz (split1 sz (S O) ww) (S O) (split2 sz (S O) ww))) (@wordToNat sz (split1 sz (S O) ww)) *) rewrite wordToNat_combine. (* Goal: @eq nat (Init.Nat.add (@wordToNat sz (split1 sz (S O) ww)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat (S O) (split2 sz (S O) ww)))) (@wordToNat sz (split1 sz (S O) ww)) *) rewrite <-H0. (* Goal: @eq nat (Init.Nat.add (@wordToNat sz (split1 sz (S O) ww)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat (S O) (wzero (S O))))) (@wordToNat sz (split1 sz (S O) ww)) *) cbn; omega. Qed. Lemma wordToZ_bound_weakened: forall z n, (Z.abs z < n)%Z -> (- n <= z < n)%Z. Proof. (* Goal: forall (z n : Z) (_ : Z.lt (Z.abs z) n), and (Z.le (Z.opp n) z) (Z.lt z n) *) intros. (* Goal: and (Z.le (Z.opp n) z) (Z.lt z n) *) apply Z.abs_lt in H. (* Goal: and (Z.le (Z.opp n) z) (Z.lt z n) *) omega. Qed. Lemma zext_size: forall sz n (w: word (sz + n)), (- Z.of_nat (pow2 sz) <= wordToZ w < Z.of_nat (pow2 sz))%Z -> Lemma zext_size_1: forall sz (w: word (sz + 1)), wmsb w false = false -> exists sw, w = zext sw 1. Proof. (* Goal: forall (sz : nat) (w : word (Init.Nat.add sz (S O))) (_ : @eq bool (@wmsb (Init.Nat.add sz (S O)) w false) false), @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz (S O))) w (@zext sz sw (S O))) *) intros. (* Goal: @ex (word sz) (fun sw : word sz => @eq (word (Init.Nat.add sz (S O))) w (@zext sz sw (S O))) *) apply zext_size; auto. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (@wordToZ (Init.Nat.add sz (S O)) w)) (Z.lt (@wordToZ (Init.Nat.add sz (S O)) w) (Z.of_nat (Nat.pow (S (S O)) sz))) *) generalize dependent w. (* Goal: forall (w : word (Init.Nat.add sz (S O))) (_ : @eq bool (@wmsb (Init.Nat.add sz (S O)) w false) false), and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (@wordToZ (Init.Nat.add sz (S O)) w)) (Z.lt (@wordToZ (Init.Nat.add sz (S O)) w) (Z.of_nat (Nat.pow (S (S O)) sz))) *) replace (sz + 1) with (S sz) by omega. (* Goal: forall (w : word (S sz)) (_ : @eq bool (@wmsb (S sz) w false) false), and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (@wordToZ (S sz) w)) (Z.lt (@wordToZ (S sz) w) (Z.of_nat (Nat.pow (S (S O)) sz))) *) intros. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (@wordToZ (S sz) w)) (Z.lt (@wordToZ (S sz) w) (Z.of_nat (Nat.pow (S (S O)) sz))) *) unfold wordToZ. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (if @wmsb (S sz) w false then match @wordToN (S sz) (@wneg (S sz) w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) w with | N0 => Z0 | Npos x => Zpos x end)) (Z.lt (if @wmsb (S sz) w false then match @wordToN (S sz) (@wneg (S sz) w) with | N0 => Z0 | Npos x => Zneg x end else match @wordToN (S sz) w with | N0 => Z0 | Npos x => Zpos x end) (Z.of_nat (Nat.pow (S (S O)) sz))) *) rewrite H. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) match @wordToN (S sz) w with | N0 => Z0 | Npos x => Zpos x end) (Z.lt match @wordToN (S sz) w with | N0 => Z0 | Npos x => Zpos x end (Z.of_nat (Nat.pow (S (S O)) sz))) *) apply wmsb_false_bound in H. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) match @wordToN (S sz) w with | N0 => Z0 | Npos x => Zpos x end) (Z.lt match @wordToN (S sz) w with | N0 => Z0 | Npos x => Zpos x end (Z.of_nat (Nat.pow (S (S O)) sz))) *) remember (wordToN w) as n; destruct n; simpl. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Zpos p)) (Z.lt (Zpos p) (Z.of_nat (Nat.pow (S (S O)) sz))) *) (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) Z0) (Z.lt Z0 (Z.of_nat (Nat.pow (S (S O)) sz))) *) - (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) Z0) (Z.lt Z0 (Z.of_nat (Nat.pow (S (S O)) sz))) *) split. (* Goal: Z.lt Z0 (Z.of_nat (Nat.pow (S (S O)) sz)) *) (* Goal: Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) Z0 *) + (* Goal: Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) Z0 *) omega. (* BG Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Zpos p)) (Z.lt (Zpos p) (Z.of_nat (Nat.pow (S (S O)) sz))) *) (* BG Goal: Z.lt Z0 (Z.of_nat (Nat.pow (S (S O)) sz)) *) + (* Goal: Z.lt Z0 (Z.of_nat (Nat.pow (S (S O)) sz)) *) pose proof (pow2_zero sz); omega. (* BG Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Zpos p)) (Z.lt (Zpos p) (Z.of_nat (Nat.pow (S (S O)) sz))) *) - (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Zpos p)) (Z.lt (Zpos p) (Z.of_nat (Nat.pow (S (S O)) sz))) *) rewrite <-N2Z.inj_pos. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.of_N (Npos p))) (Z.lt (Z.of_N (Npos p)) (Z.of_nat (Nat.pow (S (S O)) sz))) *) rewrite <-N_nat_Z. (* Goal: and (Z.le (Z.opp (Z.of_nat (Nat.pow (S (S O)) sz))) (Z.of_nat (N.to_nat (Npos p)))) (Z.lt (Z.of_nat (N.to_nat (Npos p))) (Z.of_nat (Nat.pow (S (S O)) sz))) *) split; [omega|]. (* Goal: Z.lt (Z.of_nat (N.to_nat (Npos p))) (Z.of_nat (Nat.pow (S (S O)) sz)) *) apply inj_lt. (* Goal: lt (N.to_nat (Npos p)) (Nat.pow (S (S O)) sz) *) rewrite <-Npow2_nat. (* Goal: lt (N.to_nat (Npos p)) (N.to_nat (Npow2 sz)) *) apply Nlt_out; auto. Qed. Lemma sext_wplus_exist: forall sz (w1 w2: word sz) n, exists w: word (S sz), existT word _ (sext w1 (S n) ^+ sext w2 (S n)) = existT word _ (sext w n). Arguments natToWord : simpl never. Arguments weq : simpl never. Global Opaque wlt_dec. Definition test_wlt_f (a : nat) (b : nat) : nat := if wlt_dec (natToWord 64 a) $0 then 0 else 0. Theorem test_wlt_f_example: forall x y z, test_wlt_f x y = 0 -> test_wlt_f x z = 0. Proof. (* Goal: forall (x y z : nat) (_ : @eq nat (test_wlt_f x y) O), @eq nat (test_wlt_f x z) O *) intros. (* Goal: @eq nat (test_wlt_f x z) O *) exact H. Qed. Lemma wordToNat_eq1: forall sz (a b: word sz), a = b -> wordToNat a = wordToNat b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq (word sz) a b), @eq nat (@wordToNat sz a) (@wordToNat sz b) *) intros; subst; reflexivity. Qed. Lemma wordToNat_eq2: forall sz (a b: word sz), wordToNat a = wordToNat b -> a = b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq nat (@wordToNat sz a) (@wordToNat sz b)), @eq (word sz) a b *) intros. (* Goal: @eq (word sz) a b *) rewrite <- natToWord_wordToNat with (w := a). (* Goal: @eq (word sz) (natToWord sz (@wordToNat sz a)) b *) rewrite <- natToWord_wordToNat with (w := b). (* Goal: @eq (word sz) (natToWord sz (@wordToNat sz a)) (natToWord sz (@wordToNat sz b)) *) rewrite H. (* Goal: @eq (word sz) (natToWord sz (@wordToNat sz b)) (natToWord sz (@wordToNat sz b)) *) reflexivity. Qed. Lemma wordToNat_lt1: forall sz (a b: word sz), a < b -> (wordToNat a < wordToNat b)%nat. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @wlt sz a b), lt (@wordToNat sz a) (@wordToNat sz b) *) intros. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) pre_nomega. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite wordToN_to_nat in H. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) assumption. Qed. Lemma wordToNat_lt2: forall sz (a b: word sz), (wordToNat a < wordToNat b)%nat -> a < b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : lt (@wordToNat sz a) (@wordToNat sz b)), @wlt sz a b *) intros. (* Goal: @wlt sz a b *) pre_nomega. (* Goal: lt (N.to_nat (@wordToN sz a)) (N.to_nat (@wordToN sz b)) *) repeat rewrite wordToN_to_nat. (* Goal: lt (@wordToNat sz a) (@wordToNat sz b) *) assumption. Qed. Lemma wordToNat_gt1: forall sz (a b: word sz), a > b -> (wordToNat a > wordToNat b)%nat. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @wlt sz b a), gt (@wordToNat sz a) (@wordToNat sz b) *) intros. (* Goal: gt (@wordToNat sz a) (@wordToNat sz b) *) pre_nomega. (* Goal: gt (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite wordToN_to_nat in H. (* Goal: gt (@wordToNat sz a) (@wordToNat sz b) *) assumption. Qed. Lemma wordToNat_gt2: forall sz (a b: word sz), (wordToNat a > wordToNat b)%nat -> a > b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : gt (@wordToNat sz a) (@wordToNat sz b)), @wlt sz b a *) intros. (* Goal: @wlt sz b a *) pre_nomega. (* Goal: lt (N.to_nat (@wordToN sz b)) (N.to_nat (@wordToN sz a)) *) repeat rewrite wordToN_to_nat. (* Goal: lt (@wordToNat sz b) (@wordToNat sz a) *) assumption. Qed. Lemma wordToNat_le1: forall sz (a b: word sz), a <= b -> (wordToNat a <= wordToNat b)%nat. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@wlt sz b a)), le (@wordToNat sz a) (@wordToNat sz b) *) intros. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) pre_nomega. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite wordToN_to_nat in H. (* Goal: le (@wordToNat sz a) (@wordToNat sz b) *) assumption. Qed. Lemma wordToNat_le2: forall sz (a b: word sz), (wordToNat a <= wordToNat b)%nat -> a <= b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : le (@wordToNat sz a) (@wordToNat sz b)), not (@wlt sz b a) *) intros. (* Goal: not (@wlt sz b a) *) pre_nomega. (* Goal: ge (N.to_nat (@wordToN sz b)) (N.to_nat (@wordToN sz a)) *) repeat rewrite wordToN_to_nat. (* Goal: ge (@wordToNat sz b) (@wordToNat sz a) *) assumption. Qed. Lemma wordToNat_ge1: forall sz (a b: word sz), a >= b -> (wordToNat a >= wordToNat b)%nat. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@wlt sz a b)), ge (@wordToNat sz a) (@wordToNat sz b) *) intros. (* Goal: ge (@wordToNat sz a) (@wordToNat sz b) *) pre_nomega. (* Goal: ge (@wordToNat sz a) (@wordToNat sz b) *) repeat rewrite wordToN_to_nat in H. (* Goal: ge (@wordToNat sz a) (@wordToNat sz b) *) assumption. Qed. Lemma wordToNat_ge2: forall sz (a b: word sz), (wordToNat a >= wordToNat b)%nat -> a >= b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : ge (@wordToNat sz a) (@wordToNat sz b)), not (@wlt sz a b) *) intros. (* Goal: not (@wlt sz a b) *) pre_nomega. (* Goal: ge (N.to_nat (@wordToN sz a)) (N.to_nat (@wordToN sz b)) *) repeat rewrite wordToN_to_nat. (* Goal: ge (@wordToNat sz a) (@wordToNat sz b) *) assumption. Qed. Lemma wordToNat_neq1: forall sz (a b: word sz), a <> b -> wordToNat a <> wordToNat b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@eq (word sz) a b)), not (@eq nat (@wordToNat sz a) (@wordToNat sz b)) *) unfold not. (* Goal: forall (sz : nat) (a b : word sz) (_ : forall _ : @eq (word sz) a b, False) (_ : @eq nat (@wordToNat sz a) (@wordToNat sz b)), False *) intros. (* Goal: False *) apply wordToNat_eq2 in H0. (* Goal: False *) tauto. Qed. Lemma wordToNat_neq2: forall sz (a b: word sz), wordToNat a <> wordToNat b -> a <> b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : not (@eq nat (@wordToNat sz a) (@wordToNat sz b))), not (@eq (word sz) a b) *) unfold not. (* Goal: forall (sz : nat) (a b : word sz) (_ : forall _ : @eq nat (@wordToNat sz a) (@wordToNat sz b), False) (_ : @eq (word sz) a b), False *) intros. (* Goal: False *) subst. (* Goal: False *) tauto. Qed. Lemma wordToNat_wplus': forall sz (a b: word sz), (#a + #b < pow2 sz)%nat -> #(a ^+ b) = #a + #b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : lt (Init.Nat.add (@wordToNat sz a) (@wordToNat sz b)) (Nat.pow (S (S O)) sz)), @eq nat (@wordToNat sz (@wplus sz a b)) (Init.Nat.add (@wordToNat sz a) (@wordToNat sz b)) *) intros. (* Goal: @eq nat (@wordToNat sz (@wplus sz a b)) (Init.Nat.add (@wordToNat sz a) (@wordToNat sz b)) *) rewrite <-? wordToN_to_nat in *. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wplus sz a b))) (Init.Nat.add (N.to_nat (@wordToN sz a)) (N.to_nat (@wordToN sz b))) *) rewrite <-? Nnat.N2Nat.inj_add in *. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wplus sz a b))) (N.to_nat (N.add (@wordToN sz a) (@wordToN sz b))) *) rewrite <- Npow2_nat in *. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wplus sz a b))) (N.to_nat (N.add (@wordToN sz a) (@wordToN sz b))) *) apply Nlt_in in H. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wplus sz a b))) (N.to_nat (N.add (@wordToN sz a) (@wordToN sz b))) *) rewrite wordToN_plus by assumption. (* Goal: @eq nat (N.to_nat (N.add (@wordToN sz a) (@wordToN sz b))) (N.to_nat (N.add (@wordToN sz a) (@wordToN sz b))) *) reflexivity. Qed. Lemma wordToNat_wplus'': forall sz (a: word sz) (b: nat), (#a + b < pow2 sz)%nat -> #(a ^+ $b) = #a + b. Proof. (* Goal: forall (sz : nat) (a : word sz) (b : nat) (_ : lt (Init.Nat.add (@wordToNat sz a) b) (Nat.pow (S (S O)) sz)), @eq nat (@wordToNat sz (@wplus sz a (natToWord sz b))) (Init.Nat.add (@wordToNat sz a) b) *) intros. (* Goal: @eq nat (@wordToNat sz (@wplus sz a (natToWord sz b))) (Init.Nat.add (@wordToNat sz a) b) *) rewrite wordToNat_wplus'; rewrite wordToNat_natToWord_2; omega. Qed. Lemma wordToNat_wmult': forall sz (a b: word sz), (#a * #b < pow2 sz)%nat -> #(a ^* b) = #a * #b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : lt (Init.Nat.mul (@wordToNat sz a) (@wordToNat sz b)) (Nat.pow (S (S O)) sz)), @eq nat (@wordToNat sz (@wmult sz a b)) (Init.Nat.mul (@wordToNat sz a) (@wordToNat sz b)) *) intros. (* Goal: @eq nat (@wordToNat sz (@wmult sz a b)) (Init.Nat.mul (@wordToNat sz a) (@wordToNat sz b)) *) rewrite <-? wordToN_to_nat in *. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wmult sz a b))) (Init.Nat.mul (N.to_nat (@wordToN sz a)) (N.to_nat (@wordToN sz b))) *) rewrite <-? Nnat.N2Nat.inj_mul in *. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wmult sz a b))) (N.to_nat (N.mul (@wordToN sz a) (@wordToN sz b))) *) rewrite <- Npow2_nat in *. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wmult sz a b))) (N.to_nat (N.mul (@wordToN sz a) (@wordToN sz b))) *) apply Nlt_in in H. (* Goal: @eq nat (N.to_nat (@wordToN sz (@wmult sz a b))) (N.to_nat (N.mul (@wordToN sz a) (@wordToN sz b))) *) rewrite wordToN_mult by assumption. (* Goal: @eq nat (N.to_nat (N.mul (@wordToN sz a) (@wordToN sz b))) (N.to_nat (N.mul (@wordToN sz a) (@wordToN sz b))) *) reflexivity. Qed. Lemma wordNotNot: forall sz (a b: word sz), (a <> b -> False) -> a = b. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : forall _ : not (@eq (word sz) a b), False), @eq (word sz) a b *) intros. (* Goal: @eq (word sz) a b *) destruct (weq a b); subst; tauto. Qed. Ltac pre_word_omega := unfold wzero, wone in *; repeat match goal with | H: @eq ?T ?a ?b |- _ => match T with | word ?sz => apply (@wordToNat_eq1 sz a b) in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H end | |- @eq ?T ?a ?b => match T with | word ?sz => apply (@wordToNat_eq2 sz a b); rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl end | H: ?a < ?b |- _ => apply wordToNat_lt1 in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H | |- ?a < ?b => apply wordToNat_lt2; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl | H: ?a > ?b |- _ => apply wordToNat_gt1 in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H | |- ?a > ?b => apply wordToNat_gt2; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl | H: ?a <= ?b |- _ => apply wordToNat_le1 in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H | |- ?a <= ?b => apply wordToNat_le2; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl | H: ?a > ?b -> False |- _ => apply wordToNat_le1 in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H | |- ?a > ?b -> False => apply wordToNat_le2; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl | H: ?a < ?b -> False |- _ => apply wordToNat_ge1 in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H | |- ?a < ?b -> False => apply wordToNat_ge2; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl | H: not (@eq ?T ?a ?b) |- _ => match T with | word ?sz => apply (@wordToNat_neq1 sz a b) in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H end | |- not (@eq ?T ?a ?b) => match T with | word ?sz => apply (@wordToNat_neq2 sz a b); rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl end | H: @eq ?T ?a ?b -> False |- _ => match T with | word ?sz => apply (@wordToNat_neq1 sz a b) in H; rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one in H; simpl in H end | |- @eq ?T ?a ?b -> False => match T with | word ?sz => apply (@wordToNat_neq2 sz a b); rewrite ?roundTrip_0, ?roundTrip_1, ?wones_pow2_minus_one; simpl end | H: (@eq ?T ?a ?b -> False) -> False |- _ => match T with | word ?sz => apply (@wordNotNot sz a b) in H end | H: (not (@eq ?T ?a ?b)) -> False |- _ => match T with | word ?sz => apply (@wordNotNot sz a b) in H end | H: not (@eq ?T ?a ?b -> False) |- _ => match T with | word ?sz => apply (@wordNotNot sz a b) in H end | H: not (not (@eq ?T ?a ?b)) |- _ => match T with | word ?sz => apply (@wordNotNot sz a b) in H end end. Ltac word_omega := pre_word_omega; omega. Lemma word_le_ge_eq sz (w1 w2: word sz): w1 <= w2 -> w1 >= w2 -> w1 = w2. Proof. (* Goal: forall (_ : not (@wlt sz w2 w1)) (_ : not (@wlt sz w1 w2)), @eq (word sz) w1 w2 *) intros; word_omega. Qed. Lemma word_le_zero sz (w: word sz): w <= wzero sz -> w = wzero sz. Proof. (* Goal: forall _ : not (@wlt sz (wzero sz) w), @eq (word sz) w (wzero sz) *) intros; word_omega. Qed. Close Scope word_scope. Open Scope word_scope. Local Open Scope nat. Lemma wzero_wones: forall sz, sz >= 1 -> natToWord sz 0 <> wones sz. Proof. (* Goal: forall (sz : nat) (_ : ge sz (S O)), not (@eq (word sz) (natToWord sz O) (wones sz)) *) intros. (* Goal: not (@eq (word sz) (natToWord sz O) (wones sz)) *) unfold not. (* Goal: forall _ : @eq (word sz) (natToWord sz O) (wones sz), False *) intros. (* Goal: False *) pose proof (f_equal (@wordToNat sz) H0) as sth. (* Goal: False *) unfold wzero in *. (* Goal: False *) rewrite roundTrip_0 in *. (* Goal: False *) rewrite wones_pow2_minus_one in sth. (* Goal: False *) destruct sz; [omega | ]. (* Goal: False *) pose proof (NatLib.one_lt_pow2 sz). (* Goal: False *) omega. Qed. Lemma wzero_wplus: forall sz w, wzero sz ^+ w = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wplus sz (wzero sz) w) w *) intros. (* Goal: @eq (word sz) (@wplus sz (wzero sz) w) w *) unfold wzero. (* Goal: @eq (word sz) (@wplus sz (natToWord sz O) w) w *) apply wplus_unit. Qed. Lemma wordToNat_nonZero sz (w: word sz): w <> wzero sz -> wordToNat w > 0. Proof. (* Goal: forall _ : not (@eq (word sz) w (wzero sz)), gt (@wordToNat sz w) O *) induction w; simpl; unfold wzero; simpl; intros. (* Goal: gt (if b then S (Init.Nat.mul (@wordToNat n w) (S (S O))) else Init.Nat.mul (@wordToNat n w) (S (S O))) O *) (* Goal: gt O O *) - (* Goal: gt O O *) tauto. (* BG Goal: gt (if b then S (Init.Nat.mul (@wordToNat n w) (S (S O))) else Init.Nat.mul (@wordToNat n w) (S (S O))) O *) - (* Goal: gt (if b then S (Init.Nat.mul (@wordToNat n w) (S (S O))) else Init.Nat.mul (@wordToNat n w) (S (S O))) O *) destruct b. (* Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) (* Goal: gt (S (Init.Nat.mul (@wordToNat n w) (S (S O)))) O *) + (* Goal: gt (S (Init.Nat.mul (@wordToNat n w) (S (S O)))) O *) omega. (* BG Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) + (* Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) assert (sth: w <> (natToWord n 0)). (* Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) (* Goal: not (@eq (word n) w (natToWord n O)) *) { (* Goal: not (@eq (word n) w (natToWord n O)) *) intro. (* Goal: False *) subst. (* Goal: False *) tauto. (* BG Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) } (* Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) assert (sth2: wordToNat w <> 0). (* Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) (* Goal: not (@eq nat (@wordToNat n w) O) *) { (* Goal: not (@eq nat (@wordToNat n w) O) *) intro sth3. (* Goal: False *) specialize (IHw sth). (* Goal: False *) omega. (* BG Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) } (* Goal: gt (Init.Nat.mul (@wordToNat n w) (S (S O))) O *) omega. Qed. Lemma split2_pow2: forall sz n, 2 ^ sz <= n < 2 ^ S sz -> wordToNat (split2 sz 1 (natToWord (sz + 1) n)) = 1. Proof. (* Goal: forall (sz n : nat) (_ : and (le (Nat.pow (S (S O)) sz) n) (lt n (Nat.pow (S (S O)) (S sz)))), @eq nat (@wordToNat (S O) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) n))) (S O) *) intros. (* Goal: @eq nat (@wordToNat (S O) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) n))) (S O) *) rewrite wordToNat_split2. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) n)) (Nat.pow (S (S O)) sz)) (S O) *) simpl in *. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) n)) (Nat.pow (S (S O)) sz)) (S O) *) rewrite Nat.add_0_r in *. (* Goal: @eq nat (Nat.div (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) n)) (Nat.pow (S (S O)) sz)) (S O) *) rewrite wordToNat_natToWord_bound with (bound := wones _). (* Goal: le n (@wordToNat (Init.Nat.add sz (S O)) (wones (Init.Nat.add sz (S O)))) *) (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) - (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) destruct H. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) assert (sth: pow2 sz <> 0) by omega. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) pose proof (Nat.div_le_mono _ _ (pow2 sz) sth H) as sth2. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) rewrite Nat.div_same in sth2 by auto. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) apply Nat.lt_le_pred in H0. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) pose proof (Nat.div_le_mono _ _ (pow2 sz) sth H0) as sth3. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) rewrite <- Nat.sub_1_r in sth3. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) assert (sth4: pow2 sz = 1 * pow2 sz) by omega. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) rewrite sth4 in sth3 at 2. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) assert (sth5: 1 * pow2 sz + pow2 sz - 1 = 1 * pow2 sz + (pow2 sz - 1)) by omega. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) rewrite sth5 in sth3. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) rewrite Nat.div_add_l in sth3 by omega. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) rewrite Nat.div_small with (a := pow2 sz - 1) in sth3 by omega. (* Goal: @eq nat (Nat.div n (Nat.pow (S (S O)) sz)) (S O) *) omega. (* BG Goal: le n (@wordToNat (Init.Nat.add sz (S O)) (wones (Init.Nat.add sz (S O)))) *) - (* Goal: le n (@wordToNat (Init.Nat.add sz (S O)) (wones (Init.Nat.add sz (S O)))) *) rewrite wones_pow2_minus_one. (* Goal: le n (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz (S O))) (S O)) *) assert (sth: sz + 1 = S sz) by omega. (* Goal: le n (Init.Nat.sub (Nat.pow (S (S O)) (Init.Nat.add sz (S O))) (S O)) *) rewrite sth. (* Goal: le n (Init.Nat.sub (Nat.pow (S (S O)) (S sz)) (S O)) *) simpl. (* Goal: le n (Init.Nat.sub (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) (S O)) *) omega. Qed. Lemma combine_wones_WO sz: forall w, w <> wzero sz -> split2 sz 1 (combine (wones sz) ($ 0) ^+ combine w ($ 0)) = WO~1. Proof. (* Goal: forall (w : word sz) (_ : not (@eq (word sz) w (wzero sz))), @eq (word (S O)) (split2 sz (S O) (@wplus (Init.Nat.add sz (S O)) (@combine sz (wones sz) (S O) (natToWord (S O) O)) (@combine sz w (S O) (natToWord (S O) O)))) (@WS true O WO) *) intros. (* Goal: @eq (word (S O)) (split2 sz (S O) (@wplus (Init.Nat.add sz (S O)) (@combine sz (wones sz) (S O) (natToWord (S O) O)) (@combine sz w (S O) (natToWord (S O) O)))) (@WS true O WO) *) match goal with | |- split2 _ _ (?a ^+ ?b) = _ => rewrite <- (@natToWord_wordToNat _ a); rewrite <- (@natToWord_wordToNat _ b) end. (* Goal: @eq (word (S O)) (split2 sz (S O) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (@wordToNat (Init.Nat.add sz (S O)) (@combine sz (wones sz) (S O) (natToWord (S O) O)))) (natToWord (Init.Nat.add sz (S O)) (@wordToNat (Init.Nat.add sz (S O)) (@combine sz w (S O) (natToWord (S O) O)))))) (@WS true O WO) *) rewrite <- natToWord_plus. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (@wordToNat (Init.Nat.add sz (S O)) (@combine sz (wones sz) (S O) (natToWord (S O) O))) (@wordToNat (Init.Nat.add sz (S O)) (@combine sz w (S O) (natToWord (S O) O)))))) (@WS true O WO) *) rewrite ?wordToNat_combine. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (@wordToNat sz (wones sz)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat (S O) (natToWord (S O) O)))) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat (S O) (natToWord (S O) O))))))) (@WS true O WO) *) simpl. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (@wordToNat sz (wones sz)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) rewrite wones_pow2_minus_one. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) pose proof (wordToNat_bound w) as sth. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) pose proof (wordToNat_nonZero H). (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) assert (sth2: 2^sz <= 2 ^ sz - 1 + wordToNat w < 2 ^ (S sz)). (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) (* Goal: and (le (Nat.pow (S (S O)) sz) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w))) (lt (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w)) (Nat.pow (S (S O)) (S sz))) *) { (* Goal: and (le (Nat.pow (S (S O)) sz) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w))) (lt (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w)) (Nat.pow (S (S O)) (S sz))) *) pose proof (pow2_zero sz) as sth3. (* Goal: and (le (Nat.pow (S (S O)) sz) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w))) (lt (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w)) (Nat.pow (S (S O)) (S sz))) *) split; simpl; omega. (* BG Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) } (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) apply split2_pow2 in sth2. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) (Init.Nat.add (@wordToNat sz w) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))))) (@WS true O WO) *) rewrite Nat.mul_0_r. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) O) (Init.Nat.add (@wordToNat sz w) O)))) (@WS true O WO) *) rewrite ?Nat.add_0_r. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w)))) (@WS true O WO) *) apply (f_equal (natToWord 1)) in sth2. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w)))) (@WS true O WO) *) rewrite natToWord_wordToNat in sth2. (* Goal: @eq (word (S O)) (split2 sz (S O) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Init.Nat.sub (Nat.pow (S (S O)) sz) (S O)) (@wordToNat sz w)))) (@WS true O WO) *) assumption. Qed. Lemma wordToNat_plus sz (w1 w2: word sz): natToWord sz (wordToNat w1 + wordToNat w2) = w1 ^+ w2. Proof. (* Goal: @eq (word sz) (natToWord sz (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2))) (@wplus sz w1 w2) *) rewrite natToWord_plus. (* Goal: @eq (word sz) (@wplus sz (natToWord sz (@wordToNat sz w1)) (natToWord sz (@wordToNat sz w2))) (@wplus sz w1 w2) *) rewrite ?natToWord_wordToNat. (* Goal: @eq (word sz) (@wplus sz w1 w2) (@wplus sz w1 w2) *) auto. Qed. Lemma wordToNat_natToWord_eqn sz: forall n, wordToNat (natToWord sz n) = n mod (pow2 sz). Proof. (* Goal: forall n : nat, @eq nat (@wordToNat sz (natToWord sz n)) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) intros. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) pose proof (wordToNat_natToWord sz n). (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) destruct H as [? [? ?]]. (* Goal: @eq nat (@wordToNat sz (natToWord sz n)) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) rewrite H. (* Goal: @eq nat (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) sz))) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) assert (sth: pow2 sz * x = x * pow2 sz) by (apply Nat.mul_comm). (* Goal: @eq nat (Init.Nat.sub n (Init.Nat.mul x (Nat.pow (S (S O)) sz))) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) rewrite <- sth in *. (* Goal: @eq nat (Init.Nat.sub n (Init.Nat.mul (Nat.pow (S (S O)) sz) x)) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) clear sth. (* Goal: @eq nat (Init.Nat.sub n (Init.Nat.mul (Nat.pow (S (S O)) sz) x)) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) pose proof (wordToNat_bound (natToWord sz n)). (* Goal: @eq nat (Init.Nat.sub n (Init.Nat.mul (Nat.pow (S (S O)) sz) x)) (Nat.modulo n (Nat.pow (S (S O)) sz)) *) apply (Nat.mod_unique n (pow2 sz) x (n - pow2 sz * x)); try omega. Qed. Lemma mod_factor a b c: b <> 0 -> c <> 0 -> (a mod (b * c)) mod b = a mod b. Proof. (* Goal: forall (_ : not (@eq nat b O)) (_ : not (@eq nat c O)), @eq nat (Nat.modulo (Nat.modulo a (Init.Nat.mul b c)) b) (Nat.modulo a b) *) intros. (* Goal: @eq nat (Nat.modulo (Nat.modulo a (Init.Nat.mul b c)) b) (Nat.modulo a b) *) pose proof (Nat.mod_mul_r a _ _ H H0). (* Goal: @eq nat (Nat.modulo (Nat.modulo a (Init.Nat.mul b c)) b) (Nat.modulo a b) *) rewrite H1. (* Goal: @eq nat (Nat.modulo (Nat.add (Nat.modulo a b) (Nat.mul b (Nat.modulo (Nat.div a b) c))) b) (Nat.modulo a b) *) rewrite Nat.add_mod_idemp_l by auto. (* Goal: @eq nat (Nat.modulo (Nat.add a (Nat.mul b (Nat.modulo (Nat.div a b) c))) b) (Nat.modulo a b) *) rewrite Nat.add_mod by auto. (* Goal: @eq nat (Nat.modulo (Nat.add (Nat.modulo a b) (Nat.modulo (Nat.mul b (Nat.modulo (Nat.div a b) c)) b)) b) (Nat.modulo a b) *) assert (sth: b * ((a/b) mod c) = (a/b) mod c * b) by (apply Nat.mul_comm). (* Goal: @eq nat (Nat.modulo (Nat.add (Nat.modulo a b) (Nat.modulo (Nat.mul b (Nat.modulo (Nat.div a b) c)) b)) b) (Nat.modulo a b) *) rewrite sth. (* Goal: @eq nat (Nat.modulo (Nat.add (Nat.modulo a b) (Nat.modulo (Init.Nat.mul (Nat.modulo (Nat.div a b) c) b) b)) b) (Nat.modulo a b) *) rewrite Nat.mod_mul by auto. (* Goal: @eq nat (Nat.modulo (Nat.add (Nat.modulo a b) O) b) (Nat.modulo a b) *) rewrite Nat.add_0_r. (* Goal: @eq nat (Nat.modulo (Nat.modulo a b) b) (Nat.modulo a b) *) rewrite Nat.mod_mod by auto. (* Goal: @eq nat (Nat.modulo a b) (Nat.modulo a b) *) auto. Qed. Lemma split1_combine_wplus sz1 sz2 (w11 w21: word sz1) (w12 w22: word sz2): split1 _ _ (combine w11 w12 ^+ combine w21 w22) = w11 ^+ w21. Proof. (* Goal: @eq (word sz1) (split1 sz1 sz2 (@wplus (Init.Nat.add sz1 sz2) (@combine sz1 w11 sz2 w12) (@combine sz1 w21 sz2 w22))) (@wplus sz1 w11 w21) *) rewrite <- natToWord_wordToNat at 1. (* Goal: @eq (word sz1) (natToWord sz1 (@wordToNat sz1 (split1 sz1 sz2 (@wplus (Init.Nat.add sz1 sz2) (@combine sz1 w11 sz2 w12) (@combine sz1 w21 sz2 w22))))) (@wplus sz1 w11 w21) *) rewrite wordToNat_split1. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) (@wplus (Init.Nat.add sz1 sz2) (@combine sz1 w11 sz2 w12) (@combine sz1 w21 sz2 w22))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite <- wordToNat_plus. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.add (@wordToNat (Init.Nat.add sz1 sz2) (@combine sz1 w11 sz2 w12)) (@wordToNat (Init.Nat.add sz1 sz2) (@combine sz1 w21 sz2 w22))))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite ?wordToNat_combine. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w12))) (Init.Nat.add (@wordToNat sz1 w21) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w22)))))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) assert (sth: #w11 + pow2 sz1 * #w12 + (#w21 + pow2 sz1 * #w22) = #w11 + #w21 + pow2 sz1 * (#w12 + #w22)) by ring. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (@wordToNat (Init.Nat.add sz1 sz2) (natToWord (Init.Nat.add sz1 sz2) (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w12))) (Init.Nat.add (@wordToNat sz1 w21) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w22)))))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite wordToNat_natToWord_eqn. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w12))) (Init.Nat.add (@wordToNat sz1 w21) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (@wordToNat sz2 w22)))) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite sth. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22)))) (Nat.pow (S (S O)) (Init.Nat.add sz1 sz2))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite Nat.pow_add_r. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22)))) (Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) assert (pow2 sz1 <> 0) by (pose proof (pow2_zero sz1); intro; omega). (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22)))) (Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) assert (pow2 sz2 <> 0) by (pose proof (pow2_zero sz2); intro; omega). (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22)))) (Nat.mul (Nat.pow (S (S O)) sz1) (Nat.pow (S (S O)) sz2))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite mod_factor by auto. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22)))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite Nat.add_mod by auto. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.add (Nat.modulo (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Nat.pow (S (S O)) sz1)) (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22))) (Nat.pow (S (S O)) sz1))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) assert (sth2: pow2 sz1 * (# w12 + #w22) = (#w12 + #w22) * pow2 sz1) by ring. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.add (Nat.modulo (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Nat.pow (S (S O)) sz1)) (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) sz1) (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22))) (Nat.pow (S (S O)) sz1))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite sth2. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.add (Nat.modulo (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Nat.pow (S (S O)) sz1)) (Nat.modulo (Init.Nat.mul (Init.Nat.add (@wordToNat sz2 w12) (@wordToNat sz2 w22)) (Nat.pow (S (S O)) sz1)) (Nat.pow (S (S O)) sz1))) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite Nat.mod_mul by auto. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.add (Nat.modulo (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Nat.pow (S (S O)) sz1)) O) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite Nat.add_0_r. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Nat.modulo (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Nat.pow (S (S O)) sz1)) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite Nat.mod_mod by auto. (* Goal: @eq (word sz1) (natToWord sz1 (Nat.modulo (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21)) (Nat.pow (S (S O)) sz1))) (@wplus sz1 w11 w21) *) rewrite <- wordToNat_natToWord_eqn. (* Goal: @eq (word sz1) (natToWord sz1 (@wordToNat sz1 (natToWord sz1 (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21))))) (@wplus sz1 w11 w21) *) rewrite natToWord_wordToNat. (* Goal: @eq (word sz1) (natToWord sz1 (Init.Nat.add (@wordToNat sz1 w11) (@wordToNat sz1 w21))) (@wplus sz1 w11 w21) *) rewrite natToWord_plus. (* Goal: @eq (word sz1) (@wplus sz1 (natToWord sz1 (@wordToNat sz1 w11)) (natToWord sz1 (@wordToNat sz1 w21))) (@wplus sz1 w11 w21) *) rewrite ?natToWord_wordToNat. (* Goal: @eq (word sz1) (@wplus sz1 w11 w21) (@wplus sz1 w11 w21) *) auto. Qed. Lemma div_2 a b: b <> 0 -> a < b * 2 -> a >= b -> a / b = 1. Proof. (* Goal: forall (_ : not (@eq nat b O)) (_ : lt a (Init.Nat.mul b (S (S O)))) (_ : ge a b), @eq nat (Nat.div a b) (S O) *) intros. (* Goal: @eq nat (Nat.div a b) (S O) *) assert (sth: b * 1 <= a) by omega. (* Goal: @eq nat (Nat.div a b) (S O) *) pose proof (Nat.div_le_lower_bound a b 1 H sth). (* Goal: @eq nat (Nat.div a b) (S O) *) pose proof (Nat.div_lt_upper_bound a b 2 H H0). (* Goal: @eq nat (Nat.div a b) (S O) *) omega. Qed. Lemma mod_sub a b: b <> 0 -> a < b * 2 -> a >= b -> a mod b = a - b. Proof. (* Goal: forall (_ : not (@eq nat b O)) (_ : lt a (Init.Nat.mul b (S (S O)))) (_ : ge a b), @eq nat (Nat.modulo a b) (Init.Nat.sub a b) *) intros. (* Goal: @eq nat (Nat.modulo a b) (Init.Nat.sub a b) *) rewrite Nat.mod_eq; auto. (* Goal: @eq nat (Nat.sub a (Nat.mul b (Nat.div a b))) (Init.Nat.sub a b) *) repeat f_equal. (* Goal: @eq nat (Nat.mul b (Nat.div a b)) b *) rewrite div_2 by auto. (* Goal: @eq nat (Nat.mul b (S O)) b *) rewrite Nat.mul_1_r; auto. Qed. Lemma wordToNat_wneg_non_0 sz: forall (a: word sz), a <> natToWord _ 0 -> # (wneg a) = pow2 sz - #a. Proof. (* Goal: forall (a : word sz) (_ : not (@eq (word sz) a (natToWord sz O))), @eq nat (@wordToNat sz (@wneg sz a)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) intros. (* Goal: @eq nat (@wordToNat sz (@wneg sz a)) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) unfold wneg. (* Goal: @eq nat (@wordToNat sz (NToWord sz (N.sub (Npow2 sz) (@wordToN sz a)))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) rewrite pow2_N. (* Goal: @eq nat (@wordToNat sz (NToWord sz (N.sub (N.of_nat (Nat.pow (S (S O)) sz)) (@wordToN sz a)))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) rewrite NToWord_nat. (* Goal: @eq nat (@wordToNat sz (natToWord sz (N.to_nat (N.sub (N.of_nat (Nat.pow (S (S O)) sz)) (@wordToN sz a))))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) rewrite Nnat.N2Nat.inj_sub. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (N.to_nat (N.of_nat (Nat.pow (S (S O)) sz))) (N.to_nat (@wordToN sz a))))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) rewrite wordToN_to_nat. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (N.to_nat (N.of_nat (Nat.pow (S (S O)) sz))) (@wordToNat sz a)))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) rewrite Nnat.Nat2N.id. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) simpl. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)))) (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) *) rewrite wordToNat_natToWord_idempotent'; auto. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) (Nat.pow (S (S O)) sz) *) assert (#a <> 0) by word_omega. (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) (Nat.pow (S (S O)) sz) *) pose proof (pow2_zero sz). (* Goal: lt (Init.Nat.sub (Nat.pow (S (S O)) sz) (@wordToNat sz a)) (Nat.pow (S (S O)) sz) *) omega. Qed. Lemma wordToNat_wnot sz: forall (a: word sz), # (wnot a) = pow2 sz - #a - 1. Lemma wzero_wor: forall sz w, w ^| wzero sz = w. Proof. (* Goal: forall (sz : nat) (w : word sz), @eq (word sz) (@wor sz w (wzero sz)) w *) intros. (* Goal: @eq (word sz) (@wor sz w (wzero sz)) w *) rewrite wor_comm. (* Goal: @eq (word sz) (@wor sz (wzero sz) w) w *) rewrite wor_wzero. (* Goal: @eq (word sz) w w *) auto. Qed. Lemma bool_prop1: forall a b, a && negb (a && b) = a && negb b. Proof. (* Goal: forall a b : bool, @eq bool (andb a (negb (andb a b))) (andb a (negb b)) *) destruct a, b; simpl; auto. Qed. Lemma wordToNat_wplus sz (w1 w2: word sz): #(w1 ^+ w2) = (#w1 + #w2) mod (pow2 sz). Proof. (* Goal: @eq nat (@wordToNat sz (@wplus sz w1 w2)) (Nat.modulo (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite <- (natToWord_wordToNat w1) at 1. (* Goal: @eq nat (@wordToNat sz (@wplus sz (natToWord sz (@wordToNat sz w1)) w2)) (Nat.modulo (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite <- (natToWord_wordToNat w2) at 1. (* Goal: @eq nat (@wordToNat sz (@wplus sz (natToWord sz (@wordToNat sz w1)) (natToWord sz (@wordToNat sz w2)))) (Nat.modulo (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite <- natToWord_plus. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)))) (Nat.modulo (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite wordToNat_natToWord_eqn. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) (Nat.modulo (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) auto. Qed. Lemma wordToNat_wmult : forall (sz : nat) (w1 w2 : word sz), #(w1 ^* w2) = (#w1 * #w2) mod pow2 sz. Proof. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq nat (@wordToNat sz (@wmult sz w1 w2)) (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) clear. (* Goal: forall (sz : nat) (w1 w2 : word sz), @eq nat (@wordToNat sz (@wmult sz w1 w2)) (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) intros. (* Goal: @eq nat (@wordToNat sz (@wmult sz w1 w2)) (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite <- (natToWord_wordToNat w1) at 1. (* Goal: @eq nat (@wordToNat sz (@wmult sz (natToWord sz (@wordToNat sz w1)) w2)) (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite <- (natToWord_wordToNat w2) at 1. (* Goal: @eq nat (@wordToNat sz (@wmult sz (natToWord sz (@wordToNat sz w1)) (natToWord sz (@wordToNat sz w2)))) (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite <- natToWord_mult. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)))) (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) rewrite wordToNat_natToWord_eqn. (* Goal: @eq nat (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) (Nat.modulo (Init.Nat.mul (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) *) reflexivity. Qed. Lemma wor_r_wzero_1 sz: forall w1 w2, w1 ^| w2 = natToWord sz 0 -> w2 = natToWord sz 0. Proof. (* Goal: forall (w1 w2 : word sz) (_ : @eq (word sz) (@wor sz w1 w2) (natToWord sz O)), @eq (word sz) w2 (natToWord sz O) *) induction w1; simpl; auto; intros. (* Goal: @eq (word (S n)) w2 (natToWord (S n) O) *) pose proof (shatter_word w2) as sth. (* Goal: @eq (word (S n)) w2 (natToWord (S n) O) *) simpl in sth. (* Goal: @eq (word (S n)) w2 (natToWord (S n) O) *) rewrite sth in *. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (natToWord (S n) O) *) unfold wor in H. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (natToWord (S n) O) *) simpl in H. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (natToWord (S n) O) *) unfold natToWord in H. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (natToWord (S n) O) *) unfold natToWord. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (@WS (mod2 O) n ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) n (Nat.div2 O))) *) fold (natToWord n (Nat.div2 0)) in *. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (@WS (mod2 O) n (natToWord n (Nat.div2 O))) *) unfold Nat.div2, mod2 in *. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (@WS false n (natToWord n O)) *) inversion H. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (@WS (orb b (@whd n w2)) n (natToWord n O)) *) destruct_existT. (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (@wtl n w2)) (@WS (orb b (@whd n w2)) n (natToWord n O)) *) rewrite (IHw1 _ H2). (* Goal: @eq (word (S n)) (@WS (@whd n w2) n (natToWord n O)) (@WS (orb b (@whd n w2)) n (natToWord n O)) *) f_equal. (* Goal: @eq bool (@whd n w2) (orb b (@whd n w2)) *) destruct b, (whd w2); auto. Qed. Lemma wor_r_wzero_2 sz: forall w1 w2, w1 ^| w2 = natToWord sz 0 -> w1 = natToWord sz 0. Proof. (* Goal: forall (w1 w2 : word sz) (_ : @eq (word sz) (@wor sz w1 w2) (natToWord sz O)), @eq (word sz) w1 (natToWord sz O) *) induction w1; simpl; auto; intros. (* Goal: @eq (word (S n)) (@WS b n w1) (natToWord (S n) O) *) pose proof (shatter_word w2) as sth. (* Goal: @eq (word (S n)) (@WS b n w1) (natToWord (S n) O) *) simpl in sth. (* Goal: @eq (word (S n)) (@WS b n w1) (natToWord (S n) O) *) rewrite sth in *. (* Goal: @eq (word (S n)) (@WS b n w1) (natToWord (S n) O) *) unfold wor in H. (* Goal: @eq (word (S n)) (@WS b n w1) (natToWord (S n) O) *) simpl in H. (* Goal: @eq (word (S n)) (@WS b n w1) (natToWord (S n) O) *) unfold natToWord in H. (* Goal: @eq (word (S n)) (@WS b n w1) (natToWord (S n) O) *) unfold natToWord. (* Goal: @eq (word (S n)) (@WS b n w1) (@WS (mod2 O) n ((fix natToWord (sz n : nat) {struct sz} : word sz := match sz as sz0 return (word sz0) with | O => WO | S sz' => @WS (mod2 n) sz' (natToWord sz' (Nat.div2 n)) end) n (Nat.div2 O))) *) fold (natToWord n (Nat.div2 0)) in *. (* Goal: @eq (word (S n)) (@WS b n w1) (@WS (mod2 O) n (natToWord n (Nat.div2 O))) *) unfold Nat.div2, mod2 in *. (* Goal: @eq (word (S n)) (@WS b n w1) (@WS false n (natToWord n O)) *) inversion H. (* Goal: @eq (word (S n)) (@WS b n w1) (@WS (orb b (@whd n w2)) n (natToWord n O)) *) destruct_existT. (* Goal: @eq (word (S n)) (@WS b n w1) (@WS (orb b (@whd n w2)) n (natToWord n O)) *) rewrite (IHw1 _ H2). (* Goal: @eq (word (S n)) (@WS b n (natToWord n O)) (@WS (orb b (@whd n w2)) n (natToWord n O)) *) f_equal. (* Goal: @eq bool b (orb b (@whd n w2)) *) destruct b, (whd w2); auto. Qed. Fixpoint countLeadingZerosWord ni no: word ni -> word no := match ni return word ni -> word no with | 0 => fun _ => $ 0 | S m => fun e => if (weq (split2 m 1 (nat_cast (fun n => word n) (eq_sym (Nat.add_1_r m)) e)) WO~0) then $ 1 ^+ @countLeadingZerosWord m no (split1 m 1 (nat_cast (fun n => word n) (eq_sym (Nat.add_1_r m)) e)) else $ 0 end. Lemma countLeadingZerosWord_le_len no ni: ni < pow2 no -> forall w: word ni, (countLeadingZerosWord no w <= natToWord _ ni)%word. Proof. (* Goal: forall (_ : lt ni (Nat.pow (S (S O)) no)) (w : word ni), not (@wlt no (natToWord no ni) (@countLeadingZerosWord ni no w)) *) induction ni; simpl; auto; intros. (* Goal: not (@wlt no (natToWord no (S ni)) (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else natToWord no O)) *) (* Goal: not (@wlt no (natToWord no O) (natToWord no O)) *) - (* Goal: not (@wlt no (natToWord no O) (natToWord no O)) *) word_omega. (* BG Goal: not (@wlt no (natToWord no (S ni)) (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else natToWord no O)) *) - (* Goal: not (@wlt no (natToWord no (S ni)) (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else natToWord no O)) *) match goal with | |- ((if ?P then _ else _) <= _)%word => destruct P; simpl; auto end; [| word_omega]. (* Goal: not (@wlt no (natToWord no (S ni)) (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) *) assert (sth: ni < pow2 no) by omega. (* Goal: not (@wlt no (natToWord no (S ni)) (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) *) specialize (IHni sth). (* Goal: not (@wlt no (natToWord no (S ni)) (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) *) assert (sth1: natToWord no (S ni) = natToWord no (1 + ni)) by auto. (* Goal: not (@wlt no (natToWord no (S ni)) (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) *) rewrite sth1. (* Goal: not (@wlt no (natToWord no (Init.Nat.add (S O) ni)) (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) *) rewrite natToWord_plus. (* Goal: not (@wlt no (@wplus no (natToWord no (S O)) (natToWord no ni)) (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) *) match goal with | |- ((_ ^+ countLeadingZerosWord no ?P) <= _)%word => specialize (IHni P) end. (* Goal: not (@wlt no (@wplus no (natToWord no (S O)) (natToWord no ni)) (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) *) match goal with | |- (?a ^+ ?b <= ?c ^+ ?d)%word => rewrite (wplus_comm a b); rewrite (wplus_comm c d) end. (* Goal: not (@wlt no (@wplus no (natToWord no ni) (natToWord no (S O))) (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (natToWord no (S O)))) *) pre_word_omega. (* Goal: le (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) assert (sth2: no > 0). (* Goal: le (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) (* Goal: gt no O *) { (* Goal: gt no O *) destruct no; [|omega]. (* Goal: gt O O *) destruct ni; simpl in *; try omega. (* BG Goal: le (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) } (* Goal: le (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) rewrite <- ?(@natplus1_wordplus1_eq _ _ (wones no)); auto. (* Goal: @wlt no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (wones no) *) (* Goal: @wlt no (natToWord no ni) (wones no) *) + (* Goal: @wlt no (natToWord no ni) (wones no) *) pre_word_omega. (* Goal: lt (@wordToNat no (natToWord no ni)) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite wordToNat_natToWord_eqn. (* Goal: lt (Nat.modulo ni (Nat.pow (S (S O)) no)) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite Nat.mod_small; auto. (* BG Goal: @wlt no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (wones no) *) + (* Goal: @wlt no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) (wones no) *) pre_word_omega. (* Goal: lt (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite wordToNat_natToWord_eqn in IHni. (* Goal: lt (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite Nat.mod_small in IHni; auto. Qed. Lemma countLeadingZerosWord_le_len_nat no ni: ni < pow2 no -> forall w: word ni, #(countLeadingZerosWord no w) <= ni. Proof. (* Goal: forall (_ : lt ni (Nat.pow (S (S O)) no)) (w : word ni), le (@wordToNat no (@countLeadingZerosWord ni no w)) ni *) intros H w. (* Goal: le (@wordToNat no (@countLeadingZerosWord ni no w)) ni *) pose proof (countLeadingZerosWord_le_len H w) as sth. (* Goal: le (@wordToNat no (@countLeadingZerosWord ni no w)) ni *) pre_word_omega. (* Goal: le (@wordToNat no (@countLeadingZerosWord ni no w)) ni *) rewrite wordToNat_natToWord_idempotent' in * by assumption. (* Goal: le (@wordToNat no (@countLeadingZerosWord ni no w)) ni *) assumption. Qed. Lemma wordToNat_zero sz: forall (w: word sz), #w = 0 -> w = natToWord _ 0. Proof. (* Goal: forall (w : word sz) (_ : @eq nat (@wordToNat sz w) O), @eq (word sz) w (natToWord sz O) *) intros. (* Goal: @eq (word sz) w (natToWord sz O) *) apply (f_equal (natToWord sz)) in H. (* Goal: @eq (word sz) w (natToWord sz O) *) rewrite natToWord_wordToNat in H. (* Goal: @eq (word sz) w (natToWord sz O) *) auto. Qed. Lemma wordToNat_notZero sz: forall (w: word sz), #w <> 0 -> w <> natToWord _ 0. Proof. (* Goal: forall (w : word sz) (_ : not (@eq nat (@wordToNat sz w) O)), not (@eq (word sz) w (natToWord sz O)) *) intros. (* Goal: not (@eq (word sz) w (natToWord sz O)) *) intro. (* Goal: False *) subst. (* Goal: False *) pose proof (wordToNat_wzero sz); unfold wzero in *. (* Goal: False *) tauto. Qed. Lemma natToWord_nzero sz x: 0 < x -> x < pow2 sz -> natToWord sz x <> natToWord sz 0. Proof. (* Goal: forall (_ : lt O x) (_ : lt x (Nat.pow (S (S O)) sz)), not (@eq (word sz) (natToWord sz x) (natToWord sz O)) *) intros. (* Goal: not (@eq (word sz) (natToWord sz x) (natToWord sz O)) *) pre_word_omega. (* Goal: not (@eq nat (@wordToNat sz (natToWord sz x)) O) *) rewrite wordToNat_natToWord_idempotent'; omega. Qed. Lemma pow2_lt_pow2_S: forall n, pow2 n < pow2 (n+1). Proof. (* Goal: forall n : nat, lt (Nat.pow (S (S O)) n) (Nat.pow (S (S O)) (Init.Nat.add n (S O))) *) induction n; simpl; omega. Qed. Lemma combine_shiftl_plus_n n x: x < pow2 n -> (combine (natToWord n x) WO~1) = (natToWord (n + 1) (pow2 n)) ^+ natToWord (n + 1) x. Proof. (* Goal: forall _ : lt x (Nat.pow (S (S O)) n), @eq (word (Init.Nat.add n (S O))) (@combine n (natToWord n x) (S O) (@WS true O WO)) (@wplus (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n)) (natToWord (Init.Nat.add n (S O)) x)) *) intros. (* Goal: @eq (word (Init.Nat.add n (S O))) (@combine n (natToWord n x) (S O) (@WS true O WO)) (@wplus (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n)) (natToWord (Init.Nat.add n (S O)) x)) *) apply wordToNat_eq2. (* Goal: @eq nat (@wordToNat (Init.Nat.add n (S O)) (@combine n (natToWord n x) (S O) (@WS true O WO))) (@wordToNat (Init.Nat.add n (S O)) (@wplus (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n)) (natToWord (Init.Nat.add n (S O)) x))) *) rewrite ?wordToNat_combine. (* Goal: @eq nat (Init.Nat.add (@wordToNat n (natToWord n x)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat (S O) (@WS true O WO)))) (@wordToNat (Init.Nat.add n (S O)) (@wplus (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n)) (natToWord (Init.Nat.add n (S O)) x))) *) rewrite ?wordToNat_natToWord_idempotent'; simpl; auto. (* Goal: @eq nat (Init.Nat.add x (Init.Nat.mul (Nat.pow (S (S O)) n) (S O))) (@wordToNat (Init.Nat.add n (S O)) (@wplus (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n)) (natToWord (Init.Nat.add n (S O)) x))) *) rewrite <- wordToNat_plus. (* Goal: @eq nat (Init.Nat.add x (Init.Nat.mul (Nat.pow (S (S O)) n) (S O))) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Init.Nat.add (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n))) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x))))) *) pose proof (pow2_lt_pow2_S n) as sth. (* Goal: @eq nat (Init.Nat.add x (Init.Nat.mul (Nat.pow (S (S O)) n) (S O))) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Init.Nat.add (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n))) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x))))) *) rewrite ?wordToNat_natToWord_idempotent'; simpl; try omega. (* Goal: lt (Init.Nat.add (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) (Nat.pow (S (S O)) n))) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x))) (Nat.pow (S (S O)) (Init.Nat.add n (S O))) *) rewrite ?wordToNat_natToWord_idempotent'; simpl; try omega. (* Goal: lt (Init.Nat.add (Nat.pow (S (S O)) n) x) (Nat.pow (S (S O)) (Init.Nat.add n (S O))) *) apply Nat.lt_add_lt_sub_l. (* Goal: lt x (Nat.sub (Nat.pow (S (S O)) (Init.Nat.add n (S O))) (Nat.pow (S (S O)) n)) *) rewrite Nat.add_1_r. (* Goal: lt x (Nat.sub (Nat.pow (S (S O)) (S n)) (Nat.pow (S (S O)) n)) *) simpl. (* Goal: lt x (Nat.sub (Nat.add (Nat.pow (S (S O)) n) (Nat.add (Nat.pow (S (S O)) n) O)) (Nat.pow (S (S O)) n)) *) omega. Qed. Lemma combine_natToWord_wzero n: forall x, x < pow2 n -> combine (natToWord n x) (natToWord 1 0) = natToWord (n+1) x. Proof. (* Goal: forall (x : nat) (_ : lt x (Nat.pow (S (S O)) n)), @eq (word (Init.Nat.add n (S O))) (@combine n (natToWord n x) (S O) (natToWord (S O) O)) (natToWord (Init.Nat.add n (S O)) x) *) intros. (* Goal: @eq (word (Init.Nat.add n (S O))) (@combine n (natToWord n x) (S O) (natToWord (S O) O)) (natToWord (Init.Nat.add n (S O)) x) *) apply wordToNat_eq2. (* Goal: @eq nat (@wordToNat (Init.Nat.add n (S O)) (@combine n (natToWord n x) (S O) (natToWord (S O) O))) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x)) *) rewrite ?wordToNat_combine. (* Goal: @eq nat (Init.Nat.add (@wordToNat n (natToWord n x)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat (S O) (natToWord (S O) O)))) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x)) *) simpl. (* Goal: @eq nat (Init.Nat.add (@wordToNat n (natToWord n x)) (Init.Nat.mul (Nat.pow (S (S O)) n) O)) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x)) *) rewrite Nat.mul_0_r. (* Goal: @eq nat (Init.Nat.add (@wordToNat n (natToWord n x)) O) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x)) *) rewrite Nat.add_0_r. (* Goal: @eq nat (@wordToNat n (natToWord n x)) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x)) *) pose proof (pow2_lt_pow2_S n) as sth2. (* Goal: @eq nat (@wordToNat n (natToWord n x)) (@wordToNat (Init.Nat.add n (S O)) (natToWord (Init.Nat.add n (S O)) x)) *) rewrite ?wordToNat_natToWord_idempotent' by omega. (* Goal: @eq nat x x *) reflexivity. Qed. Lemma word_cancel_l sz (a b c: word sz): a = b -> c ^+ a = c ^+ b. Proof. (* Goal: forall _ : @eq (word sz) a b, @eq (word sz) (@wplus sz c a) (@wplus sz c b) *) intro H; rewrite H; reflexivity. Qed. Lemma word_cancel_r sz (a b c: word sz): a = b -> a ^+ c = b ^+ c. Proof. (* Goal: forall _ : @eq (word sz) a b, @eq (word sz) (@wplus sz a c) (@wplus sz b c) *) intro H; rewrite H; reflexivity. Qed. Lemma word_cancel_m sz (a b c a' b': word sz): a ^+ a' = b ^+ b'-> a ^+ c ^+ a' = b ^+ c ^+ b'. Proof. (* Goal: forall _ : @eq (word sz) (@wplus sz a a') (@wplus sz b b'), @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz b c) b') *) intros. (* Goal: @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz b c) b') *) assert (sth: a ^+ c ^+ a' = a ^+ a'^+ c ). (* Goal: @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz b c) b') *) (* Goal: @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz a a') c) *) rewrite <- wplus_assoc. (* Goal: @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz b c) b') *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz c a')) (@wplus sz (@wplus sz a a') c) *) rewrite wplus_comm with (y := a'). (* Goal: @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz b c) b') *) (* Goal: @eq (word sz) (@wplus sz a (@wplus sz a' c)) (@wplus sz (@wplus sz a a') c) *) rewrite wplus_assoc. (* Goal: @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz b c) b') *) (* Goal: @eq (word sz) (@wplus sz (@wplus sz a a') c) (@wplus sz (@wplus sz a a') c) *) reflexivity. (* Goal: @eq (word sz) (@wplus sz (@wplus sz a c) a') (@wplus sz (@wplus sz b c) b') *) rewrite sth. (* Goal: @eq (word sz) (@wplus sz (@wplus sz a a') c) (@wplus sz (@wplus sz b c) b') *) rewrite H. (* Goal: @eq (word sz) (@wplus sz (@wplus sz b b') c) (@wplus sz (@wplus sz b c) b') *) rewrite <- wplus_assoc. (* Goal: @eq (word sz) (@wplus sz b (@wplus sz b' c)) (@wplus sz (@wplus sz b c) b') *) rewrite wplus_comm with (x := b'). (* Goal: @eq (word sz) (@wplus sz b (@wplus sz c b')) (@wplus sz (@wplus sz b c) b') *) rewrite wplus_assoc. (* Goal: @eq (word sz) (@wplus sz (@wplus sz b c) b') (@wplus sz (@wplus sz b c) b') *) reflexivity. Qed. Lemma move_wplus_wminus sz (a b c: word sz): a ^+ b = c <-> a = c ^- b. Proof. (* Goal: iff (@eq (word sz) (@wplus sz a b) c) (@eq (word sz) a (@wminus sz c b)) *) split; intro. (* Goal: @eq (word sz) (@wplus sz a b) c *) (* Goal: @eq (word sz) a (@wminus sz c b) *) + (* Goal: @eq (word sz) a (@wminus sz c b) *) rewrite <- H. (* Goal: @eq (word sz) a (@wminus sz (@wplus sz a b) b) *) rewrite wminus_def. (* Goal: @eq (word sz) a (@wplus sz (@wplus sz a b) (@wneg sz b)) *) rewrite <- wplus_assoc. (* Goal: @eq (word sz) a (@wplus sz a (@wplus sz b (@wneg sz b))) *) rewrite wminus_inv. (* Goal: @eq (word sz) a (@wplus sz a (wzero sz)) *) rewrite wplus_wzero_1. (* Goal: @eq (word sz) a a *) reflexivity. (* BG Goal: @eq (word sz) (@wplus sz a b) c *) + (* Goal: @eq (word sz) (@wplus sz a b) c *) rewrite H. (* Goal: @eq (word sz) (@wplus sz (@wminus sz c b) b) c *) rewrite wminus_def. (* Goal: @eq (word sz) (@wplus sz (@wplus sz c (@wneg sz b)) b) c *) rewrite <- wplus_assoc. (* Goal: @eq (word sz) (@wplus sz c (@wplus sz (@wneg sz b) b)) c *) rewrite wplus_comm with (x:= ^~b). (* Goal: @eq (word sz) (@wplus sz c (@wplus sz b (@wneg sz b))) c *) rewrite wminus_inv. (* Goal: @eq (word sz) (@wplus sz c (wzero sz)) c *) rewrite wplus_wzero_1. (* Goal: @eq (word sz) c c *) reflexivity. Qed. Lemma move_wplus_pow2 sz (w1 w2: word (S sz)): w1 = w2 ^+ $(pow2 sz) <-> w1 ^+ $(pow2 sz) = w2. Proof. (* Goal: iff (@eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz)))) (@eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2) *) split. (* Goal: forall _ : @eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2, @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) (* Goal: forall _ : @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))), @eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) + (* Goal: forall _ : @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))), @eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) intro. (* Goal: @eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) apply move_wplus_wminus. (* Goal: @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) rewrite wminus_def. (* Goal: @eq (word (S sz)) w1 (@wplus (S sz) w2 (@wneg (S sz) (natToWord (S sz) (Nat.pow (S (S O)) sz)))) *) rewrite pow2_wneg. (* Goal: @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) assumption. (* BG Goal: forall _ : @eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2, @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) + (* Goal: forall _ : @eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2, @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) intro. (* Goal: @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) apply move_wplus_wminus in H. (* Goal: @eq (word (S sz)) w1 (@wplus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) rewrite <- pow2_wneg. (* Goal: @eq (word (S sz)) w1 (@wplus (S sz) w2 (@wneg (S sz) (natToWord (S sz) (Nat.pow (S (S O)) sz)))) *) assumption. Qed. Lemma move_wminus_pow2 sz (w1 w2: word (S sz)): w1 = w2 ^- $(pow2 sz) <-> w1 ^- $(pow2 sz) = w2. Proof. (* Goal: iff (@eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz)))) (@eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2) *) split. (* Goal: forall _ : @eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2, @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) (* Goal: forall _ : @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))), @eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) + (* Goal: forall _ : @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))), @eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) intro. (* Goal: @eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) apply <- move_wplus_wminus. (* Goal: @eq (word (S sz)) w1 (@wminus (S sz) w2 (@wneg (S sz) (natToWord (S sz) (Nat.pow (S (S O)) sz)))) *) rewrite pow2_wneg. (* Goal: @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) assumption. (* BG Goal: forall _ : @eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2, @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) + (* Goal: forall _ : @eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2, @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) intro. (* Goal: @eq (word (S sz)) w1 (@wminus (S sz) w2 (natToWord (S sz) (Nat.pow (S (S O)) sz))) *) apply move_wplus_wminus. (* Goal: @eq (word (S sz)) (@wplus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) rewrite <- pow2_wneg. (* Goal: @eq (word (S sz)) (@wplus (S sz) w1 (@wneg (S sz) (natToWord (S sz) (Nat.pow (S (S O)) sz)))) w2 *) rewrite <- wminus_def. (* Goal: @eq (word (S sz)) (@wminus (S sz) w1 (natToWord (S sz) (Nat.pow (S (S O)) sz))) w2 *) assumption. Qed. Lemma pow2_wzero sz : $(pow2 sz) = wzero sz. Proof. (* Goal: @eq (word sz) (natToWord sz (Nat.pow (S (S O)) sz)) (wzero sz) *) apply wordToNat_eq2. (* Goal: @eq nat (@wordToNat sz (natToWord sz (Nat.pow (S (S O)) sz))) (@wordToNat sz (wzero sz)) *) rewrite wordToNat_natToWord_eqn. (* Goal: @eq nat (Nat.modulo (Nat.pow (S (S O)) sz) (Nat.pow (S (S O)) sz)) (@wordToNat sz (wzero sz)) *) rewrite Nat.mod_same. (* Goal: not (@eq nat (Nat.pow (S (S O)) sz) O) *) (* Goal: @eq nat O (@wordToNat sz (wzero sz)) *) rewrite wordToNat_wzero; auto. (* Goal: not (@eq nat (Nat.pow (S (S O)) sz) O) *) pose proof (zero_lt_pow2 sz) as sth. (* Goal: not (@eq nat (Nat.pow (S (S O)) sz) O) *) omega. Qed. Lemma pow2_wplus_wzero sz: $(pow2 sz) ^+ $(pow2 sz) = wzero (sz + 1). Proof. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz))) (wzero (Init.Nat.add sz (S O))) *) apply wordToNat_eq2. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)))) (@wordToNat (Init.Nat.add sz (S O)) (wzero (Init.Nat.add sz (S O)))) *) rewrite <- natToWord_plus. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.add (Nat.pow (S (S O)) sz) (Nat.pow (S (S O)) sz)))) (@wordToNat (Init.Nat.add sz (S O)) (wzero (Init.Nat.add sz (S O)))) *) rewrite <- mul2_add. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (S (S O))))) (@wordToNat (Init.Nat.add sz (S O)) (wzero (Init.Nat.add sz (S O)))) *) assert (pow2_1_mul: pow2 1 = 2) by auto. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (S (S O))))) (@wordToNat (Init.Nat.add sz (S O)) (wzero (Init.Nat.add sz (S O)))) *) rewrite <- pow2_1_mul at 2. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (Nat.pow (S (S O)) (S O))))) (@wordToNat (Init.Nat.add sz (S O)) (wzero (Init.Nat.add sz (S O)))) *) rewrite <- pow2_add_mul. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) (Init.Nat.add sz (S O))))) (@wordToNat (Init.Nat.add sz (S O)) (wzero (Init.Nat.add sz (S O)))) *) rewrite pow2_wzero; auto. Qed. Lemma wplus_wplus_pow2 sz (x1 x2 y1 y2: word (sz + 1)): x1 = y1 ^+ $(pow2 sz) -> x2 = y2 ^+ $(pow2 sz) -> x1 ^+ x2 = y1 ^+ y2. Proof. (* Goal: forall (_ : @eq (word (Init.Nat.add sz (S O))) x1 (@wplus (Init.Nat.add sz (S O)) y1 (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)))) (_ : @eq (word (Init.Nat.add sz (S O))) x2 (@wplus (Init.Nat.add sz (S O)) y2 (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)))), @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) x1 x2) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) intros. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) x1 x2) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite H. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) y1 (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz))) x2) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite <- wplus_assoc. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) y1 (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) x2)) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite wplus_comm. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) x2) y1) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite wplus_comm in H0. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) x2) y1) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite H0. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) y2)) y1) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite wplus_assoc. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz)) (natToWord (Init.Nat.add sz (S O)) (Nat.pow (S (S O)) sz))) y2) y1) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite pow2_wplus_wzero. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) (@wplus (Init.Nat.add sz (S O)) (wzero (Init.Nat.add sz (S O))) y2) y1) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite wzero_wplus. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) y2 y1) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) rewrite wplus_comm. (* Goal: @eq (word (Init.Nat.add sz (S O))) (@wplus (Init.Nat.add sz (S O)) y1 y2) (@wplus (Init.Nat.add sz (S O)) y1 y2) *) reflexivity. Qed. Lemma wlt_meaning sz (w1 w2: word sz): (w1 < w2)%word <-> #w1 < #w2. Proof. (* Goal: iff (@wlt sz w1 w2) (lt (@wordToNat sz w1) (@wordToNat sz w2)) *) pose proof (@wordToNat_gt1 sz w2 w1). (* Goal: iff (@wlt sz w1 w2) (lt (@wordToNat sz w1) (@wordToNat sz w2)) *) pose proof (@wordToNat_gt2 sz w2 w1). (* Goal: iff (@wlt sz w1 w2) (lt (@wordToNat sz w1) (@wordToNat sz w2)) *) tauto. Qed. Lemma combine_wplus sz (w1 w2: word sz): #w1 + #w2 < pow2 sz -> forall sz' (w': word sz'), combine (w1 ^+ w2) w' = combine w1 w' ^+ combine w2 ($ 0). Proof. (* Goal: forall (_ : lt (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) (sz' : nat) (w' : word sz'), @eq (word (Init.Nat.add sz sz')) (@combine sz (@wplus sz w1 w2) sz' w') (@wplus (Init.Nat.add sz sz') (@combine sz w1 sz' w') (@combine sz w2 sz' (natToWord sz' O))) *) intros. (* Goal: @eq (word (Init.Nat.add sz sz')) (@combine sz (@wplus sz w1 w2) sz' w') (@wplus (Init.Nat.add sz sz') (@combine sz w1 sz' w') (@combine sz w2 sz' (natToWord sz' O))) *) pre_word_omega. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz sz') (@combine sz (@wplus sz w1 w2) sz' w')) (@wordToNat (Init.Nat.add sz sz') (@wplus (Init.Nat.add sz sz') (@combine sz w1 sz' w') (@combine sz w2 sz' (natToWord sz' O)))) *) rewrite wordToNat_wplus in *. (* Goal: @eq nat (@wordToNat (Init.Nat.add sz sz') (@combine sz (@wplus sz w1 w2) sz' w')) (Nat.modulo (Init.Nat.add (@wordToNat (Init.Nat.add sz sz') (@combine sz w1 sz' w')) (@wordToNat (Init.Nat.add sz sz') (@combine sz w2 sz' (natToWord sz' O)))) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) rewrite ?wordToNat_combine. (* Goal: @eq nat (Init.Nat.add (@wordToNat sz (@wplus sz w1 w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Init.Nat.add (@wordToNat sz w2) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' (natToWord sz' O))))) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) rewrite wordToNat_natToWord_idempotent' by (apply pow2_zero). (* Goal: @eq nat (Init.Nat.add (@wordToNat sz (@wplus sz w1 w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Init.Nat.add (@wordToNat sz w2) (Init.Nat.mul (Nat.pow (S (S O)) sz) O))) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) rewrite Nat.mul_0_r, Nat.add_0_r. (* Goal: @eq nat (Init.Nat.add (@wordToNat sz (@wplus sz w1 w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (@wordToNat sz w2)) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) rewrite wordToNat_wplus. (* Goal: @eq nat (Init.Nat.add (Nat.modulo (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Nat.pow (S (S O)) sz)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (@wordToNat sz w2)) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) rewrite Nat.mod_small by assumption. (* Goal: @eq nat (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (@wordToNat sz w2)) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) assert (sth: #w1 + #w2 + pow2 sz * #w' = #w1 + pow2 sz * #w' + #w2) by ring. (* Goal: @eq nat (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (@wordToNat sz w2)) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) rewrite <- sth; clear sth. (* Goal: @eq nat (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.modulo (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.pow (S (S O)) (Init.Nat.add sz sz'))) *) rewrite Nat.mod_small; auto. (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.pow (S (S O)) (Init.Nat.add sz sz')) *) rewrite Nat.pow_add_r. (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.mul (Nat.pow (S (S O)) sz) (Nat.pow (S (S O)) sz')) *) assert (sth: pow2 sz' = 1 + (pow2 sz' - 1)) by (pose proof (pow2_zero sz'); omega). (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.mul (Nat.pow (S (S O)) sz) (Nat.pow (S (S O)) sz')) *) rewrite sth; clear sth. (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.add (S O) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) rewrite Nat.mul_add_distr_l. (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.add (Nat.mul (Nat.pow (S (S O)) sz) (S O)) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) rewrite Nat.mul_1_r. (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) pose proof (wordToNat_bound w'). (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) pose proof (pow2_zero sz). (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) apply Nat.lt_le_pred in H0. (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) rewrite pred_of_minus in H0. (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) pose proof (mult_le_compat_l _ _ (pow2 sz) H0). (* Goal: lt (Init.Nat.add (Init.Nat.add (@wordToNat sz w1) (@wordToNat sz w2)) (Init.Nat.mul (Nat.pow (S (S O)) sz) (@wordToNat sz' w'))) (Nat.add (Nat.pow (S (S O)) sz) (Nat.mul (Nat.pow (S (S O)) sz) (Init.Nat.sub (Nat.pow (S (S O)) sz') (S O)))) *) omega. Qed. Lemma word1_neq (w: word 1): w <> WO~0 -> w <> WO~1 -> False. Proof. (* Goal: forall (_ : not (@eq (word (S O)) w (@WS false O WO))) (_ : not (@eq (word (S O)) w (@WS true O WO))), False *) shatter_word w; intros. (* Goal: False *) destruct x; tauto. Qed. Lemma combine_1 sz: sz > 1 -> natToWord (sz + 1) 1 = combine ($ 1) WO~0. Proof. (* Goal: forall _ : gt sz (S O), @eq (word (Init.Nat.add sz (S O))) (natToWord (Init.Nat.add sz (S O)) (S O)) (@combine sz (natToWord sz (S O)) (S O) (@WS false O WO)) *) intros. (* Goal: @eq (word (Init.Nat.add sz (S O))) (natToWord (Init.Nat.add sz (S O)) (S O)) (@combine sz (natToWord sz (S O)) (S O) (@WS false O WO)) *) rewrite <- natToWord_wordToNat. (* Goal: @eq (word (Init.Nat.add sz (S O))) (natToWord (Init.Nat.add sz (S O)) (S O)) (natToWord (Init.Nat.add sz (S O)) (@wordToNat (Init.Nat.add sz (S O)) (@combine sz (natToWord sz (S O)) (S O) (@WS false O WO)))) *) f_equal. (* Goal: @eq nat (S O) (@wordToNat (Init.Nat.add sz (S O)) (@combine sz (natToWord sz (S O)) (S O) (@WS false O WO))) *) rewrite wordToNat_combine; simpl. (* Goal: @eq nat (S O) (Init.Nat.add (@wordToNat sz (natToWord sz (S O))) (Init.Nat.mul (Nat.pow (S (S O)) sz) O)) *) rewrite Nat.mul_0_r, Nat.add_0_r. (* Goal: @eq nat (S O) (@wordToNat sz (natToWord sz (S O))) *) rewrite wordToNat_natToWord_idempotent'; auto. (* Goal: lt (S O) (Nat.pow (S (S O)) sz) *) destruct sz; simpl; try omega. (* Goal: lt (S O) (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) *) pose proof (pow2_zero sz). (* Goal: lt (S O) (Nat.add (Nat.pow (S (S O)) sz) (Nat.add (Nat.pow (S (S O)) sz) O)) *) omega. Qed. Lemma wordToNat_cast ni no (pf: ni = no): forall w, #w = #(match pf in _ = Y return _ Y with | eq_refl => w end). Proof. (* Goal: forall w : word ni, @eq nat (@wordToNat ni w) (@wordToNat no match pf in (eq _ Y) return (word Y) with | eq_refl => w end) *) destruct pf; intros; auto. Qed. Lemma countLeadingZerosWord_lt_len no ni: ni < pow2 no -> forall w: word ni, w <> wzero ni -> (countLeadingZerosWord no w < natToWord _ ni)%word. Proof. (* Goal: forall (_ : lt ni (Nat.pow (S (S O)) no)) (w : word ni) (_ : not (@eq (word ni) w (wzero ni))), @wlt no (@countLeadingZerosWord ni no w) (natToWord no ni) *) induction ni; auto; intros. (* Goal: @wlt no (@countLeadingZerosWord (S ni) no w) (natToWord no (S ni)) *) (* Goal: @wlt no (@countLeadingZerosWord O no w) (natToWord no O) *) - (* Goal: @wlt no (@countLeadingZerosWord O no w) (natToWord no O) *) shatter_word w. (* Goal: @wlt no (@countLeadingZerosWord O no WO) (natToWord no O) *) tauto. (* BG Goal: @wlt no (@countLeadingZerosWord (S ni) no w) (natToWord no (S ni)) *) - (* Goal: @wlt no (@countLeadingZerosWord (S ni) no w) (natToWord no (S ni)) *) unfold countLeadingZerosWord; fold countLeadingZerosWord. (* Goal: @wlt no (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else natToWord no O) (natToWord no (S ni)) *) rewrite nat_cast_cast. (* Goal: @wlt no (if @weq (S O) (split2 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) else natToWord no O) (natToWord no (S ni)) *) match goal with | |- ((if ?P then _ else _) < _)%word => destruct P; simpl; auto end. (* Goal: @wlt no (natToWord no O) (natToWord no (S ni)) *) (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (natToWord no (S ni)) *) + (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (natToWord no (S ni)) *) assert (sth: ni < pow2 no) by omega. (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (natToWord no (S ni)) *) specialize (IHni sth). (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (natToWord no (S ni)) *) assert (sth1: natToWord no (S ni) = natToWord no (1 + ni)) by auto. (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (natToWord no (S ni)) *) rewrite sth1. (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (natToWord no (Init.Nat.add (S O) ni)) *) rewrite natToWord_plus. (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (@wplus no (natToWord no (S O)) (natToWord no ni)) *) match goal with | |- ((_ ^+ countLeadingZerosWord no ?P) < _)%word => specialize (IHni P) end. (* Goal: @wlt no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (@wplus no (natToWord no (S O)) (natToWord no ni)) *) match goal with | |- (?a ^+ ?b < ?c ^+ ?d)%word => rewrite (wplus_comm a b); rewrite (wplus_comm c d) end. (* Goal: @wlt no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O))) (@wplus no (natToWord no ni) (natToWord no (S O))) *) pre_word_omega. (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) assert (sth2: no > 0). (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) (* Goal: gt no O *) { (* Goal: gt no O *) destruct no; [|omega]. (* Goal: gt O O *) destruct ni; simpl in *; try omega. (* BG Goal: @wlt no (natToWord no O) (natToWord no (S ni)) *) (* BG Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) } (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) apply wordToNat_zero in e. (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) match type of IHni with | split1 ni 1 ?P <> _ -> _ => assert (sth3: #P <> 0) by (rewrite <- wordToNat_cast; auto); apply wordToNat_notZero in sth3; rewrite <- (combine_split ni 1 P) in sth3 end. (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) rewrite e in *. (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) match type of sth3 with | combine ?P _ <> _ => destruct (weq P (natToWord _ 0)); [rewrite e0 in *; rewrite combine_zero in sth3; tauto|] end. (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) specialize (IHni n). (* Goal: lt (@wordToNat no (@wplus no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (natToWord no (S O)))) (@wordToNat no (@wplus no (natToWord no ni) (natToWord no (S O)))) *) rewrite <- ?(@natplus1_wordplus1_eq _ _ (wones no)); auto. (* Goal: @wlt no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (wones no) *) (* Goal: @wlt no (natToWord no ni) (wones no) *) (* Goal: lt (Init.Nat.add (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (S O)) (Init.Nat.add (@wordToNat no (natToWord no ni)) (S O)) *) * (* Goal: lt (Init.Nat.add (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (S O)) (Init.Nat.add (@wordToNat no (natToWord no ni)) (S O)) *) pre_word_omega. (* Goal: lt (Init.Nat.add (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (S O)) (Init.Nat.add (@wordToNat no (natToWord no ni)) (S O)) *) omega. (* BG Goal: @wlt no (natToWord no O) (natToWord no (S ni)) *) (* BG Goal: @wlt no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (wones no) *) (* BG Goal: @wlt no (natToWord no ni) (wones no) *) * (* Goal: @wlt no (natToWord no ni) (wones no) *) pre_word_omega. (* Goal: lt (@wordToNat no (natToWord no ni)) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite wordToNat_natToWord_eqn. (* Goal: lt (Nat.modulo ni (Nat.pow (S (S O)) no)) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite Nat.mod_small; auto. (* BG Goal: @wlt no (natToWord no O) (natToWord no (S ni)) *) (* BG Goal: @wlt no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (wones no) *) * (* Goal: @wlt no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end)) (wones no) *) pre_word_omega. (* Goal: lt (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite wordToNat_natToWord_eqn in IHni. (* Goal: lt (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) match @eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni) in (eq _ Y) return (word Y) with | eq_refl => w end))) (Init.Nat.sub (Nat.pow (S (S O)) no) (S O)) *) rewrite Nat.mod_small in IHni; auto. (* BG Goal: @wlt no (natToWord no O) (natToWord no (S ni)) *) + (* Goal: @wlt no (natToWord no O) (natToWord no (S ni)) *) pre_word_omega. (* Goal: lt O (@wordToNat no (natToWord no (S ni))) *) rewrite wordToNat_natToWord_idempotent'; auto; try omega. Qed. Fixpoint countLeadingZerosWord_nat ni: word ni -> nat := match ni return word ni -> nat with | 0 => fun _ => 0 | S m => fun e => if (weq (split2 m 1 (nat_cast (fun n => word n) (eq_sym (Nat.add_1_r m)) e)) WO~0) then 1 + @countLeadingZerosWord_nat m (split1 m 1 (nat_cast (fun n => word n) (eq_sym (Nat.add_1_r m)) e)) else 0 end. Lemma countLeadingZerosWord_nat_correct ni: forall no (w: word ni), ni < pow2 no -> #(countLeadingZerosWord no w) = countLeadingZerosWord_nat w. Proof. (* Goal: forall (no : nat) (w : word ni) (_ : lt ni (Nat.pow (S (S O)) no)), @eq nat (@wordToNat no (@countLeadingZerosWord ni no w)) (@countLeadingZerosWord_nat ni w) *) induction ni; intros; simpl; auto. (* Goal: @eq nat (@wordToNat no (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else natToWord no O)) (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else O) *) (* Goal: @eq nat (@wordToNat no (natToWord no O)) O *) - (* Goal: @eq nat (@wordToNat no (natToWord no O)) O *) rewrite ?wordToNat_natToWord_idempotent'; auto. (* BG Goal: @eq nat (@wordToNat no (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else natToWord no O)) (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else O) *) - (* Goal: @eq nat (@wordToNat no (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then @wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else natToWord no O)) (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else O) *) match goal with | |- # (if ?P then _ else _) = if ?P then _ else _ => destruct P end. (* Goal: @eq nat (@wordToNat no (natToWord no O)) O *) (* Goal: @eq nat (@wordToNat no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) *) + (* Goal: @eq nat (@wordToNat no (@wplus no (natToWord no (S O)) (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) *) rewrite <- wordToNat_plus. (* Goal: @eq nat (@wordToNat no (natToWord no (Init.Nat.add (@wordToNat no (natToWord no (S O))) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))))) (S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) *) rewrite ?wordToNat_natToWord_idempotent'; try omega. (* Goal: lt (Init.Nat.add (@wordToNat no (natToWord no (S O))) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (Nat.pow (S (S O)) no) *) (* Goal: @eq nat (Init.Nat.add (S O) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) *) * (* Goal: @eq nat (Init.Nat.add (S O) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) *) simpl;f_equal. (* Goal: @eq nat (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) *) rewrite IHni; auto. (* BG Goal: @eq nat (@wordToNat no (natToWord no O)) O *) (* BG Goal: lt (Init.Nat.add (@wordToNat no (natToWord no (S O))) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (Nat.pow (S (S O)) no) *) * (* Goal: lt (Init.Nat.add (@wordToNat no (natToWord no (S O))) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (Nat.pow (S (S O)) no) *) rewrite ?wordToNat_natToWord_idempotent'; try omega. (* Goal: lt (Init.Nat.add (S O) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (Nat.pow (S (S O)) no) *) match goal with | |- 1 + #(countLeadingZerosWord no ?x) < _ => pose proof (@countLeadingZerosWord_le_len_nat no ni ltac:(omega) x) as sth end. (* Goal: lt (Init.Nat.add (S O) (@wordToNat no (@countLeadingZerosWord ni no (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))))) (Nat.pow (S (S O)) no) *) omega. (* BG Goal: @eq nat (@wordToNat no (natToWord no O)) O *) + (* Goal: @eq nat (@wordToNat no (natToWord no O)) O *) rewrite roundTrip_0; auto. Qed. Lemma countLeadingZerosWord_nat_le_len ni (w: word ni): countLeadingZerosWord_nat w <= ni. Proof. (* Goal: le (@countLeadingZerosWord_nat ni w) ni *) induction ni; simpl; auto; intros. (* Goal: le (if @weq (S O) (split2 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)) (@WS false O WO) then S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) else O) (S ni) *) match goal with | |- ((if ?P then _ else _) <= _) => destruct P; simpl; auto end. (* Goal: le (S (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w)))) (S ni) *) apply Le.le_n_S. (* Goal: le (@countLeadingZerosWord_nat ni (split1 ni (S O) (@nat_cast (fun n : nat => word n) (S ni) (Nat.add ni (S O)) (@eq_sym nat (Nat.add ni (S O)) (S ni) (Nat.add_1_r ni)) w))) ni *) eapply IHni. Qed. Lemma countLeadingZerosWord_enough_size ni no no' (pf: ni < pow2 no) (pf': ni < pow2 no'): forall (w: word ni), #(countLeadingZerosWord no w) = #(countLeadingZerosWord no' w). Proof. (* Goal: forall w : word ni, @eq nat (@wordToNat no (@countLeadingZerosWord ni no w)) (@wordToNat no' (@countLeadingZerosWord ni no' w)) *) intros. (* Goal: @eq nat (@wordToNat no (@countLeadingZerosWord ni no w)) (@wordToNat no' (@countLeadingZerosWord ni no' w)) *) rewrite ?countLeadingZerosWord_nat_correct; auto. Qed. Lemma wordToN_mod: forall sz (a b: word sz), wordToN (a ^% b) = (wordToN a mod wordToN b)%N. Lemma wordToNat_mod: forall sz (a b: word sz), b <> $0 -> #(a ^% b) = #a mod #b. Lemma wlshift_mul_pow2: forall sz n (a: word sz), wlshift a n = a ^* $ (pow2 n). Proof. (* Goal: forall (sz n : nat) (a : word sz), @eq (word sz) (@wlshift sz a n) (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n))) *) intros. (* Goal: @eq (word sz) (@wlshift sz a n) (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n))) *) apply wordToNat_inj. (* Goal: @eq nat (@wordToNat sz (@wlshift sz a n)) (@wordToNat sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n)))) *) unfold wlshift. (* Goal: @eq nat (@wordToNat sz (split1 sz n (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz a) (Nat.add sz n) (Nat.add_comm sz n)))) (@wordToNat sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n)))) *) rewrite? wordToNat_split1. (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz a) (Nat.add sz n) (Nat.add_comm sz n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n)))) *) unfold eq_rec_r, eq_rec. (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@eq_rect nat (Nat.add n sz) (fun y : nat => word y) (@combine n (wzero n) sz a) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n)))) *) rewrite? wordToNat_eq_rect. (* Goal: @eq nat (Nat.modulo (@wordToNat (Nat.add n sz) (@combine n (wzero n) sz a)) (Nat.pow (S (S O)) sz)) (@wordToNat sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n)))) *) rewrite? wordToNat_combine. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat n (wzero n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz a))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n)))) *) rewrite? wordToNat_wzero. (* Goal: @eq nat (Nat.modulo (Init.Nat.add O (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz a))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n)))) *) rewrite wordToNat_wmult. (* Goal: @eq nat (Nat.modulo (Init.Nat.add O (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz a))) (Nat.pow (S (S O)) sz)) (Nat.modulo (Init.Nat.mul (@wordToNat sz a) (@wordToNat sz (natToWord sz (Nat.pow (S (S O)) n)))) (Nat.pow (S (S O)) sz)) *) rewrite wordToNat_natToWord_eqn. (* Goal: @eq nat (Nat.modulo (Init.Nat.add O (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz a))) (Nat.pow (S (S O)) sz)) (Nat.modulo (Init.Nat.mul (@wordToNat sz a) (Nat.modulo (Nat.pow (S (S O)) n) (Nat.pow (S (S O)) sz))) (Nat.pow (S (S O)) sz)) *) rewrite Nat.add_0_l. (* Goal: @eq nat (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz a)) (Nat.pow (S (S O)) sz)) (Nat.modulo (Init.Nat.mul (@wordToNat sz a) (Nat.modulo (Nat.pow (S (S O)) n) (Nat.pow (S (S O)) sz))) (Nat.pow (S (S O)) sz)) *) rewrite Nat.mul_mod_idemp_r by (apply pow2_ne_zero). (* Goal: @eq nat (Nat.modulo (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz a)) (Nat.pow (S (S O)) sz)) (Nat.modulo (Nat.mul (@wordToNat sz a) (Nat.pow (S (S O)) n)) (Nat.pow (S (S O)) sz)) *) rewrite Nat.mul_comm. (* Goal: @eq nat (Nat.modulo (Nat.mul (@wordToNat sz a) (Nat.pow (S (S O)) n)) (Nat.pow (S (S O)) sz)) (Nat.modulo (Nat.mul (@wordToNat sz a) (Nat.pow (S (S O)) n)) (Nat.pow (S (S O)) sz)) *) reflexivity. Qed. Lemma wlshift_mul_Zpow2: forall sz n (a: word sz), (0 <= n)%Z -> wlshift a (Z.to_nat n) = a ^* ZToWord sz (2 ^ n). Proof. (* Goal: forall (sz : nat) (n : Z) (a : word sz) (_ : Z.le Z0 n), @eq (word sz) (@wlshift sz a (Z.to_nat n)) (@wmult sz a (ZToWord sz (Z.pow (Zpos (xO xH)) n))) *) intros. (* Goal: @eq (word sz) (@wlshift sz a (Z.to_nat n)) (@wmult sz a (ZToWord sz (Z.pow (Zpos (xO xH)) n))) *) rewrite wlshift_mul_pow2. (* Goal: @eq (word sz) (@wmult sz a (natToWord sz (Nat.pow (S (S O)) (Z.to_nat n)))) (@wmult sz a (ZToWord sz (Z.pow (Zpos (xO xH)) n))) *) f_equal. (* Goal: @eq (word sz) (natToWord sz (Nat.pow (S (S O)) (Z.to_nat n))) (ZToWord sz (Z.pow (Zpos (xO xH)) n)) *) change 2 with (Z.to_nat 2). (* Goal: @eq (word sz) (natToWord sz (Nat.pow (Z.to_nat (Zpos (xO xH))) (Z.to_nat n))) (ZToWord sz (Z.pow (Zpos (xO xH)) n)) *) rewrite <- Z2Nat.inj_pow by omega. (* Goal: @eq (word sz) (natToWord sz (Z.to_nat (Z.pow (Zpos (xO xH)) n))) (ZToWord sz (Z.pow (Zpos (xO xH)) n)) *) apply natToWord_Z_to_nat. (* Goal: Z.le Z0 (Z.pow (Zpos (xO xH)) n) *) apply Z.pow_nonneg. (* Goal: Z.le Z0 (Zpos (xO xH)) *) omega. Qed. Lemma wlshift_distr_plus: forall sz n (a b: word sz), wlshift (a ^+ b) n = wlshift a n ^+ wlshift b n. Proof. (* Goal: forall (sz n : nat) (a b : word sz), @eq (word sz) (@wlshift sz (@wplus sz a b) n) (@wplus sz (@wlshift sz a n) (@wlshift sz b n)) *) intros. (* Goal: @eq (word sz) (@wlshift sz (@wplus sz a b) n) (@wplus sz (@wlshift sz a n) (@wlshift sz b n)) *) rewrite? wlshift_mul_pow2. (* Goal: @eq (word sz) (@wmult sz (@wplus sz a b) (natToWord sz (Nat.pow (S (S O)) n))) (@wplus sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n))) (@wmult sz b (natToWord sz (Nat.pow (S (S O)) n)))) *) apply wmult_plus_distr. Qed. Lemma wlshift'_distr_plus: forall sz n (a b: word sz), wlshift' (a ^+ b) n = wlshift' a n ^+ wlshift' b n. Proof. (* Goal: forall (sz n : nat) (a b : word sz), @eq (word sz) (@wlshift' sz (@wplus sz a b) n) (@wplus sz (@wlshift' sz a n) (@wlshift' sz b n)) *) intros. (* Goal: @eq (word sz) (@wlshift' sz (@wplus sz a b) n) (@wplus sz (@wlshift' sz a n) (@wlshift' sz b n)) *) rewrite? wlshift_alt. (* Goal: @eq (word sz) (@wlshift sz (@wplus sz a b) n) (@wplus sz (@wlshift sz a n) (@wlshift sz b n)) *) apply wlshift_distr_plus. Qed. Lemma wlshift_iter: forall sz n1 n2 (a: word sz), wlshift (wlshift a n1) n2 = wlshift a (n1 + n2). Proof. (* Goal: forall (sz n1 n2 : nat) (a : word sz), @eq (word sz) (@wlshift sz (@wlshift sz a n1) n2) (@wlshift sz a (Init.Nat.add n1 n2)) *) intros. (* Goal: @eq (word sz) (@wlshift sz (@wlshift sz a n1) n2) (@wlshift sz a (Init.Nat.add n1 n2)) *) rewrite? wlshift_mul_pow2. (* Goal: @eq (word sz) (@wmult sz (@wmult sz a (natToWord sz (Nat.pow (S (S O)) n1))) (natToWord sz (Nat.pow (S (S O)) n2))) (@wmult sz a (natToWord sz (Nat.pow (S (S O)) (Init.Nat.add n1 n2)))) *) rewrite <- wmult_assoc. (* Goal: @eq (word sz) (@wmult sz a (@wmult sz (natToWord sz (Nat.pow (S (S O)) n1)) (natToWord sz (Nat.pow (S (S O)) n2)))) (@wmult sz a (natToWord sz (Nat.pow (S (S O)) (Init.Nat.add n1 n2)))) *) rewrite <- natToWord_mult. (* Goal: @eq (word sz) (@wmult sz a (natToWord sz (Init.Nat.mul (Nat.pow (S (S O)) n1) (Nat.pow (S (S O)) n2)))) (@wmult sz a (natToWord sz (Nat.pow (S (S O)) (Init.Nat.add n1 n2)))) *) do 2 f_equal. (* Goal: @eq nat (Init.Nat.mul (Nat.pow (S (S O)) n1) (Nat.pow (S (S O)) n2)) (Nat.pow (S (S O)) (Init.Nat.add n1 n2)) *) symmetry. (* Goal: @eq nat (Nat.pow (S (S O)) (Init.Nat.add n1 n2)) (Init.Nat.mul (Nat.pow (S (S O)) n1) (Nat.pow (S (S O)) n2)) *) apply Nat.pow_add_r. Qed. Lemma wlshift'_iter: forall sz n1 n2 (a: word sz), wlshift' (wlshift' a n1) n2 = wlshift' a (n1 + n2). Proof. (* Goal: forall (sz n1 n2 : nat) (a : word sz), @eq (word sz) (@wlshift' sz (@wlshift' sz a n1) n2) (@wlshift' sz a (Init.Nat.add n1 n2)) *) intros. (* Goal: @eq (word sz) (@wlshift' sz (@wlshift' sz a n1) n2) (@wlshift' sz a (Init.Nat.add n1 n2)) *) rewrite? wlshift_alt. (* Goal: @eq (word sz) (@wlshift sz (@wlshift sz a n1) n2) (@wlshift sz a (Init.Nat.add n1 n2)) *) apply wlshift_iter. Qed. Lemma wlshift_zero: forall sz n, wlshift $0 n = natToWord sz 0. Proof. (* Goal: forall sz n : nat, @eq (word sz) (@wlshift sz (natToWord sz O) n) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wlshift sz (natToWord sz O) n) (natToWord sz O) *) apply wordToNat_inj. (* Goal: @eq nat (@wordToNat sz (@wlshift sz (natToWord sz O) n)) (@wordToNat sz (natToWord sz O)) *) unfold wlshift. (* Goal: @eq nat (@wordToNat sz (split1 sz n (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz (natToWord sz O)) (Nat.add sz n) (Nat.add_comm sz n)))) (@wordToNat sz (natToWord sz O)) *) rewrite? wordToNat_split1. (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@eq_rec_r nat (Nat.add n sz) (fun n : nat => word n) (@combine n (wzero n) sz (natToWord sz O)) (Nat.add sz n) (Nat.add_comm sz n))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (natToWord sz O)) *) unfold eq_rec_r, eq_rec. (* Goal: @eq nat (Nat.modulo (@wordToNat (Init.Nat.add sz n) (@eq_rect nat (Nat.add n sz) (fun y : nat => word y) (@combine n (wzero n) sz (natToWord sz O)) (Nat.add sz n) (@eq_sym nat (Nat.add sz n) (Nat.add n sz) (Nat.add_comm sz n)))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (natToWord sz O)) *) rewrite? wordToNat_eq_rect. (* Goal: @eq nat (Nat.modulo (@wordToNat (Nat.add n sz) (@combine n (wzero n) sz (natToWord sz O))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (natToWord sz O)) *) rewrite? wordToNat_combine. (* Goal: @eq nat (Nat.modulo (Init.Nat.add (@wordToNat n (wzero n)) (Init.Nat.mul (Nat.pow (S (S O)) n) (@wordToNat sz (natToWord sz O)))) (Nat.pow (S (S O)) sz)) (@wordToNat sz (natToWord sz O)) *) rewrite? wordToNat_wzero. (* Goal: @eq nat (Nat.modulo (Init.Nat.add O (Init.Nat.mul (Nat.pow (S (S O)) n) O)) (Nat.pow (S (S O)) sz)) O *) rewrite Nat.mul_0_r. (* Goal: @eq nat (Nat.modulo (Init.Nat.add O O) (Nat.pow (S (S O)) sz)) O *) change (0 + 0) with 0. (* Goal: @eq nat (Nat.modulo O (Nat.pow (S (S O)) sz)) O *) rewrite Nat.mod_0_l by (apply pow2_ne_zero). (* Goal: @eq nat O O *) reflexivity. Qed. Lemma wlshift'_zero: forall sz n, wlshift' $0 n = natToWord sz 0. Proof. (* Goal: forall sz n : nat, @eq (word sz) (@wlshift' sz (natToWord sz O) n) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wlshift' sz (natToWord sz O) n) (natToWord sz O) *) rewrite? wlshift_alt. (* Goal: @eq (word sz) (@wlshift sz (natToWord sz O) n) (natToWord sz O) *) apply wlshift_zero. Qed. Lemma sext_natToWord_nat_cast: forall sz2 sz1 sz n (e: sz1 + sz2 = sz), 2 * n < pow2 sz1 -> nat_cast word e (sext (natToWord sz1 n) sz2) = natToWord sz n. Proof. (* Goal: forall (sz2 sz1 sz n : nat) (e : @eq nat (Init.Nat.add sz1 sz2) sz) (_ : lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1)), @eq (word sz) (@nat_cast word (Init.Nat.add sz1 sz2) sz e (@sext sz1 (natToWord sz1 n) sz2)) (natToWord sz n) *) intros. (* Goal: @eq (word sz) (@nat_cast word (Init.Nat.add sz1 sz2) sz e (@sext sz1 (natToWord sz1 n) sz2)) (natToWord sz n) *) rewrite nat_cast_eq_rect. (* Goal: @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (@sext sz1 (natToWord sz1 n) sz2) sz e) (natToWord sz n) *) apply sext_natToWord. (* Goal: lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1) *) assumption. Qed. Lemma sext_neg_natToWord_nat_cast: forall sz2 sz1 sz n (e: sz1 + sz2 = sz), 2 * n < pow2 sz1 -> nat_cast word e (sext (wneg (natToWord sz1 n)) sz2) = wneg (natToWord sz n). Proof. (* Goal: forall (sz2 sz1 sz n : nat) (e : @eq nat (Init.Nat.add sz1 sz2) sz) (_ : lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1)), @eq (word sz) (@nat_cast word (Init.Nat.add sz1 sz2) sz e (@sext sz1 (@wneg sz1 (natToWord sz1 n)) sz2)) (@wneg sz (natToWord sz n)) *) intros. (* Goal: @eq (word sz) (@nat_cast word (Init.Nat.add sz1 sz2) sz e (@sext sz1 (@wneg sz1 (natToWord sz1 n)) sz2)) (@wneg sz (natToWord sz n)) *) rewrite nat_cast_eq_rect. (* Goal: @eq (word sz) (@eq_rect nat (Init.Nat.add sz1 sz2) word (@sext sz1 (@wneg sz1 (natToWord sz1 n)) sz2) sz e) (@wneg sz (natToWord sz n)) *) apply sext_wneg_natToWord. (* Goal: lt (Init.Nat.mul (S (S O)) n) (Nat.pow (S (S O)) sz1) *) assumption. Qed. Lemma sext0: forall sz0 sz (v: word sz) (e: sz0 = 0), sext v sz0 = nat_cast word (eq_ind_r (fun sz0 : nat => sz = sz + sz0) (plus_n_O sz) e) v. Proof. (* Goal: forall (sz0 sz : nat) (v : word sz) (e : @eq nat sz0 O), @eq (word (Init.Nat.add sz sz0)) (@sext sz v sz0) (@nat_cast word sz (Init.Nat.add sz sz0) (@eq_ind_r nat O (fun sz1 : nat => @eq nat sz (Init.Nat.add sz sz1)) (plus_n_O sz) sz0 e) v) *) intros. (* Goal: @eq (word (Init.Nat.add sz sz0)) (@sext sz v sz0) (@nat_cast word sz (Init.Nat.add sz sz0) (@eq_ind_r nat O (fun sz0 : nat => @eq nat sz (Init.Nat.add sz sz0)) (plus_n_O sz) sz0 e) v) *) subst. (* Goal: @eq (word (Init.Nat.add sz O)) (@sext sz v O) (@nat_cast word sz (Init.Nat.add sz O) (@eq_ind_r nat O (fun sz0 : nat => @eq nat sz (Init.Nat.add sz sz0)) (plus_n_O sz) O (@eq_refl nat O)) v) *) unfold sext. (* Goal: @eq (word (Init.Nat.add sz O)) (if @wmsb sz v false then @combine sz v O (wones O) else @combine sz v O (wzero O)) (@nat_cast word sz (Init.Nat.add sz O) (@eq_ind_r nat O (fun sz0 : nat => @eq nat sz (Init.Nat.add sz sz0)) (plus_n_O sz) O (@eq_refl nat O)) v) *) destruct (wmsb v false) eqn: E; simpl; rewrite combine_n_0; rewrite <- nat_cast_eq_rect; apply nat_cast_proof_irrel. Qed. Lemma wordToN_wordToZ: forall (sz : nat) (w : word sz), wordToN w = Z.to_N (wordToZ w + Z.of_N (if wmsb w false then Npow2 sz else 0%N)). Proof. (* Goal: forall (sz : nat) (w : word sz), @eq N (@wordToN sz w) (Z.to_N (Z.add (@wordToZ sz w) (Z.of_N (if @wmsb sz w false then Npow2 sz else N0)))) *) intros. (* Goal: @eq N (@wordToN sz w) (Z.to_N (Z.add (@wordToZ sz w) (Z.of_N (if @wmsb sz w false then Npow2 sz else N0)))) *) rewrite (wordToZ_wordToN w). (* Goal: @eq N (@wordToN sz w) (Z.to_N (Z.add (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N (if @wmsb sz w false then Npow2 sz else N0))) (Z.of_N (if @wmsb sz w false then Npow2 sz else N0)))) *) remember (if wmsb w false then Npow2 sz else 0%N) as c; clear Heqc. (* Goal: @eq N (@wordToN sz w) (Z.to_N (Z.add (Z.sub (Z.of_N (@wordToN sz w)) (Z.of_N c)) (Z.of_N c))) *) rewrite Z.sub_add. (* Goal: @eq N (@wordToN sz w) (Z.to_N (Z.of_N (@wordToN sz w))) *) symmetry. (* Goal: @eq N (Z.to_N (Z.of_N (@wordToN sz w))) (@wordToN sz w) *) apply N2Z.id. Qed. Lemma uwordToZ_ZToWord_0: forall (sz : nat) (z : Z), (0 <= z < Z.of_N (Npow2 sz))%Z -> Proof. (* Goal: forall (sz : nat) (z : Z) (_ : and (Z.le Z0 z) (Z.lt z (Z.of_N (Npow2 sz)))), @eq Z (@uwordToZ sz (ZToWord sz z)) z *) intros. (* Goal: @eq Z (@uwordToZ sz (ZToWord sz z)) z *) unfold uwordToZ. (* Goal: @eq Z (Z.of_N (@wordToN sz (ZToWord sz z))) z *) pose proof (Z2N.id _ (proj1 H)). (* Goal: @eq Z (Z.of_N (@wordToN sz (ZToWord sz z))) z *) remember (Z.to_N z) as n; clear Heqn. (* Goal: @eq Z (Z.of_N (@wordToN sz (ZToWord sz z))) z *) subst z. (* Goal: @eq Z (Z.of_N (@wordToN sz (ZToWord sz (Z.of_N n)))) (Z.of_N n) *) apply proj2 in H. (* Goal: @eq Z (Z.of_N (@wordToN sz (ZToWord sz (Z.of_N n)))) (Z.of_N n) *) f_equal. (* Goal: @eq N (@wordToN sz (ZToWord sz (Z.of_N n))) n *) rewrite ZToWord_Z_of_N. (* Goal: @eq N (@wordToN sz (NToWord sz n)) n *) apply wordToN_NToWord_2. (* Goal: N.lt n (Npow2 sz) *) apply N2Z.inj_lt. (* Goal: Z.lt (Z.of_N n) (Z.of_N (Npow2 sz)) *) assumption. Qed. Lemma uwordToZ_ZToWord: forall (sz : nat) (z : Z), (0 <= z < 2 ^ (Z.of_nat sz))%Z -> Proof. (* Goal: forall (sz : nat) (z : Z) (_ : and (Z.le Z0 z) (Z.lt z (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))), @eq Z (@uwordToZ sz (ZToWord sz z)) z *) intros. (* Goal: @eq Z (@uwordToZ sz (ZToWord sz z)) z *) apply uwordToZ_ZToWord_0. (* Goal: and (Z.le Z0 z) (Z.lt z (Z.of_N (Npow2 sz))) *) intuition idtac. (* Goal: Z.lt z (Z.of_N (Npow2 sz)) *) change 2%Z with (Z.of_nat 2) in H1. (* Goal: Z.lt z (Z.of_N (Npow2 sz)) *) rewrite <- Nat2Z.inj_pow in H1. (* Goal: Z.lt z (Z.of_N (Npow2 sz)) *) rewrite <- N_nat_Z. (* Goal: Z.lt z (Z.of_nat (N.to_nat (Npow2 sz))) *) rewrite Npow2_nat. (* Goal: Z.lt z (Z.of_nat (Nat.pow (S (S O)) sz)) *) assumption. Qed. Lemma NToWord_Z_to_N: forall sz n, (0 <= n)%Z -> NToWord sz (Z.to_N n) = ZToWord sz n. Proof. (* Goal: forall (sz : nat) (n : Z) (_ : Z.le Z0 n), @eq (word sz) (NToWord sz (Z.to_N n)) (ZToWord sz n) *) intros. (* Goal: @eq (word sz) (NToWord sz (Z.to_N n)) (ZToWord sz n) *) rewrite <- ZToWord_Z_of_N. (* Goal: @eq (word sz) (ZToWord sz (Z.of_N (Z.to_N n))) (ZToWord sz n) *) rewrite Z2N.id by assumption. (* Goal: @eq (word sz) (ZToWord sz n) (ZToWord sz n) *) reflexivity. Qed. Lemma uwordToZ_ZToWord_k: forall (sz : nat) (n : Z), (0 <= n)%Z -> exists k, uwordToZ (ZToWord sz n) = (n - k * 2 ^ Z.of_nat sz)%Z /\ (k * 2 ^ Z.of_nat sz <= n)%Z. Proof. (* Goal: forall (sz : nat) (n : Z) (_ : Z.le Z0 n), @ex Z (fun k : Z => and (@eq Z (@uwordToZ sz (ZToWord sz n)) (Z.sub n (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n)) *) intros *. (* Goal: forall _ : Z.le Z0 n, @ex Z (fun k : Z => and (@eq Z (@uwordToZ sz (ZToWord sz n)) (Z.sub n (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n)) *) intro C. (* Goal: @ex Z (fun k : Z => and (@eq Z (@uwordToZ sz (ZToWord sz n)) (Z.sub n (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n)) *) unfold uwordToZ. (* Goal: @ex Z (fun k : Z => and (@eq Z (Z.of_N (@wordToN sz (ZToWord sz n))) (Z.sub n (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n)) *) pose proof (wordToN_NToWord sz (Z.to_N n)) as P. (* Goal: @ex Z (fun k : Z => and (@eq Z (Z.of_N (@wordToN sz (ZToWord sz n))) (Z.sub n (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n)) *) destruct P as [k [P Q]]. (* Goal: @ex Z (fun k : Z => and (@eq Z (Z.of_N (@wordToN sz (ZToWord sz n))) (Z.sub n (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n)) *) exists (Z.of_N k). (* Goal: and (@eq Z (Z.of_N (@wordToN sz (ZToWord sz n))) (Z.sub n (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n) *) rewrite NToWord_Z_to_N in P by assumption. (* Goal: and (@eq Z (Z.of_N (@wordToN sz (ZToWord sz n))) (Z.sub n (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n) *) rewrite P. (* Goal: and (@eq Z (Z.of_N (N.sub (Z.to_N n) (N.mul k (Npow2 sz)))) (Z.sub n (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n) *) clear P. (* Goal: and (@eq Z (Z.of_N (N.sub (Z.to_N n) (N.mul k (Npow2 sz)))) (Z.sub n (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.le (Z.mul (Z.of_N k) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) n) *) rewrite <- Z_of_N_Npow2 in *. (* Goal: and (@eq Z (Z.of_N (N.sub (Z.to_N n) (N.mul k (Npow2 sz)))) (Z.sub n (Z.mul (Z.of_N k) (Z.of_N (Npow2 sz))))) (Z.le (Z.mul (Z.of_N k) (Z.of_N (Npow2 sz))) n) *) rewrite <- N2Z.inj_mul. (* Goal: and (@eq Z (Z.of_N (N.sub (Z.to_N n) (N.mul k (Npow2 sz)))) (Z.sub n (Z.of_N (N.mul k (Npow2 sz))))) (Z.le (Z.of_N (N.mul k (Npow2 sz))) n) *) rewrite N2Z.inj_sub by assumption. (* Goal: and (@eq Z (Z.sub (Z.of_N (Z.to_N n)) (Z.of_N (N.mul k (Npow2 sz)))) (Z.sub n (Z.of_N (N.mul k (Npow2 sz))))) (Z.le (Z.of_N (N.mul k (Npow2 sz))) n) *) apply N2Z.inj_le in Q. (* Goal: and (@eq Z (Z.sub (Z.of_N (Z.to_N n)) (Z.of_N (N.mul k (Npow2 sz)))) (Z.sub n (Z.of_N (N.mul k (Npow2 sz))))) (Z.le (Z.of_N (N.mul k (Npow2 sz))) n) *) rewrite Z2N.id in * by assumption. (* Goal: and (@eq Z (Z.sub n (Z.of_N (N.mul k (Npow2 sz)))) (Z.sub n (Z.of_N (N.mul k (Npow2 sz))))) (Z.le (Z.of_N (N.mul k (Npow2 sz))) n) *) auto. Qed. Lemma Zpow2_pos: forall n, (2 ^ Z.of_nat n > 0)%Z. Proof. (* Goal: forall n : nat, Z.gt (Z.pow (Zpos (xO xH)) (Z.of_nat n)) Z0 *) intros. (* Goal: Z.gt (Z.pow (Zpos (xO xH)) (Z.of_nat n)) Z0 *) pose proof (Z.pow_pos_nonneg 2 (Z.of_nat n)). (* Goal: Z.gt (Z.pow (Zpos (xO xH)) (Z.of_nat n)) Z0 *) omega. Qed. Lemma uwordToZ_bound: forall sz (a: word sz), (0 <= uwordToZ a < 2 ^ Z.of_nat sz)%Z. Proof. (* Goal: forall (sz : nat) (a : word sz), and (Z.le Z0 (@uwordToZ sz a)) (Z.lt (@uwordToZ sz a) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) intros. (* Goal: and (Z.le Z0 (@uwordToZ sz a)) (Z.lt (@uwordToZ sz a) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) unfold uwordToZ. (* Goal: and (Z.le Z0 (Z.of_N (@wordToN sz a))) (Z.lt (Z.of_N (@wordToN sz a)) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) split. (* Goal: Z.lt (Z.of_N (@wordToN sz a)) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) *) (* Goal: Z.le Z0 (Z.of_N (@wordToN sz a)) *) + (* Goal: Z.le Z0 (Z.of_N (@wordToN sz a)) *) apply N2Z.is_nonneg. (* BG Goal: Z.lt (Z.of_N (@wordToN sz a)) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) *) + (* Goal: Z.lt (Z.of_N (@wordToN sz a)) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) *) pose proof (wordToN_bound a) as P. (* Goal: Z.lt (Z.of_N (@wordToN sz a)) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) *) apply N2Z.inj_lt in P. (* Goal: Z.lt (Z.of_N (@wordToN sz a)) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) *) rewrite Z_of_N_Npow2 in P. (* Goal: Z.lt (Z.of_N (@wordToN sz a)) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) *) assumption. Qed. Lemma uwordToZ_ZToWord_mod: forall (sz : nat) (z : Z), (0 <= z)%Z -> uwordToZ (ZToWord sz z) = (z mod 2 ^ (Z.of_nat sz))%Z. Proof. (* Goal: forall (sz : nat) (z : Z) (_ : Z.le Z0 z), @eq Z (@uwordToZ sz (ZToWord sz z)) (Z.modulo z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) intros. (* Goal: @eq Z (@uwordToZ sz (ZToWord sz z)) (Z.modulo z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) pose proof (uwordToZ_ZToWord_k sz H) as P. (* Goal: @eq Z (@uwordToZ sz (ZToWord sz z)) (Z.modulo z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) destruct P as [k [P Q]]. (* Goal: @eq Z (@uwordToZ sz (ZToWord sz z)) (Z.modulo z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) pose proof (uwordToZ_bound (ZToWord sz z)) as B. (* Goal: @eq Z (@uwordToZ sz (ZToWord sz z)) (Z.modulo z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) rewrite P in *. (* Goal: @eq Z (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.modulo z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) clear P. (* Goal: @eq Z (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.modulo z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) rewrite Zmod_eq by (apply Zpow2_pos). (* Goal: @eq Z (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.sub z (Z.mul (Z.div z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) *) pose proof (Z.div_unique_pos z (2 ^ Z.of_nat sz) k (z - k * 2 ^ Z.of_nat sz)) as U. (* Goal: @eq Z (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.sub z (Z.mul (Z.div z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) *) rewrite U. (* Goal: @eq Z z (Z.add (Z.mul (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) k) (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) *) (* Goal: and (Z.le Z0 (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.lt (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) (* Goal: @eq Z (Z.sub z (Z.mul (Z.div z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.sub z (Z.mul (Z.div z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) *) - (* Goal: @eq Z (Z.sub z (Z.mul (Z.div z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.sub z (Z.mul (Z.div z (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) *) reflexivity. (* BG Goal: @eq Z z (Z.add (Z.mul (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) k) (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) *) (* BG Goal: and (Z.le Z0 (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.lt (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) - (* Goal: and (Z.le Z0 (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) (Z.lt (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz)))) (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) *) omega. (* BG Goal: @eq Z z (Z.add (Z.mul (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) k) (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) *) - (* Goal: @eq Z z (Z.add (Z.mul (Z.pow (Zpos (xO xH)) (Z.of_nat sz)) k) (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) *) rewrite Z.mul_comm. (* Goal: @eq Z z (Z.add (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))) (Z.sub z (Z.mul k (Z.pow (Zpos (xO xH)) (Z.of_nat sz))))) *) omega. Qed. Lemma ZToWord_uwordToZ: forall sz (a: word sz), ZToWord sz (uwordToZ a) = a. Proof. (* Goal: forall (sz : nat) (a : word sz), @eq (word sz) (ZToWord sz (@uwordToZ sz a)) a *) intros. (* Goal: @eq (word sz) (ZToWord sz (@uwordToZ sz a)) a *) unfold uwordToZ. (* Goal: @eq (word sz) (ZToWord sz (Z.of_N (@wordToN sz a))) a *) rewrite ZToWord_Z_of_N. (* Goal: @eq (word sz) (NToWord sz (@wordToN sz a)) a *) apply NToWord_wordToN. Qed. Lemma wordToN_neq_0: forall sz (b : word sz), b <> $0 -> wordToN b <> 0%N. Lemma wmod_plus_distr_does_not_hold: ~ forall sz (a b m: word sz), m <> $0 -> (a ^+ b) ^% m = ((a ^% m) ^+ (b ^% m)) ^% m. Proof. (* Goal: not (forall (sz : nat) (a b m : word sz) (_ : not (@eq (word sz) m (natToWord sz O))), @eq (word sz) (@wmod sz (@wplus sz a b) m) (@wmod sz (@wplus sz (@wmod sz a m) (@wmod sz b m)) m)) *) intro C. (* Goal: False *) specialize (C 4 $9 $11 $7). (* Goal: False *) cbv in C. (* Goal: False *) match type of C with (?A -> _) => assert A by (intro; discriminate) end. (* Goal: False *) specialize (C H). (* Goal: False *) discriminate. Qed. Lemma wmul_mod_distr_does_not_hold: ~ forall sz (a b n: word sz), n <> $0 -> (a ^* b) ^% n = ((a ^% n) ^* (b ^% n)) ^% n. Proof. (* Goal: not (forall (sz : nat) (a b n : word sz) (_ : not (@eq (word sz) n (natToWord sz O))), @eq (word sz) (@wmod sz (@wmult sz a b) n) (@wmod sz (@wmult sz (@wmod sz a n) (@wmod sz b n)) n)) *) intro C. (* Goal: False *) specialize (C 4 $9 $11 $7). (* Goal: False *) cbv in C. (* Goal: False *) match type of C with (?A -> _) => assert A by (intro; discriminate) end. (* Goal: False *) specialize (C H). (* Goal: False *) discriminate. Qed. Lemma Nmod_0_r: forall a : N, (a mod 0)%N = a. Proof. (* Goal: forall a : N, @eq N (N.modulo a N0) a *) intros. (* Goal: @eq N (N.modulo a N0) a *) destruct a; reflexivity. Qed. Lemma wordToN_0: forall sz, wordToN (natToWord sz 0) = 0%N. Proof. (* Goal: forall sz : nat, @eq N (@wordToN sz (natToWord sz O)) N0 *) intros. (* Goal: @eq N (@wordToN sz (natToWord sz O)) N0 *) change (natToWord sz 0) with (wzero sz). (* Goal: @eq N (@wordToN sz (wzero sz)) N0 *) apply wordToN_wzero. Qed. Lemma NToWord_0: forall sz, NToWord sz 0 = $ (0). Proof. (* Goal: forall sz : nat, @eq (word sz) (NToWord sz N0) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (NToWord sz N0) (natToWord sz O) *) change 0%nat with (N.to_nat 0). (* Goal: @eq (word sz) (NToWord sz N0) (natToWord sz (N.to_nat N0)) *) apply NToWord_nat. Qed. Lemma wmod_0_r: forall sz (a: word sz), a ^% $0 = a. Proof. (* Goal: forall (sz : nat) (a : word sz), @eq (word sz) (@wmod sz a (natToWord sz O)) a *) intros. (* Goal: @eq (word sz) (@wmod sz a (natToWord sz O)) a *) unfold wmod, wordBin. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz a) (@wordToN sz (natToWord sz O)))) a *) rewrite wordToN_0. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz a) N0)) a *) rewrite Nmod_0_r. (* Goal: @eq (word sz) (NToWord sz (@wordToN sz a)) a *) apply NToWord_wordToN. Qed. Lemma wordToN_NToWord_eqn: forall sz (n : N), wordToN (NToWord sz n) = (n mod Npow2 sz)%N. Proof. (* Goal: forall (sz : nat) (n : N), @eq N (@wordToN sz (NToWord sz n)) (N.modulo n (Npow2 sz)) *) intros. (* Goal: @eq N (@wordToN sz (NToWord sz n)) (N.modulo n (Npow2 sz)) *) pose proof (Npow2_not_zero sz). (* Goal: @eq N (@wordToN sz (NToWord sz n)) (N.modulo n (Npow2 sz)) *) apply Nnat.N2Nat.inj. (* Goal: @eq nat (N.to_nat (@wordToN sz (NToWord sz n))) (N.to_nat (N.modulo n (Npow2 sz))) *) rewrite wordToN_to_nat. (* Goal: @eq nat (@wordToNat sz (NToWord sz n)) (N.to_nat (N.modulo n (Npow2 sz))) *) rewrite N2Nat.inj_mod by assumption. (* Goal: @eq nat (@wordToNat sz (NToWord sz n)) (Nat.modulo (N.to_nat n) (N.to_nat (Npow2 sz))) *) rewrite Npow2_nat. (* Goal: @eq nat (@wordToNat sz (NToWord sz n)) (Nat.modulo (N.to_nat n) (Nat.pow (S (S O)) sz)) *) rewrite <- wordToNat_natToWord_eqn. (* Goal: @eq nat (@wordToNat sz (NToWord sz n)) (@wordToNat sz (natToWord sz (N.to_nat n))) *) rewrite <- NToWord_nat. (* Goal: @eq nat (@wordToNat sz (NToWord sz n)) (@wordToNat sz (NToWord sz n)) *) reflexivity. Qed. Lemma Nminus_mod_idemp_r: forall a b n : N, (n <> 0)%N -> (b <= a)%N -> ((a - b mod n) mod n)%N = ((a - b) mod n)%N. Proof. (* Goal: forall (a b n : N) (_ : not (@eq N n N0)) (_ : N.le b a), @eq N (N.modulo (N.sub a (N.modulo b n)) n) (N.modulo (N.sub a b) n) *) intros. (* Goal: @eq N (N.modulo (N.sub a (N.modulo b n)) n) (N.modulo (N.sub a b) n) *) apply N2Z.inj. (* Goal: @eq Z (Z.of_N (N.modulo (N.sub a (N.modulo b n)) n)) (Z.of_N (N.modulo (N.sub a b) n)) *) rewrite? N2Z.inj_mod by assumption. (* Goal: @eq Z (Z.modulo (Z.of_N (N.sub a (N.modulo b n))) (Z.of_N n)) (Z.modulo (Z.of_N (N.sub a b)) (Z.of_N n)) *) pose proof (N.mod_le b n H). (* Goal: @eq Z (Z.modulo (Z.of_N (N.sub a (N.modulo b n))) (Z.of_N n)) (Z.modulo (Z.of_N (N.sub a b)) (Z.of_N n)) *) rewrite N2Z.inj_sub by (eapply N.le_trans; eassumption). (* Goal: @eq Z (Z.modulo (Z.sub (Z.of_N a) (Z.of_N (N.modulo b n))) (Z.of_N n)) (Z.modulo (Z.of_N (N.sub a b)) (Z.of_N n)) *) rewrite N2Z.inj_sub by assumption. (* Goal: @eq Z (Z.modulo (Z.sub (Z.of_N a) (Z.of_N (N.modulo b n))) (Z.of_N n)) (Z.modulo (Z.sub (Z.of_N a) (Z.of_N b)) (Z.of_N n)) *) rewrite? N2Z.inj_mod by assumption. (* Goal: @eq Z (Z.modulo (Z.sub (Z.of_N a) (Z.modulo (Z.of_N b) (Z.of_N n))) (Z.of_N n)) (Z.modulo (Z.sub (Z.of_N a) (Z.of_N b)) (Z.of_N n)) *) apply Zdiv.Zminus_mod_idemp_r. Qed. Lemma drop_sub_N: forall sz (n k : N), (k * Npow2 sz <= n)%N -> NToWord sz (n - k * Npow2 sz) = NToWord sz n. Proof. (* Goal: forall (sz : nat) (n k : N) (_ : N.le (N.mul k (Npow2 sz)) n), @eq (word sz) (NToWord sz (N.sub n (N.mul k (Npow2 sz)))) (NToWord sz n) *) intros. (* Goal: @eq (word sz) (NToWord sz (N.sub n (N.mul k (Npow2 sz)))) (NToWord sz n) *) apply wordToN_inj. (* Goal: @eq N (@wordToN sz (NToWord sz (N.sub n (N.mul k (Npow2 sz))))) (@wordToN sz (NToWord sz n)) *) pose proof (Npow2_not_zero sz). (* Goal: @eq N (@wordToN sz (NToWord sz (N.sub n (N.mul k (Npow2 sz))))) (@wordToN sz (NToWord sz n)) *) do 2 rewrite wordToN_NToWord_eqn. (* Goal: @eq N (N.modulo (N.sub n (N.mul k (Npow2 sz))) (Npow2 sz)) (N.modulo n (Npow2 sz)) *) rewrite <- Nminus_mod_idemp_r by assumption. (* Goal: @eq N (N.modulo (N.sub n (N.modulo (N.mul k (Npow2 sz)) (Npow2 sz))) (Npow2 sz)) (N.modulo n (Npow2 sz)) *) rewrite N.mod_mul by assumption. (* Goal: @eq N (N.modulo (N.sub n N0) (Npow2 sz)) (N.modulo n (Npow2 sz)) *) rewrite N.sub_0_r. (* Goal: @eq N (N.modulo n (Npow2 sz)) (N.modulo n (Npow2 sz)) *) reflexivity. Qed. Lemma wmod_divides: forall sz (a b: word sz), a ^% b = $0 -> exists k, a = b ^* k. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @eq (word sz) (@wmod sz a b) (natToWord sz O)), @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k)) *) intros. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k)) *) destruct (weq b $0). (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k)) *) (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k)) *) - (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k)) *) subst b. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz (natToWord sz O) k)) *) rewrite wmod_0_r in *. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz (natToWord sz O) k)) *) subst a. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) (natToWord sz O) (@wmult sz (natToWord sz O) k)) *) exists (natToWord sz 0). (* Goal: @eq (word sz) (natToWord sz O) (@wmult sz (natToWord sz O) (natToWord sz O)) *) symmetry. (* Goal: @eq (word sz) (@wmult sz (natToWord sz O) (natToWord sz O)) (natToWord sz O) *) apply wmult_neut_r. (* BG Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k)) *) - (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k)) *) unfold wmod, wmult, wordBin in *. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) pose proof (N.mod_divides (wordToN a) (wordToN b)) as P. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) apply wordToN_neq_0 in n. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) specialize (P n). (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) destruct P as [ [k P] _]. (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) (* Goal: @eq N (N.modulo (@wordToN sz a) (@wordToN sz b)) N0 *) + (* Goal: @eq N (N.modulo (@wordToN sz a) (@wordToN sz b)) N0 *) apply (f_equal (@wordToN sz)) in H. (* Goal: @eq N (N.modulo (@wordToN sz a) (@wordToN sz b)) N0 *) rewrite wordToN_NToWord_2 in H. (* Goal: N.lt (N.modulo (@wordToN sz a) (@wordToN sz b)) (Npow2 sz) *) (* Goal: @eq N (N.modulo (@wordToN sz a) (@wordToN sz b)) N0 *) * (* Goal: @eq N (N.modulo (@wordToN sz a) (@wordToN sz b)) N0 *) rewrite H. (* Goal: @eq N (@wordToN sz (natToWord sz O)) N0 *) apply wordToN_0. (* BG Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) (* BG Goal: N.lt (N.modulo (@wordToN sz a) (@wordToN sz b)) (Npow2 sz) *) * (* Goal: N.lt (N.modulo (@wordToN sz a) (@wordToN sz b)) (Npow2 sz) *) pose proof (wordToN_bound a). (* Goal: N.lt (N.modulo (@wordToN sz a) (@wordToN sz b)) (Npow2 sz) *) remember (wordToN a) as c. (* Goal: N.lt (N.modulo c (@wordToN sz b)) (Npow2 sz) *) clear Heqc a. (* Goal: N.lt (N.modulo c (@wordToN sz b)) (Npow2 sz) *) pose proof (wordToN_bound b). (* Goal: N.lt (N.modulo c (@wordToN sz b)) (Npow2 sz) *) remember (wordToN b) as d. (* Goal: N.lt (N.modulo c d) (Npow2 sz) *) clear Heqd b. (* Goal: N.lt (N.modulo c d) (Npow2 sz) *) pose proof (N.mod_upper_bound c d n). (* Goal: N.lt (N.modulo c d) (Npow2 sz) *) nomega. (* BG Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) + (* Goal: @ex (word sz) (fun k : word sz => @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz k)))) *) exists (NToWord sz (k - k / (Npow2 sz) * Npow2 sz)). (* Goal: @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (@wordToN sz (NToWord sz (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))))))) *) rewrite wordToN_NToWord_2. (* Goal: N.lt (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))) (Npow2 sz) *) (* Goal: @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))))) *) { (* Goal: @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))))) *) rewrite N.mul_sub_distr_l. (* Goal: @eq (word sz) a (NToWord sz (N.sub (N.mul (@wordToN sz b) k) (N.mul (@wordToN sz b) (N.mul (N.div k (Npow2 sz)) (Npow2 sz))))) *) rewrite N.mul_assoc. (* Goal: @eq (word sz) a (NToWord sz (N.sub (N.mul (@wordToN sz b) k) (N.mul (N.mul (@wordToN sz b) (N.div k (Npow2 sz))) (Npow2 sz)))) *) rewrite drop_sub_N. (* Goal: N.le (N.mul (N.mul (@wordToN sz b) (N.div k (Npow2 sz))) (Npow2 sz)) (N.mul (@wordToN sz b) k) *) (* Goal: @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) k)) *) - (* Goal: @eq (word sz) a (NToWord sz (N.mul (@wordToN sz b) k)) *) rewrite <- P. (* Goal: @eq (word sz) a (NToWord sz (@wordToN sz a)) *) symmetry. (* Goal: @eq (word sz) (NToWord sz (@wordToN sz a)) a *) apply NToWord_wordToN. (* BG Goal: N.lt (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))) (Npow2 sz) *) (* BG Goal: N.le (N.mul (N.mul (@wordToN sz b) (N.div k (Npow2 sz))) (Npow2 sz)) (N.mul (@wordToN sz b) k) *) - (* Goal: N.le (N.mul (N.mul (@wordToN sz b) (N.div k (Npow2 sz))) (Npow2 sz)) (N.mul (@wordToN sz b) k) *) rewrite <- N.mul_assoc. (* Goal: N.le (N.mul (@wordToN sz b) (N.mul (N.div k (Npow2 sz)) (Npow2 sz))) (N.mul (@wordToN sz b) k) *) rewrite <- (N.mul_comm (Npow2 sz)). (* Goal: N.le (N.mul (@wordToN sz b) (N.mul (Npow2 sz) (N.div k (Npow2 sz)))) (N.mul (@wordToN sz b) k) *) apply N.mul_le_mono_l. (* Goal: N.le (N.mul (Npow2 sz) (N.div k (Npow2 sz))) k *) apply (N.mul_div_le k (Npow2 sz)). (* Goal: not (@eq N (Npow2 sz) N0) *) apply Npow2_not_zero. (* BG Goal: N.lt (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))) (Npow2 sz) *) } (* Goal: N.lt (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))) (Npow2 sz) *) { (* Goal: N.lt (N.sub k (N.mul (N.div k (Npow2 sz)) (Npow2 sz))) (Npow2 sz) *) rewrite <- N.mul_comm. (* Goal: N.lt (N.sub k (N.mul (Npow2 sz) (N.div k (Npow2 sz)))) (Npow2 sz) *) rewrite <- N.mod_eq by (apply Npow2_not_zero). (* Goal: N.lt (N.modulo k (Npow2 sz)) (Npow2 sz) *) apply N.mod_upper_bound. (* Goal: not (@eq N (Npow2 sz) N0) *) apply Npow2_not_zero. Qed. Lemma wmod_divides_other_direction_does_not_hold: ~ forall sz (a b: word sz), b <> $0 -> (exists k, a = b ^* k) -> a ^% b = $0. Proof. (* Goal: not (forall (sz : nat) (a b : word sz) (_ : not (@eq (word sz) b (natToWord sz O))) (_ : @ex (word sz) (fun k : word sz => @eq (word sz) a (@wmult sz b k))), @eq (word sz) (@wmod sz a b) (natToWord sz O)) *) intro C. (* Goal: False *) specialize (C 4 $14 $5). (* Goal: False *) match type of C with (?A -> _) => assert A by (intro; discriminate) end. (* Goal: False *) specialize (C H). (* Goal: False *) match type of C with (?A -> _) => assert A as B end. (* Goal: False *) (* Goal: @ex (word (S (S (S (S O))))) (fun k : word (S (S (S (S O)))) => @eq (word (S (S (S (S O))))) (natToWord (S (S (S (S O)))) (S (S (S (S (S (S (S (S (S (S (S (S (S (S O))))))))))))))) (@wmult (S (S (S (S O)))) (natToWord (S (S (S (S O)))) (S (S (S (S (S O)))))) k)) *) - (* Goal: @ex (word (S (S (S (S O))))) (fun k : word (S (S (S (S O)))) => @eq (word (S (S (S (S O))))) (natToWord (S (S (S (S O)))) (S (S (S (S (S (S (S (S (S (S (S (S (S (S O))))))))))))))) (@wmult (S (S (S (S O)))) (natToWord (S (S (S (S O)))) (S (S (S (S (S O)))))) k)) *) exists (natToWord 4 6). (* Goal: @eq (word (S (S (S (S O))))) (natToWord (S (S (S (S O)))) (S (S (S (S (S (S (S (S (S (S (S (S (S (S O))))))))))))))) (@wmult (S (S (S (S O)))) (natToWord (S (S (S (S O)))) (S (S (S (S (S O)))))) (natToWord (S (S (S (S O)))) (S (S (S (S (S (S O)))))))) *) reflexivity. (* BG Goal: False *) - (* Goal: False *) specialize (C B). (* Goal: False *) cbv in C. (* Goal: False *) discriminate. Qed. Lemma wmod_mul_does_not_hold: ~ forall sz (a b: word sz), b <> $0 -> (a ^* b) ^% b = $0. Proof. (* Goal: not (forall (sz : nat) (a b : word sz) (_ : not (@eq (word sz) b (natToWord sz O))), @eq (word sz) (@wmod sz (@wmult sz a b) b) (natToWord sz O)) *) intro C. (* Goal: False *) specialize (C 4 $6 $5). (* Goal: False *) match type of C with (?A -> _) => assert A by (intro; discriminate) end. (* Goal: False *) specialize (C H). (* Goal: False *) cbv in C. (* Goal: False *) discriminate. Qed. Lemma wmult_plus_distr_l: forall (sz : nat) (x y z : word sz), z ^* (x ^+ y) = z ^* x ^+ z ^* y. Proof. (* Goal: forall (sz : nat) (x y z : word sz), @eq (word sz) (@wmult sz z (@wplus sz x y)) (@wplus sz (@wmult sz z x) (@wmult sz z y)) *) intros. (* Goal: @eq (word sz) (@wmult sz z (@wplus sz x y)) (@wplus sz (@wmult sz z x) (@wmult sz z y)) *) rewrite! (wmult_comm z). (* Goal: @eq (word sz) (@wmult sz (@wplus sz x y) z) (@wplus sz (@wmult sz x z) (@wmult sz y z)) *) apply wmult_plus_distr. Qed. Lemma wmod_same: forall sz (a: word sz), a ^% a = $0. Proof. (* Goal: forall (sz : nat) (a : word sz), @eq (word sz) (@wmod sz a a) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wmod sz a a) (natToWord sz O) *) destruct (weq a $0). (* Goal: @eq (word sz) (@wmod sz a a) (natToWord sz O) *) (* Goal: @eq (word sz) (@wmod sz a a) (natToWord sz O) *) - (* Goal: @eq (word sz) (@wmod sz a a) (natToWord sz O) *) subst a. (* Goal: @eq (word sz) (@wmod sz (natToWord sz O) (natToWord sz O)) (natToWord sz O) *) rewrite wmod_0_r in *. (* Goal: @eq (word sz) (natToWord sz O) (natToWord sz O) *) reflexivity. (* BG Goal: @eq (word sz) (@wmod sz a a) (natToWord sz O) *) - (* Goal: @eq (word sz) (@wmod sz a a) (natToWord sz O) *) unfold wmod, wordBin. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz a) (@wordToN sz a))) (natToWord sz O) *) apply wordToN_neq_0 in n. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz a) (@wordToN sz a))) (natToWord sz O) *) rewrite N.mod_same by assumption. (* Goal: @eq (word sz) (NToWord sz N0) (natToWord sz O) *) apply NToWord_0. Qed. Lemma wmod_0_l: forall sz (m: word sz), $0 ^% m = $0. Proof. (* Goal: forall (sz : nat) (m : word sz), @eq (word sz) (@wmod sz (natToWord sz O) m) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wmod sz (natToWord sz O) m) (natToWord sz O) *) unfold wmod, wordBin. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (natToWord sz O)) (@wordToN sz m))) (natToWord sz O) *) rewrite wordToN_0. (* Goal: @eq (word sz) (NToWord sz (N.modulo N0 (@wordToN sz m))) (natToWord sz O) *) destruct (N.eq_dec (wordToN m) 0%N). (* Goal: @eq (word sz) (NToWord sz (N.modulo N0 (@wordToN sz m))) (natToWord sz O) *) (* Goal: @eq (word sz) (NToWord sz (N.modulo N0 (@wordToN sz m))) (natToWord sz O) *) - (* Goal: @eq (word sz) (NToWord sz (N.modulo N0 (@wordToN sz m))) (natToWord sz O) *) rewrite e. (* Goal: @eq (word sz) (NToWord sz (N.modulo N0 N0)) (natToWord sz O) *) change (0 mod 0)%N with 0%N. (* Goal: @eq (word sz) (NToWord sz N0) (natToWord sz O) *) apply NToWord_0. (* BG Goal: @eq (word sz) (NToWord sz (N.modulo N0 (@wordToN sz m))) (natToWord sz O) *) - (* Goal: @eq (word sz) (NToWord sz (N.modulo N0 (@wordToN sz m))) (natToWord sz O) *) rewrite N.mod_0_l by assumption. (* Goal: @eq (word sz) (NToWord sz N0) (natToWord sz O) *) apply NToWord_0. Qed. Lemma wmod_plus_distr: forall sz (a b m: word sz), (exists k, (wordToN m * k)%N = Npow2 sz) -> (a ^+ b) ^% m = ((a ^% m) ^+ (b ^% m)) ^% m. Proof. (* Goal: forall (sz : nat) (a b m : word sz) (_ : @ex N (fun k : N => @eq N (N.mul (@wordToN sz m) k) (Npow2 sz))), @eq (word sz) (@wmod sz (@wplus sz a b) m) (@wmod sz (@wplus sz (@wmod sz a m) (@wmod sz b m)) m) *) intros. (* Goal: @eq (word sz) (@wmod sz (@wplus sz a b) m) (@wmod sz (@wplus sz (@wmod sz a m) (@wmod sz b m)) m) *) destruct H as [k E]. (* Goal: @eq (word sz) (@wmod sz (@wplus sz a b) m) (@wmod sz (@wplus sz (@wmod sz a m) (@wmod sz b m)) m) *) assert (wordToN m <> 0%N) as H. (* Goal: @eq (word sz) (@wmod sz (@wplus sz a b) m) (@wmod sz (@wplus sz (@wmod sz a m) (@wmod sz b m)) m) *) (* Goal: not (@eq N (@wordToN sz m) N0) *) { (* Goal: not (@eq N (@wordToN sz m) N0) *) intro C. (* Goal: False *) rewrite C in E. (* Goal: False *) simpl in E. (* Goal: False *) symmetry in E. (* Goal: False *) apply Npow2_not_zero in E. (* Goal: False *) assumption. (* BG Goal: @eq (word sz) (@wmod sz (@wplus sz a b) m) (@wmod sz (@wplus sz (@wmod sz a m) (@wmod sz b m)) m) *) } (* Goal: @eq (word sz) (@wmod sz (@wplus sz a b) m) (@wmod sz (@wplus sz (@wmod sz a m) (@wmod sz b m)) m) *) unfold wplus, wmod, wordBin. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz a) (@wordToN sz b)))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo (@wordToN sz a) (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo (@wordToN sz b) (@wordToN sz m))))))) (@wordToN sz m))) *) pose proof (wordToN_bound a). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz a) (@wordToN sz b)))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo (@wordToN sz a) (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo (@wordToN sz b) (@wordToN sz m))))))) (@wordToN sz m))) *) remember (wordToN a) as c. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c (@wordToN sz b)))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo (@wordToN sz b) (@wordToN sz m))))))) (@wordToN sz m))) *) clear Heqc a. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c (@wordToN sz b)))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo (@wordToN sz b) (@wordToN sz m))))))) (@wordToN sz m))) *) pose proof (wordToN_bound b). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c (@wordToN sz b)))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo (@wordToN sz b) (@wordToN sz m))))))) (@wordToN sz m))) *) remember (wordToN b) as d. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo d (@wordToN sz m))))))) (@wordToN sz m))) *) clear Heqd b. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo d (@wordToN sz m))))))) (@wordToN sz m))) *) pose proof (wordToN_bound m). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) (@wordToN sz m))) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c (@wordToN sz m)))) (@wordToN sz (NToWord sz (N.modulo d (@wordToN sz m))))))) (@wordToN sz m))) *) remember (wordToN m) as n. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) n)) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c n))) (@wordToN sz (NToWord sz (N.modulo d n)))))) n)) *) clear Heqn m. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) n)) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c n))) (@wordToN sz (NToWord sz (N.modulo d n)))))) n)) *) pose proof (N.mod_upper_bound c n H). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) n)) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c n))) (@wordToN sz (NToWord sz (N.modulo d n)))))) n)) *) pose proof (N.mod_upper_bound d n H). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) n)) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (@wordToN sz (NToWord sz (N.modulo c n))) (@wordToN sz (NToWord sz (N.modulo d n)))))) n)) *) rewrite (@wordToN_NToWord_2 sz (c mod n)) by nomega. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) n)) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (N.modulo c n) (@wordToN sz (NToWord sz (N.modulo d n)))))) n)) *) rewrite (@wordToN_NToWord_2 sz (d mod n)) by nomega. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add c d))) n)) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.add (N.modulo c n) (N.modulo d n)))) n)) *) repeat match goal with | |- context [wordToN (NToWord ?sz ?n)] => let k := fresh "k" in let E := fresh "E" in let B := fresh "B" in destruct (wordToN_NToWord sz n) as [ k [E B] ]; rewrite E in *; clear E end. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.add c d) (N.mul k0 (Npow2 sz))) n)) (NToWord sz (N.modulo (N.sub (N.add (N.modulo c n) (N.modulo d n)) (N.mul k1 (Npow2 sz))) n)) *) rewrite <- E in *. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.add c d) (N.mul k0 (N.mul n k))) n)) (NToWord sz (N.modulo (N.sub (N.add (N.modulo c n) (N.modulo d n)) (N.mul k1 (N.mul n k))) n)) *) rewrite <- Nminus_mod_idemp_r by assumption. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.add c d) (N.modulo (N.mul k0 (N.mul n k)) n)) n)) (NToWord sz (N.modulo (N.sub (N.add (N.modulo c n) (N.modulo d n)) (N.mul k1 (N.mul n k))) n)) *) rewrite <- (@Nminus_mod_idemp_r (c mod n + d mod n)) by assumption. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.add c d) (N.modulo (N.mul k0 (N.mul n k)) n)) n)) (NToWord sz (N.modulo (N.sub (N.add (N.modulo c n) (N.modulo d n)) (N.modulo (N.mul k1 (N.mul n k)) n)) n)) *) rewrite (N.mul_comm n k). (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.add c d) (N.modulo (N.mul k0 (N.mul k n)) n)) n)) (NToWord sz (N.modulo (N.sub (N.add (N.modulo c n) (N.modulo d n)) (N.modulo (N.mul k1 (N.mul k n)) n)) n)) *) do 2 rewrite N.mul_assoc. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.add c d) (N.modulo (N.mul (N.mul k0 k) n) n)) n)) (NToWord sz (N.modulo (N.sub (N.add (N.modulo c n) (N.modulo d n)) (N.modulo (N.mul (N.mul k1 k) n) n)) n)) *) do 2 rewrite N.mod_mul by assumption. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.add c d) N0) n)) (NToWord sz (N.modulo (N.sub (N.add (N.modulo c n) (N.modulo d n)) N0) n)) *) do 2 rewrite N.sub_0_r. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.add c d) n)) (NToWord sz (N.modulo (N.add (N.modulo c n) (N.modulo d n)) n)) *) f_equal. (* Goal: @eq N (N.modulo (N.add c d) n) (N.modulo (N.add (N.modulo c n) (N.modulo d n)) n) *) apply N.add_mod. (* Goal: not (@eq N n N0) *) assumption. Qed. Lemma wmod_mul: forall sz (a b: word sz), (exists k, (wordToN b * k)%N = Npow2 sz) -> (a ^* b) ^% b = $0. Proof. (* Goal: forall (sz : nat) (a b : word sz) (_ : @ex N (fun k : N => @eq N (N.mul (@wordToN sz b) k) (Npow2 sz))), @eq (word sz) (@wmod sz (@wmult sz a b) b) (natToWord sz O) *) intros. (* Goal: @eq (word sz) (@wmod sz (@wmult sz a b) b) (natToWord sz O) *) destruct H as [k E]. (* Goal: @eq (word sz) (@wmod sz (@wmult sz a b) b) (natToWord sz O) *) assert (wordToN b <> 0%N) as H. (* Goal: @eq (word sz) (@wmod sz (@wmult sz a b) b) (natToWord sz O) *) (* Goal: not (@eq N (@wordToN sz b) N0) *) { (* Goal: not (@eq N (@wordToN sz b) N0) *) intro C. (* Goal: False *) rewrite C in E. (* Goal: False *) simpl in E. (* Goal: False *) symmetry in E. (* Goal: False *) apply Npow2_not_zero in E. (* Goal: False *) assumption. (* BG Goal: @eq (word sz) (@wmod sz (@wmult sz a b) b) (natToWord sz O) *) } (* Goal: @eq (word sz) (@wmod sz (@wmult sz a b) b) (natToWord sz O) *) unfold wmult, wmod, wordBin. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul (@wordToN sz a) (@wordToN sz b)))) (@wordToN sz b))) (natToWord sz O) *) pose proof (wordToN_bound a). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul (@wordToN sz a) (@wordToN sz b)))) (@wordToN sz b))) (natToWord sz O) *) remember (wordToN a) as c. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul c (@wordToN sz b)))) (@wordToN sz b))) (natToWord sz O) *) clear Heqc a. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul c (@wordToN sz b)))) (@wordToN sz b))) (natToWord sz O) *) pose proof (wordToN_bound b). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul c (@wordToN sz b)))) (@wordToN sz b))) (natToWord sz O) *) remember (wordToN b) as d. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul c d))) d)) (natToWord sz O) *) clear Heqd b. (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul c d))) d)) (natToWord sz O) *) pose proof (N.mod_upper_bound c d H). (* Goal: @eq (word sz) (NToWord sz (N.modulo (@wordToN sz (NToWord sz (N.mul c d))) d)) (natToWord sz O) *) repeat match goal with | |- context [wordToN (NToWord ?sz ?n)] => let k := fresh "k" in let E := fresh "E" in let B := fresh "B" in destruct (wordToN_NToWord sz n) as [ k [E B] ]; rewrite E in *; clear E end. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.mul c d) (N.mul k0 (Npow2 sz))) d)) (natToWord sz O) *) rewrite <- E in *. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.mul c d) (N.mul k0 (N.mul d k))) d)) (natToWord sz O) *) rewrite <- Nminus_mod_idemp_r by assumption. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.mul c d) (N.modulo (N.mul k0 (N.mul d k)) d)) d)) (natToWord sz O) *) rewrite (N.mul_comm d k). (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.mul c d) (N.modulo (N.mul k0 (N.mul k d)) d)) d)) (natToWord sz O) *) rewrite N.mul_assoc. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.mul c d) (N.modulo (N.mul (N.mul k0 k) d) d)) d)) (natToWord sz O) *) rewrite N.mod_mul by assumption. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.sub (N.mul c d) N0) d)) (natToWord sz O) *) rewrite N.sub_0_r. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.mul c d) d)) (natToWord sz O) *) rewrite N.mul_mod by assumption. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.mul (N.modulo c d) (N.modulo d d)) d)) (natToWord sz O) *) rewrite N.mod_same by assumption. (* Goal: @eq (word sz) (NToWord sz (N.modulo (N.mul (N.modulo c d) N0) d)) (natToWord sz O) *) rewrite N.mul_0_r. (* Goal: @eq (word sz) (NToWord sz (N.modulo N0 d)) (natToWord sz O) *) rewrite N.mod_0_l by assumption. (* Goal: @eq (word sz) (NToWord sz N0) (natToWord sz O) *) apply NToWord_0. Qed. Lemma combine_zero_general sz1 sz2: forall (w: word sz1) (b: word sz2), (combine w b = $ 0 -> w = $ 0 /\ b = $ 0)%word. Proof. (* Goal: forall (w : word sz1) (b : word sz2) (_ : @eq (word (Init.Nat.add sz1 sz2)) (@combine sz1 w sz2 b) (natToWord (Init.Nat.add sz1 sz2) O)), and (@eq (word sz1) w (natToWord sz1 O)) (@eq (word sz2) b (natToWord sz2 O)) *) intros. (* Goal: and (@eq (word sz1) w (natToWord sz1 O)) (@eq (word sz2) b (natToWord sz2 O)) *) pre_word_omega. (* Goal: and (@eq (word sz1) w (natToWord sz1 O)) (@eq (word sz2) b (natToWord sz2 O)) *) rewrite wordToNat_combine in *. (* Goal: and (@eq (word sz1) w (natToWord sz1 O)) (@eq (word sz2) b (natToWord sz2 O)) *) assert (sth1: wordToNat w = 0) by lia. (* Goal: and (@eq (word sz1) w (natToWord sz1 O)) (@eq (word sz2) b (natToWord sz2 O)) *) pose proof (pow2_zero sz1) as sth2. (* Goal: and (@eq (word sz1) w (natToWord sz1 O)) (@eq (word sz2) b (natToWord sz2 O)) *) assert (sth3: wordToNat b = 0) by nia. (* Goal: and (@eq (word sz1) w (natToWord sz1 O)) (@eq (word sz2) b (natToWord sz2 O)) *) split; eapply wordToNat_zero; eauto. Qed. Lemma combine_lt sz1 sz2: forall (w1 w2: word sz1) (b1 b2: word sz2), (combine w1 b1 < combine w2 b2 -> b1 <= b2)%word. Proof. (* Goal: forall (w1 w2 : word sz1) (b1 b2 : word sz2) (_ : @wlt (Init.Nat.add sz1 sz2) (@combine sz1 w1 sz2 b1) (@combine sz1 w2 sz2 b2)), not (@wlt sz2 b2 b1) *) intros. (* Goal: not (@wlt sz2 b2 b1) *) pre_word_omega. (* Goal: le (@wordToNat sz2 b1) (@wordToNat sz2 b2) *) rewrite ?wordToNat_combine in *. (* Goal: le (@wordToNat sz2 b1) (@wordToNat sz2 b2) *) pose proof (pow2_zero sz1). (* Goal: le (@wordToNat sz2 b1) (@wordToNat sz2 b2) *) pose proof (wordToNat_bound w1). (* Goal: le (@wordToNat sz2 b1) (@wordToNat sz2 b2) *) pose proof (wordToNat_bound w2). (* Goal: le (@wordToNat sz2 b1) (@wordToNat sz2 b2) *) nia. Qed. Lemma split2_le sz1 sz2: forall (w1 w2: word (sz1 + sz2)), (w1 <= w2 -> split2 _ _ w1 <= split2 _ _ w2)%word. Proof. (* Goal: forall (w1 w2 : word (Init.Nat.add sz1 sz2)) (_ : not (@wlt (Init.Nat.add sz1 sz2) w2 w1)), not (@wlt sz2 (split2 sz1 sz2 w2) (split2 sz1 sz2 w1)) *) intros. (* Goal: not (@wlt sz2 (split2 sz1 sz2 w2) (split2 sz1 sz2 w1)) *) pre_word_omega. (* Goal: le (@wordToNat sz2 (split2 sz1 sz2 w1)) (@wordToNat sz2 (split2 sz1 sz2 w2)) *) rewrite ?wordToNat_split2. (* Goal: le (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w1) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w2) (Nat.pow (S (S O)) sz1)) *) pose proof (pow2_zero sz1). (* Goal: le (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w1) (Nat.pow (S (S O)) sz1)) (Nat.div (@wordToNat (Init.Nat.add sz1 sz2) w2) (Nat.pow (S (S O)) sz1)) *) apply Nat.div_le_mono; auto. (* Goal: not (@eq nat (Nat.pow (S (S O)) sz1) O) *) Omega.omega. Qed. Lemma word1_neq': forall w : word 1, w <> WO~1 -> w = WO~0. Proof. (* Goal: forall (w : word (S O)) (_ : not (@eq (word (S O)) w (@WS true O WO))), @eq (word (S O)) w (@WS false O WO) *) intros. (* Goal: @eq (word (S O)) w (@WS false O WO) *) shatter_word w. (* Goal: @eq (word (S O)) (@WS x O WO) (@WS false O WO) *) destruct x; auto; tauto. Qed. Lemma combine_ge sz1 sz2 (x1 y1: word sz1) (x2 y2: word sz2): (combine x1 x2 <= combine y1 y2 -> x2 < y2 \/ (x2 = y2 /\ x1 <= y1))%word. Proof. (* Goal: forall _ : not (@wlt (Init.Nat.add sz1 sz2) (@combine sz1 y1 sz2 y2) (@combine sz1 x1 sz2 x2)), or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) intros. (* Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) pre_word_omega. (* Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) rewrite ?wordToNat_combine in *. (* Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) pose proof (pow2_zero sz1). (* Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) pose proof (pow2_zero sz2). (* Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) destruct (weq x2 y2); subst. (* Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) (* Goal: or (@wlt sz2 y2 y2) (and (@eq (word sz2) y2 y2) (not (@wlt sz1 y1 x1))) *) - (* Goal: or (@wlt sz2 y2 y2) (and (@eq (word sz2) y2 y2) (not (@wlt sz1 y1 x1))) *) right; split; auto. (* Goal: not (@wlt sz1 y1 x1) *) word_omega. (* BG Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) - (* Goal: or (@wlt sz2 x2 y2) (and (@eq (word sz2) x2 y2) (not (@wlt sz1 y1 x1))) *) left. (* Goal: @wlt sz2 x2 y2 *) pose proof (wordToNat_bound x1). (* Goal: @wlt sz2 x2 y2 *) pose proof (wordToNat_bound y1). (* Goal: @wlt sz2 x2 y2 *) pre_word_omega. (* Goal: lt (@wordToNat sz2 x2) (@wordToNat sz2 y2) *) nia. Qed. Local Close Scope nat. Close Scope word_scope. Module Notations. Export ArithmeticNotations. Export BitwiseNotations. Export ComparisonNotations. Export ConversionNotations. Export ShiftNotations. End Notations.
Require Export GeoCoq.Elements.OriginalProofs.lemma_samesidesymmetric. Require Export GeoCoq.Elements.OriginalProofs.lemma_inequalitysymmetric. Section Euclid. Context `{Ax1:euclidean_neutral}. Lemma lemma_tarskiparallelflip : forall A B C D, TP A B C D -> TP B A C D /\ TP A B D C /\ TP B A D C. Proof. (* Goal: forall (A B C D : @Point Ax1) (_ : @TP Ax1 A B C D), and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) intros. (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert ((neq A B /\ neq C D /\ ~ Meet A B C D /\ OS C D A B)) by (conclude_def TP ). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (OS D C A B) by (forward_using lemma_samesidesymmetric). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (neq D C) by (conclude lemma_inequalitysymmetric). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (~ Meet A B D C). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) (* Goal: not (@Meet Ax1 A B D C) *) { (* Goal: not (@Meet Ax1 A B D C) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists T, (neq A B /\ neq D C /\ Col A B T /\ Col D C T)) by (conclude_def Meet );destruct Tf as [T];spliter. (* Goal: False *) assert (Col C D T) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq C D) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Meet A B C D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) } (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (TP A B D C) by (conclude_def TP ). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (~ Meet B A C D). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) (* Goal: not (@Meet Ax1 B A C D) *) { (* Goal: not (@Meet Ax1 B A C D) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists T, (neq B A /\ neq C D /\ Col B A T /\ Col C D T)) by (conclude_def Meet );destruct Tf as [T];spliter. (* Goal: False *) assert (Col A B T) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet A B C D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) } (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (OS D C A B) by (forward_using lemma_samesidesymmetric). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (OS C D B A) by (forward_using lemma_samesidesymmetric). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (OS D C B A) by (forward_using lemma_samesidesymmetric). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (TP B A C D) by (conclude_def TP ). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (~ Meet B A D C). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) (* Goal: not (@Meet Ax1 B A D C) *) { (* Goal: not (@Meet Ax1 B A D C) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists T, (neq B A /\ neq D C /\ Col B A T /\ Col D C T)) by (conclude_def Meet );destruct Tf as [T];spliter. (* Goal: False *) assert (Col A B T) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col C D T) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet A B C D) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) } (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) assert (TP B A D C) by (conclude_def TP ). (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) let Tf:=fresh in assert (Tf:exists Q P R, (Col A B P /\ Col A B R /\ BetS C P Q /\ BetS D R Q /\ nCol A B C /\ nCol A B D)) by (conclude_def OS );destruct Tf as [P[Q[R]]];spliter. (* Goal: and (@TP Ax1 B A C D) (and (@TP Ax1 A B D C) (@TP Ax1 B A D C)) *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_extension. Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearorder. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma proposition_11 : forall A B C, BetS A C B -> exists X, Per A C X. Proof. (* Goal: forall (A B C : @Point Ax0) (_ : @BetS Ax0 A C B), @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) intros. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (neq A C) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) let Tf:=fresh in assert (Tf:exists E, (BetS A C E /\ Cong C E A C)) by (conclude lemma_extension);destruct Tf as [E];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (neq A E) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) let Tf:=fresh in assert (Tf:exists F, (equilateral A E F /\ Triangle A E F)) by (conclude proposition_01);destruct Tf as [F];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (Cong E F F A) by (conclude_def equilateral ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (Cong A F F E) by (forward_using lemma_doublereverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (Cong A F E F) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (~ eq C F). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) (* Goal: not (@eq Ax0 C F) *) { (* Goal: not (@eq Ax0 C F) *) intro. (* Goal: False *) assert (Col A C E) by (conclude_def Col ). (* Goal: False *) assert (Col A F E) by (conclude cn_equalitysub). (* Goal: False *) assert (Col A E F) by (forward_using lemma_collinearorder). (* Goal: False *) assert (nCol A E F) by (conclude_def Triangle ). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (Cong C A E C) by (forward_using lemma_doublereverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (Cong A C E C) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) assert (Per A C F) by (conclude_def Per ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Per Ax0 A C X) *) close. Qed. End Euclid.
Set Implicit Arguments. Unset Strict Implicit. Require Export Monoid_cat. Require Export Sgroup_facts. Require Export Monoid_facts. Require Export Monoid_util. Section Free_monoid_def. Variable V : SET. Inductive FM : Type := | Var : V -> FM | Law : FM -> FM -> FM | Unit : FM. Inductive eqFM : FM -> FM -> Prop := | eqFM_Var : forall x y : V, Equal x y -> (eqFM (Var x) (Var y):Prop) | eqFM_law : forall x x' y y' : FM, eqFM x x' -> eqFM y y' -> (eqFM (Law x y) (Law x' y'):Prop) | eqFM_law_assoc : forall x y z : FM, eqFM (Law (Law x y) z) (Law x (Law y z)):Prop | eqFM_law0r : forall x : FM, eqFM (Law x Unit) x:Prop | eqFM_law0l : forall x : FM, eqFM (Law Unit x) x:Prop | eqFM_refl : forall x : FM, eqFM x x:Prop | eqFM_sym : forall x y : FM, eqFM x y -> (eqFM y x:Prop) | eqFM_trans : forall x y z : FM, eqFM x y -> eqFM y z -> (eqFM x z:Prop). Hint Resolve eqFM_Var eqFM_law eqFM_law_assoc eqFM_law0r eqFM_law0l eqFM_refl: algebra. Hint Immediate eqFM_sym: algebra. Lemma eqFM_Equiv : equivalence eqFM. Proof. (* Goal: @equivalence FM eqFM *) red in |- *. (* Goal: and (@reflexive FM eqFM) (@partial_equivalence FM eqFM) *) split; [ try assumption | idtac ]. (* Goal: @partial_equivalence FM eqFM *) (* Goal: @reflexive FM eqFM *) exact eqFM_refl. (* Goal: @partial_equivalence FM eqFM *) red in |- *. (* Goal: and (@transitive FM eqFM) (@symmetric FM eqFM) *) split; [ try assumption | idtac ]. (* Goal: @symmetric FM eqFM *) (* Goal: @transitive FM eqFM *) exact eqFM_trans. (* Goal: @symmetric FM eqFM *) exact eqFM_sym. Qed. Definition FM_set := Build_Setoid eqFM_Equiv. Definition FreeMonoid : MONOID. Proof. (* Goal: Ob MONOID *) apply (BUILD_MONOID (E:=FM_set) (genlaw:=Law) (e:=Unit)). (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *) (* Goal: forall x y z : Carrier FM_set, @Equal FM_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall (x x' y y' : Carrier FM_set) (_ : @Equal FM_set x x') (_ : @Equal FM_set y y'), @Equal FM_set (Law x y) (Law x' y') *) exact eqFM_law. (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *) (* Goal: forall x y z : Carrier FM_set, @Equal FM_set (Law (Law x y) z) (Law x (Law y z)) *) exact eqFM_law_assoc. (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law x Unit) x *) exact eqFM_law0r. (* Goal: forall x : Carrier FM_set, @Equal FM_set (Law Unit x) x *) exact eqFM_law0l. Qed. Section Universal_prop. Variable M : MONOID. Variable f : Hom V M. Fixpoint FM_lift_fun (p : FreeMonoid) : M := match p with | Var v => f v | Law p1 p2 => sgroup_law _ (FM_lift_fun p1) (FM_lift_fun p2) | Unit => monoid_unit M end. Definition FM_lift : Hom FreeMonoid M. Proof. (* Goal: Carrier (@Hom MONOID FreeMonoid M) *) apply (BUILD_HOM_MONOID (G:=FreeMonoid) (G':=M) (ff:=FM_lift_fun)). (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid))) (_ : @Equal (sgroup_set (monoid_sgroup FreeMonoid)) x y), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y) *) elim H'; simpl in |- *; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: forall (x y z : FM) (_ : eqFM x y) (_ : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun y)) (_ : eqFM y z) (_ : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y) (FM_lift_fun z)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x) (FM_lift_fun z) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun z) *) apply Trans with (FM_lift_fun y0); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup FreeMonoid)), @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (sgroup_law (monoid_sgroup FreeMonoid) x y)) (sgroup_law (monoid_sgroup M) (FM_lift_fun x) (FM_lift_fun y)) *) simpl in |- *; auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun (@monoid_unit (monoid_sgroup FreeMonoid) (monoid_on_def FreeMonoid))) (@monoid_unit (monoid_sgroup M) (monoid_on_def M)) *) simpl in |- *; auto with algebra. Qed. Definition FM_var : Hom V FreeMonoid. Proof. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup FreeMonoid))) *) apply (Build_Map (A:=V) (B:=FreeMonoid) (Ap:=Var)). (* Goal: @fun_compatible V (sgroup_set (monoid_sgroup FreeMonoid)) Var *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup FreeMonoid)) (Var x) (Var y) *) simpl in |- *; auto with algebra. Qed. Lemma FM_comp_prop : Equal f (comp_hom (FM_lift:Hom (FreeMonoid:SET) M) FM_var). Proof. (* Goal: @Equal (@Hom SET V (sgroup_set (monoid_sgroup M))) f (@comp_hom SET V (sgroup_set (monoid_sgroup FreeMonoid)) (sgroup_set (monoid_sgroup M)) (@sgroup_map (monoid_sgroup FreeMonoid) (monoid_sgroup M) (@monoid_sgroup_hom FreeMonoid M FM_lift) : Carrier (@Hom SET (sgroup_set (monoid_sgroup FreeMonoid) : Ob SET) (sgroup_set (monoid_sgroup M)))) FM_var) *) simpl in |- *. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup M)) f (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x y : FM) (H' : eqFM x y) => @eqFM_ind (fun x0 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x0 x' y0 y' : FM) (_ : eqFM x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x0 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z)) (fun x0 : FM => @MONOID_unit_r M (FM_lift_fun x0)) (fun x0 : FM => @MONOID_unit_l M (FM_lift_fun x0)) (fun x0 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0)) (fun (x0 y0 : FM) (_ : eqFM x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) H0) (fun (x0 y0 z : FM) (_ : eqFM x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x0) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x y H')) FM_var) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) (@comp_hom SET V FM_set (sgroup_set (monoid_sgroup M)) (@f2 FreeMonoid M FM_lift_fun (fun (x0 y : FM) (H' : eqFM x0 y) => @eqFM_ind (fun x1 y0 : FM => @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup M)) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup M))) f)) (fun (x1 x' y0 y' : FM) (_ : eqFM x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun x')) (_ : eqFM y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun y')) => @SGROUP_comp (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun x') (FM_lift_fun y0) (FM_lift_fun y') H0 H2) (fun x1 y0 z : FM => @SGROUP_assoc (monoid_sgroup M) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z)) (fun x1 : FM => @MONOID_unit_r M (FM_lift_fun x1)) (fun x1 : FM => @MONOID_unit_l M (FM_lift_fun x1)) (fun x1 : FM => @Refl (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1)) (fun (x1 y0 : FM) (_ : eqFM x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) H0) (fun (x1 y0 z : FM) (_ : eqFM x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0)) (_ : eqFM y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup M)) (FM_lift_fun y0) (FM_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup M)) (FM_lift_fun x1) (FM_lift_fun y0) (FM_lift_fun z) H'1 H'3) x0 y H')) FM_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup M)) (@Ap V (sgroup_set (monoid_sgroup M)) f x) (@Ap V (sgroup_set (monoid_sgroup M)) f x) *) auto with algebra. Qed. End Universal_prop. End Free_monoid_def. Hint Resolve FM_comp_prop: algebra.
Require Export GeoCoq.Elements.OriginalProofs.proposition_01. Require Export GeoCoq.Elements.OriginalProofs.proposition_03. Require Export GeoCoq.Elements.OriginalProofs.lemma_interior5. Require Export GeoCoq.Elements.OriginalProofs.lemma_twolines. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma proposition_10 : forall A B, neq A B -> exists X, BetS A X B /\ Cong X A X B. Proof. (* Goal: forall (A B : @Point Ax0) (_ : @neq Ax0 A B), @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) intros. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) let Tf:=fresh in assert (Tf:exists C, (equilateral A B C /\ Triangle A B C)) by (conclude proposition_01);destruct Tf as [C];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert ((Cong A B B C /\ Cong B C C A)) by (conclude_def equilateral ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A C C B) by (forward_using lemma_doublereverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A C B C) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (~ eq C B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) (* Goal: not (@eq Ax0 C B) *) { (* Goal: not (@eq Ax0 C B) *) intro. (* Goal: False *) assert (Col A C B) by (conclude_def Col ). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) let Tf:=fresh in assert (Tf:exists D, (BetS C B D /\ Cong B D A B)) by (conclude lemma_extension);destruct Tf as [D];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (~ eq C A). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) (* Goal: not (@eq Ax0 C A) *) { (* Goal: not (@eq Ax0 C A) *) intro. (* Goal: False *) assert (Col B C A) by (conclude_def Col ). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) let Tf:=fresh in assert (Tf:exists E, (BetS C A E /\ Cong A E A B)) by (conclude lemma_extension);destruct Tf as [E];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (BetS D B C) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (BetS E A C) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (~ Col D C E). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) (* Goal: not (@Col Ax0 D C E) *) { (* Goal: not (@Col Ax0 D C E) *) intro. (* Goal: False *) assert (Col C A E) by (conclude_def Col ). (* Goal: False *) assert (Col C B D) by (conclude_def Col ). (* Goal: False *) assert (Col E C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col E C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq C E) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq E C) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col C D A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col D C B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq C D) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq D C) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col C B A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) let Tf:=fresh in assert (Tf:exists F, (BetS D F A /\ BetS E F B)) by (conclude postulate_Pasch_inner);destruct Tf as [F];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (BetS B F E) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (BetS A F D) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (neq C D) by (forward_using lemma_betweennotequal). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (neq D C) by (conclude lemma_inequalitysymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (~ Col A D C). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) (* Goal: not (@Col Ax0 A D C) *) { (* Goal: not (@Col Ax0 A D C) *) intro. (* Goal: False *) assert (Col C B D) by (conclude_def Col ). (* Goal: False *) assert (Col D C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D C B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col C A B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) let Tf:=fresh in assert (Tf:exists M, (BetS A M B /\ BetS C M F)) by (conclude postulate_Pasch_inner);destruct Tf as [M];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong C A C B) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A B A E) by (conclude lemma_congruencesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong B D A E) by (conclude lemma_congruencetransitive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A E B D) by (conclude lemma_congruencesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A B B A) by (conclude cn_equalityreverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong C B C A) by (conclude lemma_congruencesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong B E A D) by (conclude axiom_5_line). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong B F B F) by (conclude cn_congruencereflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Lt B F B E) by (conclude_def Lt ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A D B E) by (conclude lemma_congruencesymmetric). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) let Tf:=fresh in assert (Tf:exists G, (BetS A G D /\ Cong A G B F)) by (conclude proposition_03);destruct Tf as [G];spliter. (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong G D F E) by (conclude lemma_differenceofparts). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong E F D G) by (forward_using lemma_doublereverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong F B G A) by (forward_using lemma_doublereverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong E A D B) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong B A A B) by (conclude cn_equalityreverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (BetS D G A) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong F A G B) by (conclude lemma_interior5). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A F B G) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong E D D E) by (conclude cn_equalityreverse). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong F D G E) by (conclude lemma_interior5). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (BetS B G E) by (conclude lemma_betweennesspreserved). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (BetS E G B) by (conclude axiom_betweennesssymmetry). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (~ Col A D E). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) (* Goal: not (@Col Ax0 A D E) *) { (* Goal: not (@Col Ax0 A D E) *) intro. (* Goal: False *) assert (Col C A E) by (conclude_def Col ). (* Goal: False *) assert (Col A E D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A E C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq A E) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col E D C) by (conclude lemma_collinear4). (* Goal: False *) assert (Col E C D) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col E C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq C E) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq E C) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col C D A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col C B D) by (conclude_def Col ). (* Goal: False *) assert (Col D C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D C B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq C D) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq D C) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col C A B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (~ Col A D B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) (* Goal: not (@Col Ax0 A D B) *) { (* Goal: not (@Col Ax0 A D B) *) intro. (* Goal: False *) assert (Col D B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col C B D) by (conclude_def Col ). (* Goal: False *) assert (Col D B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B D) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq D B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B A C) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cut A D E B G) by (conclude_def Cut ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cut A D E B F) by (conclude_def Cut ). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (~ Col D E B). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) (* Goal: not (@Col Ax0 D E B) *) { (* Goal: not (@Col Ax0 D E B) *) intro. (* Goal: False *) assert (Col C B D) by (conclude_def Col ). (* Goal: False *) assert (Col D B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col D B E) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B D) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq D B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B C E) by (conclude lemma_collinear4). (* Goal: False *) assert (Col C A E) by (conclude_def Col ). (* Goal: False *) assert (Col E C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col E C B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq C E) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq E C) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col C A B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) } (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (eq G F) by (conclude lemma_twolines). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong A F B F) by (conclude cn_equalitysub). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong F A F B) by (forward_using lemma_congruenceflip). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong C M C M) by (conclude cn_congruencereflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong M F M F) by (conclude cn_congruencereflexive). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) assert (Cong M A M B) by (conclude lemma_interior5). (* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@BetS Ax0 A X B) (@Cong Ax0 X A X B)) *) close. Qed. End Euclid.
Set Implicit Arguments. Unset Strict Implicit. Require Export Group_util. Require Export Group_quotient. Require Export Parts2. Section Def. Variable G G' : GROUP. Variable f : Hom G G'. Definition kernel_part : part_set G. Proof. (* Goal: Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G)))) *) apply (Build_Predicate (E:=G) (Pred_fun:=fun x : G => Equal (f x) (monoid_unit G'))). (* Goal: @pred_compatible (sgroup_set (monoid_sgroup (group_monoid G))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y x), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) intros x y H' H'0; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (Ap (sgroup_map (monoid_sgroup_hom f)) x); auto with algebra. Qed. Definition Ker : subgroup G. Proof. (* Goal: subgroup G *) apply (BUILD_SUB_GROUP (G:=G) (H:=kernel_part)). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) kernel_part *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) kernel_part *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) kernel_part *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) kernel_part *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) kernel_part *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x y)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) intros x y H' H'0; try assumption. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) kernel_part *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) kernel_part *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x y)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (Ap (sgroup_map (monoid_sgroup_hom f)) y)); auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) kernel_part *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) kernel_part *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (sgroup_law G' (monoid_unit G') (monoid_unit G')); auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) kernel_part *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) kernel_part *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) kernel_part *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x kernel_part), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (group_inverse G x) kernel_part *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) intros x H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x)); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x)) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (group_inverse _ (monoid_unit G')); auto with algebra. Qed. Definition coKer : subgroup G'. Proof. (* Goal: subgroup G' *) apply (BUILD_SUB_GROUP (G:=G') (H:=image f (full G))). (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) y (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) intros x y H' H'0; try assumption. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) elim H'0; intros x0 E; elim E; intros H'1 H'2; try exact H'2; clear E H'0. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) elim H'; intros x1 E; elim E; intros H'0 H'3; try exact H'3; clear E H'. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) exists (sgroup_law _ x1 x0); split; [ try assumption | idtac ]. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) x y) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x1 x0)) *) apply Trans with (sgroup_law G' (Ap (sgroup_map (monoid_sgroup_hom f)) x1) (Ap (sgroup_map (monoid_sgroup_hom f)) x0)); auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x))) *) exists (monoid_unit G); auto with algebra. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) x (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@image (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (full (sgroup_set (monoid_sgroup (group_monoid G))))) *) simpl in |- *. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G')))) (_ : @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) x (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0)))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) intros x H'; try assumption. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) elim H'; intros x0 E; elim E; intros H'0 H'1; try exact H'1; clear E H'. (* Goal: @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) exists (group_inverse _ x0); split; [ try assumption | idtac ]. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (group_inverse G' x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G x0)) *) apply Trans with (group_inverse G' (Ap (sgroup_map (monoid_sgroup_hom f)) x0)); auto with algebra. Qed. Lemma kernel_normal : normal Ker. Proof. (* Goal: @normal G Ker *) red in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) simpl in |- *. (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) intros x y H'; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (Ap (sgroup_map (monoid_sgroup_hom f)) (sgroup_law G y (group_inverse G x)))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) y) (Ap (sgroup_map (monoid_sgroup_hom f)) (group_inverse G x)))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) (group_inverse G x)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) y) (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x)))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) y) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (sgroup_law _ (monoid_unit G') (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x)))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (sgroup_law (monoid_sgroup (group_monoid G')) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (sgroup_law (monoid_sgroup (group_monoid G')) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) (group_inverse G' (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x)))) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) apply Trans with (sgroup_law _ (Ap (sgroup_map (monoid_sgroup_hom f)) x) (group_inverse _ (Ap (sgroup_map (monoid_sgroup_hom f)) x))); auto with algebra. Qed. Set Strict Implicit. Unset Implicit Arguments. Definition group_quo_ker := group_quo G Ker kernel_normal. Set Implicit Arguments. Unset Strict Implicit. Lemma Ker_prop : forall x : G, in_part x Ker -> Equal (f x) (monoid_unit G'). Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker)))), @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G'))) *) auto with algebra. Qed. Lemma Ker_prop_rev : forall x : G, Equal (f x) (monoid_unit G') -> in_part x Ker. Proof. (* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@monoid_unit (monoid_sgroup (group_monoid G')) (monoid_on_def (group_monoid G')))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G Ker))) *) auto with algebra. Qed. Lemma coKer_prop : forall x : G, in_part (f x) coKer. Proof. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@subsgroup_part (monoid_sgroup (group_monoid G')) (@submonoid_subsgroup (group_monoid G') (@subgroup_submonoid G' coKer))) *) simpl in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @ex (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (fun x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid G))) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G'))) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_set (monoid_sgroup (group_monoid G'))) (@sgroup_map (monoid_sgroup (group_monoid G)) (monoid_sgroup (group_monoid G')) (@monoid_sgroup_hom (group_monoid G) (group_monoid G') f)) x0))) *) intros x; exists x; split; [ idtac | try assumption ]; auto with algebra. Qed. End Def. Hint Resolve kernel_normal Ker_prop coKer_prop: algebra.
Require Import Bool Arith Even List. Require Import BellantoniCook.Lib BellantoniCook.Bitstring BellantoniCook.BC. Definition inv_e (e : BC) : BC := comp 2 0 e (proj 2 0 1 :: proj 2 0 0 :: nil) nil. Definition from_11_to_20 (e : BC) : BC := comp 2 0 e (proj 2 0 0 :: nil) (proj 2 0 1 :: nil). Lemma from_11_to_20_correct e v1 v2 : sem e [v1] [v2] = sem (from_11_to_20 e) [v1 ; v2] nil. Proof. (* Goal: @eq (list bool) (sem e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool)))) (sem (from_11_to_20 e) (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) *) intros; simpl; trivial. Qed. Definition app_e : BC := rec (proj 0 1 0) (comp 1 2 (succ false) nil ((proj 1 2 1) :: nil)) (comp 1 2 (succ true) nil ((proj 1 2 1) :: nil)). Lemma app_correct v1 v2 : sem app_e [v1] [v2] = v1 ++ v2. Proof. (* Goal: @eq (list bool) (sem app_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool)))) (@app bool v1 v2) *) induction v1; simpl in *; trivial. (* Goal: @eq (list bool) (if a then @cons bool true (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @cons bool false (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @cons bool true (@nth (list bool) O vsl (@nil bool))) v1 (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool)))) else @cons bool false (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @cons bool false (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @cons bool true (@nth (list bool) O vsl (@nil bool))) v1 (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) (@cons bool a (@app bool v1 v2)) *) intros; rewrite IHv1. (* Goal: @eq (list bool) (if a then @cons bool true (@app bool v1 v2) else @cons bool false (@app bool v1 v2)) (@cons bool a (@app bool v1 v2)) *) case a; trivial. Qed. Program Fixpoint constant (v:bs) : { e : BC | arities e = ok_arities 0 0 /\ sem e nil nil = v } := match v with | nil => BC.zero Definition rec2 g h := rec g h h. Lemma rec2_correct v1 v2 g h0 h1 : unary (hd nil v1) = true -> sem (rec g h0 h1) v1 v2 = sem (rec2 g h1) v1 v2. Proof. (* Goal: forall _ : @eq bool (unary (@hd (list bool) (@nil bool) v1)) true, @eq (list bool) (sem (rec g h0 h1) v1 v2) (sem (rec2 g h1) v1 v2) *) intros; simpl; revert H. (* Goal: forall _ : @eq bool (unary (@hd (list bool) (@nil bool) v1)) true, @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) v1) (@tl (list bool) v1) v2) (sem_rec (sem g) (sem h1) (sem h1) (@hd (list bool) (@nil bool) v1) (@tl (list bool) v1) v2) *) induction (hd nil v1); simpl; trivial; intros. (* Goal: @eq (list bool) (if a then sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2) else sem h0 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2)) (if a then sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2) else sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2)) *) rewrite andb_true_iff in H. (* Goal: @eq (list bool) (if a then sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2) else sem h0 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2)) (if a then sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2) else sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2)) *) decompose [and] H; clear H. (* Goal: @eq (list bool) (if a then sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2) else sem h0 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2)) (if a then sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2) else sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2)) *) destruct a. (* Goal: @eq (list bool) (sem h0 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2)) (sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2)) *) (* Goal: @eq (list bool) (sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2)) (sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2)) *) rewrite IHl; trivial; tauto. (* Goal: @eq (list bool) (sem h0 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) v1) v2) v2)) (sem h1 (@cons (list bool) l (@tl (list bool) v1)) (@cons (list bool) (sem_rec (sem g) (sem h1) (sem h1) l (@tl (list bool) v1) v2) v2)) *) unfold id in H0; discriminate. Qed. Lemma rec2_simpl g h i z l1 l2 : sem (rec2 g h) ((i :: z) :: l1) l2 = sem h (z :: l1) (sem_rec (sem g) (sem h) (sem h) z l1 l2 :: l2). Proof. (* Goal: @eq (list bool) (sem (rec2 g h) (@cons (list bool) (@cons bool i z) l1) l2) (sem h (@cons (list bool) z l1) (@cons (list bool) (sem_rec (sem g) (sem h) (sem h) z l1 l2) l2)) *) intros; simpl; case i; trivial. Qed. Lemma rec2_sem_rec g h z l1 l2 : sem (rec2 g h) (z :: l1) l2 = sem_rec (sem g) (sem h) (sem h) z l1 l2. Proof. (* Goal: @eq (list bool) (sem (rec2 g h) (@cons (list bool) z l1) l2) (sem_rec (sem g) (sem h) (sem h) z l1 l2) *) intros; simpl; trivial. Qed. Definition cond2 n s x g h0 h1 : BC := comp n s cond nil [ x; g; comp n s h0 (map (proj n 0) (seq 0 n)) (comp n s pred nil [x] :: map (proj n s) (seq n s)); comp n s h1 (map (proj n 0) (seq 0 n)) (comp n s pred nil [x] :: map (proj n s) (seq n s)) ]. Lemma arities_cond2 n s x g h0 h1 (Hx : arities x = ok_arities n s) (Hg : arities g = ok_arities n s) (Hh0 : arities h0 = ok_arities n (S s)) (Hh1 : arities h1 = ok_arities n (S s)) : arities (cond2 n s x g h0 h1) = ok_arities n s. Proof. (* Goal: @eq Arities (arities (cond2 n s x g h0 h1)) (ok_arities n s) *) simpl. (* Goal: @eq Arities (if andb (aeq (arities x) (ok_arities n s)) (andb (aeq (arities g) (ok_arities n s)) (andb (aeq match arities h0 with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb hs (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities hn hs) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) end (ok_arities n s)) (andb (aeq match arities h1 with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb hs (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities hn hs) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) end (ok_arities n s)) true))) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (arities x) (@cons Arities (arities g) (@cons Arities match arities h0 with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb hs (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities hn hs) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) end (@cons Arities match arities h1 with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb hs (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities hn hs) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (arities x) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (arities x) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) end (@nil Arities)))))) (ok_arities n s) *) rewrite Hx, Hg, Hh0, Hh1. (* Goal: @eq Arities (if andb (aeq (ok_arities n s) (ok_arities n s)) (andb (aeq (ok_arities n s) (ok_arities n s)) (andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true))) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj n s) (seq n s)))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (aeq (ok_arities n s) (ok_arities n s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl. (* Goal: @eq Arities (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true))) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities (if andb (andb true true) (andb (andb true true) (andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true))) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (aeq (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (ok_arities n s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (if andb (andb true true) true then ok_arities n s else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities n s) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl. (* Goal: @eq Arities (if andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj n O) (seq O n)))) (Nat.eqb s (@length BC (@map nat BC (proj n s) (seq n s))))) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) do 2 rewrite map_length, seq_length. (* Goal: @eq Arities (if andb (aeq (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities (if andb (aeq (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl. (* Goal: @eq Arities (if andb (aeq (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H1 end. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (if andb true (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb true (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb true (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb true (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s)) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H2 end. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (ok_arities n s) (ok_arities n s)) (andb (aeq (ok_arities n s) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@nil Arities)))))) (ok_arities n s) *) simpl. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (andb (Nat.eqb n n) (Nat.eqb s s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@nil Arities)))))) (ok_arities n s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (andb true true) (andb (andb true true) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@nil Arities)))))) (ok_arities n s) *) reflexivity. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite forallb_forall_conv in H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) destruct H2 as [e [H2 H3] ]. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite in_map_iff in H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) destruct H2 as [p [H2 H4] ]. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite in_seq_iff in H4. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) subst e. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl in H3. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) case_eq (n + s). (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: forall _ : @eq nat (Init.Nat.add n s) O, @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) intro H5. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) contradict H5. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: not (@eq nat (Init.Nat.add n s) O) *) omega. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) intros q H5. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite H5 in H3. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) case_eq (leb p q); intro H6. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite H6 in H3. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl in H3. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) do 2 rewrite <- beq_nat_refl in H3. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) discriminate H3. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite leb_iff_conv in H6. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) contradict H6. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: not (lt q p) *) omega. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite forallb_forall_conv in H1. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) destruct H1 as [e [H1 H2] ]. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite in_map_iff in H1. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) destruct H1 as [p [H1 H3] ]. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite in_seq_iff in H3. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) subst e. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl in H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) case_eq (n + 0). (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: forall _ : @eq nat (Init.Nat.add n O) O, @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) intro H4. (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) contradict H4. (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: not (@eq nat (Init.Nat.add n O) O) *) omega. (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) intros q H4. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite H4 in H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) case_eq (leb p q); intro H5. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite H5 in H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) simpl in H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite <- beq_nat_refl in H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) discriminate H2. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) rewrite leb_iff_conv in H5. (* Goal: @eq Arities (if andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) (andb (aeq (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (ok_arities n s)) true) then ok_arities n s else error_comp (ok_arities O (S (S (S (S O))))) (@nil Arities) (@cons Arities (ok_arities n s) (@cons Arities (ok_arities n s) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@cons Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities n (S s)) (@map BC Arities arities (@map nat BC (proj n O) (seq O n))) (@cons Arities (ok_arities n s) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))))) (@nil Arities)))))) (ok_arities n s) *) contradict H5. (* Goal: not (lt q p) *) omega. Qed. Definition cond2_correct n s x g h0 h1 vnl vsl : length vnl = n -> length vsl = s -> sem (cond2 n s x g h0 h1) vnl vsl = match sem x vnl vsl with | nil => sem g vnl vsl | true :: _ => sem h0 vnl (tl (sem x vnl vsl) :: vsl) | false :: _ => sem h1 vnl (tl (sem x vnl vsl) :: vsl) end. Proof. (* Goal: forall (_ : @eq nat (@length (list bool) vnl) n) (_ : @eq nat (@length (list bool) vsl) s), @eq (list bool) (sem (cond2 n s x g h0 h1) vnl vsl) match sem x vnl vsl with | nil => sem g vnl vsl | cons (true as b) l => sem h0 vnl (@cons (list bool) (@tl bool (sem x vnl vsl)) vsl) | cons (false as b) l => sem h1 vnl (@cons (list bool) (@tl bool (sem x vnl vsl)) vsl) end *) intros Hn Hs. (* Goal: @eq (list bool) (sem (cond2 n s x g h0 h1) vnl vsl) match sem x vnl vsl with | nil => sem g vnl vsl | cons (true as b) l => sem h0 vnl (@cons (list bool) (@tl bool (sem x vnl vsl)) vsl) | cons (false as b) l => sem h1 vnl (@cons (list bool) (@tl bool (sem x vnl vsl)) vsl) end *) simpl. (* Goal: @eq (list bool) match sem x vnl vsl with | nil => sem g vnl vsl | cons (true as b) l => sem h0 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) (@tl bool (sem x vnl vsl)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) | cons (false as b) l => sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) (@tl bool (sem x vnl vsl)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) end match sem x vnl vsl with | nil => sem g vnl vsl | cons (true as b) l => sem h0 vnl (@cons (list bool) (@tl bool (sem x vnl vsl)) vsl) | cons (false as b) l => sem h1 vnl (@cons (list bool) (@tl bool (sem x vnl vsl)) vsl) end *) destruct (sem x vnl vsl) as [ | [ | ] v]; simpl. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list bool) (sem h0 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h0 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list bool) (sem g vnl vsl) (sem g vnl vsl) *) reflexivity. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list bool) (sem h0 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h0 vnl (@cons (list bool) v vsl)) *) rewrite map_proj_seq_normal. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list bool) (sem h0 (@app (list bool) (@firstn (list bool) n vnl) (@repeat (list bool) (Init.Nat.sub n (@length (list bool) vnl)) (@nil bool))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h0 vnl (@cons (list bool) v vsl)) *) rewrite map_proj_seq_safe. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list bool) (sem h0 (@app (list bool) (@firstn (list bool) n vnl) (@repeat (list bool) (Init.Nat.sub n (@length (list bool) vnl)) (@nil bool))) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool))))) (sem h0 vnl (@cons (list bool) v vsl)) *) f_equal. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) n vnl) (@repeat (list bool) (Init.Nat.sub n (@length (list bool) vnl)) (@nil bool))) vnl *) subst n. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@repeat (list bool) (Init.Nat.sub (@length (list bool) vnl) (@length (list bool) vnl)) (@nil bool))) vnl *) rewrite minus_diag. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@repeat (list bool) O (@nil bool))) vnl *) simpl. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@nil (list bool))) vnl *) rewrite app_nil_r. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vnl) vnl) vnl *) rewrite <- (app_nil_r vnl) at 2. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vnl) (@app (list bool) vnl (@nil (list bool)))) vnl *) apply firstn_app. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) f_equal. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool))) vsl *) subst s. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@repeat (list bool) (Init.Nat.sub (@length (list bool) vsl) (@length (list bool) vsl)) (@nil bool))) vsl *) rewrite minus_diag. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@repeat (list bool) O (@nil bool))) vsl *) simpl. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@nil (list bool))) vsl *) rewrite app_nil_r. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vsl) vsl) vsl *) rewrite <- (app_nil_r vsl) at 2. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vsl) (@app (list bool) vsl (@nil (list bool)))) vsl *) apply firstn_app. (* Goal: @eq (list bool) (sem h1 (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) rewrite map_proj_seq_normal. (* Goal: @eq (list bool) (sem h1 (@app (list bool) (@firstn (list bool) n vnl) (@repeat (list bool) (Init.Nat.sub n (@length (list bool) vnl)) (@nil bool))) (@cons (list bool) v (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))))) (sem h1 vnl (@cons (list bool) v vsl)) *) rewrite map_proj_seq_safe. (* Goal: @eq (list bool) (sem h1 (@app (list bool) (@firstn (list bool) n vnl) (@repeat (list bool) (Init.Nat.sub n (@length (list bool) vnl)) (@nil bool))) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool))))) (sem h1 vnl (@cons (list bool) v vsl)) *) f_equal. (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) n vnl) (@repeat (list bool) (Init.Nat.sub n (@length (list bool) vnl)) (@nil bool))) vnl *) subst n. (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@repeat (list bool) (Init.Nat.sub (@length (list bool) vnl) (@length (list bool) vnl)) (@nil bool))) vnl *) rewrite minus_diag. (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@repeat (list bool) O (@nil bool))) vnl *) simpl. (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@nil (list bool))) vnl *) rewrite app_nil_r. (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vnl) vnl) vnl *) rewrite <- (app_nil_r vnl) at 2. (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vnl) (@app (list bool) vnl (@nil (list bool)))) vnl *) apply firstn_app. (* Goal: @eq (list (list bool)) (@cons (list bool) v (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool)))) (@cons (list bool) v vsl) *) f_equal. (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool))) vsl *) subst s. (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@repeat (list bool) (Init.Nat.sub (@length (list bool) vsl) (@length (list bool) vsl)) (@nil bool))) vsl *) rewrite minus_diag. (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@repeat (list bool) O (@nil bool))) vsl *) simpl. (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@nil (list bool))) vsl *) rewrite app_nil_r. (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vsl) vsl) vsl *) rewrite <- (app_nil_r vsl) at 2. (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vsl) (@app (list bool) vsl (@nil (list bool)))) vsl *) apply firstn_app. Qed. Definition rec1 n s g h := rec g (comp (S n) (S s) h (comp (S n) 0 (succ false) nil [proj (S n) 0 0] :: map (proj (S n) 0) (seq 1 n)) (map (proj (S n) (S s)) (seq (S n) (S s)))) (comp (S n) (S s) h (comp (S n) 0 (succ true) nil [proj (S n) 0 0] :: map (proj (S n) 0) (seq 1 n)) (map (proj (S n) (S s)) (seq (S n) (S s)))). Lemma sem_rec_false g h0 h1 vnl vsl v : sem (rec g h0 h1) ((false :: v) :: vnl) vsl = sem h0 (v :: vnl) (sem (rec g h0 h1) (v :: vnl) vsl :: vsl). Proof. (* Goal: @eq (list bool) (sem (rec g h0 h1) (@cons (list bool) (@cons bool false v) vnl) vsl) (sem h0 (@cons (list bool) v vnl) (@cons (list bool) (sem (rec g h0 h1) (@cons (list bool) v vnl) vsl) vsl)) *) reflexivity. Qed. Lemma sem_rec_true g h0 h1 vnl vsl v : sem (rec g h0 h1) ((true :: v) :: vnl) vsl = sem h1 (v :: vnl) (sem (rec g h0 h1) (v :: vnl) vsl :: vsl). Proof. (* Goal: @eq (list bool) (sem (rec g h0 h1) (@cons (list bool) (@cons bool true v) vnl) vsl) (sem h1 (@cons (list bool) v vnl) (@cons (list bool) (sem (rec g h0 h1) (@cons (list bool) v vnl) vsl) vsl)) *) reflexivity. Qed. Lemma rec1_arities n s g h (Hg : arities g = ok_arities n s) (Hh : arities h = ok_arities (S n) (S s)) : arities (rec1 n s g h) = ok_arities (S n) s. Proof. (* Goal: @eq Arities (arities (rec1 n s g h)) (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match arities g with | error_rec a a0 a1 => error_rec (error_rec a a0 a1) match arities h with | error_rec a2 a3 a4 => error_comp (error_rec a2 a3 a4) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a2 l l0 => error_comp (error_comp a2 l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end match arities h with | error_rec a2 a3 a4 => error_comp (error_rec a2 a3 a4) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a2 l l0 => error_comp (error_comp a2 l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_comp a l l0 => error_rec (error_comp a l l0) match arities h with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a0 l1 l2 => error_comp (error_comp a0 l1 l2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end match arities h with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a0 l1 l2 => error_comp (error_comp a0 l1 l2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_proj n0 n1 n2 => error_rec (error_proj n0 n1 n2) match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n3 n4 n5 => error_comp (error_proj n3 n4 n5) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n3 n4 n5 => error_comp (error_proj n3 n4 n5) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | ok_arities gn gs => match match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end with | error_rec a a0 a1 => error_rec (ok_arities gn gs) (error_rec a a0 a1) match arities h with | error_rec a2 a3 a4 => error_comp (error_rec a2 a3 a4) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a2 l l0 => error_comp (error_comp a2 l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_comp a l l0 => error_rec (ok_arities gn gs) (error_comp a l l0) match arities h with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a0 l1 l2 => error_comp (error_comp a0 l1 l2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_proj n0 n1 n2 => error_rec (ok_arities gn gs) (error_proj n0 n1 n2) match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n3 n4 n5 => error_comp (error_proj n3 n4 n5) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | ok_arities h0n h0s => match match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end with | error_rec a a0 a1 => error_rec (ok_arities gn gs) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities gn gs) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n n0 n1 => error_rec (ok_arities gn gs) (ok_arities h0n h0s) (error_proj n n0 n1) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb gn m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb gs m' end) (Nat.eqb h0s h1s) then ok_arities h0n gs else error_rec (ok_arities gn gs) (ok_arities h0n h0s) (ok_arities h1n h1s) end end end (ok_arities (S n) s) *) rewrite Hg, Hh. (* Goal: @eq Arities match (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) do 2 rewrite map_length, seq_length. (* Goal: @eq Arities match (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities match (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite <- beq_nat_refl. (* Goal: @eq Arities match (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H1 end. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) case_eq (n + S s). (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: forall _ : @eq nat (Init.Nat.add n (S s)) O, @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) intro H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) contradict H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: not (@eq nat (Init.Nat.add n (S s)) O) *) omega. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) intros p H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) case_eq (leb n p); intro H3. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H4 end. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) (* Goal: @eq Arities (if andb (andb (andb (Nat.eqb n n) (Nat.eqb (S n) (S n))) (Nat.eqb s s)) (Nat.eqb (S s) (S s)) then ok_arities (S n) s else error_rec (ok_arities n s) (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (ok_arities (S n) s) *) do 4 rewrite <- beq_nat_refl. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) (* Goal: @eq Arities (if andb (andb (andb true true) true) true then ok_arities (S n) s else error_rec (ok_arities n s) (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (ok_arities (S n) s) *) simpl. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) (* Goal: @eq Arities (ok_arities (S n) s) (ok_arities (S n) s) *) reflexivity. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) rewrite forallb_forall_conv in H4. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) destruct H4 as [e [H4 H5] ]. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) rewrite in_map_iff in H4. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) destruct H4 as [q [H4 H6] ]. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) rewrite in_seq_iff in H6. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) subst e. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) simpl in H5. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) case_eq (leb q (n + S s)); intro H7. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) rewrite H7 in H5. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) simpl in H5. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) do 2 rewrite <- beq_nat_refl in H5. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) discriminate H5. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) rewrite leb_iff_conv in H7. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (ok_arities (S n) s) *) contradict H7. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: not (lt (Init.Nat.add n (S s)) q) *) omega. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite leb_iff_conv in H3. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) contradict H3. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: not (lt p n) *) omega. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite forallb_forall_conv in H1. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) destruct H1 as [e [H1 H2] ]. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite in_map_iff in H1. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) destruct H1 as [q [H1 H3] ]. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite in_seq_iff in H3. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) subst e. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl in H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) case_eq (leb q (n+0)); intro H4. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite H4 in H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) simpl in H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite <- beq_nat_refl in H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) discriminate H2. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) rewrite leb_iff_conv in H4. (* Goal: @eq Arities match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end (ok_arities (S n) s) *) contradict H4. (* Goal: not (lt (Init.Nat.add n O) q) *) omega. Qed. Fixpoint sem_rec1 (g h:BC)(v : bs)(vnl vsl : list bs) {struct v} := match v with | nil => sem g vnl vsl | _::v' => sem h (v::vnl) (sem_rec1 g h v' vnl vsl :: vsl) end. Lemma rec1_correct n s g h vnl vsl : length vnl = S n -> length vsl = s -> sem (rec1 n s g h) vnl vsl = sem_rec1 g h (hd nil vnl) (tl vnl) vsl. Definition rec3 n s x g h : BC := comp n s (rec1 n s g h) (x :: map (proj n 0) (seq 0 n)) (map (proj n s) (seq n s)). Lemma arities_rec3 n s x g h (Hx : arities x = ok_arities n 0) (Hg : arities g = ok_arities n s) (Hh : arities h = ok_arities (S n) (S s)) : arities (rec3 n s x g h) = ok_arities n s. Proof. (* Goal: @eq Arities (arities (rec3 n s x g h)) (ok_arities n s) *) simpl. (* Goal: @eq Arities match match arities g with | error_rec a a0 a1 => error_rec (error_rec a a0 a1) match arities h with | error_rec a2 a3 a4 => error_comp (error_rec a2 a3 a4) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a2 l l0 => error_comp (error_comp a2 l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end match arities h with | error_rec a2 a3 a4 => error_comp (error_rec a2 a3 a4) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a2 l l0 => error_comp (error_comp a2 l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_comp a l l0 => error_rec (error_comp a l l0) match arities h with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a0 l1 l2 => error_comp (error_comp a0 l1 l2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end match arities h with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a0 l1 l2 => error_comp (error_comp a0 l1 l2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_proj n0 n1 n2 => error_rec (error_proj n0 n1 n2) match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n3 n4 n5 => error_comp (error_proj n3 n4 n5) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n3 n4 n5 => error_comp (error_proj n3 n4 n5) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | ok_arities gn gs => match match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end with | error_rec a a0 a1 => error_rec (ok_arities gn gs) (error_rec a a0 a1) match arities h with | error_rec a2 a3 a4 => error_comp (error_rec a2 a3 a4) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a2 l l0 => error_comp (error_comp a2 l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_comp a l l0 => error_rec (ok_arities gn gs) (error_comp a l l0) match arities h with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a0 l1 l2 => error_comp (error_comp a0 l1 l2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | error_proj n0 n1 n2 => error_rec (ok_arities gn gs) (error_proj n0 n1 n2) match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n3 n4 n5 => error_comp (error_proj n3 n4 n5) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end | ok_arities h0n h0s => match match arities h with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb hs (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities hn hs) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) end with | error_rec a a0 a1 => error_rec (ok_arities gn gs) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities gn gs) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n n0 n1 => error_rec (ok_arities gn gs) (ok_arities h0n h0s) (error_proj n n0 n1) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb gn m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb gs m' end) (Nat.eqb h0s h1s) then ok_arities h0n gs else error_rec (ok_arities gn gs) (ok_arities h0n h0s) (ok_arities h1n h1s) end end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (arities x) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (arities x) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (arities x) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj n O) (seq O n))))) (Nat.eqb hs (@length BC (@map nat BC (proj n s) (seq n s))))) (andb (aeq (arities x) (ok_arities n O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (arities x) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite Hx, Hg, Hh. (* Goal: @eq Arities match match (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb (S n) (S (@length BC (@map nat BC (proj (S n) O) (seq (S O) n))))) (Nat.eqb (S s) (S (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj n O) (seq O n))))) (Nat.eqb hs (@length BC (@map nat BC (proj n s) (seq n s))))) (andb (aeq (ok_arities n O) (ok_arities n O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb n (@length BC (@map nat BC (proj (S n) O) (seq (S O) n)))) (Nat.eqb s (@length BC (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (@length BC (@map nat BC (proj n O) (seq O n))))) (Nat.eqb hs (@length BC (@map nat BC (proj n s) (seq n s))))) (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) do 4 rewrite map_length, seq_length. (* Goal: @eq Arities match match (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (andb (aeq (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb (Nat.eqb n n) true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities match match (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb true true) (andb (aeq (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (ok_arities (S n) O)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (if andb (andb true true) true then ok_arities (S n) O else error_comp (ok_arities O (S O)) (@nil Arities) (@cons Arities (ok_arities (S n) O) (@nil Arities))) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb (Nat.eqb n n) true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite <- beq_nat_refl. (* Goal: @eq Arities match match (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n)))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities (S n) O)) (@map nat BC (proj (S n) O) (seq (S O) n))) (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H1 end. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb true (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) case_eq (n + S s). (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n1 n2 n3 => error_comp (error_proj n1 n2 n3) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall _ : @eq nat (Init.Nat.add n (S s)) O, @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) intro H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n1 n2 n3 => error_comp (error_proj n1 n2 n3) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) contradict H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n1 n2 n3 => error_comp (error_proj n1 n2 n3) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: not (@eq nat (Init.Nat.add n (S s)) O) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities match match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (error_proj n1 n2 n3) (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n n0 then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n1 n2 n3 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n1 n2 n3) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n1 n2 n3 => error_comp (error_proj n1 n2 n3) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) intros p H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if Nat.leb n p then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) case_eq (leb n p); intro H3. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (andb true true) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if @forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H4 end. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities match (if andb (andb (andb (Nat.eqb n n) (Nat.eqb (S n) (S n))) (Nat.eqb s s)) (Nat.eqb (S s) (S s)) then ok_arities (S n) s else error_rec (ok_arities n s) (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) do 4 rewrite <- beq_nat_refl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities match (if andb (andb (andb true true) true) true then ok_arities (S n) s else error_rec (ok_arities n s) (ok_arities (S n) (S s)) (ok_arities (S n) (S s))) with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (andb (andb (Nat.eqb n n) (Nat.eqb s s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) do 2 rewrite <- beq_nat_refl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (andb (andb true true) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H5 end. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) match goal with | |- context [forallb ?P ?l] => case_eq (forallb P l); intro H6 end. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true true then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (ok_arities n s) (ok_arities n s) *) reflexivity. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite forallb_forall_conv in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) destruct H6 as [e [H6 H7] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite in_map_iff in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) destruct H6 as [q [H6 H8] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite in_seq_iff in H8. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) subst e. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl in H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) case_eq (n+s). (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall _ : @eq nat (Init.Nat.add n s) O, @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) intro H9. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) contradict H8. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: not (and (le n q) (lt q (Init.Nat.add n s))) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n s) (S n0)), @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) intros r H9. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite H9 in H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) case_eq (leb q r); intro H10. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite H10 in H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl in H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) do 2 rewrite <- beq_nat_refl in H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) discriminate H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite leb_iff_conv in H10. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb true false then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) contradict H10. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: not (lt r q) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite forallb_forall_conv in H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) destruct H5 as [e [H5 H6] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite in_map_iff in H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) destruct H5 as [q [H5 H7] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite in_seq_iff in H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) subst e. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) case_eq (n+0). (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall _ : @eq nat (Init.Nat.add n O) O, @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) intro H8. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) contradict H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: not (and (le O q) (lt q (Init.Nat.add O n))) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n O) (S n0)), @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) intros r H8. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite H8 in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) case_eq (leb q r); intro H9. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite H9 in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite <- beq_nat_refl in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) discriminate H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite leb_iff_conv in H9. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (if andb false (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities (S n) s) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) contradict H9. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: not (lt r q) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite forallb_forall_conv in H4. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) destruct H4 as [e [H4 H5] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite in_map_iff in H4. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) destruct H4 as [q [H4 H6] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite in_seq_iff in H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) subst e. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl in H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) case_eq (n+S s). (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: forall _ : @eq nat (Init.Nat.add n (S s)) O, @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) intro H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) contradict H6. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: not (and (le (S (S n)) q) (lt q (Init.Nat.add (S (S n)) s))) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: forall (n0 : nat) (_ : @eq nat (Init.Nat.add n (S s)) (S n0)), @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) intros r H7. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite H7 in H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) case_eq (leb q (S r)); intro H8. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite H8 in H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) simpl in H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) do 2 rewrite <- beq_nat_refl in H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) discriminate H5. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) rewrite leb_iff_conv in H8. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities (error_comp (error_rec (ok_arities n s) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) (error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (ok_arities (S n) (S s)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))))) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s)))) (ok_arities n s) *) contradict H8. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: not (lt (S r) q) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite leb_iff_conv in H3. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb (aeq (error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) contradict H3. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: not (lt p n) *) omega. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite forallb_forall_conv in H1. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) destruct H1 as [e [H1 H2] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite in_map_iff in H1. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) destruct H1 as [q [H1 H3] ]. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite in_seq_iff in H3. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) subst e. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl in H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) case_eq (leb q (n+0)); intro H4. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite H4 in H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) simpl in H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite <- beq_nat_refl in H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) discriminate H2. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) rewrite leb_iff_conv in H4. (* Goal: @eq Arities match match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (error_rec a a0 a1) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_comp a l l0 => error_rec (ok_arities n s) (error_comp a l l0) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (error_proj n0 n1 n2) (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) | ok_arities h0n h0s => match (if andb false (andb (aeq (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (ok_arities (S n) (S s))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities (S n) (S s))) (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s)))) then ok_arities (S n) (S s) else error_comp (ok_arities (S n) (S s)) (@cons Arities (ok_arities (S n) O) (@map BC Arities arities (@map nat BC (proj (S n) O) (seq (S O) n)))) (@cons Arities (if match Init.Nat.add n (S s) with | O => false | S m' => Nat.leb n m' end then ok_arities (S n) (S s) else error_proj (S n) (S s) (S n)) (@map BC Arities arities (@map nat BC (proj (S n) (S s)) (seq (S (S n)) s))))) with | error_rec a a0 a1 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_rec a a0 a1) | error_comp a l l0 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_comp a l l0) | error_proj n0 n1 n2 => error_rec (ok_arities n s) (ok_arities h0n h0s) (error_proj n0 n1 n2) | ok_arities h1n h1s => if andb (andb (andb match h0n with | O => false | S m' => Nat.eqb n m' end (Nat.eqb h0n h1n)) match h0s with | O => false | S m' => Nat.eqb s m' end) (Nat.eqb h0s h1s) then ok_arities h0n s else error_rec (ok_arities n s) (ok_arities h0n h0s) (ok_arities h1n h1s) end end with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S n)) (Nat.eqb hs s)) (@forallb BC (fun ne : BC => aeq (arities ne) (ok_arities n O)) (@map nat BC (proj n O) (seq O n)))) (@forallb BC (fun se : BC => aeq (arities se) (ok_arities n s)) (@map nat BC (proj n s) (seq n s))) then ok_arities n s else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@map BC Arities arities (@map nat BC (proj n O) (seq O n)))) (@map BC Arities arities (@map nat BC (proj n s) (seq n s))) end (ok_arities n s) *) contradict H4. (* Goal: not (lt (Init.Nat.add n O) q) *) omega. Qed. Lemma rec3_correct n s x g h vnl vsl : length vnl = n -> length vsl = s -> sem (rec3 n s x g h) vnl vsl = sem_rec1 g h (sem x vnl nil) vnl vsl. Proof. (* Goal: forall (_ : @eq nat (@length (list bool) vnl) n) (_ : @eq nat (@length (list bool) vsl) s), @eq (list bool) (sem (rec3 n s x g h) vnl vsl) (sem_rec1 g h (sem x vnl (@nil (list bool))) vnl vsl) *) intros Hn Hs. (* Goal: @eq (list bool) (sem (rec3 n s x g h) vnl vsl) (sem_rec1 g h (sem x vnl (@nil (list bool))) vnl vsl) *) unfold rec3. (* Goal: @eq (list bool) (sem (comp n s (rec1 n s g h) (@cons BC x (@map nat BC (proj n O) (seq O n))) (@map nat BC (proj n s) (seq n s))) vnl vsl) (sem_rec1 g h (sem x vnl (@nil (list bool))) vnl vsl) *) rewrite sem_comp, rec1_correct; simpl. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list bool) (sem_rec1 g h (sem x vnl (@nil (list bool))) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) (sem_rec1 g h (sem x vnl (@nil (list bool))) vnl vsl) *) f_equal. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))) vnl *) rewrite map_proj_seq_normal. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) n vnl) (@repeat (list bool) (Init.Nat.sub n (@length (list bool) vnl)) (@nil bool))) vnl *) subst n. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@repeat (list bool) (Init.Nat.sub (@length (list bool) vnl) (@length (list bool) vnl)) (@nil bool))) vnl *) rewrite minus_diag. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@repeat (list bool) O (@nil bool))) vnl *) simpl. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vnl) vnl) (@nil (list bool))) vnl *) rewrite app_nil_r. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vnl) vnl) vnl *) rewrite <- (app_nil_r vnl) at 2. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vnl) (@app (list bool) vnl (@nil (list bool)))) vnl *) apply firstn_app. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s))) vsl *) rewrite map_proj_seq_safe. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) s vsl) (@repeat (list bool) (Init.Nat.sub s (@length (list bool) vsl)) (@nil bool))) vsl *) subst s. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@repeat (list bool) (Init.Nat.sub (@length (list bool) vsl) (@length (list bool) vsl)) (@nil bool))) vsl *) rewrite minus_diag. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@repeat (list bool) O (@nil bool))) vsl *) simpl. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@app (list bool) (@firstn (list bool) (@length (list bool) vsl) vsl) (@nil (list bool))) vsl *) rewrite app_nil_r. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vsl) vsl) vsl *) rewrite <- (app_nil_r vsl) at 2. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) (* Goal: @eq (list (list bool)) (@firstn (list bool) (@length (list bool) vsl) (@app (list bool) vsl (@nil (list bool)))) vsl *) apply firstn_app. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) (* Goal: @eq nat (S (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) (@map nat BC (proj n O) (seq O n))))) (S n) *) rewrite map_length, map_length, seq_length; reflexivity. (* Goal: @eq nat (@length (list bool) (@map BC (list bool) (fun se : BC => sem se vnl vsl) (@map nat BC (proj n s) (seq n s)))) s *) rewrite map_length, map_length, seq_length; reflexivity. Qed. Definition true_e (n s:nat) : BC := comp n s (comp 0 0 (succ true) nil (zero :: nil)) nil nil. Lemma true_correct n s l1 l2: bs2bool (sem (true_e n s) l1 l2) = true. Proof. (* Goal: @eq bool (bs2bool (sem (true_e n s) l1 l2)) true *) intros; simpl; trivial. Qed. Lemma true_correct_nat n s l1 l2: bs2nat (sem (true_e n s) l1 l2) = 1. Proof. (* Goal: @eq nat (bs2nat (sem (true_e n s) l1 l2)) (S O) *) intros; simpl; trivial. Qed. Definition false_e (n s:nat) : BC := comp n s (comp 0 0 (succ false) nil (zero :: nil)) nil nil. Lemma false_correct n s l1 l2: bs2bool (sem (false_e n s) l1 l2) = false. Proof. (* Goal: @eq bool (bs2bool (sem (false_e n s) l1 l2)) false *) intros; simpl; trivial. Qed. Lemma false_correct_nat n s l1 l2: bs2nat (sem (false_e n s) l1 l2) = 0. Proof. (* Goal: @eq nat (bs2nat (sem (false_e n s) l1 l2)) O *) intros; simpl; trivial. Qed. Definition parity_e : BC := comp 0 1 cond nil [proj 0 1 0; false_e 0 1; true_e 0 1; false_e 0 1]. Lemma parity_correct_even v : bs2bool (sem parity_e nil [v]) = false -> even (bs2nat v). Proof. (* Goal: forall _ : @eq bool (bs2bool (sem parity_e (@nil (list bool)) (@cons (list bool) v (@nil (list bool))))) false, even (bs2nat v) *) destruct v; simpl; intros. (* Goal: even (if b then S (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) else Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) *) (* Goal: even O *) apply even_O. (* Goal: even (if b then S (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) else Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) *) destruct b; simpl in *. (* Goal: even (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) *) (* Goal: even (S (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O))) *) discriminate. (* Goal: even (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) *) cutrewrite (bs2nat v + (bs2nat v + 0) = 2 * (bs2nat v)). (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) (* Goal: even (Init.Nat.mul (S (S O)) (bs2nat v)) *) auto with arith. (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) ring. Qed. Lemma parity_correct_odd v : bs2bool (sem parity_e nil [v]) = true -> odd (bs2nat v). Proof. (* Goal: forall _ : @eq bool (bs2bool (sem parity_e (@nil (list bool)) (@cons (list bool) v (@nil (list bool))))) true, odd (bs2nat v) *) destruct v; simpl; intros. (* Goal: odd (if b then S (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) else Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) *) (* Goal: odd O *) discriminate. (* Goal: odd (if b then S (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) else Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) *) cutrewrite (bs2nat v + (bs2nat v + 0) = (2 * (bs2nat v))). (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) (* Goal: odd (if b then S (Init.Nat.mul (S (S O)) (bs2nat v)) else Init.Nat.mul (S (S O)) (bs2nat v)) *) destruct b. (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) (* Goal: odd (Init.Nat.mul (S (S O)) (bs2nat v)) *) (* Goal: odd (S (Init.Nat.mul (S (S O)) (bs2nat v))) *) apply odd_S. (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) (* Goal: odd (Init.Nat.mul (S (S O)) (bs2nat v)) *) (* Goal: even (Init.Nat.mul (S (S O)) (bs2nat v)) *) auto with arith. (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) (* Goal: odd (Init.Nat.mul (S (S O)) (bs2nat v)) *) simpl in H; discriminate. (* Goal: @eq nat (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) (Init.Nat.mul (S (S O)) (bs2nat v)) *) omega. Qed. Definition P (x:bs)(y:bs) : bs := skipn (length x) y. Lemma P_nil : forall x, P x nil = nil. Proof. (* Goal: forall x : list bool, @eq (list bool) (P x (@nil bool)) (@nil bool) *) intro x; case x; trivial. Qed. Definition P_e : BC := rec (proj 0 1 0) (comp 1 2 pred nil [proj 1 2 1]) (comp 1 2 pred nil [proj 1 2 1]). Lemma P_correct x y : sem P_e [x] [y] = P x y. Proof. (* Goal: @eq (list bool) (sem P_e (@cons (list bool) x (@nil (list bool))) (@cons (list bool) y (@nil (list bool)))) (P x y) *) unfold P; induction x; simpl in *; trivial. (* Goal: @eq (list bool) (if a then @tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool)))) else @tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) intros; case a. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) rewrite IHx; clear IHx. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) (* Goal: @eq (list bool) (@tl bool (@skipn bool (@length bool x) y)) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) induction (length x); simpl; trivial. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) (* Goal: @eq (list bool) (@tl bool match y with | nil => @nil bool | cons a l => @skipn bool n l end) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => @skipn bool n l0 end *) rewrite <- IHn; clear IHn. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) (* Goal: @eq (list bool) (@tl bool (@tl bool (@skipn bool n y))) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => @skipn bool n l0 end *) revert y. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) (* Goal: forall y : list bool, @eq (list bool) (@tl bool (@tl bool (@skipn bool n y))) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => @skipn bool n l0 end *) induction n; simpl; trivial; intros. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) (* Goal: @eq (list bool) (@tl bool (@tl bool match y with | nil => @nil bool | cons a l => @skipn bool n l end)) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 (nil as l0) as l) => @nil bool | cons a (cons a0 (cons a1 l1 as l0) as l) => @skipn bool n l1 end *) (* Goal: @eq (list bool) (@tl bool (@tl bool y)) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => l0 end *) case y; simpl; trivial. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) (* Goal: @eq (list bool) (@tl bool (@tl bool match y with | nil => @nil bool | cons a l => @skipn bool n l end)) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 (nil as l0) as l) => @nil bool | cons a (cons a0 (cons a1 l1 as l0) as l) => @skipn bool n l1 end *) case y; simpl; trivial; intros. (* Goal: @eq (list bool) (@tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) x (@nil (list bool)) (@cons (list bool) y (@nil (list bool))))) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) rewrite IHx; clear IHx. (* Goal: @eq (list bool) (@tl bool (@skipn bool (@length bool x) y)) match y with | nil => @nil bool | cons a l => @skipn bool (@length bool x) l end *) induction (length x); simpl; trivial. (* Goal: @eq (list bool) (@tl bool match y with | nil => @nil bool | cons a l => @skipn bool n l end) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => @skipn bool n l0 end *) rewrite <- IHn; clear IHn. (* Goal: @eq (list bool) (@tl bool (@tl bool (@skipn bool n y))) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => @skipn bool n l0 end *) revert y. (* Goal: forall y : list bool, @eq (list bool) (@tl bool (@tl bool (@skipn bool n y))) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => @skipn bool n l0 end *) induction n; simpl; trivial; intros. (* Goal: @eq (list bool) (@tl bool (@tl bool match y with | nil => @nil bool | cons a l => @skipn bool n l end)) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 (nil as l0) as l) => @nil bool | cons a (cons a0 (cons a1 l1 as l0) as l) => @skipn bool n l1 end *) (* Goal: @eq (list bool) (@tl bool (@tl bool y)) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 l0 as l) => l0 end *) case y; simpl; trivial. (* Goal: @eq (list bool) (@tl bool (@tl bool match y with | nil => @nil bool | cons a l => @skipn bool n l end)) match y with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons a0 (nil as l0) as l) => @nil bool | cons a (cons a0 (cons a1 l1 as l0) as l) => @skipn bool n l1 end *) case y; simpl; trivial; intros. Qed. Global Opaque P_e. Definition P'_e := from_11_to_20 P_e. Definition Y (z w y:bs) : bs := P (P z w) y. Definition Y_e : BC := comp 2 1 P_e [comp 2 0 P'_e [proj 2 0 0; proj 2 0 1] nil] [proj 2 1 2]. Lemma Y_correct z w y : sem Y_e [z;w] [y] = Y z w y. Proof. (* Goal: @eq (list bool) (sem Y_e (@cons (list bool) z (@cons (list bool) w (@nil (list bool)))) (@cons (list bool) y (@nil (list bool)))) (Y z w y) *) intros; simpl. (* Goal: @eq (list bool) (sem P_e (@cons (list bool) (sem P_e (@cons (list bool) z (@nil (list bool))) (@cons (list bool) w (@nil (list bool)))) (@nil (list bool))) (@cons (list bool) y (@nil (list bool)))) (Y z w y) *) rewrite P_correct, P_correct. (* Goal: @eq (list bool) (P (P z w) y) (Y z w y) *) trivial. Qed. Lemma Y_skipn z w y : Y z w y = skipn (length w - length z) y. Proof. (* Goal: @eq (list bool) (Y z w y) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y) *) unfold Y, P; intros. (* Goal: @eq (list bool) (@skipn bool (@length bool (@skipn bool (@length bool z) w)) y) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y) *) rewrite length_skipn. (* Goal: @eq (list bool) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y) *) trivial. Qed. Global Opaque Y_e. Lemma Y_nth x y z : hd false (Y x y z) = nth (length y - length x) z false. Proof. (* Goal: @eq bool (@hd bool false (Y x y z)) (@nth bool (Init.Nat.sub (@length bool y) (@length bool x)) z false) *) unfold Y, P; intros. (* Goal: @eq bool (@hd bool false (@skipn bool (@length bool (@skipn bool (@length bool x) y)) z)) (@nth bool (Init.Nat.sub (@length bool y) (@length bool x)) z false) *) rewrite length_skipn. (* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool y) (@length bool x)) z)) (@nth bool (Init.Nat.sub (@length bool y) (@length bool x)) z false) *) remember (length y - length x) as n. (* Goal: @eq bool (@hd bool false (@skipn bool n z)) (@nth bool n z false) *) revert x y z Heqn. (* Goal: forall (x y z : list bool) (_ : @eq nat n (Init.Nat.sub (@length bool y) (@length bool x))), @eq bool (@hd bool false (@skipn bool n z)) (@nth bool n z false) *) induction n; simpl; intros. (* Goal: @eq bool (@hd bool false match z with | nil => @nil bool | cons a l => @skipn bool n l end) (@nth bool (S n) z false) *) (* Goal: @eq bool (@hd bool false z) (@nth bool O z false) *) case z; trivial. (* Goal: @eq bool (@hd bool false match z with | nil => @nil bool | cons a l => @skipn bool n l end) (@nth bool (S n) z false) *) destruct z; simpl in *; trivial. (* Goal: @eq bool (@hd bool false (@skipn bool n z)) (@nth bool n z false) *) apply IHn with (x:=true::x) (y:=y). (* Goal: @eq nat n (Init.Nat.sub (@length bool y) (@length bool (@cons bool true x))) *) simpl. (* Goal: @eq nat n (Init.Nat.sub (@length bool y) (S (@length bool x))) *) omega. Qed. Lemma Y_nil x y : Y x y nil = nil. Proof. (* Goal: @eq (list bool) (Y x y (@nil bool)) (@nil bool) *) intros; unfold Y, P. (* Goal: @eq (list bool) (@skipn bool (@length bool (@skipn bool (@length bool x) y)) (@nil bool)) (@nil bool) *) case (length (skipn (length x) y)); simpl; trivial. Qed. Lemma Y_refl x y : Y x x y = y. Proof. (* Goal: @eq (list bool) (Y x x y) y *) intros; unfold Y, P. (* Goal: @eq (list bool) (@skipn bool (@length bool (@skipn bool (@length bool x) x)) y) y *) rewrite length_skipn, minus_diag; simpl; trivial. Qed. Lemma Y_nil_length x y z : Y x y z = nil -> length z <= length y - length x. Proof. (* Goal: forall _ : @eq (list bool) (Y x y z) (@nil bool), le (@length bool z) (Init.Nat.sub (@length bool y) (@length bool x)) *) intros. (* Goal: le (@length bool z) (Init.Nat.sub (@length bool y) (@length bool x)) *) unfold Y, P in H. (* Goal: le (@length bool z) (Init.Nat.sub (@length bool y) (@length bool x)) *) rewrite length_skipn in H. (* Goal: le (@length bool z) (Init.Nat.sub (@length bool y) (@length bool x)) *) apply skipn_nil_length; trivial. Qed. Lemma Y_hd_same x y z i1 i2: Y (i1 :: x) y z = Y (i2 :: x) y z. Proof. (* Goal: @eq (list bool) (Y (@cons bool i1 x) y z) (Y (@cons bool i2 x) y z) *) intros; unfold Y, P. (* Goal: @eq (list bool) (@skipn bool (@length bool (@skipn bool (@length bool (@cons bool i1 x)) y)) z) (@skipn bool (@length bool (@skipn bool (@length bool (@cons bool i2 x)) y)) z) *) simpl; trivial. Qed. Lemma Y_le : forall u w y , length u <= length w -> length (Y u w y) <= length (Y w w y). Proof. (* Goal: forall (u w y : list bool) (_ : le (@length bool u) (@length bool w)), le (@length bool (Y u w y)) (@length bool (Y w w y)) *) intros. (* Goal: le (@length bool (Y u w y)) (@length bool (Y w w y)) *) repeat rewrite Y_skipn. (* Goal: le (@length bool (@skipn bool (Init.Nat.sub (@length bool w) (@length bool u)) y)) (@length bool (@skipn bool (Init.Nat.sub (@length bool w) (@length bool w)) y)) *) repeat rewrite skipn_length. (* Goal: le (Init.Nat.sub (@length bool y) (Init.Nat.sub (@length bool w) (@length bool u))) (Init.Nat.sub (@length bool y) (Init.Nat.sub (@length bool w) (@length bool w))) *) omega. Qed. Definition I_e : BC := comp 2 1 parity_e nil [comp 2 1 Y_e [comp 2 0 (succ true) nil [proj 2 0 0]; proj 2 0 1] [proj 2 1 2] ]. Lemma I_correct (z w y : bs) : sem I_e [z;w] [y] = [nth (length w - S (length z)) y false]. Proof. (* Goal: @eq (list bool) (sem I_e (@cons (list bool) z (@cons (list bool) w (@nil (list bool)))) (@cons (list bool) y (@nil (list bool)))) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) simpl; intros. (* Goal: @eq (list bool) match sem Y_e (@cons (list bool) (@cons bool true z) (@cons (list bool) w (@nil (list bool)))) (@cons (list bool) y (@nil (list bool))) with | nil => @cons bool false (@nil bool) | cons (true as b) l => @cons bool true (@nil bool) | cons (false as b) l => @cons bool false (@nil bool) end (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) rewrite Y_correct. (* Goal: @eq (list bool) match Y (@cons bool true z) w y with | nil => @cons bool false (@nil bool) | cons (true as b) l => @cons bool true (@nil bool) | cons (false as b) l => @cons bool false (@nil bool) end (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) case_eq (Y (true :: z) w y); intros. (* Goal: @eq (list bool) (if b then @cons bool true (@nil bool) else @cons bool false (@nil bool)) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) (* Goal: @eq (list bool) (@cons bool false (@nil bool)) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) apply Y_nil_length in H; simpl in H. (* Goal: @eq (list bool) (if b then @cons bool true (@nil bool) else @cons bool false (@nil bool)) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) (* Goal: @eq (list bool) (@cons bool false (@nil bool)) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) rewrite nth_overflow; trivial. (* Goal: @eq (list bool) (if b then @cons bool true (@nil bool) else @cons bool false (@nil bool)) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) *) replace (S (length z)) with (length (true :: z)). (* Goal: @eq nat (@length bool (@cons bool true z)) (S (@length bool z)) *) (* Goal: @eq (list bool) (if b then @cons bool true (@nil bool) else @cons bool false (@nil bool)) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (@length bool (@cons bool true z))) y false) (@nil bool)) *) rewrite <- Y_nth. (* Goal: @eq nat (@length bool (@cons bool true z)) (S (@length bool z)) *) (* Goal: @eq (list bool) (if b then @cons bool true (@nil bool) else @cons bool false (@nil bool)) (@cons bool (@hd bool false (Y (@cons bool true z) w y)) (@nil bool)) *) rewrite H; simpl; trivial. (* Goal: @eq nat (@length bool (@cons bool true z)) (S (@length bool z)) *) (* Goal: @eq (list bool) (if b then @cons bool true (@nil bool) else @cons bool false (@nil bool)) (@cons bool b (@nil bool)) *) destruct b; trivial. (* Goal: @eq nat (@length bool (@cons bool true z)) (S (@length bool z)) *) simpl; trivial. Qed. Lemma I_Y_property j z w y : length z < length w -> length w - S (length z) < length y -> Y (j :: z) w y = [nth (length w - S (length z)) y false] ++ Y z w y. Proof. (* Goal: forall (_ : lt (@length bool z) (@length bool w)) (_ : lt (Init.Nat.sub (@length bool w) (S (@length bool z))) (@length bool y)), @eq (list bool) (Y (@cons bool j z) w y) (@app bool (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@nil bool)) (Y z w y)) *) intros; simpl. (* Goal: @eq (list bool) (Y (@cons bool j z) w y) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (Y z w y)) *) rewrite Y_skipn. (* Goal: @eq (list bool) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool (@cons bool j z))) y) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (Y z w y)) *) rewrite Y_skipn. (* Goal: @eq (list bool) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool (@cons bool j z))) y) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y)) *) simpl. (* Goal: @eq (list bool) (@skipn bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y)) *) rewrite skipn_hd with (d := false). (* Goal: lt (Init.Nat.sub (@length bool w) (S (@length bool z))) (@length bool y) *) (* Goal: @eq (list bool) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@skipn bool (S (Init.Nat.sub (@length bool w) (S (@length bool z)))) y)) (@cons bool (@nth bool (Init.Nat.sub (@length bool w) (S (@length bool z))) y false) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y)) *) f_equal. (* Goal: lt (Init.Nat.sub (@length bool w) (S (@length bool z))) (@length bool y) *) (* Goal: @eq (list bool) (@skipn bool (S (Init.Nat.sub (@length bool w) (S (@length bool z)))) y) (@skipn bool (Init.Nat.sub (@length bool w) (@length bool z)) y) *) f_equal. (* Goal: lt (Init.Nat.sub (@length bool w) (S (@length bool z))) (@length bool y) *) (* Goal: @eq nat (S (Init.Nat.sub (@length bool w) (S (@length bool z)))) (Init.Nat.sub (@length bool w) (@length bool z)) *) omega. (* Goal: lt (Init.Nat.sub (@length bool w) (S (@length bool z))) (@length bool y) *) trivial. Qed. Global Opaque I_e.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat fintype finset. From mathcomp Require Import fingroup perm morphism. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope. Section Automorphism. Variable gT : finGroupType. Implicit Type A : {set gT}. Implicit Types a b : {perm gT}. Definition Aut A := [set a | perm_on A a & morphic A a]. Lemma Aut_morphic A a : a \in Aut A -> morphic A a. Proof. (* Goal: forall _ : is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (Aut A)))), is_true (@morphic gT gT A (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a)) *) by case/setIdP. Qed. Lemma out_Aut A a x : a \in Aut A -> x \notin A -> a x = x. Proof. (* Goal: forall (_ : is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (Aut A))))) (_ : is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x) x *) by case/setIdP=> Aa _; apply: out_perm. Qed. Lemma eq_Aut A : {in Aut A &, forall a b, {in A, a =1 b} -> a = b}. Proof. (* Goal: @prop_in2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (Aut A))) (fun a b : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b x)) (inPhantom (@eqfun (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b))), @eq (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a b) (inPhantom (forall (a b : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b x)) (inPhantom (@eqfun (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b)))), @eq (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) a b)) *) move=> a g Aa Ag /= eqag; apply/permP=> x. (* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) g x) *) by have [/eqag // | /out_Aut out] := boolP (x \in A); rewrite !out. Qed. Definition autm A a (AutAa : a \in Aut A) := morphm (Aut_morphic AutAa). Lemma autmE A a (AutAa : a \in Aut A) : autm AutAa = a. Proof. (* Goal: @eq (forall _ : FinGroup.arg_sort (FinGroup.base gT), FinGroup.sort (FinGroup.base gT)) (@autm A a AutAa) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a) *) by []. Qed. Canonical autm_morphism A a aM := Eval hnf in [morphism of @autm A a aM]. Section AutGroup. Variable G : {group gT}. Lemma Aut_group_set : group_set (Aut G). Proof. (* Goal: is_true (@group_set (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (Aut (@gval gT G))) *) apply/group_setP; split=> [|a b]. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Aut (@gval gT G)))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) b (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Aut (@gval gT G)))))), is_true (@in_mem (FinGroup.sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mulg (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))) a b) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Aut (@gval gT G))))) *) (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Aut (@gval gT G))))) *) by rewrite inE perm_on1; apply/morphicP=> ? *; rewrite !permE. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Aut (@gval gT G)))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) b (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Aut (@gval gT G)))))), is_true (@in_mem (FinGroup.sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mulg (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))) a b) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (Aut (@gval gT G))))) *) rewrite !inE => /andP[Ga aM] /andP[Gb bM]; rewrite perm_onM //=. (* Goal: is_true (@morphic gT gT (@gval gT G) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) a b))) *) apply/morphicP=> x y Gx Gy; rewrite !permM (morphicP aM) //. (* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b (@mulg (FinGroup.base gT) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a y))) (@mulg (FinGroup.base gT) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a y))) *) by rewrite (morphicP bM) ?perm_closed. Qed. Canonical Aut_group := group Aut_group_set. Variable (a : {perm gT}) (AutGa : a \in Aut G). Notation f := (autm AutGa). Notation fE := (autmE AutGa). Lemma injm_autm : 'injm f. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT gT (@gval gT G) (@autm_morphism (@gval gT G) a AutGa) (@MorPhantom gT gT (@autm (@gval gT G) a AutGa))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *) by apply/injmP; apply: in2W; apply: perm_inj. Qed. Lemma im_autm : f @* G = G. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) (@autm_morphism (@gval gT G) a AutGa) (@MorPhantom gT gT (@autm (@gval gT G) a AutGa)) (@gval gT G)) (@gval gT G) *) apply/setP=> x; rewrite morphimEdom (can_imset_pre _ (permK a)) inE. (* Goal: @eq bool (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@invg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) a) x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@gval gT G)))) *) by have:= AutGa; rewrite inE => /andP[/perm_closed <-]; rewrite permKV. Qed. Lemma Aut_closed x : x \in G -> a x \in G. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by move=> Gx; rewrite -im_autm; apply: mem_morphim. Qed. End AutGroup. Lemma Aut1 : Aut 1 = 1. End Automorphism. Arguments Aut _ _%g. Notation "[ 'Aut' G ]" := (Aut_group G) (at level 0, format "[ 'Aut' G ]") : Group_scope. Notation "[ 'Aut' G ]" := (Aut G) (at level 0, only parsing) : group_scope. Prenex Implicits Aut autm. Section PermIn. Variables (T : finType) (A : {set T}) (f : T -> T). Hypotheses (injf : {in A &, injective f}) (sBf : f @: A \subset A). Lemma perm_in_inj : injective (fun x => if x \in A then f x else x). Proof. (* Goal: @injective (Finite.sort T) (Finite.sort T) (fun x : Finite.sort T => if @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f x else x) *) move=> x y /=; wlog Ay: x y / y \in A. (* Goal: forall _ : @eq (Finite.sort T) (if @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f x else x) (if @in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f y else y), @eq (Finite.sort T) x y *) (* Goal: forall (_ : forall (x y : Finite.sort T) (_ : is_true (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) (_ : @eq (Finite.sort T) (if @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f x else x) (if @in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f y else y)), @eq (Finite.sort T) x y) (_ : @eq (Finite.sort T) (if @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f x else x) (if @in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f y else y)), @eq (Finite.sort T) x y *) by move=> IH eqfxy; case: ifP (eqfxy); [symmetry | case: ifP => //]; auto. (* Goal: forall _ : @eq (Finite.sort T) (if @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f x else x) (if @in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) then f y else y), @eq (Finite.sort T) x y *) rewrite Ay; case: ifP => [Ax | nAx def_x]; first exact: injf. (* Goal: @eq (Finite.sort T) x y *) by case/negP: nAx; rewrite def_x (subsetP sBf) ?mem_imset. Qed. Definition perm_in := perm perm_in_inj. Lemma perm_in_on : perm_on A perm_in. Proof. (* Goal: is_true (@perm_on T A perm_in) *) by apply/subsetP=> x; rewrite inE /= permE; case: ifP => // _; case/eqP. Qed. Lemma perm_inE : {in A, perm_in =1 f}. Proof. (* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)) (fun x : Finite.sort T => @eq (Finite.sort T) (@PermDef.fun_of_perm T perm_in x) (f x)) (inPhantom (@eqfun (Finite.sort T) (Finite.sort T) (@PermDef.fun_of_perm T perm_in) f)) *) by move=> x Ax; rewrite /= permE Ax. Qed. End PermIn. Section MakeAut. Variables (gT : finGroupType) (G : {group gT}) (f : {morphism G >-> gT}). Implicit Type A : {set gT}. Hypothesis injf : 'injm f. Lemma morphim_fixP A : A \subset G -> reflect (f @* A = A) (f @* A \subset A). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), Bool.reflect (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) A) A) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) *) rewrite /morphim => sAG; have:= eqEcard (f @: A) A. (* Goal: forall _ : @eq bool (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base gT))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) A) (andb (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (leq (@card (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (@card (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))))))), Bool.reflect (@eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A)))) A) (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) *) rewrite (setIidPr sAG) card_in_imset ?leqnn ?andbT => [<-|]; first exact: eqP. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (fun x1 x2 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => forall _ : @eq (Finite.sort (FinGroup.finType (FinGroup.base gT))) (@mfun gT gT (@gval gT G) f x1) (@mfun gT gT (@gval gT G) f x2), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x1 x2) (inPhantom (@injective (Finite.sort (FinGroup.finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT gT (@gval gT G) f))) *) by move/injmP: injf; apply: sub_in2; apply/subsetP. Qed. Hypothesis Gf : f @* G = G. Lemma aut_closed : f @: G \subset G. Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by rewrite -morphimEdom; apply/morphim_fixP. Qed. Definition aut := perm_in (injmP injf) aut_closed. Lemma autE : {in G, aut =1 f}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) aut x) (@mfun gT gT (@gval gT G) f x)) (inPhantom (@eqfun (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) aut) (@mfun gT gT (@gval gT G) f))) *) exact: perm_inE. Qed. Lemma morphic_aut : morphic G aut. Proof. (* Goal: is_true (@morphic gT gT (@gval gT G) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) aut)) *) by apply/morphicP=> x y Gx Gy /=; rewrite !autE ?groupM // morphM. Qed. Lemma Aut_aut : aut \in Aut G. Proof. (* Goal: is_true (@in_mem (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) aut (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT G))))) *) by rewrite inE morphic_aut perm_in_on. Qed. Lemma imset_autE A : A \subset G -> aut @: A = f @* A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) aut) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) A) *) move=> sAG; rewrite /morphim (setIidPr sAG). (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) aut) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) *) by apply: eq_in_imset; apply: sub_in1 autE; apply/subsetP. Qed. Lemma preim_autE A : A \subset G -> aut @^-1: A = f @*^-1 A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@preimset (FinGroup.arg_finType (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) aut) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (@morphpre gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) A) *) move=> sAG; apply/setP=> x; rewrite !inE permE /=. (* Goal: @eq bool (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (if @in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) then @mfun gT gT (@gval gT G) f x else x) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) x (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mfun gT gT (@gval gT G) f x) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) *) by case Gx: (x \in G) => //; apply/negP=> Ax; rewrite (subsetP sAG) in Gx. Qed. End MakeAut. Arguments morphim_fixP {gT G f}. Prenex Implicits aut. Section AutIsom. Variables (gT rT : finGroupType) (G D : {group gT}) (f : {morphism D >-> rT}). Hypotheses (injf : 'injm f) (sGD : G \subset D). Let domG := subsetP sGD. Lemma Aut_isom_subproof a : {a' | a' \in Aut (f @* G) & a \in Aut G -> {in G, a' \o f =1 f \o a}}. Definition Aut_isom a := s2val (Aut_isom_subproof a). Lemma Aut_Aut_isom a : Aut_isom a \in Aut (f @* G). Proof. (* Goal: is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT)))) (Aut_isom a) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)))))) *) by rewrite /Aut_isom; case: (Aut_isom_subproof a). Qed. Lemma Aut_isomE a : a \in Aut G -> {in G, forall x, Aut_isom a (f x) = f (a x)}. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) a (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT G))))), @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base rT)) (Aut_isom a) (@mfun gT rT (@gval gT D) f x)) (@mfun gT rT (@gval gT D) f (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x))) (inPhantom (forall x : FinGroup.arg_sort (FinGroup.base gT), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base rT)) (Aut_isom a) (@mfun gT rT (@gval gT D) f x)) (@mfun gT rT (@gval gT D) f (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x)))) *) by rewrite /Aut_isom; case: (Aut_isom_subproof a). Qed. Lemma Aut_isomM : {in Aut G &, {morph Aut_isom: x y / x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT G)))) (fun x y : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => @eq (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT)))) (Aut_isom ((fun x0 y0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => @mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) x0 y0) x y)) ((fun x0 y0 : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT))) => @mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base rT))) x0 y0) (Aut_isom x) (Aut_isom y))) (inPhantom (@morphism_2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT)))) Aut_isom (fun x y : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => @mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) x y) (fun x y : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT))) => @mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base rT))) x y))) *) move=> a b AutGa AutGb. (* Goal: @eq (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base rT)))) (Aut_isom (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) a b)) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base rT))) (Aut_isom a) (Aut_isom b)) *) apply: (eq_Aut (Aut_Aut_isom _)); rewrite ?groupM ?Aut_Aut_isom // => fx. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) fx (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base rT)) (Aut_isom (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) a b)) fx) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base rT))) (Aut_isom a) (Aut_isom b)) fx) *) case/morphimP=> x Dx Gx ->{fx}. (* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base rT)) (Aut_isom (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) a b)) (@mfun gT rT (@gval gT D) f x)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base rT))) (Aut_isom a) (Aut_isom b)) (@mfun gT rT (@gval gT D) f x)) *) by rewrite permM !Aut_isomE ?groupM /= ?permM ?Aut_closed. Qed. Canonical Aut_isom_morphism := Morphism Aut_isomM. Lemma injm_Aut_isom : 'injm Aut_isom. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@ker (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut gT (@gval gT G)) Aut_isom_morphism (@MorPhantom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) Aut_isom)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))))) *) apply/injmP=> a b AutGa AutGb eq_ab'; apply: (eq_Aut AutGa AutGb) => x Gx. (* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) a x) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) b x) *) by apply: (injmP injf); rewrite ?domG ?Aut_closed // -!Aut_isomE //= eq_ab'. Qed. End AutIsom. Section InjmAut. Variables (gT rT : finGroupType) (G D : {group gT}) (f : {morphism D >-> rT}). Hypotheses (injf : 'injm f) (sGD : G \subset D). Let domG := subsetP sGD. Lemma im_Aut_isom : Aut_isom injf sGD @* Aut G = Aut (f @* G). Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))))) (@morphim (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut gT (@gval gT G)) (@Aut_isom_morphism gT rT G D f injf sGD) (@MorPhantom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut_isom gT rT G D f injf sGD)) (@Aut gT (@gval gT G))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) *) apply/eqP; rewrite eqEcard; apply/andP; split. (* Goal: is_true (leq (@card (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)))))) (@card (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@morphim (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut gT (@gval gT G)) (@Aut_isom_morphism gT rT G D f injf sGD) (@MorPhantom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut_isom gT rT G D f injf sGD)) (@Aut gT (@gval gT G))))))) *) (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@morphim (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut gT (@gval gT G)) (@Aut_isom_morphism gT rT G D f injf sGD) (@MorPhantom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut_isom gT rT G D f injf sGD)) (@Aut gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)))))) *) by apply/subsetP=> _ /morphimP[a _ AutGa ->]; apply: Aut_Aut_isom. (* Goal: is_true (leq (@card (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)))))) (@card (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@morphim (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut gT (@gval gT G)) (@Aut_isom_morphism gT rT G D f injf sGD) (@MorPhantom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut_isom gT rT G D f injf sGD)) (@Aut gT (@gval gT G))))))) *) have inj_isom' := injm_Aut_isom (injm_invm injf) (morphimS _ sGD). (* Goal: is_true (leq (@card (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)))))) (@card (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))))) (@morphim (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut gT (@gval gT G)) (@Aut_isom_morphism gT rT G D f injf sGD) (@MorPhantom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut_isom gT rT G D f injf sGD)) (@Aut gT (@gval gT G))))))) *) rewrite card_injm ?injm_Aut_isom // -(card_injm inj_isom') ?subset_leq_card //. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut_group rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) G))) (@Aut_isom_morphism rT gT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) G) (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) D) (@invm_morphism gT rT D f injf) (@injm_invm gT rT D f injf) (@morphimS gT rT D f (@gval gT G) (@gval gT D) sGD)) (@MorPhantom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@gval (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut_group rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) G))) (@Aut_isom_morphism rT gT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) G) (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) D) (@invm_morphism gT rT D f injf) (@injm_invm gT rT D f injf) (@morphimS gT rT D f (@gval gT G) (@gval gT D) sGD)))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@Aut gT (@gval gT G))))) *) apply/subsetP=> a /morphimP[a' _ AutfGa' def_a]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) a (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@Aut gT (@gval gT G))))) *) by rewrite -(morphim_invm injf sGD) def_a Aut_Aut_isom. Qed. Lemma Aut_isomP : isom (Aut G) (Aut (f @* G)) (Aut_isom injf sGD). Proof. (* Goal: is_true (@isom (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (@Aut gT (@gval gT G)) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) (@Aut_isom gT rT G D f injf sGD)) *) by apply/isomP; split; [apply: injm_Aut_isom | apply: im_Aut_isom]. Qed. Lemma injm_Aut : Aut (f @* G) \isog Aut G. Proof. (* Goal: is_true (@isog (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base rT))) (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) (@Aut gT (@gval gT G))) *) by rewrite isog_sym (isom_isog _ _ Aut_isomP). Qed. End InjmAut. Section ConjugationMorphism. Variable gT : finGroupType. Implicit Type A : {set gT}. Definition conjgm of {set gT} := fun x y : gT => y ^ x. Canonical conjgm_morphism A x := @Morphism _ _ A (conjgm A x) (in2W (fun y z => conjMg y z x)). Lemma morphim_conj A x B : conjgm A x @* B = (A :&: B) :^ x. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT A (conjgm_morphism A x) (@MorPhantom gT gT (conjgm A x)) B) (@conjugate gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B) x) *) by []. Qed. Variable G : {group gT}. Lemma injm_conj x : 'injm (conjgm G x). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT gT (@gval gT G) (conjgm_morphism (@gval gT G) x) (@MorPhantom gT gT (conjgm (@gval gT G) x))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *) by apply/injmP; apply: in2W; apply: conjg_inj. Qed. Lemma conj_isom x : isom G (G :^ x) (conjgm G x). Proof. (* Goal: is_true (@isom gT gT (@gval gT G) (@conjugate gT (@gval gT G) x) (conjgm (@gval gT G) x)) *) by apply/isomP; rewrite morphim_conj setIid injm_conj. Qed. Lemma conj_isog x : G \isog G :^ x. Proof. (* Goal: is_true (@isog gT gT (@gval gT G) (@conjugate gT (@gval gT G) x)) *) exact: isom_isog (conj_isom x). Qed. Lemma norm_conjg_im x : x \in 'N(G) -> conjgm G x @* G = G. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT G))))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) (conjgm_morphism (@gval gT G) x) (@MorPhantom gT gT (conjgm (@gval gT G) x)) (@gval gT G)) (@gval gT G) *) by rewrite morphimEdom; apply: normP. Qed. Lemma norm_conj_isom x : x \in 'N(G) -> isom G G (conjgm G x). Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT G))))), is_true (@isom gT gT (@gval gT G) (@gval gT G) (conjgm (@gval gT G) x)) *) by move/norm_conjg_im/restr_isom_to/(_ (conj_isom x))->. Qed. Definition conj_aut x := aut (injm_conj _) (norm_conjg_im (subgP (subg _ x))). Lemma norm_conj_autE : {in 'N(G) & G, forall x y, conj_aut x y = y ^ x}. Proof. (* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun (x : FinGroup.arg_sort (FinGroup.base gT)) (y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut x) y) (@conjg gT y x)) (inPhantom (forall (x : FinGroup.arg_sort (FinGroup.base gT)) (y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut x) y) (@conjg gT y x))) *) by move=> x y nGx Gy; rewrite /= autE //= subgK. Qed. Lemma conj_autE : {in G &, forall x y, conj_aut x y = y ^ x}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun (x : FinGroup.arg_sort (FinGroup.base gT)) (y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut x) y) (@conjg gT y x)) (inPhantom (forall (x : FinGroup.arg_sort (FinGroup.base gT)) (y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut x) y) (@conjg gT y x))) *) by apply: sub_in11 norm_conj_autE => //; apply: subsetP (normG G). Qed. Lemma conj_aut_morphM : {in 'N(G) &, {morph conj_aut : x y / x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT G)))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (conj_aut ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => @mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) x0 y0) (conj_aut x) (conj_aut y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) conj_aut (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) => @mulg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT))) x y))) *) move=> x y nGx nGy; apply/permP=> z /=; rewrite permM. (* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut (@mulg (FinGroup.base gT) x y)) z) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut y) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut x) z)) *) case Gz: (z \in G); last by rewrite !permE /= !Gz. (* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut (@mulg (FinGroup.base gT) x y)) z) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut y) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut x) z)) *) by rewrite !norm_conj_autE // (conjgM, memJ_norm, groupM). Qed. Canonical conj_aut_morphism := Morphism conj_aut_morphM. Lemma ker_conj_aut : 'ker conj_aut = 'C(G). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT G)) conj_aut_morphism (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) conj_aut)) (@centraliser gT (@gval gT G)) *) apply/setP=> x; rewrite inE; case nGx: (x \in 'N(G)); last first. (* Goal: @eq bool (andb true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@preimset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT G)) conj_aut_morphism) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))))))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT G))))) *) (* Goal: @eq bool (andb false (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@preimset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT G)) conj_aut_morphism) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))))))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT G))))) *) by symmetry; apply/idP=> cGx; rewrite (subsetP (cent_sub G)) in nGx. (* Goal: @eq bool (andb true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@preimset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT G)) conj_aut_morphism) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))))))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT G))))) *) rewrite 2!inE /=; apply/eqP/centP=> [cx1 y Gy | cGx]. (* Goal: @eq (Equality.sort (Finite.eqType (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (conj_aut x) (oneg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) *) (* Goal: @commute (FinGroup.base gT) x y *) by rewrite /commute (conjgC y) -norm_conj_autE // cx1 perm1. (* Goal: @eq (Equality.sort (Finite.eqType (FinGroup.finType (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (conj_aut x) (oneg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) *) apply/permP=> y; case Gy: (y \in G); last by rewrite !permE Gy. (* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (conj_aut x) y) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (oneg (perm_of_baseFinGroupType (FinGroup.arg_finType (FinGroup.base gT)))) y) *) by rewrite perm1 norm_conj_autE // conjgE -cGx ?mulKg. Qed. Lemma Aut_conj_aut A : conj_aut @* A \subset Aut G. Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT)))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))))) (@morphim gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT G)) conj_aut_morphism (@MorPhantom gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) conj_aut) A))) (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT G))))) *) by apply/subsetP=> _ /imsetP[x _ ->]; apply: Aut_aut. Qed. End ConjugationMorphism. Arguments conjgm _ _%g. Prenex Implicits conjgm conj_aut. Reserved Notation "G \char H" (at level 70). Section Characteristicity. Variable gT : finGroupType. Implicit Types A B : {set gT}. Implicit Types G H K L : {group gT}. Definition characteristic A B := (A \subset B) && [forall f in Aut B, f @: A \subset A]. Infix "\char" := characteristic. Lemma charP H G : let fixH (f : {morphism G >-> gT}) := 'injm f -> f @* G = G -> f @* H = H in reflect [/\ H \subset G & forall f, fixH f] (H \char G). Proof. (* Goal: let fixH := fun f : @morphism_for gT gT (@gval gT G) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) (@gval gT G)) (@gval gT G)), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) (@gval gT H)) (@gval gT H) in Bool.reflect (and (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (forall f : @morphism_for gT gT (@gval gT G) (Phant (FinGroup.arg_sort (FinGroup.base gT))), fixH f)) (characteristic (@gval gT H) (@gval gT G)) *) do [apply: (iffP andP) => -[sHG chHG]; split] => // [f injf Gf|]. (* Goal: is_true (@FiniteQuant.quant0b (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => @FiniteQuant.all_in (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT G))))) (FiniteQuant.Quantified (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) f)) *) (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) (@gval gT H)) (@gval gT H) *) by apply/morphim_fixP; rewrite // -imset_autE ?(forall_inP chHG) ?Aut_aut. (* Goal: is_true (@FiniteQuant.quant0b (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => @FiniteQuant.all_in (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT G))))) (FiniteQuant.Quantified (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))) f)) *) apply/forall_inP=> f Af; rewrite -(autmE Af) -morphimEsub //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@morphim gT gT (@gval gT G) (@autm_morphism gT (@gval gT G) f Af) (@MorPhantom gT gT (@mfun gT gT (@gval gT G) (@autm_morphism gT (@gval gT G) f Af))) (@gval gT H)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) *) by rewrite chHG ?injm_autm ?im_autm. Qed. Lemma char1 G : 1 \char G. Proof. (* Goal: is_true (characteristic (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) *) by apply/charP; split=> [|f _ _]; rewrite (sub1G, morphim1). Qed. Lemma char_refl G : G \char G. Proof. (* Goal: is_true (characteristic (@gval gT G) (@gval gT G)) *) exact/charP. Qed. Lemma char_trans H G K : K \char H -> H \char G -> K \char G. Proof. (* Goal: forall (_ : is_true (characteristic (@gval gT K) (@gval gT H))) (_ : is_true (characteristic (@gval gT H) (@gval gT G))), is_true (characteristic (@gval gT K) (@gval gT G)) *) case/charP=> sKH chKH; case/charP=> sHG chHG. (* Goal: is_true (characteristic (@gval gT K) (@gval gT G)) *) apply/charP; split=> [|f injf Gf]; first exact: subset_trans sHG. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) (@gval gT K)) (@gval gT K) *) rewrite -{1}(setIidPr sKH) -(morphim_restrm sHG) chKH //. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT H) (@restrm_morphism gT gT (@gval gT H) (@gval gT G) sHG f) (@MorPhantom gT gT (@mfun gT gT (@gval gT H) (@restrm_morphism gT gT (@gval gT H) (@gval gT G) sHG f))) (@gval gT H)) (@gval gT H) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT gT (@gval gT H) (@restrm_morphism gT gT (@gval gT H) (@gval gT G) sHG f) (@MorPhantom gT gT (@mfun gT gT (@gval gT H) (@restrm_morphism gT gT (@gval gT H) (@gval gT G) sHG f)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *) by rewrite ker_restrm; move/trivgP: injf => ->; apply: subsetIr. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT H) (@restrm_morphism gT gT (@gval gT H) (@gval gT G) sHG f) (@MorPhantom gT gT (@mfun gT gT (@gval gT H) (@restrm_morphism gT gT (@gval gT H) (@gval gT G) sHG f))) (@gval gT H)) (@gval gT H) *) by rewrite morphim_restrm setIid chHG. Qed. Lemma char_norms H G : H \char G -> 'N(G) \subset 'N(H). Proof. (* Goal: forall _ : is_true (characteristic (@gval gT H) (@gval gT G)), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))) *) case/charP=> sHG chHG; apply/normsP=> x /normP-Nx. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (@gval gT H) x) (@gval gT H) *) have:= chHG [morphism of conjgm G x] => /=. (* Goal: forall _ : forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT gT (@gval gT G) (@Morphism gT gT (@gval gT G) (@conjgm gT (@gval gT G) x) (@in2W (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)) (fun y z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT (@mulg (FinGroup.base gT) y z) x) (@mulg (FinGroup.base gT) (@conjg gT y x) (@conjg gT z x))) (fun y z : FinGroup.arg_sort (FinGroup.base gT) => @conjMg gT y z x))) (@MorPhantom gT gT (@conjgm gT (@gval gT G) x))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@morphim gT gT (@gval gT G) (@Morphism gT gT (@gval gT G) (@conjgm gT (@gval gT G) x) (@in2W (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)) (fun y z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT (@mulg (FinGroup.base gT) y z) x) (@mulg (FinGroup.base gT) (@conjg gT y x) (@conjg gT z x))) (fun y z : FinGroup.arg_sort (FinGroup.base gT) => @conjMg gT y z x))) (@MorPhantom gT gT (@conjgm gT (@gval gT G) x)) (@gval gT G)) (@gval gT G)), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@morphim gT gT (@gval gT G) (@Morphism gT gT (@gval gT G) (@conjgm gT (@gval gT G) x) (@in2W (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)) (fun y z : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@conjg gT (@mulg (FinGroup.base gT) y z) x) (@mulg (FinGroup.base gT) (@conjg gT y x) (@conjg gT z x))) (fun y z : FinGroup.arg_sort (FinGroup.base gT) => @conjMg gT y z x))) (@MorPhantom gT gT (@conjgm gT (@gval gT G) x)) (@gval gT H)) (@gval gT H), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@conjugate gT (@gval gT H) x) (@gval gT H) *) by rewrite !morphimEsub //=; apply; rewrite // injm_conj. Qed. Lemma char_sub A B : A \char B -> A \subset B. Proof. (* Goal: forall _ : is_true (characteristic A B), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))) *) by case/andP. Qed. Lemma char_norm_trans H G A : H \char G -> A \subset 'N(G) -> A \subset 'N(H). Proof. (* Goal: forall (_ : is_true (characteristic (@gval gT H) (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT G)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))) *) by move/char_norms=> nHnG nGA; apply: subset_trans nHnG. Qed. Lemma char_normal_trans H G K : K \char H -> H <| G -> K <| G. Proof. (* Goal: forall (_ : is_true (characteristic (@gval gT K) (@gval gT H))) (_ : is_true (@normal gT (@gval gT H) (@gval gT G))), is_true (@normal gT (@gval gT K) (@gval gT G)) *) move=> chKH /andP[sHG nHG]. (* Goal: is_true (@normal gT (@gval gT K) (@gval gT G)) *) by rewrite /normal (subset_trans (char_sub chKH)) // (char_norm_trans chKH). Qed. Lemma char_normal H G : H \char G -> H <| G. Proof. (* Goal: forall _ : is_true (characteristic (@gval gT H) (@gval gT G)), is_true (@normal gT (@gval gT H) (@gval gT G)) *) by move/char_normal_trans; apply; apply/andP; rewrite normG. Qed. Lemma char_norm H G : H \char G -> G \subset 'N(H). Proof. (* Goal: forall _ : is_true (characteristic (@gval gT H) (@gval gT G)), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H))))) *) by case/char_normal/andP. Qed. Lemma charI G H K : H \char G -> K \char G -> H :&: K \char G. Proof. (* Goal: forall (_ : is_true (characteristic (@gval gT H) (@gval gT G))) (_ : is_true (characteristic (@gval gT K) (@gval gT G))), is_true (characteristic (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@gval gT G)) *) case/charP=> sHG chHG; case/charP=> _ chKG. (* Goal: is_true (characteristic (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@gval gT G)) *) apply/charP; split=> [|f injf Gf]; first by rewrite subIset // sHG. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) (@gval gT (@setI_group gT H K))) (@gval gT (@setI_group gT H K)) *) by rewrite morphimGI ?(chHG, chKG) //; apply: subset_trans (sub1G H). Qed. Lemma charY G H K : H \char G -> K \char G -> H <*> K \char G. Proof. (* Goal: forall (_ : is_true (characteristic (@gval gT H) (@gval gT G))) (_ : is_true (characteristic (@gval gT K) (@gval gT G))), is_true (characteristic (@joing gT (@gval gT H) (@gval gT K)) (@gval gT G)) *) case/charP=> sHG chHG; case/charP=> sKG chKG. (* Goal: is_true (characteristic (@joing gT (@gval gT H) (@gval gT K)) (@gval gT G)) *) apply/charP; split=> [|f injf Gf]; first by rewrite gen_subG subUset sHG. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) f (@MorPhantom gT gT (@mfun gT gT (@gval gT G) f)) (@gval gT (@joing_group gT (@gval gT H) (@gval gT K)))) (@gval gT (@joing_group gT (@gval gT H) (@gval gT K))) *) by rewrite morphim_gen ?(morphimU, subUset, sHG, chHG, chKG). Qed. Lemma charM G H K : H \char G -> K \char G -> H * K \char G. Proof. (* Goal: forall (_ : is_true (characteristic (@gval gT H) (@gval gT G))) (_ : is_true (characteristic (@gval gT K) (@gval gT G))), is_true (characteristic (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@gval gT G)) *) move=> chHG chKG; rewrite -norm_joinEl ?charY //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT K))))) *) exact: subset_trans (char_sub chHG) (char_norm chKG). Qed. Lemma lone_subgroup_char G H : H \subset G -> (forall K, K \subset G -> K \isog H -> K \subset H) -> H \char G. End Characteristicity. Arguments characteristic _ _%g _%g. Notation "H \char G" := (characteristic H G) : group_scope. Hint Resolve char_refl : core. Section InjmChar. Variables (aT rT : finGroupType) (D : {group aT}) (f : {morphism D >-> rT}). Hypothesis injf : 'injm f. Lemma injm_char (G H : {group aT}) : G \subset D -> H \char G -> f @* H \char f @* G. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@characteristic aT (@gval aT H) (@gval aT G))), is_true (@characteristic rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) move=> sGD /charP[sHG charH]. (* Goal: is_true (@characteristic rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) apply/charP; split=> [|g injg gfG]; first exact: morphimS. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H))) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H)) *) have /domP[h [_ ker_h _ im_h]]: 'dom (invm injf \o g \o f) = G. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H))) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H)) *) (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (@dom aT aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT (@morphpre_group rT rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) D)))) (@comp_morphism aT rT aT D (@morphpre_group rT rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) D)) f (@comp_morphism rT rT aT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G) (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) D) g (@invm_morphism aT rT D f injf))) (@MorPhantom aT aT (@funcomp (FinGroup.sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) tt (@funcomp (FinGroup.sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (FinGroup.arg_sort (FinGroup.base rT)) tt (@invm aT rT D f injf) (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@mfun aT rT (@gval aT D) f)))) (@gval aT G) *) by rewrite /dom /= -(morphpreIim g) (setIidPl _) ?injmK // gfG morphimS. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H))) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H)) *) have hH: h @* H = H. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H))) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H)) *) (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base aT))))) (@morphim aT aT (@gval aT G) h (@MorPhantom aT aT (@mfun aT aT (@gval aT G) h)) (@gval aT H)) (@gval aT H) *) apply: charH; first by rewrite ker_h !injm_comp ?injm_invm. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H))) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H)) *) (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base aT))))) (@morphim aT aT (@gval aT G) h (@MorPhantom aT aT (@mfun aT aT (@gval aT G) h)) (@gval aT G)) (@gval aT G) *) by rewrite im_h !morphim_comp gfG morphim_invm. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H))) (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) H)) *) rewrite /= -{2}hH im_h !morphim_comp morphim_invmE morphpreK //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g (@MorPhantom rT rT (@mfun rT rT (@gval rT (@morphim_group aT rT D f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) G)) g)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))) *) by rewrite (subset_trans _ (morphimS f sGD)) //= -{3}gfG !morphimS. Qed. End InjmChar. Section CharInjm. Variables (aT rT : finGroupType) (D : {group aT}) (f : {morphism D >-> rT}). Hypothesis injf : 'injm f. Lemma char_injm (G H : {group aT}) : G \subset D -> H \subset D -> (f @* H \char f @* G) = (H \char G). End CharInjm. Unset Implicit Arguments.
Require Import Arith. Require Import List. Import ListNotations. Require Import StructTact.StructTactics. Set Implicit Arguments. Lemma leb_false_lt : forall m n, leb m n = false -> n < m. Proof. (* Goal: forall (m n : nat) (_ : @eq bool (Nat.leb m n) false), lt n m *) induction m; intros. (* Goal: lt n (S m) *) (* Goal: lt n O *) - (* Goal: lt n O *) discriminate. (* BG Goal: lt n (S m) *) - (* Goal: lt n (S m) *) simpl in *. (* Goal: lt n (S m) *) break_match; subst; auto with arith. Qed. Lemma leb_true_le : forall m n, leb m n = true -> m <= n. Proof. (* Goal: forall (m n : nat) (_ : @eq bool (Nat.leb m n) true), le m n *) induction m; intros. (* Goal: le (S m) n *) (* Goal: le O n *) - (* Goal: le O n *) auto with arith. (* BG Goal: le (S m) n *) - (* Goal: le (S m) n *) simpl in *. (* Goal: le (S m) n *) break_match; subst; auto with arith. (* Goal: le (S m) O *) discriminate. Qed. Lemma ltb_false_le : forall m n, m <? n = false -> n <= m. Proof. (* Goal: forall (m n : nat) (_ : @eq bool (Nat.ltb m n) false), le n m *) induction m; intros; destruct n; try discriminate; auto with arith. Qed. Lemma ltb_true_lt : forall m n, m <? n = true -> m < n. Proof. (* Goal: forall (m n : nat) (_ : @eq bool (Nat.ltb m n) true), lt m n *) induction m; intros; destruct n; try discriminate; auto with arith. Qed. Ltac do_bool := repeat match goal with | [ H : beq_nat _ _ = true |- _ ] => apply beq_nat_true in H | [ H : beq_nat _ _ = false |- _ ] => apply beq_nat_false in H | [ H : andb _ _ = true |- _ ] => apply Bool.andb_true_iff in H | [ H : andb _ _ = false |- _ ] => apply Bool.andb_false_iff in H | [ H : orb _ _ = true |- _ ] => apply Bool.orb_prop in H | [ H : negb _ = true |- _ ] => apply Bool.negb_true_iff in H | [ H : negb _ = false |- _ ] => apply Bool.negb_false_iff in H | [ H : PeanoNat.Nat.ltb _ _ = true |- _ ] => apply ltb_true_lt in H | [ H : PeanoNat.Nat.ltb _ _ = false |- _ ] => apply ltb_false_le in H | [ H : leb _ _ = true |- _ ] => apply leb_true_le in H | [ H : leb _ _ = false |- _ ] => apply leb_false_lt in H | [ |- andb _ _ = true ]=> apply Bool.andb_true_iff | [ |- andb _ _ = false ] => apply Bool.andb_false_iff | [ |- leb _ _ = true ] => apply leb_correct | [ |- _ <> false ] => apply Bool.not_false_iff_true | [ |- beq_nat _ _ = false ] => apply beq_nat_false_iff | [ |- beq_nat _ _ = true ] => apply beq_nat_true_iff end. Definition null {A : Type} (xs : list A) : bool := match xs with | [] => true | _ => false end. Lemma null_sound : forall A (l : list A), null l = true -> l = []. Proof. (* Goal: forall (A : Type) (l : list A) (_ : @eq bool (@null A l) true), @eq (list A) l (@nil A) *) destruct l; simpl in *; auto; discriminate. Qed. Lemma null_false_neq_nil : forall A (l : list A), null l = false -> l <> []. Proof. (* Goal: forall (A : Type) (l : list A) (_ : @eq bool (@null A l) false), not (@eq (list A) l (@nil A)) *) destruct l; simpl in *; auto; discriminate. Qed.
Require Export GeoCoq.Tarski_dev.Ch14_sum. Section T14_prod. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma prod_to_prodp : forall O E E' A B C, Prod O E E' A B C -> Prodp O E E' A B C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Prod Tn O E E' A B C), @Prodp Tn O E E' A B C *) intros. (* Goal: @Prodp Tn O E E' A B C *) unfold Prod in H. (* Goal: @Prodp Tn O E E' A B C *) spliter. (* Goal: @Prodp Tn O E E' A B C *) unfold Prodp. (* Goal: and (@Col Tn O E A) (and (@Col Tn O E B) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E')))) *) ex_and H0 B'. (* Goal: and (@Col Tn O E A) (and (@Col Tn O E B) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E')))) *) unfold Ar2 in H. (* Goal: and (@Col Tn O E A) (and (@Col Tn O E B) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E')))) *) spliter. (* Goal: and (@Col Tn O E A) (and (@Col Tn O E B) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E')))) *) assert(O <> E' /\ E <> E'). (* Goal: and (@Col Tn O E A) (and (@Col Tn O E B) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E')))) *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (not (@eq (@Tpoint Tn) E E')) *) split; intro; apply H; subst E'; Col. (* Goal: and (@Col Tn O E A) (and (@Col Tn O E B) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E')))) *) repeat split; try Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E')) *) exists B'. (* Goal: and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E') *) spliter. (* Goal: and (@Proj Tn B B' O E' E E') (@Proj Tn B' C O E A E') *) split. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: @Proj Tn B B' O E' E E' *) apply(pj_col_project B B' O E' E E'); Col. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: not (@Par Tn O E' E E') *) intro. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: False *) induction H8. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: False *) (* Goal: False *) apply H8. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E') (@Col Tn X E E')) *) exists E'. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: False *) (* Goal: and (@Col Tn E' O E') (@Col Tn E' E E') *) split; Col. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: False *) apply H. (* Goal: @Proj Tn B' C O E A E' *) (* Goal: @Col Tn O E E' *) tauto. (* Goal: @Proj Tn B' C O E A E' *) apply(pj_col_project B' C O E A E'); Col. (* Goal: @Pj Tn A E' B' C *) (* Goal: not (@Par Tn O E A E') *) (* Goal: not (@eq (@Tpoint Tn) A E') *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @Pj Tn A E' B' C *) (* Goal: not (@Par Tn O E A E') *) (* Goal: not (@eq (@Tpoint Tn) A E') *) (* Goal: False *) subst E. (* Goal: @Pj Tn A E' B' C *) (* Goal: not (@Par Tn O E A E') *) (* Goal: not (@eq (@Tpoint Tn) A E') *) (* Goal: False *) apply H; Col. (* Goal: @Pj Tn A E' B' C *) (* Goal: not (@Par Tn O E A E') *) (* Goal: not (@eq (@Tpoint Tn) A E') *) intro. (* Goal: @Pj Tn A E' B' C *) (* Goal: not (@Par Tn O E A E') *) (* Goal: False *) subst E'. (* Goal: @Pj Tn A E' B' C *) (* Goal: not (@Par Tn O E A E') *) (* Goal: False *) contradiction. (* Goal: @Pj Tn A E' B' C *) (* Goal: not (@Par Tn O E A E') *) intro. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) induction(eq_dec_points O A). (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) subst A. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) induction H8. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H8. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O E')) *) exists O. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) induction H8. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: False *) apply H8. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X A E')) *) exists A. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) (* Goal: and (@Col Tn A O E) (@Col Tn A A E') *) split; Col. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) spliter. (* Goal: @Pj Tn A E' B' C *) (* Goal: False *) apply H. (* Goal: @Pj Tn A E' B' C *) (* Goal: @Col Tn O E E' *) apply (col_transitivity_1 _ A); Col. (* Goal: @Pj Tn A E' B' C *) unfold Pj in *. (* Goal: or (@Par Tn A E' B' C) (@eq (@Tpoint Tn) B' C) *) induction H2. (* Goal: or (@Par Tn A E' B' C) (@eq (@Tpoint Tn) B' C) *) (* Goal: or (@Par Tn A E' B' C) (@eq (@Tpoint Tn) B' C) *) left. (* Goal: or (@Par Tn A E' B' C) (@eq (@Tpoint Tn) B' C) *) (* Goal: @Par Tn A E' B' C *) apply par_left_comm. (* Goal: or (@Par Tn A E' B' C) (@eq (@Tpoint Tn) B' C) *) (* Goal: @Par Tn E' A B' C *) assumption. (* Goal: or (@Par Tn A E' B' C) (@eq (@Tpoint Tn) B' C) *) right; auto. Qed. Lemma project_pj : forall P P' A B X Y, Proj P P' A B X Y -> Pj X Y P P'. Proof. (* Goal: forall (P P' A B X Y : @Tpoint Tn) (_ : @Proj Tn P P' A B X Y), @Pj Tn X Y P P' *) intros. (* Goal: @Pj Tn X Y P P' *) unfold Proj in H. (* Goal: @Pj Tn X Y P P' *) spliter. (* Goal: @Pj Tn X Y P P' *) unfold Pj. (* Goal: or (@Par Tn X Y P P') (@eq (@Tpoint Tn) P P') *) induction H3. (* Goal: or (@Par Tn X Y P P') (@eq (@Tpoint Tn) P P') *) (* Goal: or (@Par Tn X Y P P') (@eq (@Tpoint Tn) P P') *) left. (* Goal: or (@Par Tn X Y P P') (@eq (@Tpoint Tn) P P') *) (* Goal: @Par Tn X Y P P' *) apply par_symmetry. (* Goal: or (@Par Tn X Y P P') (@eq (@Tpoint Tn) P P') *) (* Goal: @Par Tn P P' X Y *) auto. (* Goal: or (@Par Tn X Y P P') (@eq (@Tpoint Tn) P P') *) right. (* Goal: @eq (@Tpoint Tn) P P' *) auto. Qed. Lemma prodp_to_prod : forall O E E' A B C, Prodp O E E' A B C -> Prod O E E' A B C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Prodp Tn O E E' A B C), @Prod Tn O E E' A B C *) intros. (* Goal: @Prod Tn O E E' A B C *) unfold Prodp in H. (* Goal: @Prod Tn O E E' A B C *) spliter. (* Goal: @Prod Tn O E E' A B C *) ex_and H1 B'. (* Goal: @Prod Tn O E E' A B C *) unfold Prod. (* Goal: and (@Ar2 Tn O E E' A B C) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C)))) *) split. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: @Ar2 Tn O E E' A B C *) unfold Ar2. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (@Col Tn O E C))) *) unfold Proj in *. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (@Col Tn O E C))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (@Col Tn O E C))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: not (@Col Tn O E E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: False *) apply H8. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: @Par Tn O E' E E' *) right. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: and (not (@eq (@Tpoint Tn) O E')) (and (not (@eq (@Tpoint Tn) E E')) (and (@Col Tn O E E') (@Col Tn E' E E'))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) exists B'. (* Goal: and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C)) *) repeat split. (* Goal: @Pj Tn E' A B' C *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' B B' *) eapply (project_pj _ _ O E'); auto. (* Goal: @Pj Tn E' A B' C *) (* Goal: @Col Tn O E' B' *) unfold Proj in H1. (* Goal: @Pj Tn E' A B' C *) (* Goal: @Col Tn O E' B' *) tauto. (* Goal: @Pj Tn E' A B' C *) eapply (project_pj _ _ O E); auto. (* Goal: @Proj Tn B' C O E E' A *) unfold Proj. (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) E' A)) (and (not (@Par Tn O E E' A)) (and (@Col Tn O E C) (or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C))))) *) unfold Proj in H2. (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) E' A)) (and (not (@Par Tn O E E' A)) (and (@Col Tn O E C) (or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C))))) *) spliter. (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) E' A)) (and (not (@Par Tn O E E' A)) (and (@Col Tn O E C) (or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C))))) *) repeat split; Col. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: not (@Par Tn O E E' A) *) intro. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: False *) induction H7. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: False *) (* Goal: False *) apply H7. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X E' A)) *) exists A. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: False *) (* Goal: and (@Col Tn A O E) (@Col Tn A E' A) *) split; Col. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: False *) spliter. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: False *) apply H4. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: @Par Tn O E A E' *) right. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) A E')) (and (@Col Tn O A E') (@Col Tn E A E'))) *) repeat split; Col. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) induction H6. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) left. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: @Par Tn B' C E' A *) apply par_right_comm. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) (* Goal: @Par Tn B' C A E' *) auto. (* Goal: or (@Par Tn B' C E' A) (@eq (@Tpoint Tn) B' C) *) right. (* Goal: @eq (@Tpoint Tn) B' C *) auto; intro. Qed. Section Grid. Variable O E E' : Tpoint. Variable grid_ok : ~ Col O E E'. Lemma prod_exists : forall A B, Col O E A -> Col O E B -> exists C, Prod O E E' A B C. Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : @Col Tn O E A) (_ : @Col Tn O E B), @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) intros. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) assert(NC:=grid_ok). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) assert(exists! B' : Tpoint, Proj B B' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun B' : @Tpoint Tn => @Proj Tn B B' O E' E E')) *) apply(project_existence B O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) E E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) subst E'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: @Col Tn O E E *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: False *) subst E'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) (* Goal: @Col Tn O E O *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) induction H1. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X O E')) *) exists E'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) ex_and H1 B'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) unfold unique in H2. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) assert(exists! C, Proj B' C O E E' A). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun C : @Tpoint Tn => @Proj Tn B' C O E E' A)) *) apply(project_existence B' O E E' A). (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@eq (@Tpoint Tn) E' A) *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) subst E'. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: @Col Tn O E A *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: False *) subst E. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: @Col Tn O O E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: not (@Par Tn E' A O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) induction H3. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' A) (@Col Tn X O E)) *) exists A. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) (* Goal: and (@Col Tn A E' A) (@Col Tn A O E) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: False *) apply NC. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) ex_and H3 C. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) unfold unique in H4. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Prod Tn O E E' A B C) *) exists C. (* Goal: @Prod Tn O E E' A B C *) unfold Prod. (* Goal: and (@Ar2 Tn O E E' A B C) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: @Col Tn O E C *) unfold Proj in H3. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) (* Goal: @Col Tn O E C *) tauto. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C))) *) exists B'. (* Goal: and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' C)) *) repeat split. (* Goal: @Pj Tn E' A B' C *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' B B' *) apply (project_pj B B' O E'). (* Goal: @Pj Tn E' A B' C *) (* Goal: @Col Tn O E' B' *) (* Goal: @Proj Tn B B' O E' E E' *) auto. (* Goal: @Pj Tn E' A B' C *) (* Goal: @Col Tn O E' B' *) unfold Proj in H1. (* Goal: @Pj Tn E' A B' C *) (* Goal: @Col Tn O E' B' *) tauto. (* Goal: @Pj Tn E' A B' C *) apply (project_pj B' C O E). (* Goal: @Proj Tn B' C O E E' A *) assumption. Qed. Lemma prod_uniqueness : forall A B C1 C2, Prod O E E' A B C1 -> Prod O E E' A B C2 -> C1 = C2. Proof. (* Goal: forall (A B C1 C2 : @Tpoint Tn) (_ : @Prod Tn O E E' A B C1) (_ : @Prod Tn O E E' A B C2), @eq (@Tpoint Tn) C1 C2 *) intros. (* Goal: @eq (@Tpoint Tn) C1 C2 *) apply prod_to_prodp in H. (* Goal: @eq (@Tpoint Tn) C1 C2 *) apply prod_to_prodp in H0. (* Goal: @eq (@Tpoint Tn) C1 C2 *) unfold Prodp in *. (* Goal: @eq (@Tpoint Tn) C1 C2 *) spliter. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H4 B'. (* Goal: @eq (@Tpoint Tn) C1 C2 *) ex_and H2 B''. (* Goal: @eq (@Tpoint Tn) C1 C2 *) assert(B'=B''). (* Goal: @eq (@Tpoint Tn) C1 C2 *) (* Goal: @eq (@Tpoint Tn) B' B'' *) eapply (project_uniqueness B B' B'' O E' E E'); auto; unfold Prod in H. (* Goal: @eq (@Tpoint Tn) C1 C2 *) subst B''. (* Goal: @eq (@Tpoint Tn) C1 C2 *) eapply (project_uniqueness B' C1 C2 O E A E'); auto. Qed. End Grid. Lemma prod_0_l : forall O E E' A, ~ Col O E E' -> Col O E A -> Prod O E E' O A O. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A), @Prod Tn O E E' O A O *) intros. (* Goal: @Prod Tn O E E' O A O *) unfold Prod. (* Goal: and (@Ar2 Tn O E E' O A O) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) assert(HH:=(grid_not_par O E E' H)). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) induction(eq_dec_points A O). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' O B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (@Pj Tn E' O O O)) *) repeat split; try (apply pj_trivial). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: @Col Tn O E' O *) Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) assert(exists ! P' : Tpoint, Proj A P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn A P' O E' E E')) *) apply(project_existence A O E' E E' H6 H5). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: False *) apply H3. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) ex_and H8 B'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) unfold unique in H9. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) clear H9. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) unfold Proj in H8. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O))) *) exists B'. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' O B' O)) *) repeat split. (* Goal: @Pj Tn E' O B' O *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' A B' *) induction H12. (* Goal: @Pj Tn E' O B' O *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' A B' *) (* Goal: @Pj Tn E E' A B' *) left. (* Goal: @Pj Tn E' O B' O *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' A B' *) (* Goal: @Par Tn E E' A B' *) Par. (* Goal: @Pj Tn E' O B' O *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' A B' *) right. (* Goal: @Pj Tn E' O B' O *) (* Goal: @Col Tn O E' B' *) (* Goal: @eq (@Tpoint Tn) A B' *) assumption. (* Goal: @Pj Tn E' O B' O *) (* Goal: @Col Tn O E' B' *) Col. (* Goal: @Pj Tn E' O B' O *) left. (* Goal: @Par Tn E' O B' O *) right. (* Goal: and (not (@eq (@Tpoint Tn) E' O)) (and (not (@eq (@Tpoint Tn) B' O)) (and (@Col Tn E' B' O) (@Col Tn O B' O))) *) repeat split; Col. (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: False *) subst B'. (* Goal: False *) induction H12. (* Goal: False *) (* Goal: False *) induction H12. (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H12. (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X E E')) *) exists E. (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E') *) split; Col. (* Goal: False *) (* Goal: False *) spliter. (* Goal: False *) (* Goal: False *) contradiction. (* Goal: False *) contradiction. Qed. Lemma prod_0_r : forall O E E' A, ~ Col O E E' -> Col O E A -> Prod O E E' A O O. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A), @Prod Tn O E E' A O O *) intros. (* Goal: @Prod Tn O E E' A O O *) unfold Prod. (* Goal: and (@Ar2 Tn O E E' A O O) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' O B') (and (@Col Tn O E' B') (@Pj Tn E' A B' O)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' O B') (and (@Col Tn O E' B') (@Pj Tn E' A B' O))) *) exists O. (* Goal: and (@Pj Tn E E' O O) (and (@Col Tn O E' O) (@Pj Tn E' A O O)) *) repeat split; try (apply pj_trivial). (* Goal: @Col Tn O E' O *) Col. Qed. Lemma prod_1_l : forall O E E' A, ~ Col O E E' -> Col O E A -> Prod O E E' E A A. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A), @Prod Tn O E E' E A A *) intros. (* Goal: @Prod Tn O E E' E A A *) unfold Prod. (* Goal: and (@Ar2 Tn O E E' E A A) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) assert(HH:=(grid_not_par O E E' H)). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) assert(exists ! P' : Tpoint, Proj A P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn A P' O E' E E')) *) apply(project_existence A O E' E E' H6 H5). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) (* Goal: False *) apply H3. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) ex_and H7 B'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) unfold unique in H8. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) clear H8. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) unfold Proj in H7. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A))) *) exists B'. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)) *) induction H11. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)) *) (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)) *) repeat split. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)) *) (* Goal: @Pj Tn E' E B' A *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' A B' *) left; Par. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)) *) (* Goal: @Pj Tn E' E B' A *) (* Goal: @Col Tn O E' B' *) Col. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)) *) (* Goal: @Pj Tn E' E B' A *) left; Par. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' E B' A)) *) subst B'. (* Goal: and (@Pj Tn E E' A A) (and (@Col Tn O E' A) (@Pj Tn E' E A A)) *) repeat split; try(apply pj_trivial). (* Goal: @Col Tn O E' A *) Col. Qed. Lemma prod_1_r : forall O E E' A, ~ Col O E E' -> Col O E A -> Prod O E E' A E A. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A), @Prod Tn O E E' A E A *) intros. (* Goal: @Prod Tn O E E' A E A *) unfold Prod. (* Goal: and (@Ar2 Tn O E E' A E A) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' E B') (and (@Col Tn O E' B') (@Pj Tn E' A B' A)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' E B') (and (@Col Tn O E' B') (@Pj Tn E' A B' A))) *) exists E'. (* Goal: and (@Pj Tn E E' E E') (and (@Col Tn O E' E') (@Pj Tn E' A E' A)) *) assert(HH:=(grid_not_par O E E' H)). (* Goal: and (@Pj Tn E E' E E') (and (@Col Tn O E' E') (@Pj Tn E' A E' A)) *) spliter. (* Goal: and (@Pj Tn E E' E E') (and (@Col Tn O E' E') (@Pj Tn E' A E' A)) *) repeat split. (* Goal: @Pj Tn E' A E' A *) (* Goal: @Col Tn O E' E' *) (* Goal: @Pj Tn E E' E E' *) left. (* Goal: @Pj Tn E' A E' A *) (* Goal: @Col Tn O E' E' *) (* Goal: @Par Tn E E' E E' *) right. (* Goal: @Pj Tn E' A E' A *) (* Goal: @Col Tn O E' E' *) (* Goal: and (not (@eq (@Tpoint Tn) E E')) (and (not (@eq (@Tpoint Tn) E E')) (and (@Col Tn E E E') (@Col Tn E' E E'))) *) repeat split; Col. (* Goal: @Pj Tn E' A E' A *) (* Goal: @Col Tn O E' E' *) Col. (* Goal: @Pj Tn E' A E' A *) left. (* Goal: @Par Tn E' A E' A *) assert(E' <> A). (* Goal: @Par Tn E' A E' A *) (* Goal: not (@eq (@Tpoint Tn) E' A) *) intro. (* Goal: @Par Tn E' A E' A *) (* Goal: False *) subst A. (* Goal: @Par Tn E' A E' A *) (* Goal: False *) contradiction. (* Goal: @Par Tn E' A E' A *) right. (* Goal: and (not (@eq (@Tpoint Tn) E' A)) (and (not (@eq (@Tpoint Tn) E' A)) (and (@Col Tn E' E' A) (@Col Tn A E' A))) *) repeat split; Col. Qed. Lemma inv_exists : forall O E E' A, ~ Col O E E' -> Col O E A -> A <> O -> exists IA, Prod O E E' IA A E. Proof. (* Goal: forall (O E E' A : @Tpoint Tn) (_ : not (@Col Tn O E E')) (_ : @Col Tn O E A) (_ : not (@eq (@Tpoint Tn) A O)), @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => @Prod Tn O E E' IA A E) *) intros. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => @Prod Tn O E E' IA A E) *) unfold Prod. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) assert(HH:=(grid_not_par O E E' H)). (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) assert(exists ! P' : Tpoint, Proj A P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn A P' O E' E E')) *) apply(project_existence A O E' E E' H7 H6). (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) apply H4. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) ex_and H8 B'. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) unfold unique in H9. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) clear H9. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) unfold Proj in H8. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) assert(B' <> O). (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) induction H12. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: False *) induction H12. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H12. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X E E')) *) exists E. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E A O) (@Col Tn E E E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) assert(exists ! P' : Tpoint, Proj E' P' O E B' E). (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn E' P' O E B' E)) *) apply(project_existence E' O E B' E); auto. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: not (@Par Tn B' E O E) *) (* Goal: not (@eq (@Tpoint Tn) B' E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: not (@Par Tn B' E O E) *) (* Goal: False *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: not (@Par Tn B' E O E) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: not (@Par Tn B' E O E) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: not (@Par Tn B' E O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) induction H14. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: False *) apply H14. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B' E) (@Col Tn X O E)) *) exists E. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) (* Goal: and (@Col Tn E B' E) (@Col Tn E O E) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) ex_and H14 IA. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) unfold unique in H15. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) clear H15. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) unfold Proj in H14. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun IA : @Tpoint Tn => and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))))) *) exists IA. (* Goal: and (@Ar2 Tn O E E' IA A E) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E))) *) exists B'. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) assert(Par A B' E E'). (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) (* Goal: @Par Tn A B' E E' *) induction H12. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) (* Goal: @Par Tn A B' E E' *) (* Goal: @Par Tn A B' E E' *) Par. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) (* Goal: @Par Tn A B' E E' *) subst B'. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) (* Goal: @Par Tn A A E E' *) apply False_ind. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) (* Goal: False *) apply H16. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) (* Goal: @Par Tn O E A E *) right. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) (* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (not (@eq (@Tpoint Tn) A E)) (and (@Col Tn O A E) (@Col Tn E A E))) *) repeat split; Col. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) clear H12. (* Goal: and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' IA B' E)) *) repeat split. (* Goal: @Pj Tn E' IA B' E *) (* Goal: @Col Tn O E' B' *) (* Goal: @Pj Tn E E' A B' *) left. (* Goal: @Pj Tn E' IA B' E *) (* Goal: @Col Tn O E' B' *) (* Goal: @Par Tn E E' A B' *) Par. (* Goal: @Pj Tn E' IA B' E *) (* Goal: @Col Tn O E' B' *) Col. (* Goal: @Pj Tn E' IA B' E *) induction H18. (* Goal: @Pj Tn E' IA B' E *) (* Goal: @Pj Tn E' IA B' E *) left. (* Goal: @Pj Tn E' IA B' E *) (* Goal: @Par Tn E' IA B' E *) Par. (* Goal: @Pj Tn E' IA B' E *) subst IA. (* Goal: @Pj Tn E' E' B' E *) contradiction. Qed. Lemma prod_null : forall O E E' A B, Prod O E E' A B O -> A = O \/ B = O. Proof. (* Goal: forall (O E E' A B : @Tpoint Tn) (_ : @Prod Tn O E E' A B O), or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) intros. (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) unfold Prod in H. (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) spliter. (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) ex_and H0 B'. (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) induction(eq_dec_points B O). (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) right. (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) (* Goal: @eq (@Tpoint Tn) B O *) assumption. (* Goal: or (@eq (@Tpoint Tn) A O) (@eq (@Tpoint Tn) B O) *) left. (* Goal: @eq (@Tpoint Tn) A O *) unfold Ar2 in H. (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) unfold Pj in *. (* Goal: @eq (@Tpoint Tn) A O *) induction H0; induction H2. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) induction H2. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H2. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' A) (@Col Tn X B' O)) *) exists E'. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: and (@Col Tn E' E' A) (@Col Tn E' B' O) *) split; Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply(l6_21 O E B' O); Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: not (@Col Tn O E B') *) intro. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) subst B'. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) induction H0. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X B O)) *) exists E. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: and (@Col Tn E E E') (@Col Tn E B O) *) split; Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H3. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) B O *) apply (l6_21 O E E' O); Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: not (@eq (@Tpoint Tn) E' O) *) intro. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) subst E'. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn O E O *) Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) subst B'. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) induction H2. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' A) (@Col Tn X B O)) *) exists A. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: and (@Col Tn A E' A) (@Col Tn A B O) *) split; Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn A B O *) apply (col3 O E); Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: not (@eq (@Tpoint Tn) O E) *) intro. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) subst E. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H; Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) spliter. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H2. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) B O *) apply (l6_21 O E E' O); Col. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: not (@eq (@Tpoint Tn) E' O) *) intro. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) subst E'. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: False *) apply H. (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @Col Tn O E O *) Col. (* Goal: @eq (@Tpoint Tn) A O *) subst B'. (* Goal: @eq (@Tpoint Tn) A O *) contradiction. Qed. Lemma prod_y_axis_change : forall O E E' E'' A B C, Prod O E E' A B C -> ~ Col O E E'' -> Prod O E E'' A B C. Proof. (* Goal: forall (O E E' E'' A B C : @Tpoint Tn) (_ : @Prod Tn O E E' A B C) (_ : not (@Col Tn O E E'')), @Prod Tn O E E'' A B C *) intros. (* Goal: @Prod Tn O E E'' A B C *) assert(HP:=H). (* Goal: @Prod Tn O E E'' A B C *) unfold Prod in H. (* Goal: @Prod Tn O E E'' A B C *) spliter. (* Goal: @Prod Tn O E E'' A B C *) unfold Ar2 in H. (* Goal: @Prod Tn O E E'' A B C *) spliter. (* Goal: @Prod Tn O E E'' A B C *) assert(HH:=grid_not_par O E E' H ). (* Goal: @Prod Tn O E E'' A B C *) spliter. (* Goal: @Prod Tn O E E'' A B C *) ex_and H1 B'. (* Goal: @Prod Tn O E E'' A B C *) induction(eq_dec_points B O). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' A B C *) subst B. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' A O C *) assert(Prod O E E' A O O). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' A O C *) (* Goal: @Prod Tn O E E' A O O *) apply(prod_0_r); Col. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' A O C *) assert(HH:= prod_uniqueness O E E' A O C O HP H13). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' A O C *) subst C. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' A O O *) apply prod_0_r; Col. (* Goal: @Prod Tn O E E'' A B C *) induction(eq_dec_points A O). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' A B C *) subst A. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' O B C *) assert(Prod O E E' O B O). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' O B C *) (* Goal: @Prod Tn O E E' O B O *) apply(prod_0_l); Col. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' O B C *) assert(HH:= prod_uniqueness O E E' O B O C H14 HP). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' O B C *) subst C. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Prod Tn O E E'' O B O *) apply(prod_0_l); Col. (* Goal: @Prod Tn O E E'' A B C *) assert(C <> O). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@eq (@Tpoint Tn) C O) *) intro. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) subst C. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) apply prod_null in HP. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) induction HP; contradiction. (* Goal: @Prod Tn O E E'' A B C *) assert(exists ! P' : Tpoint, Proj B P' O E'' E E''). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn B P' O E'' E E'')) *) apply(project_existence B O E'' E E''). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@Par Tn E E'' O E'') *) (* Goal: not (@eq (@Tpoint Tn) O E'') *) (* Goal: not (@eq (@Tpoint Tn) E E'') *) intro. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@Par Tn E E'' O E'') *) (* Goal: not (@eq (@Tpoint Tn) O E'') *) (* Goal: False *) subst E''. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@Par Tn E E'' O E'') *) (* Goal: not (@eq (@Tpoint Tn) O E'') *) (* Goal: False *) apply H0; Col. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@Par Tn E E'' O E'') *) (* Goal: not (@eq (@Tpoint Tn) O E'') *) intro. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@Par Tn E E'' O E'') *) (* Goal: False *) subst E''. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@Par Tn E E'' O E'') *) (* Goal: False *) apply H0; Col. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: not (@Par Tn E E'' O E'') *) intro. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) induction H16. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) (* Goal: False *) apply H16. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E'') (@Col Tn X O E'')) *) exists E''. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) (* Goal: and (@Col Tn E'' E E'') (@Col Tn E'' O E'') *) split; Col. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) spliter. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) apply H0. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Col Tn O E E'' *) Col. (* Goal: @Prod Tn O E E'' A B C *) ex_and H16 B''. (* Goal: @Prod Tn O E E'' A B C *) unfold unique in H17. (* Goal: @Prod Tn O E E'' A B C *) spliter. (* Goal: @Prod Tn O E E'' A B C *) clear H17. (* Goal: @Prod Tn O E E'' A B C *) unfold Proj in H16. (* Goal: @Prod Tn O E E'' A B C *) spliter. (* Goal: @Prod Tn O E E'' A B C *) assert(Par B B'' E E''). (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Par Tn B B'' E E'' *) induction H20. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Par Tn B B'' E E'' *) (* Goal: @Par Tn B B'' E E'' *) Par. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Par Tn B B'' E E'' *) subst B''. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Par Tn B B E E'' *) apply False_ind. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: False *) apply H0. (* Goal: @Prod Tn O E E'' A B C *) (* Goal: @Col Tn O E E'' *) ColR. (* Goal: @Prod Tn O E E'' A B C *) clear H20. (* Goal: @Prod Tn O E E'' A B C *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E'' B B') (and (@Col Tn O E'' B') (@Pj Tn E'' A B' C))) *) exists B''. (* Goal: and (@Pj Tn E E'' B B'') (and (@Col Tn O E'' B'') (@Pj Tn E'' A B'' C)) *) repeat split. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E'' B'' *) (* Goal: @Pj Tn E E'' B B'' *) left; Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E'' B'' *) Col. (* Goal: @Pj Tn E'' A B'' C *) assert(Par E' A B' C). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E' A B' C *) induction H12. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E' A B' C *) (* Goal: @Par Tn E' A B' C *) assumption. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E' A B' C *) subst B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E' A C C *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) clear H12. (* Goal: @Pj Tn E'' A B'' C *) induction(eq_dec_points B E). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) subst B. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(B'' = E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) induction H21. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) (* Goal: False *) apply H12. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E B'') (@Col Tn X E E'')) *) exists E. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) (* Goal: and (@Col Tn E E B'') (@Col Tn E E E'') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) B'' E'' *) apply(l6_21 O E'' E E''); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) subst B''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A E'' C *) assert(C = A). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A E'' C *) (* Goal: @eq (@Tpoint Tn) C A *) assert(Prod O E E' A E A). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A E'' C *) (* Goal: @eq (@Tpoint Tn) C A *) (* Goal: @Prod Tn O E E' A E A *) apply(prod_1_r); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A E'' C *) (* Goal: @eq (@Tpoint Tn) C A *) eapply (prod_uniqueness O E E' A E); auto. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A E'' C *) subst C. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A E'' A *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' A E'' A *) right. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: and (not (@eq (@Tpoint Tn) E'' A)) (and (not (@eq (@Tpoint Tn) E'' A)) (and (@Col Tn E'' E'' A) (@Col Tn A E'' A))) *) repeat split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) (* Goal: False *) subst E''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) (* Goal: False *) apply H18. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) (* Goal: @Par Tn O A E A *) right. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) (* Goal: and (not (@eq (@Tpoint Tn) O A)) (and (not (@eq (@Tpoint Tn) E A)) (and (@Col Tn O E A) (@Col Tn A E A))) *) repeat split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst E''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H18. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn O A E A *) right. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: and (not (@eq (@Tpoint Tn) O A)) (and (not (@eq (@Tpoint Tn) E A)) (and (@Col Tn O E A) (@Col Tn A E A))) *) repeat split; Col. (* Goal: @Pj Tn E'' A B'' C *) assert(Par_strict B B'' E E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn B B'' E E'' *) induction H21. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn B B'' E E'' *) (* Goal: @Par_strict Tn B B'' E E'' *) assumption. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn B B'' E E'' *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn B B'' E E'' *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H0. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E E'' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) assert(Par E E' B B'). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E' B B' *) induction H1. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E' B B' *) (* Goal: @Par Tn E E' B B' *) assumption. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E' B B' *) subst B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E' B B *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) clear H1. (* Goal: @Pj Tn E'' A B'' C *) assert(Par_strict E E' B B'). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E E' B B' *) induction H23. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E E' B B' *) (* Goal: @Par_strict Tn E E' B B' *) assumption. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E E' B B' *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E E' B B' *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) assert(Par_strict E' A B' C). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' A B' C *) induction H20. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' A B' C *) (* Goal: @Par_strict Tn E' A B' C *) assumption. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' A B' C *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' A B' C *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) assert(B' <> E'). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) B' E') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) (* Goal: False *) subst B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X B E')) *) exists E'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' B E') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) induction(eq_dec_points A E). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) subst A. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' E B'' C *) assert(Prod O E E' E B B). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' E B'' C *) (* Goal: @Prod Tn O E E' E B B *) apply prod_1_l; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' E B'' C *) assert(B = C). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' E B'' C *) (* Goal: @eq (@Tpoint Tn) B C *) apply (prod_uniqueness O E E' E B); auto. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' E B'' C *) subst C. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' E B'' B *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' E B'' B *) Par. (* Goal: @Pj Tn E'' A B'' C *) assert(B' <> O). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H5. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ B); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O B E *) Col. (* Goal: @Pj Tn E'' A B'' C *) induction(eq_dec_points E' E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) subst E''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) assert(Par B B' B B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: @Par Tn B B' B B'' *) apply (par_trans _ _ E E'); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) induction H27. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: False *) apply H27. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X B B'')) *) exists B. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: and (@Col Tn B B B') (@Col Tn B B B'') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) assert(B' = B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: @eq (@Tpoint Tn) B' B'' *) apply (l6_21 B B' O E'); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: not (@Col Tn B B' O) *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: False *) apply H. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B'' C *) subst B''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E' A B' C *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E' A B' C *) Par. (* Goal: @Pj Tn E'' A B'' C *) induction(col_dec E E' E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(~Col E' E'' A). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@Col Tn E' E'' A) *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H25. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) A E *) apply (l6_21 O E E' E''); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(B' <> B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B' B'') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst B''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H27. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) E' E'' *) apply(l6_21 O E' B B'); try ColR. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: not (@Col Tn O E' B) *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: False *) apply H. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply par_distinct in H21. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) tauto. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(Par E' E'' B' B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E' E'' B' B'' *) apply par_comm. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' E' B'' B' *) apply (par_col_par _ _ _ B); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @Par Tn E'' E' B'' B *) apply par_symmetry. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @Par Tn B'' B E'' E' *) apply (par_col_par _ _ _ E); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @Par Tn B'' B E'' E *) Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) assert(Par E E' E E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @Par Tn E E' E E'' *) right. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: and (not (@eq (@Tpoint Tn) E E')) (and (not (@eq (@Tpoint Tn) E E'')) (and (@Col Tn E E E'') (@Col Tn E' E E''))) *) repeat split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) assert(Par E E' B B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @Par Tn E E' B B'' *) apply (par_trans _ _ E E''); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) assert(Par B B' B B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @Par Tn B B' B B'' *) apply (par_trans _ _ E E'); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) induction H33. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @Col Tn B'' B B' *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: False *) apply H33. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X B B'')) *) exists B. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) (* Goal: and (@Col Tn B B B') (@Col Tn B B B'') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn B'' B B' *) Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(B' <> E'). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B' E') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H1. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X B E')) *) exists E'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' B E') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(Par_strict E' E'' B' B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' E'' B' B'' *) induction H31. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' E'' B' B'' *) (* Goal: @Par_strict Tn E' E'' B' B'' *) assumption. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' E'' B' B'' *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E' E'' B' B'' *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H31. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @eq (@Tpoint Tn) E' E'' *) apply(l6_21 O E' E E');Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O E' E'' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' A B'' C *) apply(l13_15 E' E'' A B' B'' C O H29 H33 H24); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O A C *) ColR. (* Goal: @Pj Tn E'' A B'' C *) assert(Par E'' E' B'' B'). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' E' B'' B' *) apply(l13_15 E E'' E' B B'' B' O ); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@Col Tn E E'' E') *) Col. (* Goal: @Pj Tn E'' A B'' C *) induction(col_dec A E' E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(Par B' C E' E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn B' C E' E'' *) apply (par_col_par _ _ _ A); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn E' A E'' *) Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) assert(Par B' C B' B''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn B' C B' B'' *) apply (par_trans _ _ E' E''); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) induction H32. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) apply False_ind. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H32. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B' C) (@Col Tn X B' B'')) *) exists B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) (* Goal: and (@Col Tn B' B' C) (@Col Tn B' B' B'') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) spliter. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' A B'' C *) apply par_comm. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B'' *) apply(par_col_par _ _ _ B'); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B' *) (* Goal: not (@eq (@Tpoint Tn) C B'') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B' *) (* Goal: False *) subst B''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B' *) (* Goal: False *) apply H22. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C) (@Col Tn X E E'')) *) exists E. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B' *) (* Goal: and (@Col Tn E B C) (@Col Tn E E E'') *) split; ColR. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B' *) apply par_symmetry. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn C B' A E'' *) apply(par_col_par _ _ _ E'); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) A E'') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst E''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H22. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B'') (@Col Tn X E A)) *) exists B. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: and (@Col Tn B B B'') (@Col Tn B E A) *) split; ColR. (* Goal: @Pj Tn E'' A B'' C *) assert(B' <> E'). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B' E') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst B'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H24. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' A) (@Col Tn X E' C)) *) exists E'. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: and (@Col Tn E' E' A) (@Col Tn E' E' C) *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) assert(B'' <> E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: not (@eq (@Tpoint Tn) B'' E'') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) subst B''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: False *) apply H22. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B E'') (@Col Tn X E E'')) *) exists E''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: and (@Col Tn E'' B E'') (@Col Tn E'' E E'') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) induction H29. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' A B'' C *) apply(l13_15 E' E'' A B' B'' C O ); Par. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O A C *) (* Goal: not (@Col Tn E' E'' A) *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O A C *) (* Goal: False *) apply H30. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O A C *) (* Goal: @Col Tn A E' E'' *) Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Col Tn O A C *) ColR. (* Goal: @Pj Tn E'' A B'' C *) spliter. (* Goal: @Pj Tn E'' A B'' C *) induction(col_dec O E' E''). (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Pj Tn E'' A B'' C *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E'' A B'' C *) apply par_comm. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn A E'' C B'' *) apply (l13_19 E E' A E'' B B' C B'' O); Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E'' B B'' *) (* Goal: @Col Tn O E' B'' *) (* Goal: not (@eq (@Tpoint Tn) O B'') *) intro. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E'' B B'' *) (* Goal: @Col Tn O E' B'' *) (* Goal: False *) subst B''. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E'' B B'' *) (* Goal: @Col Tn O E' B'' *) (* Goal: False *) apply H22. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E'' B B'' *) (* Goal: @Col Tn O E' B'' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B O) (@Col Tn X E E'')) *) exists E. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E'' B B'' *) (* Goal: @Col Tn O E' B'' *) (* Goal: and (@Col Tn E B O) (@Col Tn E E E'') *) split; Col. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E'' B B'' *) (* Goal: @Col Tn O E' B'' *) ColR. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par Tn E E'' B B'' *) left. (* Goal: @Pj Tn E'' A B'' C *) (* Goal: @Par_strict Tn E E'' B B'' *) Par. (* Goal: @Pj Tn E'' A B'' C *) apply False_ind. (* Goal: False *) apply H31. (* Goal: @eq (@Tpoint Tn) B' E' *) apply (l6_21 O E' E'' E'); Col. (* Goal: @Col Tn E'' E' B' *) ColR. Qed. Lemma proj_preserves_prod : forall O E E' A B C A' B' C', Prod O E E' A B C -> Ar1 O E' A' B' C' -> Pj E E' A A' -> Pj E E' B B' -> Pj E E' C C' -> Prod O E' E A' B' C'. Proof. (* Goal: forall (O E E' A B C A' B' C' : @Tpoint Tn) (_ : @Prod Tn O E E' A B C) (_ : @Ar1 Tn O E' A' B' C') (_ : @Pj Tn E E' A A') (_ : @Pj Tn E E' B B') (_ : @Pj Tn E E' C C'), @Prod Tn O E' E A' B' C' *) intros. (* Goal: @Prod Tn O E' E A' B' C' *) assert(Ar2 O E E' A B C). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Ar2 Tn O E E' A B C *) unfold Prod in H. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Ar2 Tn O E E' A B C *) tauto. (* Goal: @Prod Tn O E' E A' B' C' *) assert(AR2:= H4). (* Goal: @Prod Tn O E' E A' B' C' *) destruct H4. (* Goal: @Prod Tn O E' E A' B' C' *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) unfold Ar1 in H0. (* Goal: @Prod Tn O E' E A' B' C' *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) induction(eq_dec_points A O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst A. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) assert(A' = O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) A' O *) eapply (pj_uniqueness O E E' O); Col. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Pj Tn E E' O O *) apply pj_trivial. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst A'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) assert(C = O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: @eq (@Tpoint Tn) C O *) assert(HH:= prod_0_l O E E' B H4 H6). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: @eq (@Tpoint Tn) C O *) apply(prod_uniqueness O E E' O B); auto. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) subst C. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) induction H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) apply False_ind. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: False *) induction H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X O C')) *) exists E'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O C') *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O C') *) split; Col. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: False *) apply H4. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) subst C'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' O *) apply prod_0_l; Col. (* Goal: @Prod Tn O E' E A' B' C' *) induction(eq_dec_points B O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst B. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) assert(B' = O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) B' O *) apply (pj_uniqueness O E E' O); Col. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Pj Tn E E' O O *) apply pj_trivial. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst B'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) assert(C = O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: @eq (@Tpoint Tn) C O *) assert(HH:= prod_0_r O E E' A H4 H5). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: @eq (@Tpoint Tn) C O *) apply(prod_uniqueness O E E' A O); auto. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) subst C. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) induction H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: @Prod Tn O E' E A' O C' *) apply False_ind. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: False *) induction H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X O C')) *) exists E'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O C') *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: False *) (* Goal: and (@Col Tn E' E E') (@Col Tn E' O C') *) split; Col. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: False *) apply H4. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) subst C'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O O *) apply prod_0_r; Col. (* Goal: @Prod Tn O E' E A' B' C' *) induction(eq_dec_points C O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst C. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) apply prod_null in H. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) induction H; contradiction. (* Goal: @Prod Tn O E' E A' B' C' *) induction(eq_dec_points A' O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst A'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E O B' C' *) apply False_ind. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) induction H1. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) induction H1. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H1. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X A O)) *) exists E. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E E E') (@Col Tn E A O) *) split; Col. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H4. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) contradiction. (* Goal: @Prod Tn O E' E A' B' C' *) induction(eq_dec_points B' O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst B'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' O C' *) apply False_ind. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) induction H2. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) induction H2. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H2. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X B O)) *) exists E. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E E E') (@Col Tn E B O) *) split; Col. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H4. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) contradiction. (* Goal: @Prod Tn O E' E A' B' C' *) induction(eq_dec_points C' O). (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' C' *) subst C'. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: @Prod Tn O E' E A' B' O *) apply False_ind. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) induction H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) induction H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H3. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X C O)) *) exists E. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E E E') (@Col Tn E C O) *) split; Col. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H4. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O E' E A' B' C' *) (* Goal: False *) contradiction. (* Goal: @Prod Tn O E' E A' B' C' *) unfold Ar1 in H0. (* Goal: @Prod Tn O E' E A' B' C' *) spliter. (* Goal: @Prod Tn O E' E A' B' C' *) unfold Prod in *. (* Goal: and (@Ar2 Tn O E' E A' B' C') (@ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C')))) *) spliter. (* Goal: and (@Ar2 Tn O E' E A' B' C') (@ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C')))) *) unfold Ar2 in H. (* Goal: and (@Ar2 Tn O E' E A' B' C') (@ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C')))) *) spliter. (* Goal: and (@Ar2 Tn O E' E A' B' C') (@ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C')))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C'))) *) ex_and H17 B''. (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C'))) *) assert(B' = B''). (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C'))) *) (* Goal: @eq (@Tpoint Tn) B' B'' *) apply(pj_uniqueness O E E' B B' B''); Col. (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C'))) *) subst B''. (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' E B' B'0) (and (@Col Tn O E B'0) (@Pj Tn E A' B'0 C'))) *) exists B. (* Goal: and (@Pj Tn E' E B' B) (and (@Col Tn O E B) (@Pj Tn E A' B C')) *) repeat split; Col. (* Goal: @Pj Tn E A' B C' *) (* Goal: @Pj Tn E' E B' B *) apply pj_comm. (* Goal: @Pj Tn E A' B C' *) (* Goal: @Pj Tn E E' B B' *) assumption. (* Goal: @Pj Tn E A' B C' *) left. (* Goal: @Par Tn E A' B C' *) apply par_comm. (* Goal: @Par Tn A' E C' B *) assert(HH:= grid_not_par O E E' H4). (* Goal: @Par Tn A' E C' B *) spliter. (* Goal: @Par Tn A' E C' B *) apply(l13_19 E' A A' E B' C C' B O); Col. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A C *) (* Goal: not (@Col Tn O E' A) *) intro. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A C *) (* Goal: False *) apply H4. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) (* Goal: @Col Tn O A B *) (* Goal: @Col Tn O A C *) ColR. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) (* Goal: @Col Tn O A B *) ColR. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) induction H22. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) (* Goal: @Par Tn E' A B' C *) assumption. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A B' C *) subst B'. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' A C C *) apply False_ind. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: False *) apply H4. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) induction H2. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) (* Goal: @Par Tn E' E B' B *) Par. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B' B *) subst B'. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn E' E B B *) apply False_ind. (* Goal: @Par Tn A A' C C' *) (* Goal: False *) apply H4. (* Goal: @Par Tn A A' C C' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn A A' C C' *) induction H1. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn A A' C C' *) induction H3. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn A A' C C' *) apply (par_trans _ _ E E'); Par. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn A A' C C' *) subst C'. (* Goal: @Par Tn A A' C C' *) (* Goal: @Par Tn A A' C C *) apply False_ind. (* Goal: @Par Tn A A' C C' *) (* Goal: False *) apply H4. (* Goal: @Par Tn A A' C C' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn A A' C C' *) subst A'. (* Goal: @Par Tn A A C C' *) apply False_ind. (* Goal: False *) apply H4. (* Goal: @Col Tn O E E' *) ColR. Qed. Lemma prod_assoc1 : forall O E E' A B C AB BC ABC, Prod O E E' A B AB -> Prod O E E' B C BC -> (Prod O E E' A BC ABC -> Prod O E E' AB C ABC). Proof. (* Goal: forall (O E E' A B C AB BC ABC : @Tpoint Tn) (_ : @Prod Tn O E E' A B AB) (_ : @Prod Tn O E E' B C BC) (_ : @Prod Tn O E E' A BC ABC), @Prod Tn O E E' AB C ABC *) intros. (* Goal: @Prod Tn O E E' AB C ABC *) assert(Ar2 O E E' A B AB). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Ar2 Tn O E E' A B AB *) unfold Prod in H. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Ar2 Tn O E E' A B AB *) tauto. (* Goal: @Prod Tn O E E' AB C ABC *) assert(Ar2 O E E' B C BC). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Ar2 Tn O E E' B C BC *) unfold Prod in H0. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Ar2 Tn O E E' B C BC *) tauto. (* Goal: @Prod Tn O E E' AB C ABC *) assert(Ar2 O E E' A BC ABC). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Ar2 Tn O E E' A BC ABC *) unfold Prod in H1. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Ar2 Tn O E E' A BC ABC *) tauto. (* Goal: @Prod Tn O E E' AB C ABC *) unfold Ar2 in *. (* Goal: @Prod Tn O E E' AB C ABC *) spliter. (* Goal: @Prod Tn O E E' AB C ABC *) clean_duplicated_hyps. (* Goal: @Prod Tn O E E' AB C ABC *) induction(eq_dec_points A O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) subst A. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) assert(HH:=prod_0_l O E E' B H2 H12). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) assert(AB = O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @eq (@Tpoint Tn) AB O *) apply(prod_uniqueness O E E' O B); assumption. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) subst AB. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) assert(HP:=prod_0_l O E E' BC H2 H10). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) assert(ABC=O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) (* Goal: @eq (@Tpoint Tn) ABC O *) apply(prod_uniqueness O E E' O BC); assumption. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) subst ABC. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C O *) apply prod_0_l; assumption. (* Goal: @Prod Tn O E E' AB C ABC *) induction(eq_dec_points B O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) subst B. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) assert(HH:=prod_0_r O E E' A H2 H11). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) assert(AB = O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @eq (@Tpoint Tn) AB O *) apply(prod_uniqueness O E E' A O); assumption. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) subst AB. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) assert(HP:=prod_0_l O E E' C H2 H9). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) assert(BC=O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) (* Goal: @eq (@Tpoint Tn) BC O *) apply(prod_uniqueness O E E' O C); assumption. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) subst BC. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) assert(ABC=O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) (* Goal: @eq (@Tpoint Tn) ABC O *) apply(prod_uniqueness O E E' A O); assumption. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C ABC *) subst ABC. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' O C O *) apply prod_0_l; assumption. (* Goal: @Prod Tn O E E' AB C ABC *) induction(eq_dec_points C O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) subst C. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) assert(HH:=prod_0_r O E E' B H2 H12). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) assert(BC = O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) (* Goal: @eq (@Tpoint Tn) BC O *) apply(prod_uniqueness O E E' B O); assumption. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) subst BC. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) assert(HP:=prod_0_r O E E' A H2 H11). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) assert(ABC=O). (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) (* Goal: @eq (@Tpoint Tn) ABC O *) apply(prod_uniqueness O E E' A O); assumption. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O ABC *) subst ABC. (* Goal: @Prod Tn O E E' AB C ABC *) (* Goal: @Prod Tn O E E' AB O O *) apply prod_0_r; assumption. (* Goal: @Prod Tn O E E' AB C ABC *) assert(P1:=H). (* Goal: @Prod Tn O E E' AB C ABC *) assert(P2:= H0). (* Goal: @Prod Tn O E E' AB C ABC *) assert(P3:=H1). (* Goal: @Prod Tn O E E' AB C ABC *) unfold Prod in H. (* Goal: @Prod Tn O E E' AB C ABC *) unfold Prod in H0. (* Goal: @Prod Tn O E E' AB C ABC *) unfold Prod in H1. (* Goal: @Prod Tn O E E' AB C ABC *) spliter. (* Goal: @Prod Tn O E E' AB C ABC *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) assert(HH:=grid_not_par O E E' H2). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) assert(exists ! P', Proj C P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn C P' O E' E E')) *) apply(project_existence C O E' E E' H20 H19); Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) ex_and H21 C'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) unfold unique in H22. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) clear H22. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) unfold Proj in H21. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) clean_duplicated_hyps. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) assert(Par C C' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) (* Goal: @Par Tn C C' E E' *) induction H25. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) (* Goal: @Par Tn C C' E E' *) (* Goal: @Par Tn C C' E E' *) assumption. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) (* Goal: @Par Tn C C' E E' *) subst C'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) (* Goal: @Par Tn C C E E' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) (* Goal: False *) apply H2. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) clear H25. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' C B') (and (@Col Tn O E' B') (@Pj Tn E' AB B' ABC))) *) exists C'. (* Goal: and (@Pj Tn E E' C C') (and (@Col Tn O E' C') (@Pj Tn E' AB C' ABC)) *) repeat split. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: @Col Tn O E' C' *) (* Goal: @Pj Tn E E' C C' *) left. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: @Col Tn O E' C' *) (* Goal: @Par Tn E E' C C' *) Par. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: @Col Tn O E' C' *) Col. (* Goal: @Pj Tn E' AB C' ABC *) ex_and H14 B'. (* Goal: @Pj Tn E' AB C' ABC *) ex_and H8 C''. (* Goal: @Pj Tn E' AB C' ABC *) assert(C' = C''). (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply(pj_uniqueness O E E' C); Col. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: @Pj Tn E E' C C' *) left. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: @Par Tn E E' C C' *) Par. (* Goal: @Pj Tn E' AB C' ABC *) subst C''. (* Goal: @Pj Tn E' AB C' ABC *) ex_and H6 BC'. (* Goal: @Pj Tn E' AB C' ABC *) assert(B' <> O). (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) subst B'. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) induction H14. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) (* Goal: False *) apply H15. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ B); finish. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) contradiction. (* Goal: @Pj Tn E' AB C' ABC *) assert(BC <> O). (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: not (@eq (@Tpoint Tn) BC O) *) intro. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) subst BC. (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) assert(HH:=prod_null O E E' B C P2). (* Goal: @Pj Tn E' AB C' ABC *) (* Goal: False *) induction HH; contradiction. (* Goal: @Pj Tn E' AB C' ABC *) left. (* Goal: @Par Tn E' AB C' ABC *) apply(l13_19 B' B E' AB BC' BC C' ABC O); Col. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: not (@Col Tn O B' B) *) intro. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: False *) apply H2. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) intro. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: False *) subst BC'. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: False *) induction H6. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: False *) (* Goal: False *) apply H15. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply (par_col_par _ _ _ BC); finish. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: False *) contradiction. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O C') *) intro. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: False *) subst C'. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: False *) apply H15. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: @Par Tn E E' O E *) apply (par_col_par _ _ _ C); finish. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) intro. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: False *) subst AB. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: False *) assert(HH:=prod_null O E E' A B P1). (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: False *) induction HH; contradiction. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) intro. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: False *) subst ABC. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: False *) assert(HH:=prod_null O E E' A BC P3). (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) (* Goal: False *) induction HH; contradiction. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) (* Goal: @Col Tn O B' BC' *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: @Col Tn O B' C' *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O B ABC *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) induction H14. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Par Tn B' B BC' BC *) induction H6. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Par Tn B' B BC' BC *) apply (par_trans _ _ E E'); Par. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Par Tn B' B BC' BC *) subst BC'. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Par Tn B' B BC BC *) apply False_ind. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: False *) apply H2. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' B BC' BC *) subst B'. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B B BC' BC *) apply False_ind. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: False *) apply H2. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) induction H23. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' AB BC' ABC *) induction H28. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' AB BC' ABC *) apply (par_trans _ _ E' A); Par. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' AB BC' ABC *) subst BC'. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn B' AB ABC ABC *) apply False_ind. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: False *) apply H2. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) assert(ABC <> O). (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) (* Goal: not (@eq (@Tpoint Tn) ABC O) *) intro. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) (* Goal: False *) subst ABC. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) (* Goal: False *) assert(HH:=prod_null O E E' A BC P3). (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) (* Goal: False *) induction HH; contradiction. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' AB BC' ABC *) subst AB. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B' B' BC' ABC *) apply False_ind. (* Goal: @Par Tn B E' BC C' *) (* Goal: False *) apply H2. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B E' BC C' *) induction H26. (* Goal: @Par Tn B E' BC C' *) (* Goal: @Par Tn B E' BC C' *) Par. (* Goal: @Par Tn B E' BC C' *) subst BC. (* Goal: @Par Tn B E' C' C' *) apply False_ind. (* Goal: False *) apply H2. (* Goal: @Col Tn O E E' *) ColR. Qed. Lemma prod_assoc2 : forall O E E' A B C AB BC ABC, Prod O E E' A B AB -> Prod O E E' B C BC -> (Prod O E E' AB C ABC -> Prod O E E' A BC ABC). Proof. (* Goal: forall (O E E' A B C AB BC ABC : @Tpoint Tn) (_ : @Prod Tn O E E' A B AB) (_ : @Prod Tn O E E' B C BC) (_ : @Prod Tn O E E' AB C ABC), @Prod Tn O E E' A BC ABC *) intros. (* Goal: @Prod Tn O E E' A BC ABC *) assert(Ar2 O E E' A B AB). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Ar2 Tn O E E' A B AB *) unfold Prod in H. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Ar2 Tn O E E' A B AB *) tauto. (* Goal: @Prod Tn O E E' A BC ABC *) assert(Ar2 O E E' B C BC). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Ar2 Tn O E E' B C BC *) unfold Prod in H0. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Ar2 Tn O E E' B C BC *) tauto. (* Goal: @Prod Tn O E E' A BC ABC *) assert(Ar2 O E E' AB C ABC). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Ar2 Tn O E E' AB C ABC *) unfold Prod in H1. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Ar2 Tn O E E' AB C ABC *) tauto. (* Goal: @Prod Tn O E E' A BC ABC *) unfold Ar2 in *. (* Goal: @Prod Tn O E E' A BC ABC *) spliter. (* Goal: @Prod Tn O E E' A BC ABC *) clean_duplicated_hyps. (* Goal: @Prod Tn O E E' A BC ABC *) induction(eq_dec_points A O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) subst A. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) assert(HH:=prod_0_l O E E' B H2 H12). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) assert(AB = O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) (* Goal: @eq (@Tpoint Tn) AB O *) apply(prod_uniqueness O E E' O B); assumption. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) subst AB. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) assert(HP:=prod_0_l O E E' C H2 H9). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) assert(ABC=O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) (* Goal: @eq (@Tpoint Tn) ABC O *) apply(prod_uniqueness O E E' O C); assumption. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC ABC *) subst ABC. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' O BC O *) apply prod_0_l; assumption. (* Goal: @Prod Tn O E E' A BC ABC *) induction(eq_dec_points B O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) subst B. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) assert(HH:=prod_0_l O E E' C H2 H9). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) assert(BC = O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @eq (@Tpoint Tn) BC O *) apply(prod_uniqueness O E E' O C); assumption. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) subst BC. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O ABC *) assert(HP:=prod_0_r O E E' A H2 H11). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O ABC *) assert(AB=O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O ABC *) (* Goal: @eq (@Tpoint Tn) AB O *) apply(prod_uniqueness O E E' A O); assumption. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O ABC *) subst AB. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O ABC *) assert(ABC=O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O ABC *) (* Goal: @eq (@Tpoint Tn) ABC O *) apply(prod_uniqueness O E E' O C); assumption. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O ABC *) subst ABC. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O O *) apply prod_0_r; assumption. (* Goal: @Prod Tn O E E' A BC ABC *) induction(eq_dec_points C O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) subst C. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) assert(HH:=prod_0_r O E E' B H2 H12). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) assert(ABC=O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @eq (@Tpoint Tn) ABC O *) assert(HP:=prod_0_r O E E' AB H2 H13). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @eq (@Tpoint Tn) ABC O *) apply(prod_uniqueness O E E' AB O); assumption. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC ABC *) subst ABC. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC O *) assert(BC=O). (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC O *) (* Goal: @eq (@Tpoint Tn) BC O *) apply(prod_uniqueness O E E' B O); assumption. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A BC O *) subst BC. (* Goal: @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' A O O *) apply prod_0_r; assumption. (* Goal: @Prod Tn O E E' A BC ABC *) assert(P1:=H). (* Goal: @Prod Tn O E E' A BC ABC *) assert(P2:= H0). (* Goal: @Prod Tn O E E' A BC ABC *) assert(P3:=H1). (* Goal: @Prod Tn O E E' A BC ABC *) unfold Prod in H. (* Goal: @Prod Tn O E E' A BC ABC *) unfold Prod in H0. (* Goal: @Prod Tn O E E' A BC ABC *) unfold Prod in H1. (* Goal: @Prod Tn O E E' A BC ABC *) spliter. (* Goal: @Prod Tn O E E' A BC ABC *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) assert(HH:=grid_not_par O E E' H2). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) assert(BC <> O). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: not (@eq (@Tpoint Tn) BC O) *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: False *) subst BC. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: False *) apply prod_null in P2. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: False *) induction P2; contradiction. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) assert(exists ! P', Proj BC P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn BC P' O E' E E')) *) apply(project_existence BC O E' E E' H20 H19); Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) ex_and H22 BC'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) unfold unique in H23. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) clear H23. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) unfold Proj in H22. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) clean_duplicated_hyps. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) assert(Par BC BC' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: @Par Tn BC BC' E E' *) induction H26. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: @Par Tn BC BC' E E' *) (* Goal: @Par Tn BC BC' E E' *) assumption. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: @Par Tn BC BC' E E' *) subst BC'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: @Par Tn BC BC E E' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: False *) apply H2. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) clear H26. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' BC B') (and (@Col Tn O E' B') (@Pj Tn E' A B' ABC))) *) exists BC'. (* Goal: and (@Pj Tn E E' BC BC') (and (@Col Tn O E' BC') (@Pj Tn E' A BC' ABC)) *) repeat split. (* Goal: @Pj Tn E' A BC' ABC *) (* Goal: @Col Tn O E' BC' *) (* Goal: @Pj Tn E E' BC BC' *) left. (* Goal: @Pj Tn E' A BC' ABC *) (* Goal: @Col Tn O E' BC' *) (* Goal: @Par Tn E E' BC BC' *) Par. (* Goal: @Pj Tn E' A BC' ABC *) (* Goal: @Col Tn O E' BC' *) Col. (* Goal: @Pj Tn E' A BC' ABC *) ex_and H14 B'. (* Goal: @Pj Tn E' A BC' ABC *) ex_and H8 C'. (* Goal: @Pj Tn E' A BC' ABC *) ex_and H6 C''. (* Goal: @Pj Tn E' A BC' ABC *) assert(C' = C''). (* Goal: @Pj Tn E' A BC' ABC *) (* Goal: @eq (@Tpoint Tn) C' C'' *) apply(pj_uniqueness O E E' C); Col. (* Goal: @Pj Tn E' A BC' ABC *) left. (* Goal: @Par Tn E' A BC' ABC *) Par. (* Goal: @Par Tn E' A BC' ABC *) subst C''. (* Goal: @Par Tn E' A BC' ABC *) assert(B' <> O). (* Goal: @Par Tn E' A BC' ABC *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Par Tn E' A BC' ABC *) (* Goal: False *) subst B'. (* Goal: @Par Tn E' A BC' ABC *) (* Goal: False *) induction H14. (* Goal: @Par Tn E' A BC' ABC *) (* Goal: False *) (* Goal: False *) apply H15. (* Goal: @Par Tn E' A BC' ABC *) (* Goal: False *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn E' A BC' ABC *) (* Goal: False *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ B); finish. (* Goal: @Par Tn E' A BC' ABC *) (* Goal: False *) contradiction. (* Goal: @Par Tn E' A BC' ABC *) apply(par_trans _ _ B' AB). (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn E' A B' AB *) induction H24. (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn E' A B' AB *) (* Goal: @Par Tn E' A B' AB *) Par. (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn E' A B' AB *) subst B'. (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Par Tn E' A AB AB *) apply False_ind. (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: False *) apply H2. (* Goal: @Par Tn B' AB BC' ABC *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B' AB BC' ABC *) apply(l13_19 E' B B' AB C' BC BC' ABC O); auto. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: not (@Col Tn O E' B) *) intro. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: False *) apply H2. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: not (@eq (@Tpoint Tn) O C') *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: not (@eq (@Tpoint Tn) O C') *) intro. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: False *) subst C'. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: False *) apply H15. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: @Par Tn E E' O E *) induction H6. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: @Par Tn E E' O E *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ C); Par. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: @Par Tn E E' O E *) (* Goal: @Col Tn O C E *) Col. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) (* Goal: @Par Tn E E' O E *) contradiction. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: not (@eq (@Tpoint Tn) O BC') *) intro. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: False *) subst BC'. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: False *) apply H15. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ BC); Par. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) (* Goal: @Col Tn O BC E *) Col. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: not (@eq (@Tpoint Tn) O AB) *) intro. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: False *) subst AB. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: False *) apply prod_null in P1. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) (* Goal: False *) induction P1; contradiction. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: not (@eq (@Tpoint Tn) O ABC) *) intro. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: False *) subst ABC. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: False *) apply prod_null in P3. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: False *) induction P3. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: False *) (* Goal: False *) subst AB. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: False *) (* Goal: False *) apply prod_null in P1. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: False *) (* Goal: False *) induction P1; contradiction. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) (* Goal: False *) contradiction. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) (* Goal: @Col Tn O B AB *) ColR. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) (* Goal: @Col Tn O B BC *) ColR. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Col Tn O B ABC *) ColR. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) induction H27. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) (* Goal: @Par Tn E' B C' BC *) Par. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B C' BC *) subst C'. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' B BC BC *) apply False_ind. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: False *) apply H15. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ C); auto. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Par Tn E E' O C *) apply par_comm. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Par Tn E' E C O *) apply(par_col_par _ _ _ BC); auto. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Col Tn C BC O *) (* Goal: @Par Tn E' E C BC *) induction H6. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Col Tn C BC O *) (* Goal: @Par Tn E' E C BC *) (* Goal: @Par Tn E' E C BC *) Par. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Col Tn C BC O *) (* Goal: @Par Tn E' E C BC *) subst BC. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Col Tn C BC O *) (* Goal: @Par Tn E' E C C *) apply False_ind. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Col Tn C BC O *) (* Goal: False *) apply H2. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Col Tn C BC O *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) (* Goal: @Col Tn C BC O *) ColR. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Col Tn O C E *) Col. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) induction H29. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) (* Goal: @Par Tn E' AB C' ABC *) Par. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB C' ABC *) subst C'. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn E' AB ABC ABC *) apply False_ind. (* Goal: @Par Tn B B' BC BC' *) (* Goal: False *) apply H2. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) assert(ABC <> O). (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: not (@eq (@Tpoint Tn) ABC O) *) intro. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: False *) subst ABC. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: False *) apply H15. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ C); auto. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: @Col Tn O C E *) (* Goal: @Par Tn E E' O C *) induction H6. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: @Col Tn O C E *) (* Goal: @Par Tn E E' O C *) (* Goal: @Par Tn E E' O C *) Par. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: @Col Tn O C E *) (* Goal: @Par Tn E E' O C *) contradiction. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) (* Goal: @Col Tn O C E *) ColR. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn B B' BC BC' *) induction H14. (* Goal: @Par Tn B B' BC BC' *) (* Goal: @Par Tn B B' BC BC' *) apply (par_trans _ _ E E'); Par. (* Goal: @Par Tn B B' BC BC' *) subst B'. (* Goal: @Par Tn B B BC BC' *) apply False_ind. (* Goal: False *) apply H2. (* Goal: @Col Tn O E E' *) ColR. Qed. Lemma prod_assoc : forall O E E' A B C AB BC ABC, Prod O E E' A B AB -> Prod O E E' B C BC -> (Prod O E E' A BC ABC <-> Prod O E E' AB C ABC). Proof. (* Goal: forall (O E E' A B C AB BC ABC : @Tpoint Tn) (_ : @Prod Tn O E E' A B AB) (_ : @Prod Tn O E E' B C BC), iff (@Prod Tn O E E' A BC ABC) (@Prod Tn O E E' AB C ABC) *) intros. (* Goal: iff (@Prod Tn O E E' A BC ABC) (@Prod Tn O E E' AB C ABC) *) split. (* Goal: forall _ : @Prod Tn O E E' AB C ABC, @Prod Tn O E E' A BC ABC *) (* Goal: forall _ : @Prod Tn O E E' A BC ABC, @Prod Tn O E E' AB C ABC *) intro. (* Goal: forall _ : @Prod Tn O E E' AB C ABC, @Prod Tn O E E' A BC ABC *) (* Goal: @Prod Tn O E E' AB C ABC *) apply (prod_assoc1 O E E' A B _ _ BC); auto. (* Goal: forall _ : @Prod Tn O E E' AB C ABC, @Prod Tn O E E' A BC ABC *) intro. (* Goal: @Prod Tn O E E' A BC ABC *) eapply (prod_assoc2 O E E' A B C AB ); auto. Qed. Lemma prod_comm : forall O E E' A B C, Prod O E E' A B C -> Prod O E E' B A C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Prod Tn O E E' A B C), @Prod Tn O E E' B A C *) intros. (* Goal: @Prod Tn O E E' B A C *) assert(Ar2 O E E' A B C). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Ar2 Tn O E E' A B C *) unfold Prod in H. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Ar2 Tn O E E' A B C *) tauto. (* Goal: @Prod Tn O E E' B A C *) unfold Ar2 in H0. (* Goal: @Prod Tn O E E' B A C *) spliter. (* Goal: @Prod Tn O E E' B A C *) induction(eq_dec_points A O). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B A C *) subst A. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B O C *) assert(HH:=prod_0_l O E E' B H0 H2). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B O C *) assert(C = O). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B O C *) (* Goal: @eq (@Tpoint Tn) C O *) apply(prod_uniqueness O E E' O B); auto. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B O C *) subst C. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B O O *) eapply (prod_0_r O E E'); Col. (* Goal: @Prod Tn O E E' B A C *) induction(eq_dec_points B O). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B A C *) subst B. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' O A C *) assert(HH:=prod_0_r O E E' A H0 H1). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' O A C *) assert(C = O). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' O A C *) (* Goal: @eq (@Tpoint Tn) C O *) apply(prod_uniqueness O E E' A O); auto. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' O A C *) subst C. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' O A O *) apply (prod_0_l O E E'); Col. (* Goal: @Prod Tn O E E' B A C *) induction(eq_dec_points C O). (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B A C *) subst C. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B A O *) apply prod_null in H. (* Goal: @Prod Tn O E E' B A C *) (* Goal: @Prod Tn O E E' B A O *) induction H; contradiction. (* Goal: @Prod Tn O E E' B A C *) unfold Prod in *. (* Goal: and (@Ar2 Tn O E E' B A C) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C)))) *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) ex_and H7 B'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) assert(HG:=grid_not_par O E E' H0). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) assert(exists ! P' : Tpoint, Proj A P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn A P' O E' E E')) *) apply(project_existence A O E' E E'); Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: False *) apply H12. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) ex_and H16 A'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) unfold unique in H17. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) clear H17. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) unfold Proj in H16. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) clean_duplicated_hyps. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) assert(Par A A' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: @Par Tn A A' E E' *) induction H20. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: @Par Tn A A' E E' *) (* Goal: @Par Tn A A' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: @Par Tn A A' E E' *) subst A'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: @Par Tn A A E E' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: False *) apply H0. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) clear H20. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' A B') (and (@Col Tn O E' B') (@Pj Tn E' B B' C))) *) exists A'. (* Goal: and (@Pj Tn E E' A A') (and (@Col Tn O E' A') (@Pj Tn E' B A' C)) *) repeat split. (* Goal: @Pj Tn E' B A' C *) (* Goal: @Col Tn O E' A' *) (* Goal: @Pj Tn E E' A A' *) left. (* Goal: @Pj Tn E' B A' C *) (* Goal: @Col Tn O E' A' *) (* Goal: @Par Tn E E' A A' *) Par. (* Goal: @Pj Tn E' B A' C *) (* Goal: @Col Tn O E' A' *) Col. (* Goal: @Pj Tn E' B A' C *) left. (* Goal: @Par Tn E' B A' C *) apply par_comm. (* Goal: @Par Tn B E' C A' *) apply par_symmetry. (* Goal: @Par Tn C A' B E' *) apply (l13_11 C B A E' A' B' O); Col. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Col Tn O B A *) (* Goal: @Col Tn O C B *) (* Goal: not (@Col Tn O C E') *) intro. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Col Tn O B A *) (* Goal: @Col Tn O C B *) (* Goal: False *) apply H0. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Col Tn O B A *) (* Goal: @Col Tn O C B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Col Tn O B A *) (* Goal: @Col Tn O C B *) ColR. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Col Tn O B A *) ColR. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) subst A'. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) apply H10. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ A); finish. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) induction H7. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) subst B'. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) apply H10. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: @Par Tn O E E E' *) apply par_symmetry. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: @Par Tn E E' O E *) apply(par_col_par _ _ _ B); finish. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) subst B'. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) B O) *) intro. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) (* Goal: False *) contradiction. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Col Tn O A' B' *) ColR. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) induction H7. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) (* Goal: @Par Tn B B' A A' *) apply(par_trans _ _ E E'); Par. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B' A A' *) subst B'. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn B B A A' *) apply False_ind. (* Goal: @Par Tn A E' C B' *) (* Goal: False *) apply H0. (* Goal: @Par Tn A E' C B' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn A E' C B' *) induction H9. (* Goal: @Par Tn A E' C B' *) (* Goal: @Par Tn A E' C B' *) Par. (* Goal: @Par Tn A E' C B' *) subst B'. (* Goal: @Par Tn A E' C C *) apply False_ind. (* Goal: False *) apply H0. (* Goal: @Col Tn O E E' *) ColR. Qed. Lemma prod_O_l_eq : forall O E E' B C, Prod O E E' O B C -> C = O. Proof. (* Goal: forall (O E E' B C : @Tpoint Tn) (_ : @Prod Tn O E E' O B C), @eq (@Tpoint Tn) C O *) intros. (* Goal: @eq (@Tpoint Tn) C O *) assert(HH:=H). (* Goal: @eq (@Tpoint Tn) C O *) unfold Prod in HH. (* Goal: @eq (@Tpoint Tn) C O *) spliter. (* Goal: @eq (@Tpoint Tn) C O *) unfold Ar2 in H0. (* Goal: @eq (@Tpoint Tn) C O *) spliter. (* Goal: @eq (@Tpoint Tn) C O *) assert(HH:=prod_0_l O E E' B H0 H3). (* Goal: @eq (@Tpoint Tn) C O *) apply (prod_uniqueness O E E' O B); auto. Qed. Lemma prod_O_r_eq : forall O E E' A C, Prod O E E' A O C -> C = O. Proof. (* Goal: forall (O E E' A C : @Tpoint Tn) (_ : @Prod Tn O E E' A O C), @eq (@Tpoint Tn) C O *) intros. (* Goal: @eq (@Tpoint Tn) C O *) assert(HH:=H). (* Goal: @eq (@Tpoint Tn) C O *) unfold Prod in HH. (* Goal: @eq (@Tpoint Tn) C O *) spliter. (* Goal: @eq (@Tpoint Tn) C O *) unfold Ar2 in H0. (* Goal: @eq (@Tpoint Tn) C O *) spliter. (* Goal: @eq (@Tpoint Tn) C O *) assert(HH:=prod_0_r O E E' A H0 H2). (* Goal: @eq (@Tpoint Tn) C O *) apply (prod_uniqueness O E E' A O); auto. Qed. Lemma prod_uniquenessA : forall O E E' A A' B C, B <> O -> Prod O E E' A B C -> Prod O E E' A' B C -> A = A'. Proof. (* Goal: forall (O E E' A A' B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) B O)) (_ : @Prod Tn O E E' A B C) (_ : @Prod Tn O E E' A' B C), @eq (@Tpoint Tn) A A' *) intros. (* Goal: @eq (@Tpoint Tn) A A' *) assert(HP1:= H0). (* Goal: @eq (@Tpoint Tn) A A' *) assert(HP2:= H1). (* Goal: @eq (@Tpoint Tn) A A' *) unfold Prod in H0. (* Goal: @eq (@Tpoint Tn) A A' *) unfold Prod in H1. (* Goal: @eq (@Tpoint Tn) A A' *) spliter. (* Goal: @eq (@Tpoint Tn) A A' *) unfold Ar2 in *. (* Goal: @eq (@Tpoint Tn) A A' *) spliter. (* Goal: @eq (@Tpoint Tn) A A' *) clean_duplicated_hyps. (* Goal: @eq (@Tpoint Tn) A A' *) induction(eq_dec_points A' O). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) subst A'. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) assert(C = O). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) C O *) assert(HH:= prod_0_l O E E' B H0 H8). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) C O *) apply(prod_uniqueness O E E' O B); auto. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) subst C. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) apply prod_null in HP1. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) induction HP1. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) (* Goal: @eq (@Tpoint Tn) A O *) assumption. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A O *) contradiction. (* Goal: @eq (@Tpoint Tn) A A' *) ex_and H3 B'. (* Goal: @eq (@Tpoint Tn) A A' *) ex_and H2 B''. (* Goal: @eq (@Tpoint Tn) A A' *) assert(B' = B''). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) induction H3; induction H2. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) assert(Par B B' B B''). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @Par Tn B B' B B'' *) apply (par_trans _ _ E E'); Par. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) induction H12. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: False *) apply H12. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X B B'')) *) exists B. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: and (@Col Tn B B B') (@Col Tn B B B'') *) split; Col. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) spliter. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) apply(l6_21 O E' B B'); Col. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: not (@Col Tn O E' B) *) intro. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) subst B''. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) subst B'. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @eq (@Tpoint Tn) B B'' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: False *) apply H0. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) subst B. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) B' B'' *) assumption. (* Goal: @eq (@Tpoint Tn) A A' *) subst B''. (* Goal: @eq (@Tpoint Tn) A A' *) assert(HH:= grid_not_par O E E' H0). (* Goal: @eq (@Tpoint Tn) A A' *) spliter. (* Goal: @eq (@Tpoint Tn) A A' *) induction H6; induction H11. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) assert(Par E' A' E' A). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @Par Tn E' A' E' A *) apply(par_trans _ _ B' C); Par. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) induction H18. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) apply False_ind. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: False *) apply H18. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' A') (@Col Tn X E' A)) *) exists E'. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: and (@Col Tn E' E' A') (@Col Tn E' E' A) *) split; Col. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) spliter. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) apply(l6_21 O E E' A); Col. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) subst B'. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) apply par_distincts in H6. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) tauto. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) subst B'. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) apply par_distincts in H11. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) tauto. (* Goal: @eq (@Tpoint Tn) A A' *) subst B'. (* Goal: @eq (@Tpoint Tn) A A' *) induction(eq_dec_points C O). (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) subst C. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) apply prod_null in HP1. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) apply prod_null in HP2. (* Goal: @eq (@Tpoint Tn) A A' *) (* Goal: @eq (@Tpoint Tn) A A' *) induction HP1; induction HP2; try contradiction. (* Goal: @eq (@Tpoint Tn) A A' *) apply False_ind. (* Goal: False *) apply H0. (* Goal: @Col Tn O E E' *) ColR. Qed. Lemma prod_uniquenessB : forall O E E' A B B' C, A <> O -> Prod O E E' A B C -> Prod O E E' A B' C -> B = B'. Proof. (* Goal: forall (O E E' A B B' C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A O)) (_ : @Prod Tn O E E' A B C) (_ : @Prod Tn O E E' A B' C), @eq (@Tpoint Tn) B B' *) intros. (* Goal: @eq (@Tpoint Tn) B B' *) apply prod_comm in H0. (* Goal: @eq (@Tpoint Tn) B B' *) apply prod_comm in H1. (* Goal: @eq (@Tpoint Tn) B B' *) apply (prod_uniquenessA O E E' B B' A C); auto. Qed. Lemma distr_l : forall O E E' A B C D AB AC AD, Sum O E E' B C D -> Prod O E E' A B AB -> Prod O E E' A C AC -> (Prod O E E' A D AD -> Sum O E E' AB AC AD). Proof. (* Goal: forall (O E E' A B C D AB AC AD : @Tpoint Tn) (_ : @Sum Tn O E E' B C D) (_ : @Prod Tn O E E' A B AB) (_ : @Prod Tn O E E' A C AC) (_ : @Prod Tn O E E' A D AD), @Sum Tn O E E' AB AC AD *) intros. (* Goal: @Sum Tn O E E' AB AC AD *) assert(HS:=H). (* Goal: @Sum Tn O E E' AB AC AD *) unfold Sum in H. (* Goal: @Sum Tn O E E' AB AC AD *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) ex_and H3 B'. (* Goal: @Sum Tn O E E' AB AC AD *) ex_and H4 C1. (* Goal: @Sum Tn O E E' AB AC AD *) assert(HP1:=H0). (* Goal: @Sum Tn O E E' AB AC AD *) assert(HP2:=H1). (* Goal: @Sum Tn O E E' AB AC AD *) assert(HPS:=H2). (* Goal: @Sum Tn O E E' AB AC AD *) unfold Prod in H0. (* Goal: @Sum Tn O E E' AB AC AD *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) ex_and H8 B''. (* Goal: @Sum Tn O E E' AB AC AD *) assert(~Col O E E' /\ Col O E A /\ Col O E B /\ Col O E C /\ Col O E D). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (and (@Col Tn O E C) (@Col Tn O E D)))) *) unfold Ar2 in *. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (and (@Col Tn O E C) (@Col Tn O E D)))) *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E A) (and (@Col Tn O E B) (and (@Col Tn O E C) (@Col Tn O E D)))) *) repeat split; Col. (* Goal: @Sum Tn O E E' AB AC AD *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) assert(HH:=grid_not_par O E E' H11). (* Goal: @Sum Tn O E E' AB AC AD *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) assert(B' = B''). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @eq (@Tpoint Tn) B' B'' *) apply(pj_uniqueness O E E' B); Col. (* Goal: @Sum Tn O E E' AB AC AD *) subst B''. (* Goal: @Sum Tn O E E' AB AC AD *) unfold Prod in H1. (* Goal: @Sum Tn O E E' AB AC AD *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) ex_and H22 C'. (* Goal: @Sum Tn O E E' AB AC AD *) unfold Prod in H2. (* Goal: @Sum Tn O E E' AB AC AD *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) ex_and H25 D'. (* Goal: @Sum Tn O E E' AB AC AD *) assert(Sum O E' E B' C' D'). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E' E B' C' D' *) apply(proj_preserves_sum O E E' B C D B' C' D'); auto. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Ar1 Tn O E' B' C' D' *) repeat split; Col. (* Goal: @Sum Tn O E E' AB AC AD *) induction(eq_dec_points A O). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' AB AC AD *) subst A. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' AB AC AD *) assert(HH1:= prod_0_l O E E' B H11 H13). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' AB AC AD *) assert( AB = O). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @eq (@Tpoint Tn) AB O *) apply (prod_uniqueness O E E' O B); auto. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' AB AC AD *) subst AB. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O AC AD *) assert(HH2:= prod_0_l O E E' C H11 H14). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O AC AD *) assert( AC = O). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O AC AD *) (* Goal: @eq (@Tpoint Tn) AC O *) apply (prod_uniqueness O E E' O C); auto. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O AC AD *) subst AC. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O O AD *) assert(HH3:= prod_0_l O E E' D H11 H15). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O O AD *) assert( AD = O). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O O AD *) (* Goal: @eq (@Tpoint Tn) AD O *) apply (prod_uniqueness O E E' O D); auto. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O O AD *) subst AD. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E E' O O O *) apply sum_O_O; Col. (* Goal: @Sum Tn O E E' AB AC AD *) assert(Sum O E' A B' C' D'). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O E' A B' C' D' *) apply(sum_y_axis_change O E' E A B' C' D'); auto. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: not (@Col Tn O E' A) *) intro. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: False *) apply H11. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Sum Tn O E E' AB AC AD *) assert(Sum O A E' AB AC AD). (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O A E' AB AC AD *) unfold Ar2 in *. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O A E' AB AC AD *) spliter. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Sum Tn O A E' AB AC AD *) apply(proj_preserves_sum O E' A B' C' D' AB AC AD); auto. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Ar1 Tn O A AB AC AD *) repeat split; auto. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Col Tn O A AD *) (* Goal: @Col Tn O A AC *) (* Goal: @Col Tn O A AB *) ColR. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Col Tn O A AD *) (* Goal: @Col Tn O A AC *) ColR. (* Goal: @Sum Tn O E E' AB AC AD *) (* Goal: @Col Tn O A AD *) ColR. (* Goal: @Sum Tn O E E' AB AC AD *) apply(sum_x_axis_unit_change O A E' E AB AC AD); Col. Qed. Lemma distr_r : forall O E E' A B C D AC BC DC, Sum O E E' A B D -> Prod O E E' A C AC -> Prod O E E' B C BC -> (Prod O E E' D C DC -> Sum O E E' AC BC DC). Proof. (* Goal: forall (O E E' A B C D AC BC DC : @Tpoint Tn) (_ : @Sum Tn O E E' A B D) (_ : @Prod Tn O E E' A C AC) (_ : @Prod Tn O E E' B C BC) (_ : @Prod Tn O E E' D C DC), @Sum Tn O E E' AC BC DC *) intros. (* Goal: @Sum Tn O E E' AC BC DC *) apply prod_comm in H0. (* Goal: @Sum Tn O E E' AC BC DC *) apply prod_comm in H1. (* Goal: @Sum Tn O E E' AC BC DC *) apply prod_comm in H2. (* Goal: @Sum Tn O E E' AC BC DC *) apply(distr_l O E E' C A B D AC BC DC); auto. Qed. Lemma prod_1_l_eq : forall O E E' A B, Prod O E E' A B B -> A = E \/ B = O. Proof. (* Goal: forall (O E E' A B : @Tpoint Tn) (_ : @Prod Tn O E E' A B B), or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) intros. (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) assert(HP:=H). (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) unfold Prod in H. (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) spliter. (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) unfold Ar2 in H. (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) spliter. (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) clear H0. (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) assert(HH:= prod_1_l O E E' B H H2). (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) induction(eq_dec_points B O). (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) right; assumption. (* Goal: or (@eq (@Tpoint Tn) A E) (@eq (@Tpoint Tn) B O) *) left. (* Goal: @eq (@Tpoint Tn) A E *) apply (prod_uniquenessA O E E' A E B B H0); assumption. Qed. Lemma prod_1_r_eq : forall O E E' A B, Prod O E E' A B A -> B = E \/ A = O. Proof. (* Goal: forall (O E E' A B : @Tpoint Tn) (_ : @Prod Tn O E E' A B A), or (@eq (@Tpoint Tn) B E) (@eq (@Tpoint Tn) A O) *) intros. (* Goal: or (@eq (@Tpoint Tn) B E) (@eq (@Tpoint Tn) A O) *) apply prod_comm in H. (* Goal: or (@eq (@Tpoint Tn) B E) (@eq (@Tpoint Tn) A O) *) apply (prod_1_l_eq O E E'). (* Goal: @Prod Tn O E E' B A A *) assumption. Qed. Lemma change_grid_prod_l_O : forall O E E' B C O' A' B' C', Par_strict O E O' E' -> Ar1 O E O B C -> Ar1 O' E' A' B' C' -> Pj O O' E E' -> Pj O O' O A' -> Pj O O' B B' -> Pj O O' C C' -> Prod O E E' O B C -> Prod O' E' E A' B' C'. Proof. (* Goal: forall (O E E' B C O' A' B' C' : @Tpoint Tn) (_ : @Par_strict Tn O E O' E') (_ : @Ar1 Tn O E O B C) (_ : @Ar1 Tn O' E' A' B' C') (_ : @Pj Tn O O' E E') (_ : @Pj Tn O O' O A') (_ : @Pj Tn O O' B B') (_ : @Pj Tn O O' C C') (_ : @Prod Tn O E E' O B C), @Prod Tn O' E' E A' B' C' *) intros. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HP:= H6). (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Prod in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar2 in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H7. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(C = O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) C O *) apply prod_O_l_eq in HP. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) C O *) assumption. (* Goal: @Prod Tn O' E' E A' B' C' *) subst C. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par O O' O A'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' O A' *) induction H3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' O A' *) (* Goal: @Par Tn O O' O A' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' O A' *) subst A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' O O *) unfold Ar1 in H1. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' O O *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' O O *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) induction H10. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H10. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X O A')) *) exists O. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O O O') (@Col Tn O O A') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(A' = O'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) A' O' *) apply (l6_21 O O' E' O'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: not (@Col Tn O O' E') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) unfold Ar1 in H1. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) auto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) unfold Ar1 in H1. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E' O' A' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst A'. (* Goal: @Prod Tn O' E' E O' B' C' *) clean_trivial_hyps. (* Goal: @Prod Tn O' E' E O' B' C' *) assert(Par O O' O C'). (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Par Tn O O' O C' *) induction H5. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Par Tn O O' O C' *) (* Goal: @Par Tn O O' O C' *) Par. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Par Tn O O' O C' *) subst C'. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Par Tn O O' O O *) apply False_ind. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: False *) unfold Ar1 in H1. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Prod Tn O' E' E O' B' C' *) induction H7. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Prod Tn O' E' E O' B' C' *) apply False_ind. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: False *) apply H7. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X O C')) *) exists O. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: and (@Col Tn O O O') (@Col Tn O O C') *) split; Col. (* Goal: @Prod Tn O' E' E O' B' C' *) spliter. (* Goal: @Prod Tn O' E' E O' B' C' *) assert(C' = O'). (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @eq (@Tpoint Tn) C' O' *) apply (l6_21 O O' E' O'); Col. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: not (@Col Tn O O' E') *) intro. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) unfold Ar1 in H1. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) spliter. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) (* Goal: not (@eq (@Tpoint Tn) E' O') *) auto. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) unfold Ar1 in H1. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) spliter. (* Goal: @Prod Tn O' E' E O' B' C' *) (* Goal: @Col Tn E' O' C' *) Col. (* Goal: @Prod Tn O' E' E O' B' C' *) subst C'. (* Goal: @Prod Tn O' E' E O' B' O' *) apply(prod_0_l). (* Goal: @Col Tn O' E' B' *) (* Goal: not (@Col Tn O' E' E) *) intro. (* Goal: @Col Tn O' E' B' *) (* Goal: False *) apply H. (* Goal: @Col Tn O' E' B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists E. (* Goal: @Col Tn O' E' B' *) (* Goal: and (@Col Tn E O E) (@Col Tn E O' E') *) split; Col. (* Goal: @Col Tn O' E' B' *) unfold Ar1 in H1. (* Goal: @Col Tn O' E' B' *) spliter. (* Goal: @Col Tn O' E' B' *) Col. Qed. Lemma change_grid_prod1 : forall O E E' B C O' A' B' C', Par_strict O E O' E' -> Ar1 O E E B C -> Ar1 O' E' A' B' C' -> Pj O O' E E' -> Pj O O' E A' -> Pj O O' B B' -> Pj O O' C C' -> Prod O E E' E B C -> Prod O' E' E A' B' C'. Proof. (* Goal: forall (O E E' B C O' A' B' C' : @Tpoint Tn) (_ : @Par_strict Tn O E O' E') (_ : @Ar1 Tn O E E B C) (_ : @Ar1 Tn O' E' A' B' C') (_ : @Pj Tn O O' E E') (_ : @Pj Tn O O' E A') (_ : @Pj Tn O O' B B') (_ : @Pj Tn O O' C C') (_ : @Prod Tn O E E' E B C), @Prod Tn O' E' E A' B' C' *) intros. (* Goal: @Prod Tn O' E' E A' B' C' *) induction (eq_dec_points B O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst B. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) apply prod_comm. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E B' A' C' *) unfold Ar1 in *. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E B' A' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E B' A' C' *) apply(change_grid_prod_l_O O E E' E C O' B' A' C'); auto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' O E C *) (* Goal: @Ar1 Tn O' E' B' A' C' *) (* Goal: @Ar1 Tn O E O E C *) repeat split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' O E C *) (* Goal: @Ar1 Tn O' E' B' A' C' *) repeat split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' O E C *) apply prod_comm. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' E O C *) assumption. (* Goal: @Prod Tn O' E' E A' B' C' *) induction(eq_dec_points C O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst C. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) apply prod_null in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) induction H6. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' O A' B' C' *) apply par_strict_distinct in H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' O A' B' C' *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst B. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HP:= H6). (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Prod in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar2 in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H9. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar1 in H1. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HH:=prod_1_l O E E' B H6 H11). (* Goal: @Prod Tn O' E' E A' B' C' *) assert(B = C). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) B C *) apply (prod_uniqueness O E E' E B); auto. (* Goal: @Prod Tn O' E' E A' B' C' *) subst C. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(A' = E'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) A' E' *) apply(l6_21 E E' O' E'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: not (@Col Tn E E' O') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: and (@Col Tn E O E) (@Col Tn E O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) induction H2; induction H3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) assert(Par E A' E E'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Par Tn E A' E E' *) apply(par_trans _ _ O O'); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) induction H15. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: False *) apply H15. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E A') (@Col Tn X E E')) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: and (@Col Tn E E A') (@Col Tn E E E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) subst A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' E *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E' A' *) subst E'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) (* Goal: @Col Tn E E A' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' A' *) subst A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst A'. (* Goal: @Prod Tn O' E' E E' B' C' *) assert(C' = B'). (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @eq (@Tpoint Tn) C' B' *) apply(l6_21 B' B O' E'); Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: not (@Col Tn B' B O') *) intro. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists B. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: and (@Col Tn B O E) (@Col Tn B O' E') *) split; Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) assert(B' <> O'). (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: not (@eq (@Tpoint Tn) B' O') *) intro. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) subst B'. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) induction H4. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: False *) induction H4. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H4. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X B O')) *) exists O'. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn O' O O') (@Col Tn O' B O') *) split; Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) subst B. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B O' E' *) ColR. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) induction H4; induction H5. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) assert(Par B C' B B'). (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Par Tn B C' B B' *) apply(par_trans _ _ O O'); Par. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) induction H15. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) apply False_ind. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: False *) apply H15. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B C') (@Col Tn X B B')) *) exists B. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: and (@Col Tn B B C') (@Col Tn B B B') *) split; Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) spliter. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) subst C'. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B B *) Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B' B C' *) subst B'. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) (* Goal: @Col Tn B B C' *) Col. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B C' *) subst C'. (* Goal: @Prod Tn O' E' E E' B' C' *) (* Goal: @Col Tn B' B B *) Col. (* Goal: @Prod Tn O' E' E E' B' C' *) subst C'. (* Goal: @Prod Tn O' E' E E' B' B' *) apply (prod_1_l O' E' E); Col. (* Goal: not (@Col Tn O' E' E) *) intro. (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists E. (* Goal: and (@Col Tn E O E) (@Col Tn E O' E') *) split; Col. Qed. Lemma change_grid_prod : forall O E E' A B C O' A' B' C', Par_strict O E O' E' -> Ar1 O E A B C -> Ar1 O' E' A' B' C' -> Pj O O' E E' -> Pj O O' A A' -> Pj O O' B B' -> Pj O O' C C' -> Prod O E E' A B C -> Prod O' E' E A' B' C'. Proof. (* Goal: forall (O E E' A B C O' A' B' C' : @Tpoint Tn) (_ : @Par_strict Tn O E O' E') (_ : @Ar1 Tn O E A B C) (_ : @Ar1 Tn O' E' A' B' C') (_ : @Pj Tn O O' E E') (_ : @Pj Tn O O' A A') (_ : @Pj Tn O O' B B') (_ : @Pj Tn O O' C C') (_ : @Prod Tn O E E' A B C), @Prod Tn O' E' E A' B' C' *) intros. (* Goal: @Prod Tn O' E' E A' B' C' *) induction (eq_dec_points A O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst A. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) apply(change_grid_prod_l_O O E E' B C O' A' B' C'); auto. (* Goal: @Prod Tn O' E' E A' B' C' *) induction (eq_dec_points B O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst B. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) apply prod_comm. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E B' A' C' *) unfold Ar1 in *. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E B' A' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E B' A' C' *) apply(change_grid_prod_l_O O E E' A C O' B' A' C'); auto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' O A C *) (* Goal: @Ar1 Tn O' E' B' A' C' *) (* Goal: @Ar1 Tn O E O A C *) repeat split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' O A C *) (* Goal: @Ar1 Tn O' E' B' A' C' *) repeat split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' O A C *) apply prod_comm. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O E E' A O C *) assumption. (* Goal: @Prod Tn O' E' E A' B' C' *) induction(eq_dec_points C O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst C. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) apply prod_null in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) induction H6;contradiction. (* Goal: @Prod Tn O' E' E A' B' C' *) induction(eq_dec_points A E). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) subst A. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' E A' B' C' *) apply (change_grid_prod1 O E E' B C); auto. (* Goal: @Prod Tn O' E' E A' B' C' *) rename H10 into ANE. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HP:=H6). (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Prod in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H10. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar1 in *. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar2 in H6. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) clean_duplicated_hyps. (* Goal: @Prod Tn O' E' E A' B' C' *) prolong O O' E'' O O'. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(E''<> O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) E'' O) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) subst E''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply between_identity in H10. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) subst O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O E')) *) exists O. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O O E) (@Col Tn O O E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(~Col O E E''). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@Col Tn O E E'') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) apply bet_col in H10. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HH:= prod_y_axis_change O E E' E'' A B C HP H19). (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HP1:= HH). (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Prod in HH. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H21 B''. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(~Col O E'' E). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@Col Tn O E'' E) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H19. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O E E'' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(exists C : Tpoint, Sum O E'' E E'' O' C). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E'' E E'' O' C) *) apply(sum_exists O E'' E H24 E'' O'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H25 C2. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(~ Col O E'' A). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@Col Tn O E'' A) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H24. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O E'' E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HH:= sum_y_axis_change O E'' E A E'' O' C2 H26 H25). (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HS1:= HH). (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Sum in HH. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar2 in H27. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H27. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H28 A0. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H27 A0'. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(A = A0). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) A A0 *) apply(l6_21 O E E'' A); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn O E A0 *) (* Goal: not (@eq (@Tpoint Tn) E'' A) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn O E A0 *) (* Goal: False *) subst A. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn O E A0 *) (* Goal: False *) apply H25. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn O E A0 *) (* Goal: @Col Tn O E'' E'' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn O E A0 *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) induction H27. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) induction H27. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) (* Goal: False *) apply H27. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E'' A) (@Col Tn X E'' A0)) *) exists E''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) (* Goal: and (@Col Tn E'' E'' A) (@Col Tn E'' E'' A0) *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) (* Goal: @Col Tn E'' A A0 *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A A0 *) subst A0. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' A E'' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst A0. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par O O' E E'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' E E' *) induction H2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' E E' *) (* Goal: @Par Tn O O' E E' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' E E' *) subst E'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' E E *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H6. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O E E *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par O O' A A'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' A A' *) induction H3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' A A' *) (* Goal: @Par Tn O O' A A' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' A A' *) subst A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' A A *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists A. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn A O E) (@Col Tn A O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par O O' B B'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' B B' *) induction H4. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' B B' *) (* Goal: @Par Tn O O' B B' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' B B' *) subst B'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' B B *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists B. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn B O E) (@Col Tn B O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par O O' C C'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' C C' *) induction H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' C C' *) (* Goal: @Par Tn O O' C C' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' C C' *) subst C'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O O' C C *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists C. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn C O E) (@Col Tn C O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(O <> O'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) O O') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) subst O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply par_distinct in H35. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H2 H3 H4 H5. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(A0'=A'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) A0' A' *) apply (l6_21 O' E' A A'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: not (@eq (@Tpoint Tn) A A') *) (* Goal: not (@Col Tn O' E' A) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: not (@eq (@Tpoint Tn) A A') *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: not (@eq (@Tpoint Tn) A A') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists A. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: not (@eq (@Tpoint Tn) A A') *) (* Goal: and (@Col Tn A O E) (@Col Tn A O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: not (@eq (@Tpoint Tn) A A') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: False *) subst A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: False *) apply par_distinct in H36. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: False *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) induction H33. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) assert(Par O' E' O' A0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Par Tn O' E' O' A0' *) apply(par_trans _ _ O A); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Par Tn O' E' O A *) apply(par_col_par _ _ _ E); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Par Tn O' E' O E *) left. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Par_strict Tn O' E' O E *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) induction H3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: False *) apply H3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O' E') (@Col Tn X O' A0')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: and (@Col Tn O' O' E') (@Col Tn O' O' A0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) (* Goal: @Col Tn O' E' A0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' A0' *) subst A0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn O' E' O' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) induction H32. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) assert(Par A A' A A0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Par Tn A A' A A0' *) apply(par_trans _ _ O O'); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Par Tn O O' A A0' *) apply par_symmetry. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Par Tn A A0' O O' *) apply(par_col_par _ _ _ E''); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Par Tn A A0' O E'' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) induction H3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: False *) apply H3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A A') (@Col Tn X A A0')) *) exists A. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) (* Goal: and (@Col Tn A A A') (@Col Tn A A A0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) (* Goal: @Col Tn A A' A0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A0' *) subst A0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A A' A *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst A0'. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par O E'' A A'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O E'' A A' *) induction H32. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O E'' A A' *) (* Goal: @Par Tn O E'' A A' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O E'' A A' *) subst A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O E'' A A *) apply par_distinct in H36. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O E'' A A *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par O A O' A'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O A O' A' *) induction H33. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O A O' A' *) (* Goal: @Par Tn O A O' A' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O A O' A' *) subst A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn O A O' O' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) induction H2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E'') (@Col Tn X A O')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: and (@Col Tn O' O E'') (@Col Tn O' A O') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par A E'' A' C2). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' A' C2 *) induction H34. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' A' C2 *) (* Goal: @Par Tn A E'' A' C2 *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' A' C2 *) subst C2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' A' A' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) induction H2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E'') (@Col Tn X A A')) *) exists A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: and (@Col Tn A' O E'') (@Col Tn A' A A') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists A'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn A' O E) (@Col Tn A' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn A' O E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H33 H34 H32. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HS0:= H26). (* Goal: @Prod Tn O' E' E A' B' C' *) induction H26. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar2 in H5. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) clean_duplicated_hyps. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H26 E0. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H5 E0'. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(E0 = E). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) E0 E *) apply (l6_21 E'' E O E); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) induction H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) induction H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) (* Goal: False *) apply H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E'' E) (@Col Tn X E'' E0)) *) exists E''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) (* Goal: and (@Col Tn E'' E'' E) (@Col Tn E'' E'' E0) *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) (* Goal: @Col Tn E'' E E0 *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E0 *) subst E0. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E'' E E'' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst E0. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(E0' = E'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) E0' E' *) apply(l6_21 O' E' E E'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: not (@Col Tn O' E' E) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: not (@eq (@Tpoint Tn) E E') *) (* Goal: and (@Col Tn E O E) (@Col Tn E O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: not (@eq (@Tpoint Tn) E E') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: False *) subst E'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: False *) apply H6. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O E E *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) induction H30. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) assert(Par O' E' O' E0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Par Tn O' E' O' E0' *) apply(par_trans _ _ O E); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) induction H40. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: False *) apply H40. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O' E') (@Col Tn X O' E0')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: and (@Col Tn O' O' E') (@Col Tn O' O' E0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) (* Goal: @Col Tn O' E' E0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' E0' *) subst E0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn O' E' O' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) induction H29. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) assert(Par E E' E E0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Par Tn E E' E E0' *) apply(par_trans _ _ O E''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Par Tn E E' O E'' *) apply (par_col_par _ _ _ O'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Par Tn E E' O O' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) induction H40. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) (* Goal: False *) apply H40. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X E E0')) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) (* Goal: and (@Col Tn E E E') (@Col Tn E E E0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) (* Goal: @Col Tn E E' E0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E0' *) subst E0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn E E' E *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst E0'. (* Goal: @Prod Tn O' E' E A' B' C' *) clean_trivial_hyps. (* Goal: @Prod Tn O' E' E A' B' C' *) clean_duplicated_hyps. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par E E'' E' C2). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' E' C2 *) induction H31. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' E' C2 *) (* Goal: @Par Tn E E'' E' C2 *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' E' C2 *) subst C2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' E' E' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) assert(Col O O' E'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn O O' E' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H31. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H5. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H30. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H29. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par E E'' B B''). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B B'' *) induction H21. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B B'' *) (* Goal: @Par Tn E E'' B B'' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B B'' *) subst B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B B *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H19. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O E E'' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H21. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(exists C : Tpoint, Sum O E'' E B'' O' C). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @Sum Tn O E'' E B'' O' C) *) apply(sum_exists O E'' E H24 B'' O'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H21 C3. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HS2:= H28). (* Goal: @Prod Tn O' E' E A' B' C' *) induction H28. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H28 B0. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H29 B0'. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(B'' <> O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) subst B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) induction H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E'') (@Col Tn X B O)) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: and (@Col Tn E E E'') (@Col Tn E B O) *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H19. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O E E'' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(B0 = B). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) B0 B *) apply (l6_21 O E B'' B); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: not (@eq (@Tpoint Tn) B'' B) *) (* Goal: not (@Col Tn O E B'') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: not (@eq (@Tpoint Tn) B'' B) *) (* Goal: False *) apply H24. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: not (@eq (@Tpoint Tn) B'' B) *) (* Goal: @Col Tn O E'' E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: not (@eq (@Tpoint Tn) B'' B) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: False *) subst B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: False *) apply par_distinct in H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: False *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) induction H28. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) assert(Par B'' B0 B B''). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Par Tn B'' B0 B B'' *) apply(par_trans _ _ E E''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) induction H41. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) (* Goal: False *) apply H41. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B'' B0) (@Col Tn X B B'')) *) exists B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) (* Goal: and (@Col Tn B'' B'' B0) (@Col Tn B'' B B'') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) (* Goal: @Col Tn B'' B B0 *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B0 *) subst B0. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' B B'' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst B0. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(B0' = B'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) B0' B' *) apply (l6_21 O' E' B B'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: not (@Col Tn O' E' B) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists B. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) (* Goal: and (@Col Tn B O E) (@Col Tn B O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: not (@eq (@Tpoint Tn) B B') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: False *) subst B'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: False *) apply par_distinct in H37. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: False *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) induction H31. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) assert(Par O' E' O' B0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Par Tn O' E' O' B0' *) apply(par_trans _ _ O E); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) induction H41. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: False *) apply H41. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O' E') (@Col Tn X O' B0')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: and (@Col Tn O' O' E') (@Col Tn O' O' B0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) (* Goal: @Col Tn O' E' B0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' B0' *) subst B0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn O' E' O' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) induction H30. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) assert(Par B B' B B0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Par Tn B B' B B0' *) apply(par_trans _ _ O E''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Par Tn B B' O E'' *) apply (par_col_par _ _ _ O'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Par Tn B B' O O' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) induction H41. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) (* Goal: False *) apply H41. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B B') (@Col Tn X B B0')) *) exists B. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) (* Goal: and (@Col Tn B B B') (@Col Tn B B B0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) (* Goal: @Col Tn B B' B0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B0' *) subst B0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B B' B *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst B0'. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar2 in H21. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) clean_duplicated_hyps. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(E'' <> O). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) E'' O) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) subst E''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H25. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O A *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(B' <> O'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: not (@eq (@Tpoint Tn) B' O') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) subst B'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) induction H37. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H29. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X B O')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: and (@Col Tn O' O O') (@Col Tn O' B O') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par E E'' B' C3). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B' C3 *) induction H32. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B' C3 *) (* Goal: @Par Tn E E'' B' C3 *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B' C3 *) subst C3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E E'' B' B' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) assert(Col O O' B'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn O O' B' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O O' E' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H32. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par E'' E B'' B). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' E B'' B *) induction H28. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' E B'' B *) (* Goal: @Par Tn E'' E B'' B *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' E B'' B *) subst B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' E B B *) apply par_distinct in H5. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' E B B *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H28. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HH:= sum_y_axis_change O E'' E A B'' O' C3 HS2 H25). (* Goal: @Prod Tn O' E' E A' B' C' *) assert(HS3 := HH). (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Sum in HH. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) unfold Ar2 in H28. (* Goal: @Prod Tn O' E' E A' B' C' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) clean_duplicated_hyps. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H42 C0. (* Goal: @Prod Tn O' E' E A' B' C' *) ex_and H21 C0'. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par E'' A B'' C). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' A B'' C *) induction H23. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' A B'' C *) (* Goal: @Par Tn E'' A B'' C *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' A B'' C *) subst B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn E'' A C C *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) induction H32. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H23. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E'' E) (@Col Tn X C B)) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: and (@Col Tn E E'' E) (@Col Tn E C B) *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @Col Tn E C B *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H19. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O E E'' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) clear H23. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(C0 = C). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) C0 C *) apply (l6_21 O E B'' C); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) (* Goal: not (@eq (@Tpoint Tn) B'' C) *) (* Goal: not (@Col Tn O E B'') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) (* Goal: not (@eq (@Tpoint Tn) B'' C) *) (* Goal: False *) apply H19. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) (* Goal: not (@eq (@Tpoint Tn) B'' C) *) (* Goal: @Col Tn O E E'' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) (* Goal: not (@eq (@Tpoint Tn) B'' C) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) (* Goal: False *) subst B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) (* Goal: False *) apply par_distinct in H46. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) (* Goal: False *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn O E C0 *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) induction H21. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) assert(Par B'' C B'' C0). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Par Tn B'' C B'' C0 *) apply(par_trans _ _ E'' A); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) induction H23. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) (* Goal: False *) apply H23. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B'' C) (@Col Tn X B'' C0)) *) exists B''. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) (* Goal: and (@Col Tn B'' B'' C) (@Col Tn B'' B'' C0) *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) (* Goal: @Col Tn B'' C C0 *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C C0 *) subst C0. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn B'' C B'' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst C0. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(C0' = C'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @eq (@Tpoint Tn) C0' C' *) apply (l6_21 O' E' C C'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: not (@Col Tn O' E' C) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists C. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) (* Goal: and (@Col Tn C O E) (@Col Tn C O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: not (@eq (@Tpoint Tn) C C') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: False *) subst C'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: False *) apply par_distincts in H38. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: False *) tauto. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) induction H44. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) assert(Par O' C' O' C0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O' C' O' C0' *) apply(par_trans _ _ O E); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O' C' O E *) apply par_symmetry. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' C' *) apply(par_col_par _ _ _ E'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: not (@eq (@Tpoint Tn) O' C') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: False *) subst C'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: False *) induction H38. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: False *) (* Goal: False *) apply H38. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X C O')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: False *) (* Goal: and (@Col Tn O' O O') (@Col Tn O' C O') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par Tn O E O' E' *) left. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) (* Goal: @Par_strict Tn O E O' E' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O E O' C0' *) apply par_symmetry. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O' C0' O E *) apply(par_col_par _ _ _ A); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Par Tn O' C0' O A *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) induction H44. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: False *) apply H44. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O' C') (@Col Tn X O' C0')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: and (@Col Tn O' O' C') (@Col Tn O' O' C0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) (* Goal: @Col Tn O' E' C0' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' C0' *) subst C0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn O' E' O' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) induction H42. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) assert(Par C C' C C0'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Par Tn C C' C C0' *) apply(par_trans _ _ O O'); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Par Tn O O' C C0' *) apply par_symmetry. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Par Tn C C0' O O' *) apply (par_col_par _ _ _ E''); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Par Tn C C0' O E'' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) induction H42. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: False *) apply H42. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C C') (@Col Tn X C C0')) *) exists C. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) (* Goal: and (@Col Tn C C C') (@Col Tn C C C0') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) (* Goal: @Col Tn C C' C0' *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C0' *) subst C0'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) induction H44. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) induction H23. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) (* Goal: False *) apply H23. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O A) (@Col Tn X O' C)) *) exists C. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) (* Goal: and (@Col Tn C O A) (@Col Tn C O' C) *) split;Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn C C' C *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn C C' C *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) subst C0'. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par B B'' B' C3). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn B B'' B' C3 *) apply(par_trans _ _ E E''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Par C B'' C' C3). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn C B'' C' C3 *) apply(par_trans _ _ A E''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C3 *) induction H45. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C3 *) (* Goal: @Par Tn A E'' C' C3 *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C3 *) subst C3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) assert(Par E E'' O E). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Par Tn E E'' O E *) apply(par_trans _ _ O' E'); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Par Tn E E'' O' E' *) apply(par_col_par _ _ _ C'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Par Tn E E'' O' C' *) apply par_comm. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Par Tn E'' E C' O' *) apply(par_col_par _ _ _ B'); Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: not (@eq (@Tpoint Tn) C' O') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: False *) subst C'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: False *) induction H38. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: False *) (* Goal: False *) apply H38. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O O') (@Col Tn X C O')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: False *) (* Goal: and (@Col Tn O' O O') (@Col Tn O' C O') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O'. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: and (@Col Tn O' O E) (@Col Tn O' O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) (* Goal: @Col Tn O' O E *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) (* Goal: @Par Tn E'' E C' B' *) Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) (* Goal: @Col Tn C' B' O' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn A E'' C' C' *) apply False_ind. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) induction H45. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: False *) apply H45. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E'') (@Col Tn X O E)) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) (* Goal: and (@Col Tn E E E'') (@Col Tn E O E) *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: False *) apply H24. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Col Tn O E'' E *) Col. (* Goal: @Prod Tn O' E' E A' B' C' *) assert(Prod O' E' C2 A' B' C'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Prod Tn O' E' C2 A' B' C' *) repeat split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: not (@Col Tn O' E' C2) *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) assert(C2 <> O'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) C2 O') *) intro. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) subst C2. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) assert(Par O E E E''). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) (* Goal: @Par Tn O E E E'' *) apply(par_trans _ _ O' E'); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) induction H49. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H49. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X E E'')) *) exists E. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E O E) (@Col Tn E E E'') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) assert(Col O O' C2). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: @Col Tn O O' C2 *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) assert(Col O O' E'). (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) (* Goal: @Col Tn O O' E' *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: False *) apply H. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists O. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) (* Goal: and (@Col Tn O O E) (@Col Tn O O' E') *) split; Col. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @ex (@Tpoint Tn) (fun B'0 : @Tpoint Tn => and (@Pj Tn E' C2 B' B'0) (and (@Col Tn O' C2 B'0) (@Pj Tn C2 A' B'0 C'))) *) exists C3. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Pj Tn E' C2 B' C3) (and (@Col Tn O' C2 C3) (@Pj Tn C2 A' C3 C')) *) split. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' C2 C3) (@Pj Tn C2 A' C3 C') *) (* Goal: @Pj Tn E' C2 B' C3 *) left. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' C2 C3) (@Pj Tn C2 A' C3 C') *) (* Goal: @Par Tn E' C2 B' C3 *) apply (par_trans _ _ B B''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' C2 C3) (@Pj Tn C2 A' C3 C') *) (* Goal: @Par Tn E' C2 B B'' *) apply (par_trans _ _ E E''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: and (@Col Tn O' C2 C3) (@Pj Tn C2 A' C3 C') *) split. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Pj Tn C2 A' C3 C' *) (* Goal: @Col Tn O' C2 C3 *) ColR. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Pj Tn C2 A' C3 C' *) left. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn C2 A' C3 C' *) apply(par_trans _ _ C B''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) (* Goal: @Par Tn C2 A' C B'' *) apply(par_trans _ _ A E''); Par. (* Goal: @Prod Tn O' E' E A' B' C' *) apply(prod_y_axis_change O' E' C2 E A' B' C' H48). (* Goal: not (@Col Tn O' E' E) *) intro. (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O E) (@Col Tn X O' E')) *) exists E. (* Goal: and (@Col Tn E O E) (@Col Tn E O' E') *) split; Col. Qed. Lemma prod_sym : forall O E E' A B C, Prod O E E' A B C -> Prod O E E' B A C. Proof. (* Goal: forall (O E E' A B C : @Tpoint Tn) (_ : @Prod Tn O E E' A B C), @Prod Tn O E E' B A C *) intros. (* Goal: @Prod Tn O E E' B A C *) apply (prod_comm O E E'). (* Goal: @Prod Tn O E E' A B C *) assumption. Qed. Lemma l14_31_1 : forall O E E' A B C D, Ar2_4 O E E' A B C D -> C <> O -> (exists X, Prod O E E' A B X /\ Prod O E E' C D X) -> Prod O C E' A B D. Proof. (* Goal: forall (O E E' A B C D : @Tpoint Tn) (_ : @Ar2_4 Tn O E E' A B C D) (_ : not (@eq (@Tpoint Tn) C O)) (_ : @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X))), @Prod Tn O C E' A B D *) intros. (* Goal: @Prod Tn O C E' A B D *) ex_and H1 X. (* Goal: @Prod Tn O C E' A B D *) spliter. (* Goal: @Prod Tn O C E' A B D *) unfold Ar2_4 in H. (* Goal: @Prod Tn O C E' A B D *) spliter. (* Goal: @Prod Tn O C E' A B D *) induction(eq_dec_points A O). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B D *) subst A. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) assert(HH:= prod_0_l O E E' B H H4). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) assert(X=O). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) (* Goal: @eq (@Tpoint Tn) X O *) apply (prod_O_l_eq O E E' B); assumption. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) subst X. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) apply (prod_null)in H2. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) induction H2. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) (* Goal: @Prod Tn O C E' O B D *) contradiction. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B D *) subst D. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' O B O *) apply(prod_0_l O C E' B). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C B *) (* Goal: not (@Col Tn O C E') *) intro. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C B *) (* Goal: False *) apply H. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C B *) assert(HG:=grid_not_par O E E' H). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C B *) spliter. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C B *) ColR. (* Goal: @Prod Tn O C E' A B D *) induction(eq_dec_points B O). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B D *) subst B. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) assert(HH:= prod_0_r O E E' A H H3). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) assert(X=O). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) (* Goal: @eq (@Tpoint Tn) X O *) apply (prod_O_r_eq O E E' A); assumption. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) subst X. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) apply (prod_null)in H2. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) induction H2. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) (* Goal: @Prod Tn O C E' A O D *) contradiction. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O D *) subst D. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A O O *) apply(prod_0_r O C E' A). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C A *) (* Goal: not (@Col Tn O C E') *) intro. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C A *) (* Goal: False *) apply H. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C A *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C A *) assert(HG:=grid_not_par O E E' H). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C A *) spliter. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O C A *) ColR. (* Goal: @Prod Tn O C E' A B D *) induction(eq_dec_points D O). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B D *) subst D. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) assert(HH:= prod_0_r O E E' C H H5). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) assert(X=O). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) (* Goal: @eq (@Tpoint Tn) X O *) apply (prod_O_r_eq O E E' C); assumption. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) subst X. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) apply (prod_null)in H1. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) induction H1. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) (* Goal: @Prod Tn O C E' A B O *) contradiction. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Prod Tn O C E' A B O *) contradiction. (* Goal: @Prod Tn O C E' A B D *) assert(HG:=grid_not_par O E E' H). (* Goal: @Prod Tn O C E' A B D *) spliter. (* Goal: @Prod Tn O C E' A B D *) assert(exists ! P' : Tpoint, Proj B P' O E' E' C). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn B P' O E' E' C)) *) apply(project_existence B O E' E' C). (* Goal: @Prod Tn O C E' A B D *) (* Goal: not (@Par Tn E' C O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) E' C) *) intro. (* Goal: @Prod Tn O C E' A B D *) (* Goal: not (@Par Tn E' C O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) subst C. (* Goal: @Prod Tn O C E' A B D *) (* Goal: not (@Par Tn E' C O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) contradiction. (* Goal: @Prod Tn O C E' A B D *) (* Goal: not (@Par Tn E' C O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) auto. (* Goal: @Prod Tn O C E' A B D *) (* Goal: not (@Par Tn E' C O E') *) intro. (* Goal: @Prod Tn O C E' A B D *) (* Goal: False *) induction H16. (* Goal: @Prod Tn O C E' A B D *) (* Goal: False *) (* Goal: False *) apply H16. (* Goal: @Prod Tn O C E' A B D *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' C) (@Col Tn X O E')) *) exists E'. (* Goal: @Prod Tn O C E' A B D *) (* Goal: False *) (* Goal: and (@Col Tn E' E' C) (@Col Tn E' O E') *) split; Col. (* Goal: @Prod Tn O C E' A B D *) (* Goal: False *) spliter. (* Goal: @Prod Tn O C E' A B D *) (* Goal: False *) apply H. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O C E' A B D *) ex_and H16 B''. (* Goal: @Prod Tn O C E' A B D *) unfold unique in H17. (* Goal: @Prod Tn O C E' A B D *) spliter. (* Goal: @Prod Tn O C E' A B D *) clear H17. (* Goal: @Prod Tn O C E' A B D *) unfold Proj in H16. (* Goal: @Prod Tn O C E' A B D *) spliter. (* Goal: @Prod Tn O C E' A B D *) assert(Par B B'' E' C). (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Par Tn B B'' E' C *) induction H20. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Par Tn B B'' E' C *) (* Goal: @Par Tn B B'' E' C *) Par. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Par Tn B B'' E' C *) subst B''. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Par Tn B B E' C *) apply False_ind. (* Goal: @Prod Tn O C E' A B D *) (* Goal: False *) apply H. (* Goal: @Prod Tn O C E' A B D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O C E' A B D *) clear H20. (* Goal: @Prod Tn O C E' A B D *) unfold Prod. (* Goal: and (@Ar2 Tn O C E' A B D) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn C E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' D)))) *) repeat split; try ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn C E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' D))) *) (* Goal: not (@Col Tn O C E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn C E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' D))) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn C E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' D))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn C E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' D))) *) exists B''. (* Goal: and (@Pj Tn C E' B B'') (and (@Col Tn O E' B'') (@Pj Tn E' A B'' D)) *) split. (* Goal: and (@Col Tn O E' B'') (@Pj Tn E' A B'' D) *) (* Goal: @Pj Tn C E' B B'' *) left. (* Goal: and (@Col Tn O E' B'') (@Pj Tn E' A B'' D) *) (* Goal: @Par Tn C E' B B'' *) Par. (* Goal: and (@Col Tn O E' B'') (@Pj Tn E' A B'' D) *) split. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Col Tn O E' B'' *) Col. (* Goal: @Pj Tn E' A B'' D *) assert(HP1:=H1). (* Goal: @Pj Tn E' A B'' D *) assert(HP2:=H2). (* Goal: @Pj Tn E' A B'' D *) unfold Prod in H1. (* Goal: @Pj Tn E' A B'' D *) unfold Prod in H2. (* Goal: @Pj Tn E' A B'' D *) spliter. (* Goal: @Pj Tn E' A B'' D *) ex_and H22 B'. (* Goal: @Pj Tn E' A B'' D *) ex_and H20 D'. (* Goal: @Pj Tn E' A B'' D *) assert(B' <> O). (* Goal: @Pj Tn E' A B'' D *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) subst B'. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) induction H22. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) (* Goal: False *) induction H22. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H22. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X B O)) *) exists E. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E E E') (@Col Tn E B O) *) split; Col. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) contradiction. (* Goal: @Pj Tn E' A B'' D *) assert(Par E B'' C B'). (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn E B'' C B' *) apply(l13_11 E C B B' B'' E' O); Col. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O C B *) (* Goal: not (@Col Tn O E B') *) intro. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O C B *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O C B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O C B *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) intro. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) subst B''. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) induction H21. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) (* Goal: False *) apply H21. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B O) (@Col Tn X E' C)) *) exists C. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) (* Goal: and (@Col Tn C B O) (@Col Tn C E' C) *) split; Col. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) (* Goal: @Col Tn C B O *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) (* Goal: @Col Tn O B' B'' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn C E' B B'' *) Par. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) induction H22. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' E E' *) Par. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B' E E' *) subst B'. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn B B E E' *) apply False_ind. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) assert(X <> O). (* Goal: @Pj Tn E' A B'' D *) (* Goal: not (@eq (@Tpoint Tn) X O) *) intro. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) subst X. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) apply prod_null in HP1. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) induction HP1; contradiction. (* Goal: @Pj Tn E' A B'' D *) assert(Par A D' C B'). (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn A D' C B' *) apply(l13_11 A C X B' D' E' O); Col. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O C X *) (* Goal: @Col Tn O A C *) (* Goal: not (@Col Tn O A B') *) intro. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O C X *) (* Goal: @Col Tn O A C *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O C X *) (* Goal: @Col Tn O A C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O C X *) (* Goal: @Col Tn O A C *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O C X *) unfold Ar2 in *. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O C X *) spliter. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O C X *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) intro. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) subst D'. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) induction H20. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) (* Goal: False *) induction H20. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H20. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E E') (@Col Tn X D O)) *) exists E. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E E E') (@Col Tn E D O) *) split; Col. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) (* Goal: False *) contradiction. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Col Tn O B' D' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) induction H26. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) (* Goal: @Par Tn C E' X D' *) Par. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X D' *) subst D'. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn C E' X X *) apply False_ind. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Col Tn O E E' *) unfold Ar2 in *. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Col Tn O E E' *) spliter. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) induction H24. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) (* Goal: @Par Tn X B' A E' *) Par. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X B' A E' *) subst B'. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Par Tn X X A E' *) apply False_ind. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) unfold Ar2 in *. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' A B'' D *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' A B'' D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' A B'' D *) left. (* Goal: @Par Tn E' A B'' D *) apply par_symmetry. (* Goal: @Par Tn B'' D E' A *) apply par_comm. (* Goal: @Par Tn D B'' A E' *) unfold Ar2 in *. (* Goal: @Par Tn D B'' A E' *) spliter. (* Goal: @Par Tn D B'' A E' *) apply(l13_11 D A E E' B'' D' O); Col. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O D A *) (* Goal: not (@Col Tn O D E') *) intro. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O D A *) (* Goal: False *) apply H. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O D A *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) (* Goal: @Col Tn O D A *) ColR. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) intro. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: False *) subst B''. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: False *) induction H28. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: False *) (* Goal: False *) apply H28. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E O) (@Col Tn X C B')) *) exists C. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: False *) (* Goal: and (@Col Tn C E O) (@Col Tn C C B') *) split; Col. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: False *) spliter. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: False *) apply H. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) intro. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) subst D'. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) induction H30. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) (* Goal: False *) apply H30. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A O) (@Col Tn X C B')) *) exists C. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) (* Goal: and (@Col Tn C A O) (@Col Tn C C B') *) split; Col. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) (* Goal: @Col Tn C A O *) ColR. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) apply H. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) (* Goal: @Col Tn O B'' D' *) ColR. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn A D' E B'' *) apply (par_trans _ _ C B'); Par. (* Goal: @Par Tn E E' D D' *) induction H20. (* Goal: @Par Tn E E' D D' *) (* Goal: @Par Tn E E' D D' *) Par. (* Goal: @Par Tn E E' D D' *) subst D'. (* Goal: @Par Tn E E' D D *) apply False_ind. (* Goal: False *) apply H. (* Goal: @Col Tn O E E' *) ColR. Qed. Lemma l14_31_2 : forall O E E' A B C D , Ar2_4 O E E' A B C D -> C <> O -> Prod O C E' A B D -> (exists X, Prod O E E' A B X /\ Prod O E E' C D X). Proof. (* Goal: forall (O E E' A B C D : @Tpoint Tn) (_ : @Ar2_4 Tn O E E' A B C D) (_ : not (@eq (@Tpoint Tn) C O)) (_ : @Prod Tn O C E' A B D), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) unfold Ar2_4 in H. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) assert(HG:= grid_not_par O E E' H). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) induction(eq_dec_points A O). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' O B X) (@Prod Tn O E E' C D X)) *) assert(D = O). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' O B X) (@Prod Tn O E E' C D X)) *) (* Goal: @eq (@Tpoint Tn) D O *) apply(prod_O_l_eq O C E' B); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' O B X) (@Prod Tn O E E' C D X)) *) subst D. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' O B X) (@Prod Tn O E E' C O X)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' O B O) (@Prod Tn O E E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Prod Tn O E E' C O O *) (* Goal: @Prod Tn O E E' O B O *) apply(prod_0_l O E E' B); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Prod Tn O E E' C O O *) apply(prod_0_r O E E' C); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) induction(eq_dec_points B O). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) subst B. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A O X) (@Prod Tn O E E' C D X)) *) assert(D = O). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A O X) (@Prod Tn O E E' C D X)) *) (* Goal: @eq (@Tpoint Tn) D O *) apply(prod_O_r_eq O C E' A); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A O X) (@Prod Tn O E E' C D X)) *) subst D. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A O X) (@Prod Tn O E E' C O X)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A O O) (@Prod Tn O E E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Prod Tn O E E' C O O *) (* Goal: @Prod Tn O E E' A O O *) apply(prod_0_r O E E' A); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Prod Tn O E E' C O O *) apply(prod_0_r O E E' C); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) induction(eq_dec_points D O). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) subst D. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C O X)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) apply prod_null in H1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) induction H1. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) (* Goal: and (@Prod Tn O E E' O B O) (@Prod Tn O E E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) (* Goal: @Prod Tn O E E' C O O *) (* Goal: @Prod Tn O E E' O B O *) apply(prod_0_l O E E' B); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) (* Goal: @Prod Tn O E E' C O O *) apply(prod_0_r O E E' C); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A B O) (@Prod Tn O E E' C O O) *) subst B. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: and (@Prod Tn O E E' A O O) (@Prod Tn O E E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Prod Tn O E E' C O O *) (* Goal: @Prod Tn O E E' A O O *) apply(prod_0_r O E E' A); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Prod Tn O E E' C O O *) apply(prod_0_r O E E' C); Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) assert(exists ! P' : Tpoint, Proj B P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn B P' O E' E E')) *) apply(project_existence B O E' E E'); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) apply H8. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) ex_and H15 B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) unfold unique in H16. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) clear H16. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) unfold Proj in H15. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) assert(Par B B' E E'). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn B B' E E' *) induction H19. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn B B' E E' *) (* Goal: @Par Tn B B' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn B B' E E' *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn B B E E' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) clear H19. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) assert(exists ! P' : Tpoint, Proj B' P' O E E' A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn B' P' O E E' A)) *) apply(project_existence B' O E E' A); auto. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: not (@eq (@Tpoint Tn) E' A) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: False *) subst A. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@Par Tn E' A O E) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@Par Tn E' A O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) induction H19. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) apply H19. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' A) (@Col Tn X O E)) *) exists A. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: and (@Col Tn A E' A) (@Col Tn A O E) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) ex_and H19 X. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) unfold unique in H21. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) clear H21. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) unfold Proj in H19. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) clean_duplicated_hyps. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) assert(X <> O). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@eq (@Tpoint Tn) X O) *) intro. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) subst X. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) induction H24. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) induction H15. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H15. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B' O) (@Col Tn X E' A)) *) exists E'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn E' B' O) (@Col Tn E' E' A) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) induction H20. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: False *) apply H15. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B O) (@Col Tn X E E')) *) exists E. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) (* Goal: and (@Col Tn E B O) (@Col Tn E E E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) assert(Par B' X E' A). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn B' X E' A *) induction H24. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn B' X E' A *) (* Goal: @Par Tn B' X E' A *) Par. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn B' X E' A *) subst B'. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Par Tn X X E' A *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) clear H24. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) exists X. (* Goal: and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X) *) unfold Prod in *. (* Goal: and (and (@Ar2 Tn O E E' A B X) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' X))))) (and (@Ar2 Tn O E E' C D X) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))))) *) spliter. (* Goal: and (and (@Ar2 Tn O E E' A B X) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' X))))) (and (@Ar2 Tn O E E' C D X) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))))) *) ex_and H17 B''. (* Goal: and (and (@Ar2 Tn O E E' A B X) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' X))))) (and (@Ar2 Tn O E E' C D X) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))))) *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' X))) *) exists B'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: and (@Pj Tn E E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' X)) *) split. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: and (@Col Tn O E' B') (@Pj Tn E' A B' X) *) (* Goal: @Pj Tn E E' B B' *) left. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: and (@Col Tn O E' B') (@Pj Tn E' A B' X) *) (* Goal: @Par Tn E E' B B' *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: and (@Col Tn O E' B') (@Pj Tn E' A B' X) *) split. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Pj Tn E' A B' X *) (* Goal: @Col Tn O E' B' *) Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Pj Tn E' A B' X *) induction H24. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Pj Tn E' A B' X *) (* Goal: @Pj Tn E' A B' X *) left. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Pj Tn E' A B' X *) (* Goal: @Par Tn E' A B' X *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Pj Tn E' A B' X *) subst B''. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Pj Tn E' A B' X *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) assert(exists ! P' : Tpoint, Proj D P' O E' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn D P' O E' E E')) *) apply(project_existence D O E' E E'); Col. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: not (@Par Tn E E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: False *) apply H8. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Par Tn O E' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) ex_and H25 D'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) unfold unique in H26. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) clear H26. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) unfold Proj in H25. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) clean_duplicated_hyps. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) assert(Par D D' E E'). (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Par Tn D D' E E' *) induction H29. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Par Tn D D' E E' *) (* Goal: @Par Tn D D' E E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Par Tn D D' E E' *) subst D'. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Par Tn D D E E' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) clear H29. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn E E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' X))) *) exists D'. (* Goal: and (@Pj Tn E E' D D') (and (@Col Tn O E' D') (@Pj Tn E' C D' X)) *) split. (* Goal: and (@Col Tn O E' D') (@Pj Tn E' C D' X) *) (* Goal: @Pj Tn E E' D D' *) left. (* Goal: and (@Col Tn O E' D') (@Pj Tn E' C D' X) *) (* Goal: @Par Tn E E' D D' *) Par. (* Goal: and (@Col Tn O E' D') (@Pj Tn E' C D' X) *) split. (* Goal: @Pj Tn E' C D' X *) (* Goal: @Col Tn O E' D' *) Col. (* Goal: @Pj Tn E' C D' X *) left. (* Goal: @Par Tn E' C D' X *) assert(Par X D' B B''). (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn X D' B B'' *) apply(l13_11 X B D B'' D' B' O); auto. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: not (@Col Tn O X B'') *) intro. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) assert(B''<>O). (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: not (@eq (@Tpoint Tn) B'' O) *) intro. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) subst B''. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) induction H17. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: False *) induction H17. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H17. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C E') (@Col Tn X B O)) *) exists C. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn C C E') (@Col Tn C B O) *) split; Col. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn C B O *) ColR. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) (* Goal: False *) contradiction. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: False *) apply H. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O X B *) ColR. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) (* Goal: @Col Tn O B D *) ColR. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: not (@eq (@Tpoint Tn) D' O) *) intro. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) subst D'. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) induction H25. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) (* Goal: False *) apply H25. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X D O) (@Col Tn X E E')) *) exists E. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) (* Goal: and (@Col Tn E D O) (@Col Tn E E E') *) split; Col. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) spliter. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) (* Goal: False *) contradiction. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) subst B'. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) induction H20. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) (* Goal: False *) apply H20. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B O) (@Col Tn X E E')) *) exists E. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) (* Goal: and (@Col Tn E B O) (@Col Tn E E E') *) split; Col. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) spliter. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) (* Goal: False *) contradiction. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) (* Goal: @Col Tn O B'' D' *) ColR. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) (* Goal: @Col Tn O D' B' *) ColR. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) Par. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn B B' D D' *) apply(par_trans _ _ E E'); Par. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) induction H24. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) (* Goal: @Par Tn D B'' X B' *) apply(par_trans _ _ E' A); Par. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D B'' X B' *) subst B''. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn D D X B' *) apply False_ind. (* Goal: @Par Tn E' C D' X *) (* Goal: False *) apply H. (* Goal: @Par Tn E' C D' X *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Par Tn E' C D' X *) induction H17. (* Goal: @Par Tn E' C D' X *) (* Goal: @Par Tn E' C D' X *) apply (par_trans _ _ B B''); Par. (* Goal: @Par Tn E' C D' X *) subst B''. (* Goal: @Par Tn E' C D' X *) apply par_distincts in H26. (* Goal: @Par Tn E' C D' X *) tauto. Qed. Lemma prod_x_axis_unit_change : forall O E E' A B C D U, Ar2_4 O E E' A B C D -> Col O E U -> U <> O -> ( exists X, Prod O E E' A B X /\ Prod O E E' C D X) -> ( exists Y, Prod O U E' A B Y /\ Prod O U E' C D Y). Proof. (* Goal: forall (O E E' A B C D U : @Tpoint Tn) (_ : @Ar2_4 Tn O E E' A B C D) (_ : @Col Tn O E U) (_ : not (@eq (@Tpoint Tn) U O)) (_ : @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X))), @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) ex_and H2 X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) unfold Ar2_4 in H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) assert(HG:= grid_not_par O E E' H). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) induction(eq_dec_points A O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) assert(X = O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @eq (@Tpoint Tn) X O *) apply(prod_O_l_eq O E E' B); assumption. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) subst X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) apply prod_null in H3. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) induction H3. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) subst C. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' O D Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: and (@Prod Tn O U E' O B O) (@Prod Tn O U E' O D O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Prod Tn O U E' O B O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C D Y)) *) subst D. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C O Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: and (@Prod Tn O U E' O B O) (@Prod Tn O U E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Prod Tn O U E' O B O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) induction(eq_dec_points B O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) subst B. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) assert(X = O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @eq (@Tpoint Tn) X O *) apply(prod_O_r_eq O E E' A); assumption. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) subst X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) apply prod_null in H3. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) induction H3. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) subst C. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' O D Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: and (@Prod Tn O U E' A O O) (@Prod Tn O U E' O D O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Prod Tn O U E' A O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C D Y)) *) subst D. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C O Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: and (@Prod Tn O U E' A O O) (@Prod Tn O U E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Prod Tn O U E' A O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) induction(eq_dec_points C O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) subst C. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) assert(X = O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @eq (@Tpoint Tn) X O *) apply(prod_O_l_eq O E E' D); assumption. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) subst X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) apply prod_null in H2. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) induction H2. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' O D Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: and (@Prod Tn O U E' O B O) (@Prod Tn O U E' O D O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Prod Tn O U E' O B O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Prod Tn O U E' O D O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) (* Goal: @Col Tn O U D *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' O D Y)) *) subst B. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' O D Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: and (@Prod Tn O U E' A O O) (@Prod Tn O U E' O D O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Prod Tn O U E' A O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) (* Goal: @Col Tn O U A *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' O D O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U D *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) induction(eq_dec_points D O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) subst D. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) assert(X = O). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @eq (@Tpoint Tn) X O *) apply(prod_O_r_eq O E E' C); assumption. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) subst X. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) apply prod_null in H2. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) induction H2. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) subst A. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' O B Y) (@Prod Tn O U E' C O Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: and (@Prod Tn O U E' O B O) (@Prod Tn O U E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Prod Tn O U E' O B O *) apply(prod_0_l). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U B *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Prod Tn O U E' C O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Col Tn O U C *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Col Tn O U C *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Col Tn O U C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) (* Goal: @Col Tn O U C *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C O Y)) *) subst B. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A O Y) (@Prod Tn O U E' C O Y)) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: and (@Prod Tn O U E' A O O) (@Prod Tn O U E' C O O) *) split. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Prod Tn O U E' A O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) (* Goal: @Col Tn O U A *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Prod Tn O U E' C O O *) apply(prod_0_r). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O U C *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) assert(exists ! P' : Tpoint, Proj B P' O E' U E'). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn B P' O E' U E')) *) apply(project_existence B O E' U E'). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) subst U. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) auto. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn U E' O E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) induction H18. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: False *) apply H18. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X U E') (@Col Tn X O E')) *) exists E'. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: and (@Col Tn E' U E') (@Col Tn E' O E') *) split;Col. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) ex_and H18 Bu. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) unfold unique in H19. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) clear H19. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) unfold Proj in H18. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) assert(Par B Bu U E'). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn B Bu U E' *) induction H22. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn B Bu U E' *) (* Goal: @Par Tn B Bu U E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn B Bu U E' *) subst Bu. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn B B U E' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) clear H22. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) assert(exists ! P' : Tpoint, Proj Bu P' O E A E'). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn Bu P' O E A E')) *) apply(project_existence Bu O E A E'). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn A E' O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: not (@eq (@Tpoint Tn) A E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn A E' O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) subst A. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn A E' O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) (* Goal: False *) contradiction. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn A E' O E) *) (* Goal: not (@eq (@Tpoint Tn) O E) *) auto. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: not (@Par Tn A E' O E) *) intro. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) induction H22. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: False *) apply H22. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X A E') (@Col Tn X O E)) *) exists A. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: and (@Col Tn A A E') (@Col Tn A O E) *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O E E' *) Col. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) ex_and H22 Xu. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) unfold unique in H24. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) clear H24. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) unfold Proj in H22. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) assert(Par Bu Xu A E'). (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn Bu Xu A E' *) induction H27. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn Bu Xu A E' *) (* Goal: @Par Tn Bu Xu A E' *) Par. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn Bu Xu A E' *) subst Bu. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Par Tn Xu Xu A E' *) apply False_ind. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) induction H23. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: False *) apply H23. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X B Xu) (@Col Tn X U E')) *) exists U. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: and (@Col Tn U B Xu) (@Col Tn U U E') *) split; Col. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) (* Goal: @Col Tn U B Xu *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) spliter. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) clear H27. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Prod Tn O U E' A B Y) (@Prod Tn O U E' C D Y)) *) exists Xu. (* Goal: and (@Prod Tn O U E' A B Xu) (@Prod Tn O U E' C D Xu) *) split. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Prod Tn O U E' A B Xu *) unfold Prod. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: and (@Ar2 Tn O U E' A B Xu) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' Xu)))) *) repeat split; try ColR. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' Xu))) *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' Xu))) *) (* Goal: False *) apply H. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' Xu))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' B B') (and (@Col Tn O E' B') (@Pj Tn E' A B' Xu))) *) exists Bu. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: and (@Pj Tn U E' B Bu) (and (@Col Tn O E' Bu) (@Pj Tn E' A Bu Xu)) *) split. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: and (@Col Tn O E' Bu) (@Pj Tn E' A Bu Xu) *) (* Goal: @Pj Tn U E' B Bu *) left. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: and (@Col Tn O E' Bu) (@Pj Tn E' A Bu Xu) *) (* Goal: @Par Tn U E' B Bu *) Par. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: and (@Col Tn O E' Bu) (@Pj Tn E' A Bu Xu) *) split. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Pj Tn E' A Bu Xu *) (* Goal: @Col Tn O E' Bu *) ColR. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Pj Tn E' A Bu Xu *) left. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Par Tn E' A Bu Xu *) Par. (* Goal: @Prod Tn O U E' C D Xu *) assert(exists ! P' : Tpoint, Proj D P' O E' U E'). (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @ex (@Tpoint Tn) (@unique (@Tpoint Tn) (fun P' : @Tpoint Tn => @Proj Tn D P' O E' U E')) *) apply(project_existence D O E' U E'). (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: not (@eq (@Tpoint Tn) U E') *) intro. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) subst U. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: False *) apply H. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: not (@Par Tn U E' O E') *) (* Goal: not (@eq (@Tpoint Tn) O E') *) auto. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: not (@Par Tn U E' O E') *) intro. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: False *) induction H27. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: False *) (* Goal: False *) apply H27. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X U E') (@Col Tn X O E')) *) exists E'. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: False *) (* Goal: and (@Col Tn E' U E') (@Col Tn E' O E') *) split; Col. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: False *) spliter. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: False *) apply H. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O U E' C D Xu *) ex_and H27 Du. (* Goal: @Prod Tn O U E' C D Xu *) unfold unique in H29. (* Goal: @Prod Tn O U E' C D Xu *) spliter. (* Goal: @Prod Tn O U E' C D Xu *) clear H29. (* Goal: @Prod Tn O U E' C D Xu *) unfold Proj in H27. (* Goal: @Prod Tn O U E' C D Xu *) spliter. (* Goal: @Prod Tn O U E' C D Xu *) assert(Par D Du U E'). (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Par Tn D Du U E' *) induction H32. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Par Tn D Du U E' *) (* Goal: @Par Tn D Du U E' *) Par. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Par Tn D Du U E' *) subst Du. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Par Tn D D U E' *) apply False_ind. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: False *) apply H. (* Goal: @Prod Tn O U E' C D Xu *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Prod Tn O U E' C D Xu *) clear H32. (* Goal: @Prod Tn O U E' C D Xu *) unfold Prod. (* Goal: and (@Ar2 Tn O U E' C D Xu) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' Xu)))) *) repeat split; try ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' Xu))) *) (* Goal: not (@Col Tn O U E') *) intro. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' Xu))) *) (* Goal: False *) apply H. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' Xu))) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Pj Tn U E' D B') (and (@Col Tn O E' B') (@Pj Tn E' C B' Xu))) *) exists Du. (* Goal: and (@Pj Tn U E' D Du) (and (@Col Tn O E' Du) (@Pj Tn E' C Du Xu)) *) split. (* Goal: and (@Col Tn O E' Du) (@Pj Tn E' C Du Xu) *) (* Goal: @Pj Tn U E' D Du *) left. (* Goal: and (@Col Tn O E' Du) (@Pj Tn E' C Du Xu) *) (* Goal: @Par Tn U E' D Du *) Par. (* Goal: and (@Col Tn O E' Du) (@Pj Tn E' C Du Xu) *) split. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Col Tn O E' Du *) Col. (* Goal: @Pj Tn E' C Du Xu *) assert(Prod O C E' A B D). (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Prod Tn O C E' A B D *) apply(l14_31_1 O E E' A B C D). (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@eq (@Tpoint Tn) C O) *) (* Goal: @Ar2_4 Tn O E E' A B C D *) repeat split; Col. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) (* Goal: not (@eq (@Tpoint Tn) C O) *) auto. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X)) *) exists X. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: and (@Prod Tn O E E' A B X) (@Prod Tn O E E' C D X) *) split; Col. (* Goal: @Pj Tn E' C Du Xu *) unfold Prod in H2. (* Goal: @Pj Tn E' C Du Xu *) spliter. (* Goal: @Pj Tn E' C Du Xu *) ex_and H34 B'. (* Goal: @Pj Tn E' C Du Xu *) unfold Prod in H3. (* Goal: @Pj Tn E' C Du Xu *) spliter. (* Goal: @Pj Tn E' C Du Xu *) ex_and H37 D'. (* Goal: @Pj Tn E' C Du Xu *) unfold Prod in H32. (* Goal: @Pj Tn E' C Du Xu *) spliter. (* Goal: @Pj Tn E' C Du Xu *) ex_and H40 D''. (* Goal: @Pj Tn E' C Du Xu *) assert(Xu <> O). (* Goal: @Pj Tn E' C Du Xu *) (* Goal: not (@eq (@Tpoint Tn) Xu O) *) intro. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) subst Xu. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) induction H28. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) apply H28. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X Bu O) (@Col Tn X A E')) *) exists E'. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: and (@Col Tn E' Bu O) (@Col Tn E' A E') *) split; Col. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' C Du Xu *) assert(D'' <> O). (* Goal: @Pj Tn E' C Du Xu *) (* Goal: not (@eq (@Tpoint Tn) D'' O) *) intro. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) subst D''. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) induction H42. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) induction H42. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) (* Goal: False *) apply H42. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X E' A) (@Col Tn X O D)) *) exists A. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) (* Goal: and (@Col Tn A E' A) (@Col Tn A O D) *) split; Col. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) (* Goal: @Col Tn A O D *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) subst D. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) tauto. (* Goal: @Pj Tn E' C Du Xu *) assert(Par Xu Du B D''). (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn Xu Du B D'' *) apply(l13_11 Xu B D D'' Du Bu O); auto. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: not (@eq (@Tpoint Tn) Du O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O Xu B *) (* Goal: not (@Col Tn O Xu D'') *) intro. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: not (@eq (@Tpoint Tn) Du O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O Xu B *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: not (@eq (@Tpoint Tn) Du O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O Xu B *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: not (@eq (@Tpoint Tn) Du O) *) (* Goal: @Col Tn O B D *) (* Goal: @Col Tn O Xu B *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: not (@eq (@Tpoint Tn) Du O) *) (* Goal: @Col Tn O B D *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: not (@eq (@Tpoint Tn) Du O) *) intro. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) subst Du. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) induction H33. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) (* Goal: False *) apply H33. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X D O) (@Col Tn X U E')) *) exists U. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) (* Goal: and (@Col Tn U D O) (@Col Tn U U E') *) split; Col. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) (* Goal: @Col Tn U D O *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: not (@eq (@Tpoint Tn) Bu O) *) intro. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) subst Bu. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) induction H28. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) (* Goal: False *) apply H28. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O Xu) (@Col Tn X A E')) *) exists A. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) (* Goal: and (@Col Tn A O Xu) (@Col Tn A A E') *) split; Col. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) (* Goal: @Col Tn A O Xu *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) spliter. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) (* Goal: @Col Tn O D'' Du *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) (* Goal: @Col Tn O Du Bu *) ColR. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn B Bu D Du *) apply(par_trans _ _ U E'); Par. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) induction H42. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) (* Goal: @Par Tn D D'' Xu Bu *) apply (par_trans _ _ E' A); Par. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D'' Xu Bu *) subst D''. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Par Tn D D Xu Bu *) apply False_ind. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: False *) apply H. (* Goal: @Pj Tn E' C Du Xu *) (* Goal: @Col Tn O E E' *) ColR. (* Goal: @Pj Tn E' C Du Xu *) left. (* Goal: @Par Tn E' C Du Xu *) apply (par_trans _ _ B D''); Par. (* Goal: @Par Tn E' C B D'' *) induction H40. (* Goal: @Par Tn E' C B D'' *) (* Goal: @Par Tn E' C B D'' *) Par. (* Goal: @Par Tn E' C B D'' *) subst D''. (* Goal: @Par Tn E' C B B *) apply False_ind. (* Goal: False *) apply par_distincts in H45. (* Goal: False *) tauto. Qed. Lemma opp_prod : forall O E E' ME X MX, Opp O E E' E ME -> Opp O E E' X MX -> Prod O E E' X ME MX. Proof. (* Goal: forall (O E E' ME X MX : @Tpoint Tn) (_ : @Opp Tn O E E' E ME) (_ : @Opp Tn O E E' X MX), @Prod Tn O E E' X ME MX *) intros O E E' ME X MX HOpp1 HOpp2. (* Goal: @Prod Tn O E E' X ME MX *) assert (HNC : ~ Col O E E') by (unfold Opp, Sum, Ar2 in *; spliter; Col). (* Goal: @Prod Tn O E E' X ME MX *) assert (HCol1 : Col O E ME) by (unfold Opp, Sum, Ar2 in *; spliter; Col). (* Goal: @Prod Tn O E E' X ME MX *) assert (HCol2 : Col O E X) by (unfold Opp, Sum, Ar2 in *; spliter; Col). (* Goal: @Prod Tn O E E' X ME MX *) destruct (sum_exists O E E' HNC E ME) as [EPME HEPME]; Col. (* Goal: @Prod Tn O E E' X ME MX *) assert (O = EPME) by (apply sum_uniqueness with O E E' E ME; auto; apply diff_sum; apply diff_O_A; Col). (* Goal: @Prod Tn O E E' X ME MX *) treat_equalities; destruct (prod_exists O E E' HNC X E) as [X' HX]; Col. (* Goal: @Prod Tn O E E' X ME MX *) assert (X = X') by (apply prod_uniqueness with O E E' X E; auto; apply prod_1_r; Col). (* Goal: @Prod Tn O E E' X ME MX *) treat_equalities; destruct (prod_exists O E E' HNC X O) as [O' HProd]; Col. (* Goal: @Prod Tn O E E' X ME MX *) assert (O = O') by (apply prod_uniqueness with O E E' X O; auto; apply prod_0_r; Col). (* Goal: @Prod Tn O E E' X ME MX *) treat_equalities; destruct (prod_exists O E E' HNC X ME) as [MX' HMX]; Col. (* Goal: @Prod Tn O E E' X ME MX *) assert (HOpp3 : Sum O E E' X MX' O) by (apply distr_l with X E ME O; auto). (* Goal: @Prod Tn O E E' X ME MX *) apply sum_opp in HOpp3; assert (MX = MX') by (apply opp_uniqueness with O E E' X; Col). (* Goal: @Prod Tn O E E' X ME MX *) treat_equalities; auto. Qed. Lemma distr_l_diff : forall O E E' A B C BMC AB AC ABMC, Diff O E E' B C BMC -> Prod O E E' A B AB -> Prod O E E' A C AC -> Prod O E E' A BMC ABMC -> Diff O E E' AB AC ABMC. Proof. (* Goal: forall (O E E' A B C BMC AB AC ABMC : @Tpoint Tn) (_ : @Diff Tn O E E' B C BMC) (_ : @Prod Tn O E E' A B AB) (_ : @Prod Tn O E E' A C AC) (_ : @Prod Tn O E E' A BMC ABMC), @Diff Tn O E E' AB AC ABMC *) intros O E E' A B C BMC AB AC ABMC HBMC HAB HAC HABMC. (* Goal: @Diff Tn O E E' AB AC ABMC *) apply diff_sum in HBMC; apply sum_diff. (* Goal: @Sum Tn O E E' AC ABMC AB *) apply distr_l with A C BMC B; auto. Qed. Lemma diff_of_squares : forall O E E' A B A2 B2 A2MB2 APB AMB F, Prod O E E' A A A2 -> Prod O E E' B B B2 -> Diff O E E' A2 B2 A2MB2 -> Sum O E E' A B APB -> Diff O E E' A B AMB -> Prod O E E' APB AMB F -> A2MB2 = F. Proof. (* Goal: forall (O E E' A B A2 B2 A2MB2 APB AMB F : @Tpoint Tn) (_ : @Prod Tn O E E' A A A2) (_ : @Prod Tn O E E' B B B2) (_ : @Diff Tn O E E' A2 B2 A2MB2) (_ : @Sum Tn O E E' A B APB) (_ : @Diff Tn O E E' A B AMB) (_ : @Prod Tn O E E' APB AMB F), @eq (@Tpoint Tn) A2MB2 F *) intros O E E' A B A2 B2 A2MB2 APB AMB F HA2 HB2 HA2MB2 HAPB HAMB HF. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HNC : ~ Col O E E') by (apply diff_ar2 in HA2MB2; unfold Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColA : Col O E A) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColB : Col O E B) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColAMB : Col O E AMB) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) destruct (prod_exists O E E' HNC A AMB) as [F1 HF1]; Col. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColF1 : Col O E F1) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) destruct (prod_exists O E E' HNC B AMB) as [F2 HF2]; Col. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColF2 : Col O E F2) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) destruct (sum_exists O E E' HNC F1 F2) as [F' HF']; Col. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (F = F'). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) (* Goal: @eq (@Tpoint Tn) F F' *) { (* Goal: @eq (@Tpoint Tn) F F' *) apply sum_uniqueness with O E E' F1 F2; auto. (* Goal: @Sum Tn O E E' F1 F2 F *) apply distr_r with A B AMB APB; auto. (* BG Goal: @eq (@Tpoint Tn) A2MB2 F *) } (* Goal: @eq (@Tpoint Tn) A2MB2 F *) treat_equalities; destruct (prod_exists O E E' HNC A B) as [AB HAB]; Col. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColA2 : Col O E A2) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColAB : Col O E AB) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) destruct (diff_exists O E E' A2 AB) as [A2MAB HA2MAB]; Col. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (A2MAB = F1). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) (* Goal: @eq (@Tpoint Tn) A2MAB F1 *) { (* Goal: @eq (@Tpoint Tn) A2MAB F1 *) apply diff_uniqueness with O E E' A2 AB; auto. (* Goal: @Diff Tn O E E' A2 AB F1 *) apply distr_l_diff with A A B AMB; auto. (* BG Goal: @eq (@Tpoint Tn) A2MB2 F *) } (* Goal: @eq (@Tpoint Tn) A2MB2 F *) destruct (prod_exists O E E' HNC B A) as [BA HBA]; Col. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColB2 : Col O E B2) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (HColBA : Col O E BA) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) destruct (diff_exists O E E' BA B2) as [BAMB2 HBAMB2]; Col. (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (BAMB2 = F2). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) (* Goal: @eq (@Tpoint Tn) BAMB2 F2 *) { (* Goal: @eq (@Tpoint Tn) BAMB2 F2 *) apply diff_uniqueness with O E E' BA B2; auto. (* Goal: @Diff Tn O E E' BA B2 F2 *) apply distr_l_diff with B A B AMB; auto. (* BG Goal: @eq (@Tpoint Tn) A2MB2 F *) } (* Goal: @eq (@Tpoint Tn) A2MB2 F *) assert (AB = BA). (* Goal: @eq (@Tpoint Tn) A2MB2 F *) (* Goal: @eq (@Tpoint Tn) AB BA *) { (* Goal: @eq (@Tpoint Tn) AB BA *) apply prod_uniqueness with O E E' A B; auto. (* Goal: @Prod Tn O E E' A B BA *) apply prod_comm; auto. (* BG Goal: @eq (@Tpoint Tn) A2MB2 F *) } (* Goal: @eq (@Tpoint Tn) A2MB2 F *) treat_equalities; apply diff_uniqueness with O E E' A2 B2; auto. (* Goal: @Diff Tn O E E' A2 B2 F *) apply sum_diff_diff_b with AB BAMB2 A2MAB; auto. Qed. Lemma eq_squares_eq_or_opp : forall O E E' A B A2, Prod O E E' A A A2 -> Prod O E E' B B A2 -> A = B \/ Opp O E E' A B. Proof. (* Goal: forall (O E E' A B A2 : @Tpoint Tn) (_ : @Prod Tn O E E' A A A2) (_ : @Prod Tn O E E' B B A2), or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) intros O E E' A B A2 HA2 HB2. (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (HNC : ~ Col O E E') by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (HColA : Col O E A) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (HColA2 : Col O E A2) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (HColB : Col O E B) by (unfold Prod, Ar2 in *; spliter; Col). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) destruct (diff_exists O E E' A2 A2) as [O' HA2MA2]; Col. (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (O = O') by (apply diff_uniqueness with O E E' A2 A2; auto; apply diff_null; Col). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) destruct (sum_exists O E E' HNC A B) as [APB HAPB]; Col. (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (HColAPB : Col O E APB) by (unfold Sum, Ar2 in *; spliter; Col). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) destruct (diff_exists O E E' A B) as [AMB HAMB]; Col; treat_equalities. (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (HColAMB : Col O E AMB) by (apply diff_sum in HAMB; unfold Sum, Ar2 in *; spliter; Col). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) destruct (prod_exists O E E' HNC APB AMB) as [O' H]; Col. (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) assert (O = O') by (apply diff_of_squares with O E E' A B A2 A2 APB AMB; auto). (* Goal: or (@eq (@Tpoint Tn) A B) (@Opp Tn O E E' A B) *) treat_equalities; apply prod_null in H; induction H; treat_equalities; [right; apply sum_opp|left; apply diff_null_eq with AMB E E']; auto. Qed. Lemma diff_2_prod : forall O E E' A B AMB BMA ME, Opp O E E' E ME -> Diff O E E' A B AMB -> Diff O E E' B A BMA -> Prod O E E' AMB ME BMA. Proof. (* Goal: forall (O E E' A B AMB BMA ME : @Tpoint Tn) (_ : @Opp Tn O E E' E ME) (_ : @Diff Tn O E E' A B AMB) (_ : @Diff Tn O E E' B A BMA), @Prod Tn O E E' AMB ME BMA *) intros O E E' A B AMB BMA ME HOpp HAMB HBMA. (* Goal: @Prod Tn O E E' AMB ME BMA *) apply opp_prod; auto; apply diff_opp with A B; auto. Qed. End T14_prod.
Require Import TS. Goal forall (n : nat) (a b : terms), var n <> app a b. intros; discriminate. Save diff_var_app. Goal forall (n : nat) (a : terms), var n <> lambda a. intros; discriminate. Save diff_var_lambda. Goal forall (n : nat) (a : terms) (s : sub_explicits), var n <> env a s. intros; discriminate. Save diff_var_env. Goal forall a b c : terms, app a b <> lambda c. intros; discriminate. Save diff_app_lambda. Goal forall (a b c : terms) (s : sub_explicits), app a b <> env c s. intros; discriminate. Save diff_app_env. Goal forall (a b : terms) (s : sub_explicits), lambda a <> env b s. intros; discriminate. Save diff_lambda_env. Goal id <> shift. intros; discriminate. Save diff_id_shift. Goal forall (a : terms) (s : sub_explicits), id <> cons a s. intros; discriminate. Save diff_id_cons. Goal forall s t : sub_explicits, id <> comp s t. intros; discriminate. Save diff_id_comp. Goal forall s : sub_explicits, id <> lift s. intros; discriminate. Save diff_id_lift. Goal forall (a : terms) (s : sub_explicits), shift <> cons a s. intros; discriminate. Save diff_shift_cons. Goal forall s t : sub_explicits, shift <> comp s t. intros; discriminate. Save diff_shift_comp. Goal forall s : sub_explicits, shift <> lift s. intros; discriminate. Save diff_shift_lift. Goal forall (a : terms) (s t u : sub_explicits), cons a s <> comp t u. intros; discriminate. Save diff_cons_comp. Goal forall (a : terms) (s t : sub_explicits), cons a s <> lift t. intros; discriminate. Save diff_cons_lift. Goal forall s t u : sub_explicits, comp s t <> lift u. intros; discriminate. Save diff_comp_lift. Goal forall n1 n2 : nat, var n1 = var n2 -> n1 = n2. intros n1 n2 H; injection H; trivial. Save proj_var. Goal forall a1 b1 a2 b2 : terms, app a1 b1 = app a2 b2 -> a1 = a2. intros a1 b1 a2 b2 H; injection H; trivial. Save proj_app1. Goal forall a1 b1 a2 b2 : terms, app a1 b1 = app a2 b2 -> b1 = b2. intros a1 b1 a2 b2 H; injection H; trivial. Save proj_app2. Goal forall a b : terms, lambda a = lambda b -> a = b. intros a b H; injection H; trivial. Save proj_lambda. Goal forall (a b : terms) (s t : sub_explicits), env a s = env b t -> a = b. intros a b s t H; injection H; trivial. Save proj_env1. Goal forall (a b : terms) (s t : sub_explicits), env a s = env b t -> s = t. intros a b s t H; injection H; trivial. Save proj_env2. Goal forall (a b : terms) (s t : sub_explicits), cons a s = cons b t -> a = b. intros a b s t H; injection H; trivial. Save proj_cons1. Goal forall (a b : terms) (s t : sub_explicits), cons a s = cons b t -> s = t. intros a b s t H; injection H; trivial. Save proj_cons2. Goal forall s1 s2 t1 t2 : sub_explicits, comp s1 t1 = comp s2 t2 -> s1 = s2. intros s1 s2 t1 t2 H; injection H; trivial. Save proj_comp1. Goal forall s1 s2 t1 t2 : sub_explicits, comp s1 t1 = comp s2 t2 -> t1 = t2. intros s1 s2 t1 t2 H; injection H; trivial. Save proj_comp2. Goal forall s t : sub_explicits, lift s = lift t -> s = t. intros s t H; injection H; trivial. Save proj_lift.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrbool ssrfun eqtype ssrnat seq choice fintype finfun. From mathcomp Require Import bigop finset fingroup. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Import GroupScope. Reserved Notation "x \isog y" (at level 70). Section MorphismStructure. Variables aT rT : finGroupType. Structure morphism (D : {set aT}) : Type := Morphism { mfun :> aT -> FinGroup.sort rT; _ : {in D &, {morph mfun : x y / x * y}} }. Definition morphism_for D of phant rT := morphism D. Definition clone_morphism D f := let: Morphism _ fM := f return {type of @Morphism D for f} -> morphism_for D (Phant rT) in fun k => k fM. Variables (D A : {set aT}) (R : {set rT}) (x : aT) (y : rT) (f : aT -> rT). Variant morphim_spec : Prop := MorphimSpec z & z \in D & z \in A & y = f z. Lemma morphimP : reflect morphim_spec (y \in f @: (D :&: A)). Proof. (* Goal: Bool.reflect morphim_spec (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) f (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) D A))))))) *) apply: (iffP imsetP) => [] [z]; first by case/setIP; exists z. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D)))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) (_ : @eq (FinGroup.arg_sort (FinGroup.base rT)) y (f z)), @ex2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) D A))))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) y (f x)) *) by exists z; first apply/setIP. Qed. Lemma morphpreP : reflect (x \in D /\ f x \in R) (x \in D :&: f @^-1: R). Proof. (* Goal: Bool.reflect (and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D)))) (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base rT)) (f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R))))) (@in_mem (FinGroup.arg_sort (FinGroup.base aT)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) D (@preimset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) f (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R))))))) *) by rewrite !inE; apply: andP. Qed. End MorphismStructure. Notation "{ 'morphism' D >-> T }" := (morphism_for D (Phant T)) (at level 0, format "{ 'morphism' D >-> T }") : group_scope. Notation "[ 'morphism' D 'of' f ]" := (@clone_morphism _ _ D _ (fun fM => @Morphism _ _ D f fM)) (at level 0, format "[ 'morphism' D 'of' f ]") : form_scope. Notation "[ 'morphism' 'of' f ]" := (clone_morphism (@Morphism _ _ _ f)) (at level 0, format "[ 'morphism' 'of' f ]") : form_scope. Arguments morphimP {aT rT D A y f}. Arguments morphpreP {aT rT D R x f}. Section MorphismOps1. Variables (aT rT : finGroupType) (D : {set aT}) (f : {morphism D >-> rT}). Lemma morphM : {in D &, {morph f : x y / x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D)) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT D f ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base aT) => @mulg (FinGroup.base aT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x0 y0) (@mfun aT rT D f x) (@mfun aT rT D f y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT D f) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @mulg (FinGroup.base aT) x y) (fun x y : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x y))) *) by case f. Qed. Notation morPhantom := (phantom (aT -> rT)). Definition MorPhantom := Phantom (aT -> rT). Definition dom of morPhantom f := D. Definition morphim of morPhantom f := fun A => f @: (D :&: A). Definition morphpre of morPhantom f := fun R : {set rT} => D :&: f @^-1: R. Definition ker mph := morphpre mph 1. End MorphismOps1. Arguments morphim _ _ _%g _ _ _%g. Arguments morphpre _ _ _%g _ _ _%g. Notation "''dom' f" := (dom (MorPhantom f)) (at level 10, f at level 8, format "''dom' f") : group_scope. Notation "''ker' f" := (ker (MorPhantom f)) (at level 10, f at level 8, format "''ker' f") : group_scope. Notation "''ker_' H f" := (H :&: 'ker f) (at level 10, H at level 2, f at level 8, format "''ker_' H f") : group_scope. Notation "f @* A" := (morphim (MorPhantom f) A) (at level 24, format "f @* A") : group_scope. Notation "f @*^-1 R" := (morphpre (MorPhantom f) R) (at level 24, format "f @*^-1 R") : group_scope. Notation "''injm' f" := (pred_of_set ('ker f) \subset pred_of_set 1) (at level 10, f at level 8, format "''injm' f") : group_scope. Section MorphismTheory. Variables aT rT : finGroupType. Implicit Types A B : {set aT}. Implicit Types G H : {group aT}. Implicit Types R S : {set rT}. Implicit Types M : {group rT}. Variables (D : {group aT}) (f : {morphism D >-> rT}). Lemma morph1 : f 1 = 1. Proof. (* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (oneg (FinGroup.base aT))) (oneg (FinGroup.base rT)) *) by apply: (mulgI (f 1)); rewrite -morphM ?mulg1. Qed. Lemma morph_prod I r (P : pred I) F : (forall i, P i -> F i \in D) -> f (\prod_(i <- r | P i) F i) = \prod_( i <- r | P i) f (F i). Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (F i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@BigOp.bigop (FinGroup.sort (FinGroup.base aT)) I (oneg (FinGroup.base aT)) r (fun i : I => @BigBody (FinGroup.arg_sort (FinGroup.base aT)) I i (@mulg (FinGroup.base aT)) (P i) (F i)))) (@BigOp.bigop (FinGroup.sort (FinGroup.base rT)) I (oneg (FinGroup.base rT)) r (fun i : I => @BigBody (FinGroup.arg_sort (FinGroup.base rT)) I i (@mulg (FinGroup.base rT)) (P i) (@mfun aT rT (@gval aT D) f (F i)))) *) move=> D_F; elim/(big_load (fun x => x \in D)): _. (* Goal: prod (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@BigOp.bigop (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) I (oneg (FinGroup.base aT)) r (fun i : I => @BigBody (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) I i (@mulg (FinGroup.base aT)) (P i) (F i))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (@eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@BigOp.bigop (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) I (oneg (FinGroup.base aT)) r (fun i : I => @BigBody (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) I i (@mulg (FinGroup.base aT)) (P i) (F i)))) (@BigOp.bigop (FinGroup.sort (FinGroup.base rT)) I (oneg (FinGroup.base rT)) r (fun i : I => @BigBody (FinGroup.arg_sort (FinGroup.base rT)) I i (@mulg (FinGroup.base rT)) (P i) (@mfun aT rT (@gval aT D) f (F i))))) *) elim/big_rec2: _ => [|i _ x Pi [Dx <-]]; first by rewrite morph1. (* Goal: prod (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) (F i) x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (@eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) (F i) x)) (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f (F i)) (@mfun aT rT (@gval aT D) f x))) *) by rewrite groupM ?morphM // D_F. Qed. Lemma morphV : {in D, {morph f : x / x^-1}}. Lemma morphJ : {in D &, {morph f : x y / x ^ y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base aT) => @conjg aT x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base rT) => @conjg rT x0 y0) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @conjg aT x y) (fun x y : FinGroup.sort (FinGroup.base rT) => @conjg rT x y))) *) by move=> * /=; rewrite !morphM ?morphV // ?groupM ?groupV. Qed. Lemma morphX n : {in D, {morph f : x / x ^+ n}}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) (fun x : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f ((fun x0 : FinGroup.arg_sort (FinGroup.base aT) => @expgn (FinGroup.base aT) x0 n) x)) ((fun x0 : FinGroup.sort (FinGroup.base rT) => @expgn (FinGroup.base rT) x0 n) (@mfun aT rT (@gval aT D) f x))) (inPhantom (@morphism_1 (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (fun x : FinGroup.arg_sort (FinGroup.base aT) => @expgn (FinGroup.base aT) x n) (fun x : FinGroup.sort (FinGroup.base rT) => @expgn (FinGroup.base rT) x n))) *) by elim: n => [|n IHn] x Dx; rewrite ?morph1 // !expgS morphM ?(groupX, IHn). Qed. Lemma morphR : {in D &, {morph f : x y / [~ x, y]}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base aT) => @commg aT x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base rT) => @commg rT x0 y0) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @commg aT x y) (fun x y : FinGroup.sort (FinGroup.base rT) => @commg rT x y))) *) by move=> * /=; rewrite morphM ?(groupV, groupJ) // morphJ ?morphV. Qed. Lemma morphpreE R : f @*^-1 R = D :&: f @^-1: R. Proof. by []. Qed. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@preimset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)))) *) by []. Qed. Lemma morphimEsub A : A \subset D -> f @* A = f @: A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))) *) by move=> sAD; rewrite /morphim (setIidPr sAD). Qed. Lemma morphimEdom : f @* D = f @: D. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) *) exact: morphimEsub. Qed. Lemma morphimIdom A : f @* (D :&: A) = f @* A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) A)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) *) by rewrite /morphim setIA setIid. Qed. Lemma morphpreIdom R : D :&: f @*^-1 R = f @*^-1 R. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) *) by rewrite /morphim setIA setIid. Qed. Lemma morphpreIim R : f @*^-1 (f @* D :&: R) = f @*^-1 R. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) R)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) *) apply/setP=> x; rewrite morphimEdom !inE. (* Goal: @eq bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (andb (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) R))))) (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)))) *) by case Dx: (x \in D); rewrite // mem_imset. Qed. Lemma morphimIim A : f @* D :&: f @* A = f @* A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) *) by apply/setIidPr; rewrite imsetS // setIid subsetIl. Qed. Lemma mem_morphim A x : x \in D -> x \in A -> f x \in f @* A. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))), is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))) *) by move=> Dx Ax; apply/morphimP; exists x. Qed. Lemma mem_morphpre R x : x \in D -> f x \in R -> x \in f @*^-1 R. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)))) *) by move=> Dx Rfx; apply/morphpreP. Qed. Lemma morphimS A B : A \subset B -> f @* A \subset f @* B. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))) *) by move=> sAB; rewrite imsetS ?setIS. Qed. Lemma morphim_sub A : f @* A \subset f @* D. Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))) *) by rewrite imsetS // setIid subsetIl. Qed. Lemma leq_morphim A : #|f @* A| <= #|A|. Proof. (* Goal: is_true (leq (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) *) by apply: (leq_trans (leq_imset_card _ _)); rewrite subset_leq_card ?subsetIr. Qed. Lemma morphpreS R S : R \subset S -> f @*^-1 R \subset f @*^-1 S. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) S))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)))) *) by move=> sRS; rewrite setIS ?preimsetS. Qed. Lemma morphpre_sub R : f @*^-1 R \subset D. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) *) exact: subsetIl. Qed. Lemma morphim_setIpre A R : f @* (A :&: f @*^-1 R) = f @* A :&: R. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) R) *) apply/setP=> fa; apply/morphimP/setIP=> [[a Da] | [/morphimP[a Da Aa ->] Rfa]]. (* Goal: @morphim_spec aT rT (@gval aT D) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)) (@mfun aT rT (@gval aT D) f a) (@mfun aT rT (@gval aT D) f) *) (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)))))) (_ : @eq (FinGroup.arg_sort (FinGroup.base rT)) fa (@mfun aT rT (@gval aT D) f a)), and (is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) fa (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) fa (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) R)))) *) by rewrite !inE Da /= => /andP[Aa Rfa] ->; rewrite mem_morphim. (* Goal: @morphim_spec aT rT (@gval aT D) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)) (@mfun aT rT (@gval aT D) f a) (@mfun aT rT (@gval aT D) f) *) by exists a; rewrite // !inE Aa Da. Qed. Lemma morphim0 : f @* set0 = set0. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@set0 (FinGroup.arg_finType (FinGroup.base aT)))) (@set0 (FinGroup.finType (FinGroup.base rT))) *) by rewrite morphimE setI0 imset0. Qed. Lemma morphim_eq0 A : A \subset D -> (f @* A == set0) = (A == set0). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@set0 (FinGroup.finType (FinGroup.base rT)))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base aT))) A (@set0 (FinGroup.arg_finType (FinGroup.base aT)))) *) by rewrite imset_eq0 => /setIidPr->. Qed. Lemma morphim_set1 x : x \in D -> f @* [set x] = [set f x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)) (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)) *) by rewrite /morphim -sub1set => /setIidPr->; apply: imset_set1. Qed. Lemma morphim1 : f @* 1 = 1. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (oneg (group_set_of_baseGroupType (FinGroup.base aT)))) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) *) by rewrite morphim_set1 ?morph1. Qed. Lemma morphimV A : f @* A^-1 = (f @* A)^-1. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@invg (group_set_of_baseGroupType (FinGroup.base aT)) A)) (@invg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) *) wlog suffices: A / f @* A^-1 \subset (f @* A)^-1. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@invg (group_set_of_baseGroupType (FinGroup.base aT)) A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@invg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) (* Goal: forall _ : forall A : @set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@invg (group_set_of_baseGroupType (FinGroup.base aT)) A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@invg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@invg (group_set_of_baseGroupType (FinGroup.base aT)) A)) (@invg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) *) by move=> IH; apply/eqP; rewrite eqEsubset IH -invSg invgK -{1}(invgK A) IH. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@invg (group_set_of_baseGroupType (FinGroup.base aT)) A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@invg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) apply/subsetP=> _ /morphimP[x Dx Ax' ->]; rewrite !inE in Ax' *. by rewrite -morphV // mem_imset // inE groupV Dx. Qed. Qed. Lemma morphpreV R : f @*^-1 R^-1 = (f @*^-1 R)^-1. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@invg (group_set_of_baseGroupType (FinGroup.base rT)) R)) (@invg (group_set_of_baseGroupType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)) *) apply/setP=> x; rewrite !inE groupV; case Dx: (x \in D) => //=. (* Goal: @eq bool (@in_mem (FinGroup.sort (FinGroup.base rT)) (@invg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x)) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@invg (FinGroup.base aT) x)) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R))) *) by rewrite morphV. Qed. Lemma morphimMl A B : A \subset D -> f @* (A * B) = f @* A * f @* B. Lemma morphimMr A B : B \subset D -> f @* (A * B) = f @* A * f @* B. Lemma morphpreMl R S : R \subset f @* D -> f @*^-1 (R * S) = f @*^-1 R * f @*^-1 S. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) R S)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)) *) move=> sRfD; apply/setP=> x; rewrite !inE. (* Goal: @eq bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) R S))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))))) *) apply/andP/imset2P=> [[Dx] | [y z]]; last first. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) R S)))), @imset2_spec (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (fun _ : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))) x *) (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mulg (FinGroup.base aT) y z)), and (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) R S))))) *) rewrite !inE => /andP[Dy Rfy] /andP[Dz Rfz] ->. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) R S)))), @imset2_spec (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (fun _ : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))) x *) (* Goal: and (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) y z) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) y z)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) R S))))) *) by rewrite ?(groupM, morphM, mem_imset2). (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) R S)))), @imset2_spec (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (fun _ : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))) x *) case/imset2P=> fy fz Rfy Rfz def_fx. (* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (fun _ : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))) x *) have /morphimP[y Dy _ def_fy]: fy \in f @* D := subsetP sRfD fy Rfy. (* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (fun _ : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))) x *) exists y (y^-1 * x); last by rewrite mulKVg. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) (@invg (FinGroup.base aT) y) x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)))) *) by rewrite !inE Dy -def_fy. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) (@invg (FinGroup.base aT) y) x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)))) *) by rewrite !inE groupM ?(morphM, morphV, groupV) // def_fx -def_fy mulKg. Qed. Lemma morphimJ A x : x \in D -> f @* (A :^ x) = f @* A :^ f x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@conjugate aT A x)) (@conjugate rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@mfun aT rT (@gval aT D) f x)) *) move=> Dx; rewrite !conjsgE morphimMl ?(morphimMr, sub1set, groupV) //. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@set1 (FinGroup.finType (FinGroup.base aT)) (@invg (FinGroup.base aT) x))) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)))) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@set1 (FinGroup.finType (FinGroup.base rT)) (@invg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x))) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@set1 (FinGroup.arg_finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))) *) by rewrite !(morphim_set1, groupV, morphV). Qed. Lemma morphpreJ R x : x \in D -> f @*^-1 (R :^ f x) = f @*^-1 R :^ x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@conjugate rT R (@mfun aT rT (@gval aT D) f x))) (@conjugate aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) x) *) move=> Dx; apply/setP=> y; rewrite conjIg !inE conjGid // !mem_conjg inE. (* Goal: @eq bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@conjg rT (@mfun aT rT (@gval aT D) f y) (@invg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)))) (andb (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@conjg aT y (@invg (FinGroup.base aT) x))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)))) *) by case Dy: (y \in D); rewrite // morphJ ?(morphV, groupV). Qed. Lemma morphim_class x A : x \in D -> A \subset D -> f @* (x ^: A) = f x ^: f @* A. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@class aT x A)) (@class rT (@mfun aT rT (@gval aT D) f x) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) *) move=> Dx sAD; rewrite !morphimEsub ?class_subG // /class -!imset_comp. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base rT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) tt (@mfun aT rT (@gval aT D) f) (@conjg aT x)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@funcomp (Finite.sort (FinGroup.finType (FinGroup.base rT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) tt (@conjg rT (@mfun aT rT (@gval aT D) f x)) (@mfun aT rT (@gval aT D) f)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))) *) by apply: eq_in_imset => y Ay /=; rewrite morphJ // (subsetP sAD). Qed. Lemma classes_morphim A : A \subset D -> classes (f @* A) = [set f @* xA | xA in classes A]. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (set_of_finType (FinGroup.finType (FinGroup.base rT))) (Phant (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))))) (@classes rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) (@Imset.imset (set_of_finType (FinGroup.arg_finType (FinGroup.base aT))) (set_of_finType (FinGroup.finType (FinGroup.base rT))) (fun xA : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT))) => @morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) xA) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base aT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base aT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base aT))) (@classes aT A)))) *) move=> sAD; rewrite morphimEsub // /classes -!imset_comp. (* Goal: @eq (@set_of (set_of_finType (FinGroup.finType (FinGroup.base rT))) (Phant (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (set_of_finType (FinGroup.finType (FinGroup.base rT))) (@funcomp (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) tt (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @class rT x (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) (@mfun aT rT (@gval aT D) f)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (set_of_finType (FinGroup.finType (FinGroup.base rT))) (@funcomp (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))) (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT)))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) tt (fun xA : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT))) => @morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) xA) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @class aT x A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))) *) apply: eq_in_imset => x /(subsetP sAD) Dx /=. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (FinGroup.sort (FinGroup.base rT)))) (@class rT (@mfun aT rT (@gval aT D) f x) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@class aT x A)) *) by rewrite morphim_class ?morphimEsub. Qed. Lemma morphimT : f @* setT = f @* D. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setTfor (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) *) by rewrite -morphimIdom setIT. Qed. Lemma morphimU A B : f @* (A :|: B) = f @* A :|: f @* B. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setU (FinGroup.arg_finType (FinGroup.base aT)) A B)) (@setU (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)) *) by rewrite -imsetU -setIUr. Qed. Lemma morphimI A B : f @* (A :&: B) \subset f @* A :&: f @* B. Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A B)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B))))) *) by rewrite subsetI // ?morphimS ?(subsetIl, subsetIr). Qed. Lemma morphpre0 : f @*^-1 set0 = set0. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@set0 (FinGroup.arg_finType (FinGroup.base rT)))) (@set0 (FinGroup.arg_finType (FinGroup.base aT))) *) by rewrite morphpreE preimset0 setI0. Qed. Lemma morphpreT : f @*^-1 setT = D. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setTfor (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))))) (@gval aT D) *) by rewrite morphpreE preimsetT setIT. Qed. Lemma morphpreU R S : f @*^-1 (R :|: S) = f @*^-1 R :|: f @*^-1 S. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setU (FinGroup.arg_finType (FinGroup.base rT)) R S)) (@setU (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)) *) by rewrite -setIUr -preimsetU. Qed. Lemma morphpreI R S : f @*^-1 (R :&: S) = f @*^-1 R :&: f @*^-1 S. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) R S)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)) *) by rewrite -setIIr -preimsetI. Qed. Lemma morphpreD R S : f @*^-1 (R :\: S) = f @*^-1 R :\: f @*^-1 S. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.arg_finType (FinGroup.base rT)) R S)) (@setD (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)) *) by apply/setP=> x; rewrite !inE; case: (x \in D). Qed. Lemma kerP x : x \in D -> reflect (f x = 1) (x \in 'ker f). Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), Bool.reflect (@eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (oneg (FinGroup.base rT))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) *) by move=> Dx; rewrite 2!inE Dx; apply: set1P. Qed. Lemma dom_ker : {subset 'ker f <= D}. Proof. (* Goal: @sub_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) *) by move=> x /morphpreP[]. Qed. Lemma mker x : x \in 'ker f -> f x = 1. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))), @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (oneg (FinGroup.base rT)) *) by move=> Kx; apply/kerP=> //; apply: dom_ker. Qed. Lemma mkerl x y : x \in 'ker f -> y \in D -> f (x * y) = f y. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) x y)) (@mfun aT rT (@gval aT D) f y) *) by move=> Kx Dy; rewrite morphM // ?(dom_ker, mker Kx, mul1g). Qed. Lemma mkerr x y : x \in D -> y \in 'ker f -> f (x * y) = f x. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))), @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) x y)) (@mfun aT rT (@gval aT D) f x) *) by move=> Dx Ky; rewrite morphM // ?(dom_ker, mker Ky, mulg1). Qed. Lemma rcoset_kerP x y : x \in D -> y \in D -> reflect (f x = f y) (x \in 'ker f :* y). Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), Bool.reflect (@eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) y))))) *) move=> Dx Dy; rewrite mem_rcoset !inE groupM ?morphM ?groupV //=. (* Goal: Bool.reflect (@eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y)) (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f (@invg (FinGroup.base aT) y))) (oneg (FinGroup.base rT))) *) by rewrite morphV // -eq_mulgV1; apply: eqP. Qed. Lemma ker_rcoset x y : x \in D -> y \in D -> f x = f y -> exists2 z, z \in 'ker f & x = z * y. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y)), @ex2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) z (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mulg (FinGroup.base aT) z y)) *) by move=> Dx Dy eqfxy; apply/rcosetP; apply/rcoset_kerP. Qed. Lemma ker_norm : D \subset 'N('ker f). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))) *) apply/subsetP=> x Dx; rewrite inE; apply/subsetP=> _ /imsetP[y Ky ->]. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (@conjg aT y x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) *) by rewrite !inE groupJ ?morphJ // ?dom_ker //= mker ?conj1g. Qed. Lemma ker_normal : 'ker f <| D. Proof. (* Goal: is_true (@normal aT (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (@gval aT D)) *) by rewrite /(_ <| D) subsetIl ker_norm. Qed. Lemma morphimGI G A : 'ker f \subset G -> f @* (G :&: A) = f @* G :&: f @* A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) A)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) *) move=> sKG; apply/eqP; rewrite eqEsubset morphimI setIC. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) A)))))) *) apply/subsetP=> _ /setIP[/morphimP[x Dx Ax ->] /morphimP[z Dz Gz]]. (* Goal: forall _ : @eq (FinGroup.arg_sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f z), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) A))))) *) case/ker_rcoset=> {Dz}// y Ky def_x. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) A))))) *) have{z Gz y Ky def_x} Gx: x \in G by rewrite def_x groupMl // (subsetP sKG). (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) A))))) *) by rewrite mem_imset ?inE // Dx Gx Ax. Qed. Lemma morphimIG A G : 'ker f \subset G -> f @* (A :&: G) = f @* A :&: f @* G. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@gval aT G))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) by move=> sKG; rewrite setIC morphimGI // setIC. Qed. Lemma morphimD A B : f @* A :\: f @* B \subset f @* (A :\: B). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setD (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.arg_finType (FinGroup.base aT)) A B))))) *) rewrite subDset -morphimU morphimS //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setU (FinGroup.arg_finType (FinGroup.base aT)) B (@setD (FinGroup.arg_finType (FinGroup.base aT)) A B))))) *) by rewrite setDE setUIr setUCr setIT subsetUr. Qed. Lemma morphimDG A G : 'ker f \subset G -> f @* (A :\: G) = f @* A :\: f @* G. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.arg_finType (FinGroup.base aT)) A (@gval aT G))) (@setD (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) move=> sKG; apply/eqP; rewrite eqEsubset morphimD andbT !setDE subsetI. (* Goal: is_true (andb (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@setC (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))) (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@setC (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setC (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))))) *) rewrite morphimS ?subsetIl // -[~: f @* G]setU0 -subDset setDE setCK. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@setC (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@set0 (FinGroup.finType (FinGroup.base rT))))))) *) by rewrite -morphimIG //= setIAC -setIA setICr setI0 morphim0. Qed. Lemma morphimD1 A : (f @* A)^# \subset f @* A^#. Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setD (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@set1 (FinGroup.finType (FinGroup.base rT)) (oneg (FinGroup.base rT)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.arg_finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))))) *) by rewrite -!set1gE -morphim1 morphimD. Qed. Lemma morphpre_groupset M : group_set (f @*^-1 M). Proof. (* Goal: is_true (@group_set aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT M))) *) apply/group_setP; split=> [|x y]; rewrite !inE ?(morph1, group1) //. (* Goal: forall (_ : is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT M)))))) (_ : is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT M)))))), is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) x y)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT M))))) *) by case/andP=> Dx Mfx /andP[Dy Mfy]; rewrite morphM ?groupM. Qed. Lemma morphim_groupset G : group_set (f @* G). Proof. (* Goal: is_true (@group_set rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) *) apply/group_setP; split=> [|_ _ /morphimP[x Dx Gx ->] /morphimP[y Dy Gy ->]]. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (oneg (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) by rewrite -morph1 mem_imset ?group1. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f y)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) by rewrite -morphM ?mem_imset ?inE ?groupM. Qed. Canonical morphpre_group fPh M := @group _ (morphpre fPh M) (morphpre_groupset M). Canonical morphim_group fPh G := @group _ (morphim fPh G) (morphim_groupset G). Canonical ker_group fPh : {group aT} := Eval hnf in [group of ker fPh]. Lemma morph_dom_groupset : group_set (f @: D). Proof. (* Goal: is_true (@group_set rT (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) *) by rewrite -morphimEdom groupP. Qed. Canonical morph_dom_group := group morph_dom_groupset. Lemma morphpreMr R S : S \subset f @* D -> f @*^-1 (R * S) = f @*^-1 R * f @*^-1 S. Lemma morphimK A : A \subset D -> f @*^-1 (f @* A) = 'ker f * A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) A) *) move=> sAD; apply/setP=> x; rewrite !inE. (* Goal: @eq bool (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) A)))) *) apply/idP/idP=> [/andP[Dx /morphimP[y Dy Ay eqxy]] | /imset2P[z y Kz Ay ->{x}]]. (* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) z y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) z y)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) A)))) *) rewrite -(mulgKV y x) mem_mulg // !inE !(groupM, morphM, groupV) //. (* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) z y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) z y)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) (* Goal: is_true (andb true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@mulg (FinGroup.base rT) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) f (@invg (FinGroup.base aT) y))) (oneg (FinGroup.base rT)))) *) by rewrite morphV //= eqxy mulgV. (* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) z y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) z y)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) have [Dy Dz]: y \in D /\ z \in D by rewrite (subsetP sAD) // dom_ker. (* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mulg (FinGroup.base aT) z y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f (@mulg (FinGroup.base aT) z y)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) by rewrite groupM // morphM // mker // mul1g mem_imset // inE Dy. Qed. Lemma morphimGK G : 'ker f \subset G -> G \subset D -> f @*^-1 (f @* G) = G. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))) (@gval aT G) *) by move=> sKG sGD; rewrite morphimK // mulSGid. Qed. Lemma morphpre_set1 x : x \in D -> f @*^-1 [set f x] = 'ker f :* x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x))) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)) *) by move=> Dx; rewrite -morphim_set1 // morphimK ?sub1set. Qed. Lemma morphpreK R : R \subset f @* D -> f @* (f @*^-1 R) = R. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)) R *) move=> sRfD; apply/setP=> y; apply/morphimP/idP=> [[x _] | Ry]. (* Goal: @morphim_spec aT rT (@gval aT D) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) y (@mfun aT rT (@gval aT D) f) *) (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))))) (_ : @eq (FinGroup.arg_sort (FinGroup.base rT)) y (@mfun aT rT (@gval aT D) f x)), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) y (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) R))) *) by rewrite !inE; case/andP=> _ Rfx ->. (* Goal: @morphim_spec aT rT (@gval aT D) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) y (@mfun aT rT (@gval aT D) f) *) have /morphimP[x Dx _ defy]: y \in f @* D := subsetP sRfD y Ry. (* Goal: @morphim_spec aT rT (@gval aT D) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) y (@mfun aT rT (@gval aT D) f) *) by exists x; rewrite // !inE Dx -defy. Qed. Lemma morphim_ker : f @* 'ker f = 1. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) *) by rewrite morphpreK ?sub1G. Qed. Lemma ker_sub_pre M : 'ker f \subset f @*^-1 M. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT M))))) *) by rewrite morphpreS ?sub1G. Qed. Lemma ker_normal_pre M : 'ker f <| f @*^-1 M. Proof. (* Goal: is_true (@normal aT (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval rT M))) *) by rewrite /normal ker_sub_pre subIset ?ker_norm. Qed. Lemma morphpreSK R S : R \subset f @* D -> (f @*^-1 R \subset f @*^-1 S) = (R \subset S). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))), @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)))) (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) S))) *) move=> sRfD; apply/idP/idP=> [sf'RS|]; last exact: morphpreS. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) S))) *) suffices: R \subset f @* D :&: S by rewrite subsetI sRfD. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) S)))) *) rewrite -(morphpreK sRfD) -[_ :&: S]morphpreK (morphimS, subsetIl) //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) S))))) *) by rewrite morphpreI morphimGK ?subsetIl // setIA setIid. Qed. Lemma sub_morphim_pre A R : A \subset D -> (f @* A \subset R) = (A \subset f @*^-1 R). Lemma morphpre_proper R S : R \subset f @* D -> S \subset f @* D -> (f @*^-1 R \proper f @*^-1 S) = (R \proper S). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) S)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)))))), @eq bool (@proper (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)))) (@proper (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) S))) *) by move=> dQ dR; rewrite /proper !morphpreSK. Qed. Lemma sub_morphpre_im R G : 'ker f \subset G -> G \subset D -> R \subset f @* D -> (f @*^-1 R \subset G) = (R \subset f @* G). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)))))), @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) *) by symmetry; rewrite -morphpreSK ?morphimGK. Qed. Lemma ker_trivg_morphim A : (A \subset 'ker f) = (A \subset D) && (f @* A \subset [1]). Proof. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (andb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))) (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (oneg (group_set_of_baseGroupType (FinGroup.base rT)) : @set_of (FinGroup.finType (FinGroup.base rT)) (Phant (FinGroup.sort (FinGroup.base rT)))))))) *) case sAD: (A \subset D); first by rewrite sub_morphim_pre. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)))))) (andb false (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (oneg (group_set_of_baseGroupType (FinGroup.base rT))))))) *) by rewrite subsetI sAD. Qed. Lemma morphimSK A B : A \subset D -> (f @* A \subset f @* B) = (A \subset 'ker f * B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) B)))) *) move=> sAD; transitivity (A \subset 'ker f * (D :&: B)). (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) B))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) B)))) *) (* Goal: @eq bool (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) B))))) *) by rewrite -morphimK ?subsetIl // -sub_morphim_pre // /morphim setIA setIid. (* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) B))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@mulg (group_set_of_baseGroupType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) B)))) *) by rewrite setIC group_modl (subsetIl, subsetI) // andbC sAD. Qed. Lemma morphimSGK A G : A \subset D -> 'ker f \subset G -> (f @* A \subset f @* G) = (A \subset G). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))), @eq bool (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) *) by move=> sGD skfK; rewrite morphimSK // mulSGid. Qed. Lemma ltn_morphim A : [1] \proper 'ker_A f -> #|f @* A| < #|A|. Proof. (* Goal: forall _ : is_true (@proper (FinGroup.finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (oneg (group_set_of_baseGroupType (FinGroup.base aT)) : @set_of (FinGroup.finType (FinGroup.base aT)) (Phant (FinGroup.sort (FinGroup.base aT)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))))), is_true (leq (S (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) *) case/properP; rewrite sub1set => /setIP[A1 _] [x /setIP[Ax kx] x1]. (* Goal: is_true (leq (S (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) *) rewrite (cardsD1 1 A) A1 ltnS -{1}(setD1K A1) morphimU morphim1. (* Goal: is_true (leq (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setU (FinGroup.finType (FinGroup.base rT)) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT))))))))) (@card (FinGroup.finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (@setD (FinGroup.finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))))) *) rewrite (setUidPr _) ?sub1set; last first. (* Goal: is_true (leq (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))))) (@card (FinGroup.finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (@setD (FinGroup.finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))))) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (oneg (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))))) *) by rewrite -(mker kx) mem_morphim ?(dom_ker kx) // inE x1. (* Goal: is_true (leq (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))))) (@card (FinGroup.finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (@setD (FinGroup.finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))))) *) by rewrite (leq_trans (leq_imset_card _ _)) ?subset_leq_card ?subsetIr. Qed. Lemma morphpre_inj : {in [pred R : {set rT} | R \subset f @* D] &, injective (fun R => f @*^-1 R)}. Proof. (* Goal: @prop_in2 (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@mem (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (simplPredType (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))))) (@SimplPred (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun R : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))))) (fun x1 x2 : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) ((fun R : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) x1) ((fun R : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) x2), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) x1 x2) (inPhantom (@injective (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun R : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) *) exact: can_in_inj morphpreK. Qed. Lemma morphim_injG : {in [pred G : {group aT} | 'ker f \subset G & G \subset D] &, injective (fun G => f @* G)}. Proof. (* Goal: @prop_in2 (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (@mem (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (simplPredType (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT))))) (@SimplPred (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (fun G : @group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT))) => andb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))))) (fun x1 x2 : @group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT))) => forall _ : @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) ((fun G : @group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT))) => @morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) x1) ((fun G : @group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT))) => @morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) x2), @eq (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) x1 x2) (inPhantom (@injective (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (fun G : @group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT))) => @morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) move=> G H /andP[sKG sGD] /andP[sKH sHD] eqfGH. (* Goal: @eq (@group_of aT (Phant (FinGroup.arg_sort (FinGroup.base aT)))) G H *) by apply: val_inj; rewrite /= -(morphimGK sKG sGD) eqfGH morphimGK. Qed. Lemma morphim_inj G H : ('ker f \subset G) && (G \subset D) -> ('ker f \subset H) && (H \subset D) -> f @* G = f @* H -> G :=: H. Proof. (* Goal: forall (_ : is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))))) (_ : is_true (andb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))))) (_ : @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT H))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@gval aT G) (@gval aT H) *) by move=> nsGf nsHf /morphim_injG->. Qed. Lemma morphim_gen A : A \subset D -> f @* <<A>> = <<f @* A>>. Lemma morphim_cycle x : x \in D -> f @* <[x]> = <[f x]>. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@cycle aT x)) (@cycle rT (@mfun aT rT (@gval aT D) f x)) *) by move=> Dx; rewrite morphim_gen (sub1set, morphim_set1). Qed. Lemma morphimY A B : A \subset D -> B \subset D -> f @* (A <*> B) = f @* A <*> f @* B. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@joing aT A B)) (@joing rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)) *) by move=> sAD sBD; rewrite morphim_gen ?morphimU // subUset sAD. Qed. Lemma morphpre_gen R : 1 \in R -> R \subset f @* D -> f @*^-1 <<R>> = <<f @*^-1 R>>. Lemma morphimR A B : A \subset D -> B \subset D -> f @* [~: A, B] = [~: f @* A, f @* B]. Lemma morphim_norm A : f @* 'N(A) \subset 'N(f @* A). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser aT A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) apply/subsetP=> fx; case/morphimP=> x Dx Nx -> {fx}. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) by rewrite inE -morphimJ ?(normP Nx). Qed. Lemma morphim_norms A B : A \subset 'N(B) -> f @* A \subset 'N(f @* B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT B)))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B))))) *) by move=> nBA; apply: subset_trans (morphim_norm B); apply: morphimS. Qed. Lemma morphim_subnorm A B : f @* 'N_A(B) \subset 'N_(f @* A)(f @* B). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@normaliser aT B))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))))) *) exact: subset_trans (morphimI A _) (setIS _ (morphim_norm B)). Qed. Lemma morphim_normal A B : A <| B -> f @* A <| f @* B. Proof. (* Goal: forall _ : is_true (@normal aT A B), is_true (@normal rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)) *) by case/andP=> sAB nAB; rewrite /(_ <| _) morphimS // morphim_norms. Qed. Lemma morphim_cent1 x : x \in D -> f @* 'C[x] \subset 'C[f x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))))) *) by move=> Dx; rewrite -(morphim_set1 Dx) morphim_norm. Qed. Lemma morphim_cent1s A x : x \in D -> A \subset 'C[x] -> f @* A \subset 'C[f x]. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)))))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))))) *) by move=> Dx cAx; apply: subset_trans (morphim_cent1 Dx); apply: morphimS. Qed. Lemma morphim_subcent1 A x : x \in D -> f @* 'C_A[x] \subset 'C_(f @* A)[f x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x))))))) *) by move=> Dx; rewrite -(morphim_set1 Dx) morphim_subnorm. Qed. Lemma morphim_cent A : f @* 'C(A) \subset 'C(f @* A). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@centraliser aT A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) apply/bigcapsP=> fx; case/morphimP=> x Dx Ax ->{fx}. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@centraliser aT A)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@normaliser rT (@set1 (FinGroup.arg_finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))))) *) by apply: subset_trans (morphim_cent1 Dx); apply: morphimS; apply: bigcap_inf. Qed. Lemma morphim_cents A B : A \subset 'C(B) -> f @* A \subset 'C(f @* B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@centraliser aT B)))), is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B))))) *) by move=> cBA; apply: subset_trans (morphim_cent B); apply: morphimS. Qed. Lemma morphim_subcent A B : f @* 'C_A(B) \subset 'C_(f @* A)(f @* B). Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@centraliser aT B))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))))) *) exact: subset_trans (morphimI A _) (setIS _ (morphim_cent B)). Qed. Lemma morphim_abelian A : abelian A -> abelian (f @* A). Proof. (* Goal: forall _ : is_true (@abelian aT A), is_true (@abelian rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) *) exact: morphim_cents. Qed. Lemma morphpre_norm R : f @*^-1 'N(R) \subset 'N(f @*^-1 R). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser rT R)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))))) *) apply/subsetP=> x; rewrite !inE => /andP[Dx Nfx]. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base aT)) (@conjugate aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) x))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R)))) *) by rewrite -morphpreJ ?morphpreS. Qed. Lemma morphpre_norms R S : R \subset 'N(S) -> f @*^-1 R \subset 'N(f @*^-1 S). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT S)))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S))))) *) by move=> nSR; apply: subset_trans (morphpre_norm S); apply: morphpreS. Qed. Lemma morphpre_normal R S : R \subset f @* D -> S \subset f @* D -> (f @*^-1 R <| f @*^-1 S) = (R <| S). Lemma morphpre_subnorm R S : f @*^-1 'N_R(S) \subset 'N_(f @*^-1 R)(f @*^-1 S). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) R (@normaliser rT S))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@normaliser aT (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) S)))))) *) by rewrite morphpreI setIS ?morphpre_norm. Qed. Lemma morphim_normG G : 'ker f \subset G -> G \subset D -> f @* 'N(G) = 'N_(f @* D)(f @* G). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser aT (@gval aT G))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) move=> sKG sGD; apply/eqP; rewrite eqEsubset -{1}morphimIdom morphim_subnorm. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser aT (@gval aT G))))))) *) rewrite -(morphpreK (subsetIl _ _)) morphimS //= morphpreI subIset // orbC. (* Goal: is_true (orb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT (@gval aT G))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT (@gval aT G)))))) *) by rewrite -{2}(morphimGK sKG sGD) morphpre_norm. Qed. Lemma morphim_subnormG A G : 'ker f \subset G -> G \subset D -> f @* 'N_A(G) = 'N_(f @* A)(f @* G). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@normaliser aT (@gval aT G)))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) move=> sKB sBD; rewrite morphimIG ?normsG // morphim_normG //. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G))))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT G)))) *) by rewrite setICA setIA morphimIim. Qed. Lemma morphpre_cent1 x : x \in D -> 'C_D[x] \subset f @*^-1 'C[f x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x))))))) *) move=> Dx; rewrite -sub_morphim_pre ?subsetIl //. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))))) *) by apply: subset_trans (morphim_cent1 Dx); rewrite morphimS ?subsetIr. Qed. Lemma morphpre_cent1s R x : x \in D -> R \subset f @* D -> f @*^-1 R \subset 'C[x] -> R \subset 'C[f x]. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))))) *) by move=> Dx sRfD; move/(morphim_cent1s Dx); rewrite morphpreK. Qed. Lemma morphpre_subcent1 R x : x \in D -> 'C_(f @*^-1 R)[x] \subset f @*^-1 'C_R[f x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) R (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))))))) *) move=> Dx; rewrite -morphpreIdom -setIA setICA morphpreI setIS //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x))))))) *) exact: morphpre_cent1. Qed. Lemma morphpre_cent A : 'C_D(A) \subset f @*^-1 'C(f @* A). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@centraliser aT A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))))) *) rewrite -sub_morphim_pre ?subsetIl // morphimGI ?(subsetIl, subIset) // orbC. (* Goal: is_true (orb (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@centraliser aT A)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))))) *) by rewrite (subset_trans (morphim_cent _)). Qed. Lemma morphpre_cents A R : R \subset f @* D -> f @*^-1 R \subset 'C(A) -> R \subset 'C(f @* A). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@centraliser aT A))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) *) by move=> sRfD; move/morphim_cents; rewrite morphpreK. Qed. Lemma morphpre_subcent R A : 'C_(f @*^-1 R)(A) \subset f @*^-1 'C_R(f @* A). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R) (@centraliser aT A)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base rT)) R (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))))) *) by rewrite -morphpreIdom -setIA setICA morphpreI setIS //; apply: morphpre_cent. Qed. Lemma injmP : reflect {in D &, injective f} ('injm f). Lemma card_im_injm : (#|f @* D| == #|D|) = 'injm f. Proof. (* Goal: @eq bool (@eq_op nat_eqType (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D))))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *) by rewrite morphimEdom (sameP imset_injP injmP). Qed. Section Injective. Hypothesis injf : 'injm f. Lemma ker_injm : 'ker f = 1. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f))) (oneg (group_set_of_baseGroupType (FinGroup.base aT))) *) exact/trivgP. Qed. Lemma injmK A : A \subset D -> f @*^-1 (f @* A) = A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) A *) by move=> sAD; rewrite morphimK // ker_injm // mul1g. Qed. Lemma injm_morphim_inj A B : A \subset D -> B \subset D -> f @* A = f @* B -> A = B. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT)))) A B *) by move=> sAD sBD eqAB; rewrite -(injmK sAD) eqAB injmK. Qed. Lemma card_injm A : A \subset D -> #|f @* A| = #|A|. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq nat (@card (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))) *) move=> sAD; rewrite morphimEsub // card_in_imset //. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (fun x1 x2 : Finite.sort (FinGroup.arg_finType (FinGroup.base aT)) => forall _ : @eq (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x1) (@mfun aT rT (@gval aT D) f x2), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x1 x2) (inPhantom (@injective (Finite.sort (FinGroup.finType (FinGroup.base rT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mfun aT rT (@gval aT D) f))) *) exact: (sub_in2 (subsetP sAD) (injmP injf)). Qed. Lemma order_injm x : x \in D -> #[f x] = #[x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq nat (@order rT (@mfun aT rT (@gval aT D) f x)) (@order aT x) *) by move=> Dx; rewrite orderE -morphim_cycle // card_injm ?cycle_subG. Qed. Lemma injm1 x : x \in D -> f x = 1 -> x = 1. Proof. (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (oneg (FinGroup.base rT))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (oneg (FinGroup.base aT)) *) by move=> Dx; move/(kerP Dx); rewrite ker_injm; move/set1P. Qed. Lemma morph_injm_eq1 x : x \in D -> (f x == 1) = (x == 1). Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (oneg (FinGroup.base rT))) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base aT))) x (oneg (FinGroup.base aT))) *) by move=> Dx; rewrite -morph1 (inj_in_eq (injmP injf)) ?group1. Qed. Lemma injmSK A B : A \subset D -> (f @* A \subset f @* B) = (A \subset B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B))) *) by move=> sAD; rewrite morphimSK // ker_injm mul1g. Qed. Lemma sub_morphpre_injm R A : A \subset D -> R \subset f @* D -> (f @*^-1 R \subset A) = (R \subset f @* A). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)))))), @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) R))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))) (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) R)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)))) *) by move=> sAD sRfD; rewrite -morphpreSK ?injmK. Qed. Lemma injm_eq A B : A \subset D -> B \subset D -> (f @* A == f @* B) = (A == B). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq bool (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base aT))) A B) *) by move=> sAD sBD; rewrite !eqEsubset !injmSK. Qed. Lemma morphim_injm_eq1 A : A \subset D -> (f @* A == 1) = (A == 1). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base aT))) A (oneg (group_set_of_baseGroupType (FinGroup.base aT)))) *) by move=> sAD; rewrite -morphim1 injm_eq ?sub1G. Qed. Lemma injmI A B : f @* (A :&: B) = f @* A :&: f @* B. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A B)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)) *) rewrite -morphimIdom setIIr -4!(injmK (subsetIl D _), =^~ morphimIdom). (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)) *) by rewrite -morphpreI morphpreK // subIset ?morphim_sub. Qed. Lemma injmD1 A : f @* A^# = (f @* A)^#. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setD (FinGroup.arg_finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT))))) (@setD (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@set1 (FinGroup.finType (FinGroup.base rT)) (oneg (FinGroup.base rT)))) *) by have:= morphimDG A injf; rewrite morphim1. Qed. Lemma nclasses_injm A : A \subset D -> #|classes (f @* A)| = #|classes A|. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq nat (@card (set_of_finType (FinGroup.finType (FinGroup.base rT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base rT))) (@classes rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@card (set_of_finType (FinGroup.finType (FinGroup.base aT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base aT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base aT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base aT))) (@classes aT A)))) *) move=> sAD; rewrite classes_morphim // card_in_imset //. (* Goal: @prop_in2 (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT)))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base aT))) (@classes aT A))) (fun x1 x2 : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT))) => forall _ : @eq (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) x1) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) x2), @eq (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT)))) x1 x2) (inPhantom (@injective (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))) (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT)))) (fun xA : Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT))) => @morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) xA))) *) move=> _ _ /imsetP[x Ax ->] /imsetP[y Ay ->]. (* Goal: forall _ : @eq (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base rT)))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@class aT x A)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@class aT y A)), @eq (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base aT)))) (@class aT x A) (@class aT y A) *) by apply: injm_morphim_inj; rewrite // class_subG ?(subsetP sAD). Qed. Lemma injm_norm A : A \subset D -> f @* 'N(A) = 'N_(f @* D)(f @* A). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser aT A)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) *) move=> sAD; apply/eqP; rewrite -morphimIdom eqEsubset morphim_subnorm. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@normaliser aT A))))))) *) rewrite -sub_morphpre_injm ?subsetIl // morphpreI injmK // setIS //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT A)))) *) by rewrite -{2}(injmK sAD) morphpre_norm. Qed. Lemma injm_norms A B : A \subset D -> B \subset D -> (f @* A \subset 'N(f @* B)) = (A \subset 'N(B)). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq bool (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@normaliser aT B)))) *) by move=> sAD sBD; rewrite -injmSK // injm_norm // subsetI morphimS. Qed. Lemma injm_normal A B : A \subset D -> B \subset D -> (f @* A <| f @* B) = (A <| B). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq bool (@normal rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B)) (@normal aT A B) *) by move=> sAD sBD; rewrite /normal injmSK ?injm_norms. Qed. Lemma injm_subnorm A B : B \subset D -> f @* 'N_A(B) = 'N_(f @* A)(f @* B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@normaliser aT B))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@normaliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B))) *) by move=> sBD; rewrite injmI injm_norm // setICA setIA morphimIim. Qed. Lemma injm_cent1 x : x \in D -> f @* 'C[x] = 'C_(f @* D)[f x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))) *) by move=> Dx; rewrite injm_norm ?morphim_set1 ?sub1set. Qed. Lemma injm_subcent1 A x : x \in D -> f @* 'C_A[x] = 'C_(f @* A)[f x]. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x)))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@normaliser rT (@set1 (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x)))) *) by move=> Dx; rewrite injm_subnorm ?morphim_set1 ?sub1set. Qed. Lemma injm_cent A : A \subset D -> f @* 'C(A) = 'C_(f @* D)(f @* A). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@centraliser aT A)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) *) move=> sAD; apply/eqP; rewrite -morphimIdom eqEsubset morphim_subcent. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@gval aT D)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@centraliser aT A))))))) *) apply/subsetP=> fx; case/setIP; case/morphimP=> x Dx _ ->{fx} cAfx. (* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mfun aT rT (@gval aT D) f x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) (@centraliser aT A)))))) *) rewrite mem_morphim // inE Dx -sub1set centsC cent_set1 -injmSK //. (* Goal: is_true (andb true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@normaliser aT (@set1 (FinGroup.arg_finType (FinGroup.base aT)) x))))))) *) by rewrite injm_cent1 // subsetI morphimS // -cent_set1 centsC sub1set. Qed. Lemma injm_cents A B : A \subset D -> B \subset D -> (f @* A \subset 'C(f @* B)) = (A \subset 'C(B)). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))), @eq bool (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B))))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@centraliser aT B)))) *) by move=> sAD sBD; rewrite -injmSK // injm_cent // subsetI morphimS. Qed. Lemma injm_subcent A B : B \subset D -> f @* 'C_A(B) = 'C_(f @* A)(f @* B). Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@centraliser aT B))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@centraliser rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) B))) *) by move=> sBD; rewrite injmI injm_cent // setICA setIA morphimIim. Qed. Lemma injm_abelian A : A \subset D -> abelian (f @* A) = abelian A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D)))), @eq bool (@abelian rT (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A)) (@abelian aT A) *) by move=> sAD; rewrite /abelian -subsetIidl -injm_subcent // injmSK ?subsetIidl. Qed. End Injective. Lemma eq_morphim (g : {morphism D >-> rT}): {in D, f =1 g} -> forall A, f @* A = g @* A. Proof. (* Goal: forall (_ : @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))) (fun x : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT (@gval aT D) g x)) (inPhantom (@eqfun (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (@mfun aT rT (@gval aT D) f) (@mfun aT rT (@gval aT D) g)))) (A : @set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT (@gval aT D) g (@MorPhantom aT rT (@mfun aT rT (@gval aT D) g)) A) *) by move=> efg A; apply: eq_in_imset; apply: sub_in1 efg => x /setIP[]. Qed. Lemma eq_in_morphim B A (g : {morphism B >-> rT}) : D :&: A = B :&: A -> {in A, f =1 g} -> f @* A = g @* A. Proof. (* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D) A) (@setI (FinGroup.arg_finType (FinGroup.base aT)) B A)) (_ : @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (fun x : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f x) (@mfun aT rT B g x)) (inPhantom (@eqfun (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (@mfun aT rT (@gval aT D) f) (@mfun aT rT B g)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT D) f (@MorPhantom aT rT (@mfun aT rT (@gval aT D) f)) A) (@morphim aT rT B g (@MorPhantom aT rT (@mfun aT rT B g)) A) *) move=> eqDBA eqAfg; rewrite /morphim /= eqDBA. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (FinGroup.sort (FinGroup.base rT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT D) f) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) B A)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT B g) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) B A)))) *) by apply: eq_in_imset => x /setIP[_]/eqAfg. Qed. End MorphismTheory. Notation "''ker' f" := (ker_group (MorPhantom f)) : Group_scope. Notation "''ker_' G f" := (G :&: 'ker f)%G : Group_scope. Notation "f @* G" := (morphim_group (MorPhantom f) G) : Group_scope. Notation "f @*^-1 M" := (morphpre_group (MorPhantom f) M) : Group_scope. Notation "f @: D" := (morph_dom_group f D) : Group_scope. Arguments injmP {aT rT D f}. Arguments morphpreK {aT rT D f} [R] sRf. Section IdentityMorphism. Variable gT : finGroupType. Implicit Types A B : {set gT}. Implicit Type G : {group gT}. Definition idm of {set gT} := fun x : gT => x : FinGroup.sort gT. Lemma idm_morphM A : {in A & , {morph idm A : x y / x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (idm A ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) (idm A x) (idm A y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (idm A) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y))) *) by []. Qed. Canonical idm_morphism A := Morphism (@idm_morphM A). Lemma injm_idm G : 'injm (idm G). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT gT (@gval gT G) (idm_morphism (@gval gT G)) (@MorPhantom gT gT (idm (@gval gT G)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *) by apply/injmP=> x y _ _. Qed. Lemma ker_idm G : 'ker (idm G) = 1. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT gT (@gval gT G) (idm_morphism (@gval gT G)) (@MorPhantom gT gT (idm (@gval gT G)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *) by apply/trivgP; apply: injm_idm. Qed. Lemma morphim_idm A B : B \subset A -> idm A @* B = B. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT A (idm_morphism A) (@MorPhantom gT gT (idm A)) B) B *) rewrite /morphim /= /idm => /setIidPr->. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => x) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B))) B *) by apply/setP=> x; apply/imsetP/idP=> [[y By ->]|Bx]; last exists x. Qed. Lemma morphpre_idm A B : idm A @*^-1 B = A :&: B. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT gT A (idm_morphism A) (@MorPhantom gT gT (idm A)) B) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A B) *) by apply/setP=> x; rewrite !inE. Qed. Lemma im_idm A : idm A @* A = A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT A (idm_morphism A) (@MorPhantom gT gT (idm A)) A) A *) exact: morphim_idm. Qed. End IdentityMorphism. Arguments idm {_} _%g _%g. Section RestrictedMorphism. Variables aT rT : finGroupType. Variables A D : {set aT}. Implicit Type B : {set aT}. Implicit Type R : {set rT}. Definition restrm of A \subset D := @id (aT -> FinGroup.sort rT). Section Props. Hypothesis sAD : A \subset D. Variable f : {morphism D >-> rT}. Local Notation fA := (restrm sAD (mfun f)). Canonical restrm_morphism := @Morphism aT rT A fA (sub_in2 (subsetP sAD) (morphM f)). Lemma morphim_restrm B : fA @* B = f @* (A :&: B). Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A restrm_morphism (@MorPhantom aT rT (restrm sAD (@mfun aT rT D f))) B) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A B)) *) by rewrite {2}/morphim setIA (setIidPr sAD). Qed. Lemma restrmEsub B : B \subset A -> fA @* B = f @* B. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A restrm_morphism (@MorPhantom aT rT (restrm sAD (@mfun aT rT D f))) B) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) B) *) by rewrite morphim_restrm => /setIidPr->. Qed. Lemma im_restrm : fA @* A = f @* A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A restrm_morphism (@MorPhantom aT rT (restrm sAD (@mfun aT rT D f))) A) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) A) *) exact: restrmEsub. Qed. Lemma morphpre_restrm R : fA @*^-1 R = A :&: f @*^-1 R. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT A restrm_morphism (@MorPhantom aT rT (restrm sAD (@mfun aT rT D f))) R) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@morphpre aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) R)) *) by rewrite setIA (setIidPl sAD). Qed. Lemma ker_restrm : 'ker fA = 'ker_A f. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT A restrm_morphism (@MorPhantom aT rT (restrm sAD (@mfun aT rT D f)))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@ker aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)))) *) exact: morphpre_restrm. Qed. Lemma injm_restrm : 'injm f -> 'injm fA. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT D f (@MorPhantom aT rT (@mfun aT rT D f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT A restrm_morphism (@MorPhantom aT rT (restrm sAD (@mfun aT rT D f)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *) by apply: subset_trans; rewrite ker_restrm subsetIr. Qed. End Props. Lemma restrmP (f : {morphism D >-> rT}) : A \subset 'dom f -> {g : {morphism A >-> rT} | [/\ g = f :> (aT -> rT), 'ker g = 'ker_A f, forall R, g @*^-1 R = A :&: f @*^-1 R & forall B, B \subset A -> g @* B = f @* B]}. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@dom aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)))))), @sig (@morphism_for aT rT A (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun g : @morphism_for aT rT A (Phant (FinGroup.arg_sort (FinGroup.base rT))) => and4 (@eq (forall _ : FinGroup.arg_sort (FinGroup.base aT), FinGroup.arg_sort (FinGroup.base rT)) (@mfun aT rT A g) (@mfun aT rT D f)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT A g (@MorPhantom aT rT (@mfun aT rT A g))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@ker aT rT D f (@MorPhantom aT rT (@mfun aT rT D f))))) (forall R : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT A g (@MorPhantom aT rT (@mfun aT rT A g)) R) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@morphpre aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) R))) (forall (B : @set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A g (@MorPhantom aT rT (@mfun aT rT A g)) B) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) B))) *) move=> sAD; exists (restrm_morphism sAD f). (* Goal: and4 (@eq (forall _ : FinGroup.arg_sort (FinGroup.base aT), FinGroup.arg_sort (FinGroup.base rT)) (@mfun aT rT A (restrm_morphism sAD f)) (@mfun aT rT D f)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT A (restrm_morphism sAD f) (@MorPhantom aT rT (@mfun aT rT A (restrm_morphism sAD f)))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@ker aT rT D f (@MorPhantom aT rT (@mfun aT rT D f))))) (forall R : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT A (restrm_morphism sAD f) (@MorPhantom aT rT (@mfun aT rT A (restrm_morphism sAD f))) R) (@setI (FinGroup.arg_finType (FinGroup.base aT)) A (@morphpre aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) R))) (forall (B : @set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A (restrm_morphism sAD f) (@MorPhantom aT rT (@mfun aT rT A (restrm_morphism sAD f))) B) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) B)) *) split=> // [|R|B sBA]; first 1 [exact: ker_restrm | exact: morphpre_restrm]. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A (restrm_morphism sAD f) (@MorPhantom aT rT (@mfun aT rT A (restrm_morphism sAD f))) B) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) B) *) by rewrite morphim_restrm (setIidPr sBA). Qed. Lemma domP (f : {morphism D >-> rT}) : 'dom f = A -> {g : {morphism A >-> rT} | [/\ g = f :> (aT -> rT), 'ker g = 'ker f, forall R, g @*^-1 R = f @*^-1 R & forall B, g @* B = f @* B]}. Proof. (* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (@dom aT rT D f (@MorPhantom aT rT (@mfun aT rT D f))) A, @sig (@morphism_for aT rT A (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun g : @morphism_for aT rT A (Phant (FinGroup.arg_sort (FinGroup.base rT))) => and4 (@eq (forall _ : FinGroup.arg_sort (FinGroup.base aT), FinGroup.arg_sort (FinGroup.base rT)) (@mfun aT rT A g) (@mfun aT rT D f)) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT A g (@MorPhantom aT rT (@mfun aT rT A g))) (@ker aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)))) (forall R : @set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT A g (@MorPhantom aT rT (@mfun aT rT A g)) R) (@morphpre aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) R)) (forall B : @set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A g (@MorPhantom aT rT (@mfun aT rT A g)) B) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) B))) *) by move <-; exists f. Qed. End RestrictedMorphism. Arguments restrm {_ _ _%g _%g} _ _%g. Arguments restrmP {aT rT A D}. Arguments domP {aT rT A D}. Section TrivMorphism. Variables aT rT : finGroupType. Definition trivm of {set aT} & aT := 1 : FinGroup.sort rT. Lemma trivm_morphM (A : {set aT}) : {in A &, {morph trivm A : x y / x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.sort (FinGroup.base rT)) (trivm A ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base aT) => @mulg (FinGroup.base aT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x0 y0) (trivm A x) (trivm A y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (trivm A) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @mulg (FinGroup.base aT) x y) (fun x y : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x y))) *) by move=> x y /=; rewrite mulg1. Qed. Canonical triv_morph A := Morphism (@trivm_morphM A). Lemma morphim_trivm (G H : {group aT}) : trivm G @* H = 1. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) (triv_morph (@gval aT G)) (@MorPhantom aT rT (trivm (@gval aT G))) (@gval aT H)) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) *) apply/setP=> /= y; rewrite inE; apply/idP/eqP=> [|->]; first by case/morphimP. (* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (oneg (FinGroup.base rT)) (@mem (FinGroup.sort (FinGroup.base rT)) (predPredType (FinGroup.sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT G) (triv_morph (@gval aT G)) (@MorPhantom aT rT (trivm (@gval aT G))) (@gval aT H))))) *) by apply/morphimP; exists (1 : aT); rewrite /= ?group1. Qed. Lemma ker_trivm (G : {group aT}) : 'ker (trivm G) = G. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT (@gval aT G) (triv_morph (@gval aT G)) (@MorPhantom aT rT (trivm (@gval aT G)))) (@gval aT G) *) by apply/setIidPl/subsetP=> x _; rewrite !inE /=. Qed. End TrivMorphism. Arguments trivm {aT rT} _%g _%g. Section MorphismComposition. Variables gT hT rT : finGroupType. Variables (G : {group gT}) (H : {group hT}). Variable f : {morphism G >-> hT}. Variable g : {morphism H >-> rT}. Local Notation gof := (mfun g \o mfun f). Lemma comp_morphM : {in f @*^-1 H &, {morph gof: x y / x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base rT)) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f) ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x0 y0) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f) x) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f) y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base rT)) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f)) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x y))) *) by move=> x y; rewrite /= !inE => /andP[? ?] /andP[? ?]; rewrite !morphM. Qed. Canonical comp_morphism := Morphism comp_morphM. Lemma ker_comp : 'ker gof = f @*^-1 'ker g. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism (@MorPhantom gT rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f)))) (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@ker hT rT (@gval hT H) g (@MorPhantom hT rT (@mfun hT rT (@gval hT H) g)))) *) by apply/setP=> x; rewrite !inE andbA. Qed. Lemma injm_comp : 'injm f -> 'injm g -> 'injm gof. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base hT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base hT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base hT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base hT)) (@ker hT rT (@gval hT H) g (@MorPhantom hT rT (@mfun hT rT (@gval hT H) g))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base hT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base hT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base hT)) (oneg (group_set_baseGroupType (FinGroup.base hT))))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism (@MorPhantom gT rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *) by move=> injf; rewrite ker_comp; move/trivgP=> ->. Qed. Lemma morphim_comp (A : {set gT}) : gof @* A = g @* (f @* A). Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism (@MorPhantom gT rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f))) A) (@morphim hT rT (@gval hT H) g (@MorPhantom hT rT (@mfun hT rT (@gval hT H) g)) (@morphim gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) A)) *) apply/setP=> z; apply/morphimP/morphimP=> [[x]|[y Hy fAy ->{z}]]. (* Goal: @morphim_spec gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) A (@mfun hT rT (@gval hT H) g y) (@mfun gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism) *) (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)))) (_ : @eq (FinGroup.arg_sort (FinGroup.base rT)) z (@mfun gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism x)), @morphim_spec hT rT (@gval hT H) (@morphim gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) A) z (@mfun hT rT (@gval hT H) g) *) rewrite !inE => /andP[Gx Hfx]; exists (f x) => //. (* Goal: @morphim_spec gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) A (@mfun hT rT (@gval hT H) g y) (@mfun gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism) *) (* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base hT))) (@mfun gT hT (@gval gT G) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base hT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base hT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base hT)) (@morphim gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) A)))) *) by apply/morphimP; exists x. (* Goal: @morphim_spec gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) A (@mfun hT rT (@gval hT H) g y) (@mfun gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism) *) by case/morphimP: fAy Hy => x Gx Ax ->{y} Hfx; exists x; rewrite ?inE ?Gx. Qed. Lemma morphpre_comp (C : {set rT}) : gof @*^-1 C = f @*^-1 (g @*^-1 C). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@morphpre gT rT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT H)) comp_morphism (@MorPhantom gT rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT rT (@gval hT H) g) (@mfun gT hT (@gval gT G) f))) C) (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@morphpre hT rT (@gval hT H) g (@MorPhantom hT rT (@mfun hT rT (@gval hT H) g)) C)) *) by apply/setP=> z; rewrite !inE andbA. Qed. End MorphismComposition. Section FactorMorphism. Variables aT qT rT : finGroupType. Variables G H : {group aT}. Variable f : {morphism G >-> rT}. Variable q : {morphism H >-> qT}. Definition factm of 'ker q \subset 'ker f & G \subset H := fun x => f (repr (q @*^-1 [set x])). Hypothesis sKqKf : 'ker q \subset 'ker f. Hypothesis sGH : G \subset H. Notation ff := (factm sKqKf sGH). Lemma factmE x : x \in G -> ff (q x) = f x. Proof. (* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))), @eq (FinGroup.sort (FinGroup.base rT)) (factm sKqKf sGH (@mfun aT qT (@gval aT H) q x)) (@mfun aT rT (@gval aT G) f x) *) rewrite /ff => Gx; have Hx := subsetP sGH x Gx. (* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f (@repr (FinGroup.base aT) (@morphpre aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@set1 (FinGroup.arg_finType (FinGroup.base qT)) (@mfun aT qT (@gval aT H) q x))))) (@mfun aT rT (@gval aT G) f x) *) have /mem_repr: x \in q @*^-1 [set q x] by rewrite !inE Hx /=. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base aT)) (@repr (FinGroup.base aT) (@morphpre aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@set1 (FinGroup.finType (FinGroup.base qT)) (@mfun aT qT (@gval aT H) q x)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@set1 (FinGroup.finType (FinGroup.base qT)) (@mfun aT qT (@gval aT H) q x)))))), @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f (@repr (FinGroup.base aT) (@morphpre aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@set1 (FinGroup.arg_finType (FinGroup.base qT)) (@mfun aT qT (@gval aT H) q x))))) (@mfun aT rT (@gval aT G) f x) *) case/morphpreP; move: (repr _) => y Hy /set1P. (* Goal: forall _ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))) (@mfun aT qT (@gval aT H) q y) (@mfun aT qT (@gval aT H) q x), @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f y) (@mfun aT rT (@gval aT G) f x) *) by case/ker_rcoset=> // z Kz ->; rewrite mkerl ?(subsetP sKqKf). Qed. Lemma factm_morphM : {in q @* G &, {morph ff : x y / x * y}}. Proof. (* Goal: @prop_in2 (Finite.sort (FinGroup.finType (FinGroup.base qT))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base qT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base qT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base qT)) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)))) (fun x y : Finite.sort (FinGroup.arg_finType (FinGroup.base qT)) => @eq (FinGroup.sort (FinGroup.base rT)) (factm sKqKf sGH ((fun x0 y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base qT)) => @mulg (FinGroup.base qT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x0 y0) (factm sKqKf sGH x) (factm sKqKf sGH y))) (inPhantom (@morphism_2 (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))) (FinGroup.sort (FinGroup.base rT)) (factm sKqKf sGH) (fun x y : Finite.sort (FinGroup.arg_finType (FinGroup.base qT)) => @mulg (FinGroup.base qT) x y) (fun x y : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x y))) *) move=> _ _ /morphimP[x Hx Gx ->] /morphimP[y Hy Gy ->]. (* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (factm sKqKf sGH (@mulg (FinGroup.base qT) (@mfun aT qT (@gval aT H) q x) (@mfun aT qT (@gval aT H) q y))) (@mulg (FinGroup.base rT) (factm sKqKf sGH (@mfun aT qT (@gval aT H) q x)) (factm sKqKf sGH (@mfun aT qT (@gval aT H) q y))) *) by rewrite -morphM ?factmE ?groupM // morphM. Qed. Canonical factm_morphism := Morphism factm_morphM. Lemma morphim_factm (A : {set aT}) : ff @* (q @* A) = f @* A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim qT rT (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)) factm_morphism (@MorPhantom qT rT (factm sKqKf sGH)) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) A)) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) *) rewrite -morphim_comp /= {1}/morphim /= morphimGK //; last first. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (FinGroup.sort (FinGroup.base rT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base qT)) (FinGroup.arg_sort (FinGroup.base aT)) tt (factm sKqKf sGH) (@mfun aT qT (@gval aT H) q)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) A)))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) *) by rewrite (subset_trans sKqKf) ?subsetIl. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (FinGroup.sort (FinGroup.base rT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base qT)) (FinGroup.arg_sort (FinGroup.base aT)) tt (factm sKqKf sGH) (@mfun aT qT (@gval aT H) q)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) A)))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) *) apply/setP=> y; apply/morphimP/morphimP; by case=> x Gx Ax ->{y}; exists x; rewrite //= factmE. Qed. Lemma morphpre_factm (C : {set rT}) : ff @*^-1 C = q @* (f @*^-1 C). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base qT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))))) (@morphpre qT rT (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)) factm_morphism (@MorPhantom qT rT (factm sKqKf sGH)) C) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@morphpre aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) C)) *) apply/setP=> y; rewrite !inE /=; apply/andP/morphimP=> [[]|[x Hx]]; last first. (* Goal: forall (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base qT)) y (@mem (FinGroup.arg_sort (FinGroup.base qT)) (predPredType (FinGroup.arg_sort (FinGroup.base qT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base qT)) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)))))) (_ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (factm sKqKf sGH y) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) C)))), @morphim_spec aT qT (@gval aT H) (@morphpre aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) C) y (@mfun aT qT (@gval aT H) q) *) (* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) C))))) (_ : @eq (FinGroup.arg_sort (FinGroup.base qT)) y (@mfun aT qT (@gval aT H) q x)), and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base qT)) y (@mem (FinGroup.arg_sort (FinGroup.base qT)) (predPredType (FinGroup.arg_sort (FinGroup.base qT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base qT)) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)))))) (is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (factm sKqKf sGH y) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) C)))) *) by case/morphpreP=> Gx Cfx ->; rewrite factmE ?mem_imset ?inE ?Hx. (* Goal: forall (_ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base qT)) y (@mem (FinGroup.arg_sort (FinGroup.base qT)) (predPredType (FinGroup.arg_sort (FinGroup.base qT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base qT)) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)))))) (_ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (factm sKqKf sGH y) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) C)))), @morphim_spec aT qT (@gval aT H) (@morphpre aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) C) y (@mfun aT qT (@gval aT H) q) *) case/morphimP=> x Hx Gx ->; rewrite factmE //. (* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f x) (@mem (FinGroup.arg_sort (FinGroup.base rT)) (predPredType (FinGroup.arg_sort (FinGroup.base rT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) C))), @morphim_spec aT qT (@gval aT H) (@morphpre aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) C) (@mfun aT qT (@gval aT H) q x) (@mfun aT qT (@gval aT H) q) *) by exists x; rewrite // !inE Gx. Qed. Lemma ker_factm : 'ker ff = q @* 'ker f. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base qT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))))) (@ker qT rT (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)) factm_morphism (@MorPhantom qT rT (factm sKqKf sGH))) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))) *) exact: morphpre_factm. Qed. Lemma injm_factm : 'injm f -> 'injm ff. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base qT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base qT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base qT)) (@ker qT rT (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)) factm_morphism (@MorPhantom qT rT (factm sKqKf sGH))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base qT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base qT)) (oneg (group_set_baseGroupType (FinGroup.base qT)))))) *) by rewrite ker_factm => /trivgP->; rewrite morphim1. Qed. Lemma injm_factmP : reflect ('ker f = 'ker q) ('injm ff). Proof. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))) (@ker aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)))) (@subset (FinGroup.arg_finType (FinGroup.base qT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base qT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base qT)) (@ker qT rT (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)) factm_morphism (@MorPhantom qT rT (factm sKqKf sGH))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base qT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base qT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base qT)) (oneg (group_set_baseGroupType (FinGroup.base qT)))))) *) rewrite ker_factm -morphimIdom sub_morphim_pre ?subsetIl //. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))) (@ker aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)))) (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@morphpre aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (oneg (group_set_baseGroupType (FinGroup.base qT))))))) *) rewrite setIA (setIidPr sGH) (sameP setIidPr eqP) (setIidPl _) // eq_sym. (* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))) (@ker aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base aT))) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) (@preimset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (oneg (group_set_of_baseGroupType (FinGroup.base rT))))))) (@morphpre aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (oneg (group_set_baseGroupType (FinGroup.base qT))))) *) exact: eqP. Qed. Lemma ker_factm_loc (K : {group aT}) : 'ker_(q @* K) ff = q @* 'ker_K f. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base qT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base qT))))) (@setI (FinGroup.finType (FinGroup.base qT)) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT K)) (@ker qT rT (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@gval aT G)) factm_morphism (@MorPhantom qT rT (factm sKqKf sGH)))) (@morphim aT qT (@gval aT H) q (@MorPhantom aT qT (@mfun aT qT (@gval aT H) q)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT K) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) *) by rewrite ker_factm -morphimIG. Qed. End FactorMorphism. Prenex Implicits factm. Section InverseMorphism. Variables aT rT : finGroupType. Implicit Types A B : {set aT}. Implicit Types C D : {set rT}. Variables (G : {group aT}) (f : {morphism G >-> rT}). Hypothesis injf : 'injm f. Lemma invm_subker : 'ker f \subset 'ker (idm G). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT aT (@gval aT G) (@idm_morphism aT (@gval aT G)) (@MorPhantom aT aT (@idm aT (@gval aT G))))))) *) by rewrite ker_idm. Qed. Definition invm := factm invm_subker (subxx _). Canonical invm_morphism := Eval hnf in [morphism of invm]. Lemma invmE : {in G, cancel f invm}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))) (fun x : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.arg_sort (FinGroup.base aT)) (invm (@mfun aT rT (@gval aT G) f x)) x) (inPhantom (@cancel (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (@mfun aT rT (@gval aT G) f) invm)) *) exact: factmE. Qed. Lemma invmK : {in f @* G, cancel invm f}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.finType (FinGroup.base rT))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (@mfun aT rT (@gval aT G) f (invm x)) x) (inPhantom (@cancel (FinGroup.sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) invm (@mfun aT rT (@gval aT G) f))) *) by move=> fx; case/morphimP=> x _ Gx ->; rewrite invmE. Qed. Lemma morphpre_invm A : invm @*^-1 A = f @* A. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@morphpre rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) A) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) *) by rewrite morphpre_factm morphpre_idm morphimIdom. Qed. Lemma morphim_invm A : A \subset G -> invm @* (f @* A) = A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))), @eq (@set_of (FinGroup.finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base aT))))) (@morphim rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A)) A *) by move=> sAG; rewrite morphim_factm morphim_idm. Qed. Lemma morphim_invmE C : invm @* C = f @*^-1 C. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base aT))))) (@morphim rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) C) (@morphpre aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) C) *) rewrite -morphpreIdom -(morphim_invm (subsetIl _ _)). (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base aT))))) (@morphim rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) C) (@morphim rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@setI (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) (@morphpre aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) C)))) *) by rewrite morphimIdom -morphpreIim morphpreK (subsetIl, morphimIdom). Qed. Lemma injm_proper A B : A \subset G -> B \subset G -> (f @* A \proper f @* B) = (A \proper B). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))), @eq bool (@proper (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) B)))) (@proper (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B))) *) move=> dA dB; rewrite -morphpre_invm -(morphpre_invm B). (* Goal: @eq bool (@proper (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphpre rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) A))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphpre rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) B)))) (@proper (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) B))) *) by rewrite morphpre_proper ?morphim_invm. Qed. Lemma injm_invm : 'injm invm. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@ker rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (oneg (group_set_baseGroupType (FinGroup.base rT)))))) *) by move/can_in_inj/injmP: invmK. Qed. Lemma ker_invm : 'ker invm = 1. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@ker rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm)) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) *) by move/trivgP: injm_invm. Qed. Lemma im_invm : invm @* (f @* G) = G. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base aT))))) (@morphim rT aT (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) invm_morphism (@MorPhantom rT aT invm) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G))) (@gval aT G) *) exact: morphim_invm. Qed. End InverseMorphism. Prenex Implicits invm. Section InjFactm. Variables (gT aT rT : finGroupType) (D G : {group gT}). Variables (g : {morphism G >-> rT}) (f : {morphism D >-> aT}) (injf : 'injm f). Definition ifactm := tag (domP [morphism of g \o invm injf] (morphpre_invm injf G)). Lemma ifactmE : {in D, forall x, ifactm (f x) = g x}. Proof. (* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm (@mfun gT aT (@gval gT D) f x)) (@mfun gT rT (@gval gT G) g x)) (inPhantom (forall x : FinGroup.arg_sort (FinGroup.base gT), @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm (@mfun gT aT (@gval gT D) f x)) (@mfun gT rT (@gval gT G) g x))) *) rewrite /ifactm => x Dx; case: domP => f' /= [def_f' _ _ _]. (* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) f' (@mfun gT aT (@gval gT D) f x)) (@mfun gT rT (@gval gT G) g x) *) by rewrite {f'}def_f' //= invmE. Qed. Lemma morphim_ifactm (A : {set gT}) : A \subset D -> ifactm @* (f @* A) = g @* A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm (@MorPhantom aT rT (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm)) (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) A)) (@morphim gT rT (@gval gT G) g (@MorPhantom gT rT (@mfun gT rT (@gval gT G) g)) A) *) rewrite /ifactm => sAD; case: domP => _ /= [_ _ _ ->]. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (FinGroup.sort (FinGroup.base rT)))) (@morphim aT rT (@morphpre aT gT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT D)) (@invm_morphism gT aT D f injf) (@MorPhantom aT gT (@invm gT aT D f injf)) (@gval gT G)) (@Morphism aT rT (@morphpre aT gT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT D)) (@invm_morphism gT aT D f injf) (@MorPhantom aT gT (@invm gT aT D f injf)) (@gval gT G)) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base aT)) tt (@mfun gT rT (@gval gT G) g) (@invm gT aT D f injf)) (@comp_morphM aT gT rT (@morphim_group gT aT D f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) D) G (@invm_morphism gT aT D f injf) g)) (@MorPhantom aT rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base aT)) tt (@mfun gT rT (@gval gT G) g) (@invm gT aT D f injf))) (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) A)) (@morphim gT rT (@gval gT G) g (@MorPhantom gT rT (@mfun gT rT (@gval gT G) g)) A) *) by rewrite morphim_comp morphim_invm. Qed. Lemma im_ifactm : G \subset D -> ifactm @* (f @* G) = g @* G. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm (@MorPhantom aT rT (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm)) (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G))) (@morphim gT rT (@gval gT G) g (@MorPhantom gT rT (@mfun gT rT (@gval gT G) g)) (@gval gT G)) *) exact: morphim_ifactm. Qed. Lemma morphpre_ifactm C : ifactm @*^-1 C = f @* (g @*^-1 C). Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@morphpre aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm (@MorPhantom aT rT (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm)) C) (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@morphpre gT rT (@gval gT G) g (@MorPhantom gT rT (@mfun gT rT (@gval gT G) g)) C)) *) rewrite /ifactm; case: domP => _ /= [_ _ -> _]. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (FinGroup.arg_sort (FinGroup.base aT)))) (@morphpre aT rT (@morphpre aT gT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT D)) (@invm_morphism gT aT D f injf) (@MorPhantom aT gT (@invm gT aT D f injf)) (@gval gT G)) (@Morphism aT rT (@morphpre aT gT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT D)) (@invm_morphism gT aT D f injf) (@MorPhantom aT gT (@invm gT aT D f injf)) (@gval gT G)) (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base aT)) tt (@mfun gT rT (@gval gT G) g) (@invm gT aT D f injf)) (@comp_morphM aT gT rT (@morphim_group gT aT D f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) D) G (@invm_morphism gT aT D f injf) g)) (@MorPhantom aT rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base aT)) tt (@mfun gT rT (@gval gT G) g) (@invm gT aT D f injf))) C) (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@morphpre gT rT (@gval gT G) g (@MorPhantom gT rT (@mfun gT rT (@gval gT G) g)) C)) *) by rewrite morphpre_comp morphpre_invm. Qed. Lemma ker_ifactm : 'ker ifactm = f @* 'ker g. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base aT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))))) (@ker aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm (@MorPhantom aT rT (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm))) (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@ker gT rT (@gval gT G) g (@MorPhantom gT rT (@mfun gT rT (@gval gT G) g)))) *) exact: morphpre_ifactm. Qed. Lemma injm_ifactm : 'injm g -> 'injm ifactm. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT G) g (@MorPhantom gT rT (@mfun gT rT (@gval gT G) g))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm (@MorPhantom aT rT (@mfun aT rT (@morphim gT aT (@gval gT D) f (@MorPhantom gT aT (@mfun gT aT (@gval gT D) f)) (@gval gT G)) ifactm))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *) by rewrite ker_ifactm => /trivgP->; rewrite morphim1. Qed. End InjFactm. Section ReflectProp. Variables aT rT : finGroupType. Section Defs. Variables (A : {set aT}) (B : {set rT}). Definition morphic (f : aT -> rT) := [forall u in [predX A & A], f (u.1 * u.2) == f u.1 * f u.2]. Definition isom f := f @: A^# == B^#. Definition misom f := morphic f && isom f. Definition isog := [exists f : {ffun aT -> rT}, misom f]. Section MorphicProps. Variable f : aT -> rT. Lemma morphicP : reflect {in A &, {morph f : x y / x * y}} (morphic f). Proof. (* Goal: Bool.reflect (@prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @eq (FinGroup.arg_sort (FinGroup.base rT)) (f ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base aT) => @mulg (FinGroup.base aT) x0 y0) x y)) ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x0 y0) (f x) (f y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) f (fun x y : FinGroup.arg_sort (FinGroup.base aT) => @mulg (FinGroup.base aT) x y) (fun x y : FinGroup.arg_sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x y)))) (morphic f) *) apply: (iffP forallP) => [fM x y Ax Ay | fM [x y] /=]. (* Goal: is_true (implb (@in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT))) (@pair (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT)) x y) (@mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT))) (simplPredType (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT)))) (@predX (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base aT)) (@pred_of_mem_pred (FinGroup.arg_sort (FinGroup.base aT)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base aT)) (@pred_of_mem_pred (FinGroup.arg_sort (FinGroup.base aT)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))))))) (@eq_op (FinGroup.arg_eqType (FinGroup.base rT)) (f (@mulg (FinGroup.base aT) x y)) (@mulg (FinGroup.base rT) (f x) (f y)))) *) (* Goal: @eq (FinGroup.arg_sort (FinGroup.base rT)) (f (@mulg (FinGroup.base aT) x y)) (@mulg (FinGroup.base rT) (f x) (f y)) *) by apply/eqP; have:= fM (x, y); rewrite inE /= Ax Ay. (* Goal: is_true (implb (@in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT))) (@pair (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT)) x y) (@mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT))) (simplPredType (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT)))) (@predX (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base aT)) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base aT)) (@pred_of_mem_pred (FinGroup.arg_sort (FinGroup.base aT)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)))) (@pred_of_simpl (FinGroup.arg_sort (FinGroup.base aT)) (@pred_of_mem_pred (FinGroup.arg_sort (FinGroup.base aT)) (@mem (FinGroup.arg_sort (FinGroup.base aT)) (predPredType (FinGroup.arg_sort (FinGroup.base aT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A))))))) (@eq_op (FinGroup.arg_eqType (FinGroup.base rT)) (f (@mulg (FinGroup.base aT) x y)) (@mulg (FinGroup.base rT) (f x) (f y)))) *) by apply/implyP=> /andP[Ax Ay]; rewrite fM. Qed. Definition morphm of morphic f := f : aT -> FinGroup.sort rT. Canonical morphm_morphism fM := @Morphism _ _ A (morphm fM) (morphicP fM). End MorphicProps. Lemma misomP f : reflect {fM : morphic f & isom (morphm fM)} (misom f). Proof. (* Goal: Bool.reflect (@sigT (is_true (morphic f)) (fun fM : is_true (morphic f) => is_true (isom (@morphm f fM)))) (misom f) *) by apply: (iffP andP) => [] [fM fiso] //; exists fM. Qed. Lemma misom_isog f : misom f -> isog. Proof. (* Goal: forall _ : is_true (misom f), is_true isog *) case/andP=> fM iso_f; apply/existsP; exists (finfun f). (* Goal: is_true (misom (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) f))) *) apply/andP; split; last by rewrite /misom /isom !(eq_imset _ (ffunE f)). (* Goal: is_true (morphic (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) f))) *) by apply/forallP=> u; rewrite !ffunE; apply: forallP fM u. Qed. Lemma isom_isog (D : {group aT}) (f : {morphism D >-> rT}) : A \subset D -> isom f -> isog. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT D))))) (_ : is_true (isom (@mfun aT rT (@gval aT D) f))), is_true isog *) move=> sAD isof; apply: (@misom_isog f); rewrite /misom isof andbT. (* Goal: is_true (morphic (@mfun aT rT (@gval aT D) f)) *) by apply/morphicP; apply: (sub_in2 (subsetP sAD) (morphM f)). Qed. Lemma isog_isom : isog -> {f : {morphism A >-> rT} | isom f}. Proof. (* Goal: forall _ : is_true isog, @sig (@morphism_for aT rT A (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun f : @morphism_for aT rT A (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (isom (@mfun aT rT A f))) *) by case/existsP/sigW=> f /misomP[fM isom_f]; exists (morphm_morphism fM). Qed. End Defs. Infix "\isog" := isog. Arguments isom_isog [A B D]. Section Main. Variables (G : {group aT}) (H : {group rT}). Lemma isomP (f : {morphism G >-> rT}) : reflect ('injm f /\ f @* G = H) (isom G H f). Proof. (* Goal: Bool.reflect (and (is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))) (@eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@gval rT H))) (isom (@gval aT G) (@gval rT H) (@mfun aT rT (@gval aT G) f)) *) apply: (iffP eqP) => [eqfGH | [injf <-]]; last first. (* Goal: and (is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))) (@eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@gval rT H)) *) (* Goal: @eq (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base rT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setD (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G) (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT))))))) (@setD (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@set1 (FinGroup.finType (FinGroup.base rT)) (oneg (FinGroup.base rT)))) *) by rewrite -injmD1 // morphimEsub ?subsetDl. (* Goal: and (is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))) (@eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@gval rT H)) *) split. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@gval rT H) *) (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *) apply/subsetP=> x /morphpreP[Gx fx1]; have: f x \notin H^# by rewrite inE fx1. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@gval rT H) *) (* Goal: forall _ : is_true (negb (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@setD (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H) (@set1 (FinGroup.finType (FinGroup.base rT)) (oneg (FinGroup.base rT)))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *) by apply: contraR => ntx; rewrite -eqfGH mem_imset // inE ntx. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@gval rT H) *) rewrite morphimEdom -{2}(setD1K (group1 G)) imsetU eqfGH. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@setU (FinGroup.finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.finType (FinGroup.base rT)) (@mfun aT rT (@gval aT G) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))) (@setD (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H) (@set1 (FinGroup.finType (FinGroup.base rT)) (oneg (FinGroup.base rT))))) (@gval rT H) *) by rewrite imset_set1 morph1 setD1K. Qed. Lemma isogP : reflect (exists2 f : {morphism G >-> rT}, 'injm f & f @* G = H) (G \isog H). Proof. (* Goal: Bool.reflect (@ex2 (@morphism_for aT rT (@gval aT G) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun f : @morphism_for aT rT (@gval aT G) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))) (fun f : @morphism_for aT rT (@gval aT G) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT G)) (@gval rT H))) (isog (@gval aT G) (@gval rT H)) *) apply: (iffP idP) => [/isog_isom[f /isomP[]] | [f injf fG]]; first by exists f. (* Goal: is_true (isog (@gval aT G) (@gval rT H)) *) by apply: (isom_isog f) => //; apply/isomP. Qed. Variable f : {morphism G >-> rT}. Hypothesis isoGH : isom G H f. Lemma isom_inj : 'injm f. Proof. by have /isomP[] := isoGH. Qed. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *) by have /isomP[] := isoGH. Qed. Lemma isom_card : #|G| = #|H|. Proof. (* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT H)))) *) by rewrite -isom_im card_injm ?isom_inj. Qed. Definition isom_inv := restrm isom_sub_im (invm isom_inj). End Main. Variables (G : {group aT}) (f : {morphism G >-> rT}). Lemma morphim_isom (H : {group aT}) (K : {group rT}) : H \subset G -> isom H K f -> f @* H = K. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (isom (@gval aT H) (@gval rT K) (@mfun aT rT (@gval aT G) f))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT H)) (@gval rT K) *) by case/(restrmP f)=> g [gf _ _ <- //]; rewrite -gf; case/isomP. Qed. Lemma sub_isom (A : {set aT}) (C : {set rT}) : A \subset G -> f @* A = C -> 'injm f -> isom A C f. Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) C) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))), is_true (isom A C (@mfun aT rT (@gval aT G) f)) *) move=> sAG; case: (restrmP f sAG) => g [_ _ _ img] <-{C} injf. (* Goal: is_true (isom A (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) (@mfun aT rT (@gval aT G) f)) *) rewrite /isom -morphimEsub ?morphimDG ?morphim1 //. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@setD (FinGroup.arg_finType (FinGroup.base aT)) A (@set1 (FinGroup.finType (FinGroup.base aT)) (oneg (FinGroup.base aT)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G)))) *) by rewrite subDset setUC subsetU ?sAG. Qed. Lemma sub_isog (A : {set aT}) : A \subset G -> 'injm f -> isog A (f @* A). Proof. (* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))), is_true (isog A (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A)) *) by move=> sAG injf; apply: (isom_isog f sAG); apply: sub_isom. Qed. Lemma restr_isom_to (A : {set aT}) (C R : {group rT}) (sAG : A \subset G) : f @* A = C -> isom G R f -> isom A C (restrm sAG f). Proof. (* Goal: forall (_ : @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) A) (@gval rT C)) (_ : is_true (isom (@gval aT G) (@gval rT R) (@mfun aT rT (@gval aT G) f))), is_true (isom A (@gval rT C) (@restrm aT rT A (@gval aT G) sAG (@mfun aT rT (@gval aT G) f))) *) by move=> defC /isomP[inj_f _]; apply: sub_isom. Qed. Lemma restr_isom (A : {group aT}) (R : {group rT}) (sAG : A \subset G) : isom G R f -> isom A (f @* A) (restrm sAG f). Proof. (* Goal: forall _ : is_true (isom (@gval aT G) (@gval rT R) (@mfun aT rT (@gval aT G) f)), is_true (isom (@gval aT A) (@morphim aT rT (@gval aT G) f (@MorPhantom aT rT (@mfun aT rT (@gval aT G) f)) (@gval aT A)) (@restrm aT rT (@gval aT A) (@gval aT G) sAG (@mfun aT rT (@gval aT G) f))) *) exact: restr_isom_to. Qed. End ReflectProp. Arguments isom {_ _} _%g _%g _. Arguments morphic {_ _} _%g _. Arguments misom _ _ _%g _%g _. Arguments isog {_ _} _%g _%g. Arguments morphicP {aT rT A f}. Arguments misomP {aT rT A B f}. Arguments isom_isog [aT rT A B D]. Arguments isomP {aT rT G H f}. Arguments isogP {aT rT G H}. Prenex Implicits morphm. Notation "x \isog y":= (isog x y). Section Isomorphisms. Variables gT hT kT : finGroupType. Variables (G : {group gT}) (H : {group hT}) (K : {group kT}). Lemma idm_isom : isom G G (idm G). Proof. (* Goal: is_true (@isom gT gT (@gval gT G) (@gval gT G) (@idm gT (@gval gT G))) *) exact: sub_isom (im_idm G) (injm_idm G). Qed. Lemma card_isog : G \isog H -> #|G| = #|H|. Proof. (* Goal: forall _ : is_true (@isog gT hT (@gval gT G) (@gval hT H)), @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base hT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base hT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base hT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base hT)) (@gval hT H)))) *) by case/isogP=> f injf <-; apply: isom_card (f) _; apply/isomP. Qed. Lemma isog_abelian : G \isog H -> abelian G = abelian H. Proof. (* Goal: forall _ : is_true (@isog gT hT (@gval gT G) (@gval hT H)), @eq bool (@abelian gT (@gval gT G)) (@abelian hT (@gval hT H)) *) by case/isogP=> f injf <-; rewrite injm_abelian. Qed. Lemma trivial_isog : G :=: 1 -> H :=: 1 -> G \isog H. Lemma isog_eq1 : G \isog H -> (G :==: 1) = (H :==: 1). Proof. (* Goal: forall _ : is_true (@isog gT hT (@gval gT G) (@gval hT H)), @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base hT))) (@gval hT H : @set_of (FinGroup.arg_finType (FinGroup.base hT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base hT))))) (oneg (group_set_of_baseGroupType (FinGroup.base hT)) : @set_of (FinGroup.arg_finType (FinGroup.base hT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base hT)))))) *) by move=> isoGH; rewrite !trivg_card1 card_isog. Qed. Lemma isom_sym (f : {morphism G >-> hT}) (isoGH : isom G H f) : isom H G (isom_inv isoGH). Proof. (* Goal: is_true (@isom hT gT (@gval hT H) (@gval gT G) (@isom_inv gT hT G H f isoGH)) *) rewrite sub_isom 1?injm_restrm ?injm_invm // im_restrm. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim hT gT (@morphim gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval gT G)) (@invm_morphism gT hT G f (@isom_inj gT hT G H f isoGH)) (@MorPhantom hT gT (@mfun hT gT (@morphim gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval gT G)) (@invm_morphism gT hT G f (@isom_inj gT hT G H f isoGH)))) (@gval hT H)) (@gval gT G) *) by rewrite -(isom_im isoGH) im_invm. Qed. Lemma isog_symr : G \isog H -> H \isog G. Proof. (* Goal: forall _ : is_true (@isog gT hT (@gval gT G) (@gval hT H)), is_true (@isog hT gT (@gval hT H) (@gval gT G)) *) by case/isog_isom=> f /isom_sym/isom_isog->. Qed. Lemma isog_trans : G \isog H -> H \isog K -> G \isog K. Proof. (* Goal: forall (_ : is_true (@isog gT hT (@gval gT G) (@gval hT H))) (_ : is_true (@isog hT kT (@gval hT H) (@gval kT K))), is_true (@isog gT kT (@gval gT G) (@gval kT K)) *) case/isogP=> f injf <-; case/isogP=> g injg <-. (* Goal: is_true (@isog gT kT (@gval gT G) (@morphim hT kT (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G)) g (@MorPhantom hT kT (@mfun hT kT (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G)) g)) (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G)))) *) have defG: f @*^-1 (f @* G) = G by rewrite morphimGK ?subsetIl. (* Goal: is_true (@isog gT kT (@gval gT G) (@morphim hT kT (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G)) g (@MorPhantom hT kT (@mfun hT kT (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G)) g)) (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G)))) *) rewrite -morphim_comp -{1 8}defG. (* Goal: is_true (@isog gT kT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@morphim gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval gT G))) (@morphim gT kT (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G))) (@comp_morphism gT hT kT G (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G) f g) (@MorPhantom gT kT (@funcomp (FinGroup.sort (FinGroup.base kT)) (FinGroup.arg_sort (FinGroup.base hT)) (FinGroup.arg_sort (FinGroup.base gT)) tt (@mfun hT kT (@gval hT (@morphim_group gT hT G f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) G)) g) (@mfun gT hT (@gval gT G) f))) (@morphpre gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@morphim gT hT (@gval gT G) f (@MorPhantom gT hT (@mfun gT hT (@gval gT G) f)) (@gval gT G))))) *) by apply/isogP; exists [morphism of g \o f]; rewrite ?injm_comp. Qed. Lemma nclasses_isog : G \isog H -> #|classes G| = #|classes H|. Proof. (* Goal: forall _ : is_true (@isog gT hT (@gval gT G) (@gval hT H)), @eq nat (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@card (set_of_finType (FinGroup.finType (FinGroup.base hT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base hT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base hT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base hT))) (@classes hT (@gval hT H))))) *) by case/isogP=> f injf <-; rewrite nclasses_injm. Qed. End Isomorphisms. Section IsoBoolEquiv. Variables gT hT kT : finGroupType. Variables (G : {group gT}) (H : {group hT}) (K : {group kT}). Lemma isog_sym : (G \isog H) = (H \isog G). Proof. (* Goal: @eq bool (@isog gT hT (@gval gT G) (@gval hT H)) (@isog hT gT (@gval hT H) (@gval gT G)) *) by apply/idP/idP; apply: isog_symr. Qed. Lemma isog_transl : G \isog H -> (G \isog K) = (H \isog K). Proof. (* Goal: forall _ : is_true (@isog gT hT (@gval gT G) (@gval hT H)), @eq bool (@isog gT kT (@gval gT G) (@gval kT K)) (@isog hT kT (@gval hT H) (@gval kT K)) *) by move=> iso; apply/idP/idP; apply: isog_trans; rewrite // -isog_sym. Qed. Lemma isog_transr : G \isog H -> (K \isog G) = (K \isog H). Proof. (* Goal: forall _ : is_true (@isog gT hT (@gval gT G) (@gval hT H)), @eq bool (@isog kT gT (@gval kT K) (@gval gT G)) (@isog kT hT (@gval kT K) (@gval hT H)) *) by move=> iso; apply/idP/idP; move/isog_trans; apply; rewrite // -isog_sym. Qed. End IsoBoolEquiv. Section Homg. Implicit Types rT gT aT : finGroupType. Definition homg rT aT (C : {set rT}) (D : {set aT}) := [exists (f : {ffun aT -> rT} | morphic D f), f @: D == C]. Lemma homgP rT aT (C : {set rT}) (D : {set aT}) : reflect (exists f : {morphism D >-> rT}, f @* D = C) (homg C D). Proof. (* Goal: Bool.reflect (@ex (@morphism_for aT rT D (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun f : @morphism_for aT rT D (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) D) C)) (@homg rT aT C D) *) apply: (iffP exists_eq_inP) => [[f fM <-] | [f <-]]. (* Goal: @ex2 (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (fun x : Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) => is_true (@morphic aT rT D (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) x))) (fun x : Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) => @eq (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base rT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D))) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) D)) *) (* Goal: @ex (@morphism_for aT rT D (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun f0 : @morphism_for aT rT D (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT D f0 (@MorPhantom aT rT (@mfun aT rT D f0)) D) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) f) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D)))) *) by exists (morphm_morphism fM); rewrite /morphim /= setIid. (* Goal: @ex2 (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (fun x : Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) => is_true (@morphic aT rT D (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) x))) (fun x : Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) => @eq (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base rT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D))) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) D)) *) exists (finfun f); first by apply/morphicP=> x y Dx Dy; rewrite !ffunE morphM. (* Goal: @eq (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base rT)))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@FunFinfun.finfun (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mfun aT rT D f))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D))) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) D) *) by rewrite /morphim setIid; apply: eq_imset => x; rewrite ffunE. Qed. Lemma morphim_homg aT rT (A D : {set aT}) (f : {morphism D >-> rT}) : A \subset D -> homg (f @* A) A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) D))), is_true (@homg rT aT (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) A) A) *) move=> sAD; apply/homgP; exists (restrm_morphism sAD f). (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT A (@restrm_morphism aT rT A D sAD f) (@MorPhantom aT rT (@mfun aT rT A (@restrm_morphism aT rT A D sAD f))) A) (@morphim aT rT D f (@MorPhantom aT rT (@mfun aT rT D f)) A) *) by rewrite morphim_restrm setIid. Qed. Lemma leq_homg rT aT (C : {set rT}) (G : {group aT}) : homg C G -> #|C| <= #|G|. Proof. (* Goal: forall _ : is_true (@homg rT aT C (@gval aT G)), is_true (leq (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) C))) (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT G))))) *) by case/homgP=> f <-; apply: leq_morphim. Qed. Lemma homg_refl aT (A : {set aT}) : homg A A. Proof. (* Goal: is_true (@homg aT aT A A) *) by apply/homgP; exists (idm_morphism A); rewrite im_idm. Qed. Lemma homg_trans aT (B : {set aT}) rT (C : {set rT}) gT (G : {group gT}) : homg C B -> homg B G -> homg C G. Proof. (* Goal: forall (_ : is_true (@homg rT aT C B)) (_ : is_true (@homg aT gT B (@gval gT G))), is_true (@homg rT gT C (@gval gT G)) *) move=> homCB homBG; case/homgP: homBG homCB => fG <- /homgP[fK <-]. (* Goal: is_true (@homg rT gT (@morphim aT rT (@morphim gT aT (@gval gT G) fG (@MorPhantom gT aT (@mfun gT aT (@gval gT G) fG)) (@gval gT G)) fK (@MorPhantom aT rT (@mfun aT rT (@morphim gT aT (@gval gT G) fG (@MorPhantom gT aT (@mfun gT aT (@gval gT G) fG)) (@gval gT G)) fK)) (@morphim gT aT (@gval gT G) fG (@MorPhantom gT aT (@mfun gT aT (@gval gT G) fG)) (@gval gT G))) (@gval gT G)) *) by rewrite -morphim_comp morphim_homg // -sub_morphim_pre. Qed. Lemma isogEcard rT aT (G : {group rT}) (H : {group aT}) : (G \isog H) = (homg G H) && (#|H| <= #|G|). Proof. (* Goal: @eq bool (@isog rT aT (@gval rT G) (@gval aT H)) (andb (@homg rT aT (@gval rT G) (@gval aT H)) (leq (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))) (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G)))))) *) rewrite isog_sym; apply/isogP/andP=> [[f injf <-] | []]. (* Goal: forall (_ : is_true (@homg rT aT (@gval rT G) (@gval aT H))) (_ : is_true (leq (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))) (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G)))))), @ex2 (@morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun f : @morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))) (fun f : @morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f)) (@gval aT H)) (@gval rT G)) *) (* Goal: and (is_true (@homg rT aT (@morphim aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f)) (@gval aT H)) (@gval aT H))) (is_true (leq (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))) (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f)) (@gval aT H))))))) *) by rewrite leq_eqVlt eq_sym card_im_injm injf morphim_homg. (* Goal: forall (_ : is_true (@homg rT aT (@gval rT G) (@gval aT H))) (_ : is_true (leq (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H)))) (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT G)))))), @ex2 (@morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun f : @morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))) (fun f : @morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f)) (@gval aT H)) (@gval rT G)) *) case/homgP=> f <-; rewrite leq_eqVlt eq_sym card_im_injm. (* Goal: forall _ : is_true (orb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) (leq (S (@card (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@gval aT H))))) (@card (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@morphim aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f)) (@gval aT H))))))), @ex2 (@morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun f : @morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT))))))) (fun f0 : @morphism_for aT rT (@gval aT H) (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim aT rT (@gval aT H) f0 (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f0)) (@gval aT H)) (@morphim aT rT (@gval aT H) f (@MorPhantom aT rT (@mfun aT rT (@gval aT H) f)) (@gval aT H))) *) by rewrite ltnNge leq_morphim orbF; exists f. Qed. Lemma isog_hom rT aT (G : {group rT}) (H : {group aT}) : G \isog H -> homg G H. Proof. (* Goal: forall _ : is_true (@isog rT aT (@gval rT G) (@gval aT H)), is_true (@homg rT aT (@gval rT G) (@gval aT H)) *) by rewrite isogEcard; case/andP. Qed. Lemma isogEhom rT aT (G : {group rT}) (H : {group aT}) : (G \isog H) = homg G H && homg H G. Proof. (* Goal: @eq bool (@isog rT aT (@gval rT G) (@gval aT H)) (andb (@homg rT aT (@gval rT G) (@gval aT H)) (@homg aT rT (@gval aT H) (@gval rT G))) *) apply/idP/andP=> [isoGH | [homGH homHG]]. (* Goal: is_true (@isog rT aT (@gval rT G) (@gval aT H)) *) (* Goal: and (is_true (@homg rT aT (@gval rT G) (@gval aT H))) (is_true (@homg aT rT (@gval aT H) (@gval rT G))) *) by rewrite !isog_hom // isog_sym. (* Goal: is_true (@isog rT aT (@gval rT G) (@gval aT H)) *) by rewrite isogEcard homGH leq_homg. Qed. Lemma eq_homgl gT aT rT (G : {group gT}) (H : {group aT}) (K : {group rT}) : G \isog H -> homg G K = homg H K. Proof. (* Goal: forall _ : is_true (@isog gT aT (@gval gT G) (@gval aT H)), @eq bool (@homg gT rT (@gval gT G) (@gval rT K)) (@homg aT rT (@gval aT H) (@gval rT K)) *) by rewrite isogEhom => /andP[homGH homHG]; apply/idP/idP; apply: homg_trans. Qed. Lemma eq_homgr gT rT aT (G : {group gT}) (H : {group rT}) (K : {group aT}) : G \isog H -> homg K G = homg K H. Proof. (* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT H)), @eq bool (@homg aT gT (@gval aT K) (@gval gT G)) (@homg aT rT (@gval aT K) (@gval rT H)) *) rewrite isogEhom => /andP[homGH homHG]. (* Goal: @eq bool (@homg aT gT (@gval aT K) (@gval gT G)) (@homg aT rT (@gval aT K) (@gval rT H)) *) by apply/idP/idP=> homK; apply: homg_trans homK _. Qed. End Homg. Arguments homg _ _ _%g _%g. Notation "G \homg H" := (homg G H) (at level 70, no associativity) : group_scope. Arguments homgP {rT aT C D}. Section SubMorphism. Variables (gT : finGroupType) (G : {group gT}). Canonical sgval_morphism := Morphism (@sgvalM _ G). Canonical subg_morphism := Morphism (@subgM _ G). Lemma injm_sgval : 'injm sgval. Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G))) (@ker (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G))) (oneg (group_set_baseGroupType (FinGroup.base (@subFinGroupType gT G))))))) *) exact/injmP/(in2W subg_inj). Qed. Lemma injm_subg : 'injm (subg G). Proof. (* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT (@subFinGroupType gT G) (@gval gT G) subg_morphism (@MorPhantom gT (@subFinGroupType gT G) (@subg gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *) exact/injmP/(can_in_inj subgK). Qed. Hint Resolve injm_sgval injm_subg : core. Lemma ker_sgval : 'ker sgval = 1. Proof. exact/trivgP. Qed. Proof. (* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@subFinGroupType gT G)))))) (@ker (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G))) (oneg (group_set_of_baseGroupType (FinGroup.base (@subFinGroupType gT G)))) *) exact/trivgP. Qed. Lemma im_subg : subg G @* G = [subg G]. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G)))))) (@morphim gT (@subFinGroupType gT G) (@gval gT G) subg_morphism (@MorPhantom gT (@subFinGroupType gT G) (@subg gT G)) (@gval gT G)) (@setTfor (@subg_finType gT G) (Phant (@subg_of gT G))) *) apply/eqP; rewrite -subTset morphimEdom. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (@setTfor (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G)))))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (@mfun gT (@subFinGroupType gT G) (@gval gT G) subg_morphism) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) *) by apply/subsetP=> u _; rewrite -(sgvalK u) mem_imset ?subgP. Qed. Lemma sgval_sub A : sgval @* A \subset G. Proof. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G)) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *) by apply/subsetP=> x; case/imsetP=> u _ ->; apply: subgP. Qed. Lemma sgvalmK A : subg G @* (sgval @* A) = A. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G)))))) (@morphim gT (@subFinGroupType gT G) (@gval gT G) subg_morphism (@MorPhantom gT (@subFinGroupType gT G) (@subg gT G)) (@morphim (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G)) A)) A *) apply/eqP; rewrite eqEcard !card_injm ?subsetT ?sgval_sub // leqnn andbT. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) (@morphim gT (@subFinGroupType gT G) (@gval gT G) subg_morphism (@MorPhantom gT (@subFinGroupType gT G) (@subg gT G)) (@morphim (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G)) A)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@subFinGroupType gT G))) A))) *) rewrite -morphim_comp; apply/subsetP=> _ /morphimP[v _ Av ->] /=. (* Goal: is_true (@in_mem (@subg_of gT G) (@subg gT G (@sgval gT G v)) (@mem (@subg_of gT G) (predPredType (@subg_of gT G)) (@SetDef.pred_of_set (FinGroup.finType (@subBaseFinGroupType gT G)) A))) *) by rewrite sgvalK. Qed. Lemma subgmK (A : {set gT}) : A \subset G -> sgval @* (subg G @* A) = A. Proof. (* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))), @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G)) (@morphim gT (@subFinGroupType gT G) (@gval gT G) subg_morphism (@MorPhantom gT (@subFinGroupType gT G) (@subg gT G)) A)) A *) move=> sAG; apply/eqP; rewrite eqEcard !card_injm ?subsetT //. (* Goal: is_true (andb (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G)) (@morphim gT (@subFinGroupType gT G) (@gval gT G) subg_morphism (@MorPhantom gT (@subFinGroupType gT G) (@subg gT G)) A)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (leq (@card (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A))))) *) rewrite leqnn andbT -morphim_comp morphimE /= morphpreT. (* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (@funcomp (FinGroup.sort (FinGroup.base gT)) (@subg_of gT G) (FinGroup.arg_sort (FinGroup.base gT)) tt (@sgval gT G) (@subg gT G)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) A)))))) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) A))) *) by apply/subsetP=> _ /morphimP[v Gv Av ->] /=; rewrite subgK. Qed. Lemma im_sgval : sgval @* [subg G] = G. Proof. (* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (Finite.sort (@subg_finType gT G)))) sgval_morphism (@MorPhantom (@subFinGroupType gT G) gT (@sgval gT G)) (@setTfor (@subg_finType gT G) (Phant (@subg_of gT G)))) (@gval gT G) *) by rewrite -{2}im_subg subgmK. Qed. Lemma isom_subg : isom G [subg G] (subg G). Proof. (* Goal: is_true (@isom gT (@subFinGroupType gT G) (@gval gT G) (@setTfor (@subg_finType gT G) (Phant (@subg_of gT G))) (@subg gT G)) *) by apply/isomP; rewrite im_subg. Qed. Lemma isom_sgval : isom [subg G] G sgval. Proof. (* Goal: is_true (@isom (@subFinGroupType gT G) gT (@setTfor (@subg_finType gT G) (Phant (@subg_of gT G))) (@gval gT G) (@sgval gT G)) *) by apply/isomP; rewrite im_sgval. Qed. Lemma isog_subg : isog G [subg G]. Proof. (* Goal: is_true (@isog gT (@subFinGroupType gT G) (@gval gT G) (@setTfor (@subg_finType gT G) (Phant (@subg_of gT G)))) *) exact: isom_isog isom_subg. Qed. End SubMorphism. Arguments sgvalmK {gT G} A. Arguments subgmK {gT G} [A] sAG.
Require Export GeoCoq.Elements.OriginalProofs.lemma_angleordertransitive. Require Export GeoCoq.Elements.OriginalProofs.lemma_sameside2. Require Export GeoCoq.Elements.OriginalProofs.proposition_07. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_angletrichotomy : forall A B C D E F, LtA A B C D E F -> ~ LtA D E F A B C. Proof. (* Goal: forall (A B C D E F : @Point Ax0) (_ : @LtA Ax0 A B C D E F), not (@LtA Ax0 D E F A B C) *) intros. (* Goal: not (@LtA Ax0 D E F A B C) *) assert (~ LtA D E F A B C). (* Goal: not (@LtA Ax0 D E F A B C) *) (* Goal: not (@LtA Ax0 D E F A B C) *) { (* Goal: not (@LtA Ax0 D E F A B C) *) intro. (* Goal: False *) assert (LtA A B C A B C) by (conclude lemma_angleordertransitive). (* Goal: False *) rename_H H;let Tf:=fresh in assert (Tf:exists G H J, (BetS G H J /\ Out B A G /\ Out B C J /\ CongA A B C A B H)) by (conclude_def LtA );destruct Tf as [G[H[J]]];spliter. (* Goal: False *) let Tf:=fresh in assert (Tf:exists U V u v, (Out B A U /\ Out B C V /\ Out B A u /\ Out B H v /\ Cong B U B u /\ Cong B V B v /\ Cong U V u v /\ nCol A B C)) by (conclude_def CongA );destruct Tf as [U[V[u[v]]]];spliter. (* Goal: False *) assert (~ eq A B). (* Goal: False *) (* Goal: not (@eq Ax0 A B) *) { (* Goal: not (@eq Ax0 A B) *) intro. (* Goal: False *) assert (Col A B C) by (conclude_def Col ). (* Goal: False *) contradict. (* BG Goal: not (@LtA Ax0 D E F A B C) *) (* BG Goal: False *) } (* Goal: False *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (eq U u) by (conclude lemma_layoffunique). (* Goal: False *) assert (Cong U V U v) by (conclude cn_equalitysub). (* Goal: False *) assert (Col B A U) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col B A G) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (neq G H) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq H G) by (conclude lemma_inequalitysymmetric). (* Goal: False *) let Tf:=fresh in assert (Tf:exists P, (BetS H G P /\ Cong G P H G)) by (conclude lemma_extension);destruct Tf as [P];spliter. (* Goal: False *) assert (BetS J H G) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (BetS J G P) by (conclude lemma_3_7a). (* Goal: False *) assert (~ Col B A J). (* Goal: False *) (* Goal: not (@Col Ax0 B A J) *) { (* Goal: not (@Col Ax0 B A J) *) intro. (* Goal: False *) assert (Col B C J) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col J B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col J B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B J) by (conclude lemma_raystrict). (* Goal: False *) assert (neq J B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B A C) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@LtA Ax0 D E F A B C) *) (* BG Goal: False *) } (* Goal: False *) assert (TS J B A P) by (conclude_def TS ). (* Goal: False *) assert (~ Col B U H). (* Goal: False *) (* Goal: not (@Col Ax0 B U H) *) { (* Goal: not (@Col Ax0 B U H) *) intro. (* Goal: False *) assert (Col B A U) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col U B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col U B H) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B U) by (conclude lemma_raystrict). (* Goal: False *) assert (neq U B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B A H) by (conclude lemma_collinear4). (* Goal: False *) assert (Col G H J) by (conclude_def Col ). (* Goal: False *) assert (Col A B G) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A B H) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B G H) by (conclude lemma_collinear4). (* Goal: False *) assert (Col G H B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col G H J) by (conclude_def Col ). (* Goal: False *) assert (neq G H) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col H B J) by (conclude lemma_collinear4). (* Goal: False *) assert (Col H B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (~ neq H B). (* Goal: False *) (* Goal: not (@neq Ax0 H B) *) { (* Goal: not (@neq Ax0 H B) *) intro. (* Goal: False *) assert (Col B J A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B A J) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@LtA Ax0 D E F A B C) *) (* BG Goal: False *) (* BG Goal: False *) } (* Goal: False *) assert (BetS G B J) by (conclude cn_equalitysub). (* Goal: False *) assert (Col G B J) by (conclude_def Col ). (* Goal: False *) assert (Col B G J) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B G A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B G) by (conclude lemma_raystrict). (* Goal: False *) assert (Col G J A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col G J B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq G J) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col J A B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B A J) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@LtA Ax0 D E F A B C) *) (* BG Goal: False *) } (* Goal: False *) assert (Out B G U) by (conclude lemma_ray3). (* Goal: False *) assert (Col B G U) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col B U G) by (forward_using lemma_collinearorder). (* Goal: False *) assert (TS H B U P) by (conclude_def TS ). (* Goal: False *) assert (BetS J H G) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (BetS J G P) by (conclude lemma_3_7a). (* Goal: False *) assert (~ Col B U J). (* Goal: False *) (* Goal: not (@Col Ax0 B U J) *) { (* Goal: not (@Col Ax0 B U J) *) intro. (* Goal: False *) assert (Col B C J) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col B J C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B A U) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col U B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col U B J) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B U) by (conclude lemma_raystrict). (* Goal: False *) assert (neq U B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B A J) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B C J) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col J B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col J B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B J) by (conclude lemma_raystrict). (* Goal: False *) assert (neq J B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B C A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@LtA Ax0 D E F A B C) *) (* BG Goal: False *) } (* Goal: False *) assert (OS J H B U) by (conclude_def OS ). (* Goal: False *) assert (OS H J B U) by (forward_using lemma_samesidesymmetric). (* Goal: False *) assert (Out B J V) by (conclude lemma_ray3). (* Goal: False *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: False *) assert (Col B B U) by (conclude_def Col ). (* Goal: False *) assert (OS H V B U) by (conclude lemma_sameside2). (* Goal: False *) assert (OS V H B U) by (forward_using lemma_samesidesymmetric). (* Goal: False *) assert (OS V v B U) by (conclude lemma_sameside2). (* Goal: False *) assert (neq B U) by (conclude lemma_raystrict). (* Goal: False *) assert (Cong V B v B) by (forward_using lemma_congruenceflip). (* Goal: False *) assert (Cong V U v U) by (forward_using lemma_congruenceflip). (* Goal: False *) assert (eq V v) by (conclude proposition_07). (* Goal: False *) assert (Out B H V) by (conclude cn_equalitysub). (* Goal: False *) assert (Col B H V) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col B J V) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col V B J) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col V B H) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B V) by (conclude lemma_raystrict). (* Goal: False *) assert (neq V B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B J H) by (conclude lemma_collinear4). (* Goal: False *) assert (Col G H J) by (conclude_def Col ). (* Goal: False *) assert (Col H J B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col H J G) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq J H) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq H J) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col J B G) by (conclude lemma_collinear4). (* Goal: False *) assert (Col B C J) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col J B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B J) by (conclude lemma_raystrict). (* Goal: False *) assert (neq J B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B G C) by (conclude lemma_collinear4). (* Goal: False *) assert (Col G B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B A G) by (conclude lemma_rayimpliescollinear). (* Goal: False *) assert (Col G B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B G) by (conclude lemma_raystrict). (* Goal: False *) assert (neq G B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B C A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@LtA Ax0 D E F A B C) *) } (* Goal: not (@LtA Ax0 D E F A B C) *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthantransitive. Require Export GeoCoq.Elements.OriginalProofs.lemma_trichotomy2. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_subtractequals : forall A B C D E, BetS A B C -> BetS A D E -> Cong B C D E -> BetS A C E -> BetS A B D. Proof. (* Goal: forall (A B C D E : @Point Ax) (_ : @BetS Ax A B C) (_ : @BetS Ax A D E) (_ : @Cong Ax B C D E) (_ : @BetS Ax A C E), @BetS Ax A B D *) intros. (* Goal: @BetS Ax A B D *) assert (~ BetS A D B). (* Goal: @BetS Ax A B D *) (* Goal: not (@BetS Ax A D B) *) { (* Goal: not (@BetS Ax A D B) *) intro. (* Goal: False *) assert (BetS A D C) by (conclude lemma_3_6b). (* Goal: False *) assert (BetS A D C) by (conclude lemma_3_6b). (* Goal: False *) assert (BetS B C E) by (conclude lemma_3_6a). (* Goal: False *) assert (Cong B C B C) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt B C B E) by (conclude_def Lt ). (* Goal: False *) assert (Cong B E E B) by (conclude cn_equalityreverse). (* Goal: False *) assert (Lt B C E B) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (BetS D C E) by (conclude lemma_3_6a). (* Goal: False *) assert (BetS D B C) by (conclude lemma_3_6a). (* Goal: False *) assert (BetS D B E) by (conclude lemma_3_6b). (* Goal: False *) assert (BetS E B D) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (Cong E B E B) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Lt E B E D) by (conclude_def Lt ). (* Goal: False *) assert (Cong E D D E) by (conclude cn_equalityreverse). (* Goal: False *) assert (Lt E B D E) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (Lt B C D E) by (conclude lemma_lessthantransitive). (* Goal: False *) assert (Cong D E B C) by (conclude lemma_congruencesymmetric). (* Goal: False *) assert (Lt B C B C) by (conclude lemma_lessthancongruence). (* Goal: False *) assert (~ Lt B C B C) by (conclude lemma_trichotomy2). (* Goal: False *) contradict. (* BG Goal: @BetS Ax A B D *) } (* Goal: @BetS Ax A B D *) assert (~ ~ BetS A B D). (* Goal: @BetS Ax A B D *) (* Goal: not (not (@BetS Ax A B D)) *) { (* Goal: not (not (@BetS Ax A B D)) *) intro. (* Goal: False *) assert (BetS A B E) by (conclude lemma_3_6b). (* Goal: False *) assert (eq B D) by (conclude axiom_connectivity). (* Goal: False *) assert (Cong A B A B) by (conclude cn_congruencereflexive). (* Goal: False *) assert (Cong A B A D) by (conclude cn_equalitysub). (* Goal: False *) assert (Cong A C A E) by (conclude cn_sumofparts). (* Goal: False *) assert (BetS A B E) by (conclude cn_equalitysub). (* Goal: False *) assert (neq A B) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Out A B E) by (conclude lemma_ray4). (* Goal: False *) assert (Out A B C) by (conclude lemma_ray4). (* Goal: False *) assert (eq C E) by (conclude lemma_layoffunique). (* Goal: False *) assert (neq C E) by (forward_using lemma_betweennotequal). (* Goal: False *) contradict. (* BG Goal: @BetS Ax A B D *) } (* Goal: @BetS Ax A B D *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_betweennotequal. Require Export GeoCoq.Elements.OriginalProofs.lemma_localextension. Require Export GeoCoq.Elements.OriginalProofs.lemma_congruencesymmetric. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_betweennesspreserved : forall A B C a b c, Cong A B a b -> Cong A C a c -> Cong B C b c -> BetS A B C -> BetS a b c. Proof. (* Goal: forall (A B C a b c : @Point Ax0) (_ : @Cong Ax0 A B a b) (_ : @Cong Ax0 A C a c) (_ : @Cong Ax0 B C b c) (_ : @BetS Ax0 A B C), @BetS Ax0 a b c *) intros. (* Goal: @BetS Ax0 a b c *) assert (neq A B) by (forward_using lemma_betweennotequal). (* Goal: @BetS Ax0 a b c *) assert (neq a b) by (conclude axiom_nocollapse). (* Goal: @BetS Ax0 a b c *) assert (neq B C) by (forward_using lemma_betweennotequal). (* Goal: @BetS Ax0 a b c *) assert (neq b c) by (conclude axiom_nocollapse). (* Goal: @BetS Ax0 a b c *) let Tf:=fresh in assert (Tf:exists d, (BetS a b d /\ Cong b d b c)) by (conclude lemma_localextension);destruct Tf as [d];spliter. (* Goal: @BetS Ax0 a b c *) assert (Cong b c b d) by (conclude lemma_congruencesymmetric). (* Goal: @BetS Ax0 a b c *) assert (Cong b c B C) by (conclude lemma_congruencesymmetric). (* Goal: @BetS Ax0 a b c *) assert (Cong b d B C) by (conclude cn_congruencetransitive). (* Goal: @BetS Ax0 a b c *) assert (Cong B C b d) by (conclude lemma_congruencesymmetric). (* Goal: @BetS Ax0 a b c *) assert (Cong C C c d) by (conclude axiom_5_line). (* Goal: @BetS Ax0 a b c *) assert (Cong c d C C) by (conclude lemma_congruencesymmetric). (* Goal: @BetS Ax0 a b c *) assert (~ neq c d). (* Goal: @BetS Ax0 a b c *) (* Goal: not (@neq Ax0 c d) *) { (* Goal: not (@neq Ax0 c d) *) intro. (* Goal: False *) assert (neq C C) by (conclude axiom_nocollapse). (* Goal: False *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: False *) contradict. (* BG Goal: @BetS Ax0 a b c *) } (* Goal: @BetS Ax0 a b c *) assert (BetS a b c) by (conclude cn_equalitysub). (* Goal: @BetS Ax0 a b c *) close. Qed. End Euclid.
Global Set Asymmetric Patterns. Inductive act : Set := | r1 : act | r2 : act | r3 : act | r5 : act | r6 : act | s2 : act | s3 : act | s4 : act | s5 : act | s6 : act | c2 : act | c3 : act | c5 : act | c6 : act | int : act | delta : act | tau : act. Parameter proc : Set. Parameter ia : forall E : Set, act -> E -> proc. Inductive one : Set := i : one. Definition Delta := ia one delta i. Inductive list (A : Set) : Set := | nil : list A | cons : A -> list A -> list A. Inductive ehlist : Set := | ehnil : ehlist | ehcons : act -> ehlist -> ehlist. Definition In_list (N : Set) (n : N) (Y : list N) : Prop := (fix F (l : list N) : Prop := match l with | nil => False | cons y l0 => n = y :>N \/ F l0 end) Y. Definition In_ehlist (a : act) (H : ehlist) : Prop := (fix F (e : ehlist) : Prop := match e with | ehnil => False | ehcons a0 e0 => a = a0 :>act \/ F e0 end) H. Parameter alt : proc -> proc -> proc. Parameter seq : proc -> proc -> proc. Parameter mer : proc -> proc -> proc. Parameter Lmer : proc -> proc -> proc. Parameter comm : proc -> proc -> proc. Parameter cond : proc -> bool -> proc -> proc. Parameter sum : forall A : Set, (A -> proc) -> proc. Parameter enc : ehlist -> proc -> proc. Parameter hide : ehlist -> proc -> proc. Parameter GRD : proc -> Prop. Infix "+" := sum (left associativity, at level 50). Definition gamma (a b : act) := match a, b with | r2, s2 => c2 | r3, s3 => c3 | r5, s5 => c5 | r6, s5 => c6 | s2, r2 => c2 | s3, r3 => c3 | s5, r5 => c5 | s6, r6 => c6 | _, _ => delta end. Parameter EQ : Set -> Set -> Prop. Axiom EQ_refl : forall S1 : Set, EQ S1 S1. Axiom EQ_sym : forall S1 S2 : Set, EQ S1 S2 -> EQ S2 S1. Section COMMUNICATION_F. Variable a b : act. Variable E F : Set. Variable e e1 e2 : E. Variable f : F. Axiom CF1 : ia E (gamma a b) e = comm (ia E a e) (ia E b e). Axiom CF2 : gamma a b = delta -> Delta = comm (ia E a e1) (ia E b e2). Axiom CF2' : e1 <> e2 -> Delta = comm (ia E a e1) (ia E b e2). Axiom CF2'' : ~ EQ E F -> Delta = comm (ia E a e) (ia F b f). End COMMUNICATION_F. Axiom EXTE : forall (D : Set) (x y : D -> proc), (forall d : D, x d = y d) -> x = y. Section BPA. Variable x y z : proc. Axiom A1 : alt x y = alt y x. Axiom A2 : alt x (alt y z) = alt (alt x y) z. Axiom A3 : x = alt x x. Axiom A4 : alt (seq x z) (seq y z) = seq (alt x y) z. Axiom A5 : seq x (seq y z) = seq (seq x y) z. Axiom A6 : x = alt x Delta. Axiom A7 : Delta = seq Delta x. End BPA. Goal forall x : proc, x = alt Delta x. intro. elim A1. apply A6. Save A6'. Section GUARDED. Variable D : Set. Variable d : D. Variable x y : proc. Variable z : D -> proc. Variable a : act. Variable B : bool. Variable L : ehlist. Axiom G2 : GRD (ia D a d). Axiom G5 : (forall d : D, GRD (z d)) -> GRD (D + z). Axiom G6 : GRD x -> GRD (seq x y). Axiom G7 : GRD x -> GRD (Lmer x y). Axiom G8 : GRD x -> GRD y -> GRD (alt x y). Axiom G9 : GRD x -> GRD y -> GRD (mer x y). Axiom G10 : GRD x -> GRD y -> GRD (comm x y). Axiom G11 : GRD x -> GRD y -> GRD (cond x B y). Axiom G12 : GRD x -> GRD (hide L x). Axiom G13 : GRD x -> GRD (enc L x). End GUARDED. Section PARALLEL_OPERATORS. Variable x y z : proc. Variable E F : Set. Variable e : E. Variable f : F. Variable a b : act. Axiom CM1 : alt (alt (Lmer x y) (Lmer y x)) (comm x y) = mer x y. Axiom CM2 : seq (ia E a e) x = Lmer (ia E a e) x. Axiom CM3 : seq (ia E a e) (mer x y) = Lmer (seq (ia E a e) x) y. Axiom CM4 : alt (Lmer x z) (Lmer y z) = Lmer (alt x y) z. Axiom CM5 : seq (comm (ia E a e) (ia F b f)) x = comm (seq (ia E a e) x) (ia F b f). Axiom CM6 : seq (comm (ia E a e) (ia F b f)) x = comm (ia E a e) (seq (ia F b f) x). Axiom CM7 : seq (comm (ia E a e) (ia F b f)) (mer x y) = comm (seq (ia E a e) x) (seq (ia F b f) y). Axiom CM8 : alt (comm x z) (comm y z) = comm (alt x y) z. Axiom CM9 : alt (comm x y) (comm x z) = comm x (alt y z). End PARALLEL_OPERATORS. Section STANDARD_CONCURRENCY. Variable x y z : proc. Axiom SC1 : Lmer x (mer y z) = Lmer (Lmer x y) z. Axiom SC3 : comm y x = comm x y. Axiom SC4 : comm x (comm y z) = comm (comm x y) z. Axiom SC5 : Lmer (comm x y) z = comm x (Lmer y z). End STANDARD_CONCURRENCY. Goal forall x y : proc, mer x y = mer y x. intros. elim CM1. elim CM1. elim SC3. elim (A1 (Lmer x y) (Lmer y x)). apply refl_equal. Save SC6. Goal forall x y z : proc, mer x (mer y z) = mer (mer x y) z. intros. repeat elim CM1. repeat elim CM8. repeat elim CM9. repeat elim CM4. repeat elim SC5. repeat elim SC4. repeat elim CM1. repeat elim A2. repeat elim SC1. repeat elim CM1. elim (A1 (Lmer z x) (Lmer x z)). repeat elim A2. elim (SC3 x z). elimtype (alt (Lmer z (alt (Lmer y x) (alt (Lmer x y) (comm y x)))) (alt (Lmer (comm y z) x) (alt (Lmer (comm x y) z) (alt (Lmer (comm z x) y) (comm x (comm y z))))) = alt (Lmer (comm x y) z) (alt (Lmer z (alt (Lmer x y) (alt (Lmer y x) (comm x y)))) (alt (comm (Lmer x y) z) (alt (comm (Lmer y x) z) (comm x (comm y z)))))). apply refl_equal. elim (A1 (alt (Lmer z (alt (Lmer x y) (alt (Lmer y x) (comm x y)))) (alt (comm (Lmer x y) z) (alt (comm (Lmer y x) z) (comm x (comm y z))))) (Lmer (comm x y) z)). repeat elim A2. elimtype (alt (Lmer (comm y z) x) (alt (Lmer (comm x y) z) (alt (Lmer (comm z x) y) (comm x (comm y z)))) = alt (comm (Lmer x y) z) (alt (comm (Lmer y x) z) (alt (comm x (comm y z)) (Lmer (comm x y) z)))). elimtype (alt (Lmer y x) (alt (Lmer x y) (comm y x)) = alt (Lmer x y) (alt (Lmer y x) (comm x y))). apply refl_equal. elim SC3. elim A1. elim A2. elim (A1 (comm x y) (Lmer y x)). apply refl_equal. elim (SC3 (Lmer y x) z). elim SC5. elim (A1 (alt (Lmer (comm z y) x) (alt (comm x (comm y z)) (Lmer (comm x y) z))) (comm (Lmer x y) z)). repeat elim A2. elimtype (alt (Lmer (comm x y) z) (alt (Lmer (comm z x) y) (comm x (comm y z))) = alt (comm x (comm y z)) (alt (Lmer (comm x y) z) (comm (Lmer x y) z))). elim (SC3 y z). apply refl_equal. elim (A1 (alt (Lmer (comm x y) z) (comm (Lmer x y) z)) (comm x (comm y z))). elim A2. elim (SC3 (Lmer x y) z). elim SC5. apply refl_equal. Save SC7. Section CONDITION. Variable x y : proc. Axiom COND1 : x = cond x true y. Axiom COND2 : y = cond x false y. End CONDITION. Section SUM. Variable D : Set. Variable d : D. Variable x y : D -> proc. Variable p : proc. Variable L : ehlist. Axiom SUM1 : p = D + (fun d : D => p). Axiom SUM3 : alt (D + x) (x d) = D + x. Axiom SUM4 : alt (D + x) (D + y) = D + (fun d : D => alt (x d) (y d)). Axiom SUM5 : D + (fun d : D => seq (x d) p) = seq (D + x) p. Axiom SUM6 : D + (fun d : D => Lmer (x d) p) = Lmer (D + x) p. Axiom SUM7 : D + (fun d : D => comm (x d) p) = comm (D + x) p. Axiom SUM8 : D + (fun d : D => hide L (x d)) = hide L (D + x). Axiom SUM9 : D + (fun d : D => enc L (x d)) = enc L (D + x). End SUM. Section HIDE. Variable x y : proc. Variable E : Set. Variable e : E. Variable a : act. Variable L : ehlist. Axiom TI1 : ~ In_ehlist a L -> ia E a e = hide L (ia E a e). Axiom TI2 : In_ehlist a L -> ia one tau i = hide L (ia E a e). Axiom TI3 : Delta = hide L Delta. Axiom TI4 : alt (hide L x) (hide L y) = hide L (alt x y). Axiom TI5 : seq (hide L x) (hide L y) = hide L (seq x y). End HIDE. Section ENCAPSULATION. Variable x y : proc. Variable E : Set. Variable e : E. Variable a : act. Variable L : ehlist. Axiom D1 : ~ In_ehlist a L -> ia E a e = enc L (ia E a e). Axiom D2 : In_ehlist a L -> Delta = enc L (ia E a e). Axiom D3 : Delta = enc L Delta. Axiom D4 : alt (enc L x) (enc L y) = enc L (alt x y). Axiom D5 : seq (enc L x) (enc L y) = enc L (seq x y). End ENCAPSULATION. Axiom Handshaking : forall x y z : proc, Delta = comm x (comm y z). Axiom T1 : forall (D : Set) (d : D) (a : act), ia D a d = seq (ia D a d) (ia one tau i). Goal forall (D : Set) (d : D) (a : act) (x : proc), seq (ia D a d) x = seq (ia D a d) (seq (ia one tau i) x). intros. elimtype (seq (seq (ia D a d) (ia one tau i)) x = seq (ia D a d) (seq (ia one tau i) x)). elim T1. apply refl_equal. apply sym_equal. apply A5. Save T1'. Axiom KFAR2 : forall (D : Set) (d : D) (int : act) (x y : proc) (I : ehlist), In_ehlist int I -> x = alt (seq (ia D int d) (seq (ia D int d) x)) y -> seq (ia one tau i) (hide I x) = seq (ia one tau i) (hide I y). Axiom RSP : forall (D : Set) (x y : D -> proc) (G : (D -> proc) -> D -> proc), (forall (p : D -> proc) (d : D), GRD (G p d)) -> (forall d : D, x d = G x d) -> (forall d : D, y d = G y d) -> forall d : D, x d = y d. Hint Resolve G2 G5 G6 G7 G8 G9 G10 G11 G12 G13. Goal forall B : bool, true = B \/ false = B. intro. elim B. auto. auto. Save Lemma4. Section EXP2_. Variable x y : proc. Goal alt (Lmer x y) (alt (Lmer y x) (comm x y)) = mer x y. elim CM1. elim A2. apply refl_equal. Save EXP2. End EXP2_. Section EXP3_. Variable x y z : proc. Goal alt (Lmer x (mer y z)) (alt (Lmer y (mer x z)) (alt (Lmer z (mer x y)) (alt (Lmer (comm y z) x) (alt (Lmer (comm x y) z) (Lmer (comm x z) y))))) = mer x (mer y z). elim (EXP2 x (mer y z)). elim EXP2. elim CM4. elim SC1. elim (SC6 x z). elim CM4. elim SC1. elim (SC6 x y). elim CM9. elim CM9. elim Handshaking. elim A6. elim SC5. elim SC5. repeat elim A2. reflexivity. Save EXP3. End EXP3_. Goal forall x y z u : proc, alt (Lmer x (mer y (mer z u))) (alt (Lmer y (mer x (mer z u))) (alt (Lmer z (mer x (mer y u))) (alt (Lmer u (mer x (mer y z))) (alt (Lmer (comm z u) (mer x y)) (alt (Lmer (comm y z) (mer x u)) (alt (Lmer (comm y u) (mer x z)) (alt (Lmer (comm x y) (mer z u)) (alt (Lmer (comm x z) (mer y u)) (Lmer (comm x u) (mer y z)))))))))) = mer x (mer y (mer z u)). intros. elim (EXP2 x (mer y (mer z u))). elim EXP3. repeat elim CM4. repeat elim SC1. repeat elim CM9. repeat elim SC5. repeat elim Handshaking. unfold Delta in |- *. repeat elim CM2. repeat elim A7. repeat elim A6. repeat elim A2. elim (SC6 x (mer z u)). elim (SC6 x (mer y u)). elim (SC6 x (mer y z)). elim (SC6 x u). elim (SC6 x y). elim (SC6 x z). elim (SC6 y z). apply refl_equal. Save EXP4. Section EXPH4_. Variable x y z u : proc. Variable H : ehlist. Goal alt (enc H (Lmer x (mer y (mer z u)))) (alt (enc H (Lmer y (mer x (mer z u)))) (alt (enc H (Lmer z (mer x (mer y u)))) (alt (enc H (Lmer u (mer x (mer y z)))) (alt (enc H (Lmer (comm z u) (mer x y))) (alt (enc H (Lmer (comm y z) (mer x u))) (alt (enc H (Lmer (comm y u) (mer x z))) (alt (enc H (Lmer (comm x y) (mer z u))) (alt (enc H (Lmer (comm x z) (mer y u))) (enc H (Lmer (comm x u) (mer y z))))))))))) = enc H (mer x (mer y (mer z u))). elim EXP4. repeat elim D4. apply refl_equal. Save EXPH4. End EXPH4_.
Require Export GeoCoq.Elements.OriginalProofs.lemma_paralleldef2B. Require Export GeoCoq.Elements.OriginalProofs.lemma_samesideflip. Require Export GeoCoq.Elements.OriginalProofs.proposition_29C. Require Export GeoCoq.Elements.OriginalProofs.lemma_supplements2. Require Export GeoCoq.Elements.OriginalProofs.lemma_samesidecollinear. Require Export GeoCoq.Elements.OriginalProofs.lemma_samesidetransitive. Require Export GeoCoq.Elements.OriginalProofs.proposition_28D. Section Euclid. Context `{Ax:area}. Lemma proposition_43B : forall A B C D E F G H K, PG A B C D -> BetS A H D -> BetS A E B -> BetS D F C -> BetS B G C -> PG E A H K -> PG G K F C -> PG E K G B. Proof. (* Goal: forall (A B C D E F G H K : @Point Ax0) (_ : @PG Ax0 A B C D) (_ : @BetS Ax0 A H D) (_ : @BetS Ax0 A E B) (_ : @BetS Ax0 D F C) (_ : @BetS Ax0 B G C) (_ : @PG Ax0 E A H K) (_ : @PG Ax0 G K F C), @PG Ax0 E K G B *) intros. (* Goal: @PG Ax0 E K G B *) assert (Par A D B C) by (conclude_def PG ). (* Goal: @PG Ax0 E K G B *) assert (Par A B C D) by (conclude_def PG ). (* Goal: @PG Ax0 E K G B *) assert (Par E A H K) by (conclude_def PG ). (* Goal: @PG Ax0 E K G B *) assert (Par E K A H) by (conclude_def PG ). (* Goal: @PG Ax0 E K G B *) assert (Par G K F C) by (conclude_def PG ). (* Goal: @PG Ax0 E K G B *) assert (Par F C G K) by (conclude lemma_parallelsymmetric). (* Goal: @PG Ax0 E K G B *) assert (Par C F G K) by (forward_using lemma_parallelflip). (* Goal: @PG Ax0 E K G B *) assert (Par G C K F) by (conclude_def PG ). (* Goal: @PG Ax0 E K G B *) assert (Par B C A D) by (conclude lemma_parallelsymmetric). (* Goal: @PG Ax0 E K G B *) assert (Par C D A B) by (conclude lemma_parallelsymmetric). (* Goal: @PG Ax0 E K G B *) assert (Par A H E K) by (conclude lemma_parallelsymmetric). (* Goal: @PG Ax0 E K G B *) assert (TP A B C D) by (conclude lemma_paralleldef2B). (* Goal: @PG Ax0 E K G B *) assert (TP E A H K) by (conclude lemma_paralleldef2B). (* Goal: @PG Ax0 E K G B *) assert (TP G C K F) by (conclude lemma_paralleldef2B). (* Goal: @PG Ax0 E K G B *) assert (TP B C A D) by (conclude lemma_paralleldef2B). (* Goal: @PG Ax0 E K G B *) assert (OS A D B C) by (conclude_def TP ). (* Goal: @PG Ax0 E K G B *) assert (OS A D C B) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (OS D A C B) by (forward_using lemma_samesidesymmetric). (* Goal: @PG Ax0 E K G B *) assert (OS C D A B) by (conclude_def TP ). (* Goal: @PG Ax0 E K G B *) assert (OS H K E A) by (conclude_def TP ). (* Goal: @PG Ax0 E K G B *) assert (OS K F G C) by (conclude_def TP ). (* Goal: @PG Ax0 E K G B *) assert (neq A E) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (neq A H) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (neq B G) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (neq A B) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @PG Ax0 E K G B *) let Tf:=fresh in assert (Tf:exists e, (BetS B A e /\ Cong A e B A)) by (conclude lemma_extension);destruct Tf as [e];spliter. (* Goal: @PG Ax0 E K G B *) assert (BetS e A B) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (OS D C A B) by (forward_using lemma_samesidesymmetric). (* Goal: @PG Ax0 E K G B *) assert (RT D A B A B C) by (conclude proposition_29C). (* Goal: @PG Ax0 E K G B *) assert (BetS B E A) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (BetS E A e) by (conclude lemma_3_6a). (* Goal: @PG Ax0 E K G B *) assert (BetS e A E) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (OS H K A E) by (forward_using lemma_samesidesymmetric). (* Goal: @PG Ax0 E K G B *) assert (RT H A E A E K) by (conclude proposition_29C). (* Goal: @PG Ax0 E K G B *) assert (Out A E B) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out A H D) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (nCol A H E) by (forward_using lemma_parallelNC). (* Goal: @PG Ax0 E K G B *) assert (nCol E A H) by (forward_using lemma_NCorder). (* Goal: @PG Ax0 E K G B *) assert (CongA E A H E A H) by (conclude lemma_equalanglesreflexive). (* Goal: @PG Ax0 E K G B *) assert (CongA E A H B A D) by (conclude lemma_equalangleshelper). (* Goal: @PG Ax0 E K G B *) assert (CongA H A E D A B) by (conclude lemma_equalanglesflip). (* Goal: @PG Ax0 E K G B *) assert (CongA A E K A B C) by (apply (lemma_supplements2 H A E A B C D A B A E K);eauto). (* Goal: @PG Ax0 E K G B *) assert (OS C D B A) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (Col A E B) by (conclude_def Col ). (* Goal: @PG Ax0 E K G B *) assert (Col B A E) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 E K G B *) assert (neq E B) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (neq B E) by (conclude lemma_inequalitysymmetric). (* Goal: @PG Ax0 E K G B *) assert (OS C D B E) by (conclude lemma_samesidecollinear). (* Goal: @PG Ax0 E K G B *) assert (Out A H D) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out A D H) by (conclude lemma_ray5). (* Goal: @PG Ax0 E K G B *) assert (OS C H B E) by (conclude lemma_sameside2). (* Goal: @PG Ax0 E K G B *) assert (Col E A B) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 E K G B *) assert (OS H K E B) by (conclude lemma_samesidecollinear). (* Goal: @PG Ax0 E K G B *) assert (OS H K B E) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (OS C K B E) by (conclude lemma_samesidetransitive). (* Goal: @PG Ax0 E K G B *) assert (OS K C B E) by (forward_using lemma_samesidesymmetric). (* Goal: @PG Ax0 E K G B *) assert (Out B G C) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out B C G) by (conclude lemma_ray5). (* Goal: @PG Ax0 E K G B *) assert (eq B B) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 E K G B *) assert (Col B B E) by (conclude_def Col ). (* Goal: @PG Ax0 E K G B *) assert (OS K G B E) by (conclude lemma_sameside2). (* Goal: @PG Ax0 E K G B *) assert (OS K G E B) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (Out B E A) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out B A E) by (conclude lemma_ray5). (* Goal: @PG Ax0 E K G B *) assert (CongA A E K E B G) by (conclude lemma_equalangleshelper). (* Goal: @PG Ax0 E K G B *) assert (Par E K B G) by (conclude proposition_28D). (* Goal: @PG Ax0 E K G B *) assert (Par E K G B) by (forward_using lemma_parallelflip). (* Goal: @PG Ax0 E K G B *) assert (neq B C) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) let Tf:=fresh in assert (Tf:exists c, (BetS B C c /\ Cong C c B C)) by (conclude lemma_extension);destruct Tf as [c];spliter. (* Goal: @PG Ax0 E K G B *) assert (BetS c C B) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (Par C D B A) by (forward_using lemma_parallelflip). (* Goal: @PG Ax0 E K G B *) assert (RT D C B C B A) by (conclude proposition_29C). (* Goal: @PG Ax0 E K G B *) assert (OS K F C G) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (OS F K C G) by (forward_using lemma_samesidesymmetric). (* Goal: @PG Ax0 E K G B *) assert (BetS C G B) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (BetS c C G) by (conclude axiom_innertransitivity). (* Goal: @PG Ax0 E K G B *) assert (RT F C G C G K) by (conclude proposition_29C). (* Goal: @PG Ax0 E K G B *) assert (nCol D B C) by (forward_using lemma_parallelNC). (* Goal: @PG Ax0 E K G B *) assert (nCol D C B) by (forward_using lemma_NCorder). (* Goal: @PG Ax0 E K G B *) assert (CongA D C B D C B) by (conclude lemma_equalanglesreflexive). (* Goal: @PG Ax0 E K G B *) assert (BetS C F D) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (neq C F) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (Out C F D) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out C D F) by (conclude lemma_ray5). (* Goal: @PG Ax0 E K G B *) assert (BetS C G B) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (neq C G) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (Out C G B) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out C B G) by (conclude lemma_ray5). (* Goal: @PG Ax0 E K G B *) assert (CongA D C B F C G) by (conclude lemma_equalangleshelper). (* Goal: @PG Ax0 E K G B *) assert (CongA C B A C G K) by (conclude (lemma_supplements2 D C B C G K F C G C B A)). (* Goal: @PG Ax0 E K G B *) assert (CongA C G K C B A) by (conclude lemma_equalanglessymmetric). (* Goal: @PG Ax0 E K G B *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 E K G B *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (neq B G) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (Out B G C) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out B C G) by (conclude lemma_ray5). (* Goal: @PG Ax0 E K G B *) assert (CongA C G K G B A) by (conclude lemma_equalangleshelper). (* Goal: @PG Ax0 E K G B *) assert (Col B G C) by (conclude_def Col ). (* Goal: @PG Ax0 E K G B *) assert (Col C B G) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 E K G B *) assert (BetS C F D) by (conclude axiom_betweennesssymmetry). (* Goal: @PG Ax0 E K G B *) assert (neq C F) by (forward_using lemma_betweennotequal). (* Goal: @PG Ax0 E K G B *) assert (Out C F D) by (conclude lemma_ray4). (* Goal: @PG Ax0 E K G B *) assert (Out C D F) by (conclude lemma_ray5). (* Goal: @PG Ax0 E K G B *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @PG Ax0 E K G B *) assert (Col B C C) by (conclude_def Col ). (* Goal: @PG Ax0 E K G B *) assert (OS A F B C) by (conclude lemma_sameside2). (* Goal: @PG Ax0 E K G B *) assert (TP G C K F) by (conclude lemma_paralleldef2B). (* Goal: @PG Ax0 E K G B *) assert (OS K F G C) by (conclude_def TP ). (* Goal: @PG Ax0 E K G B *) assert (Col C G B) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 E K G B *) assert (neq C B) by (conclude lemma_inequalitysymmetric). (* Goal: @PG Ax0 E K G B *) assert (OS K F C G) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (OS K F C B) by (conclude lemma_samesidecollinear). (* Goal: @PG Ax0 E K G B *) assert (OS K F B C) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (OS F K B C) by (forward_using lemma_samesidesymmetric). (* Goal: @PG Ax0 E K G B *) assert (OS A K B C) by (conclude lemma_samesidetransitive). (* Goal: @PG Ax0 E K G B *) assert (OS K A B C) by (forward_using lemma_samesidesymmetric). (* Goal: @PG Ax0 E K G B *) assert (Col B C G) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 E K G B *) assert (OS K A B G) by (conclude lemma_samesidecollinear). (* Goal: @PG Ax0 E K G B *) assert (OS K A G B) by (conclude lemma_samesideflip). (* Goal: @PG Ax0 E K G B *) assert (Par G K B A) by (conclude proposition_28D). (* Goal: @PG Ax0 E K G B *) assert (Par G K A B) by (forward_using lemma_parallelflip). (* Goal: @PG Ax0 E K G B *) assert (Col A B E) by (forward_using lemma_collinearorder). (* Goal: @PG Ax0 E K G B *) assert (Par G K E B) by (conclude lemma_collinearparallel). (* Goal: @PG Ax0 E K G B *) assert (Par E B G K) by (conclude lemma_parallelsymmetric). (* Goal: @PG Ax0 E K G B *) assert (Par E B K G) by (forward_using lemma_parallelflip). (* Goal: @PG Ax0 E K G B *) assert (PG E K G B) by (conclude_def PG ). (* Goal: @PG Ax0 E K G B *) close. Qed. End Euclid.
Set Implicit Arguments. Unset Strict Implicit. Require Export Tiroirs. Require Export Parts2. Require Export Classical_Pred_Type. Require Export Compare_dec. Lemma not_injective_prop : forall (A B : Setoid) (f : MAP A B), ~ injective f -> exists x : A, (exists y : A, ~ Equal x y /\ Equal (f x) (f y)). Proof. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (_ : not (@injective A B f)), @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) unfold injective in |- *. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (_ : not (forall (x y : Carrier A) (_ : @Equal B (@Ap A B f x) (@Ap A B f y)), @Equal A x y)), @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) intros A B f H'; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) cut (ex (fun x : A => ~ (forall y : A, ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y))))). (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: forall _ : @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))), @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) intros H'0; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) elim H'0; intros x E; try exact E; clear H'0. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun x : Carrier A => @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))) *) exists x; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))) *) cut (ex (fun y : A => ~ ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y)))). (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: forall _ : @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))), @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))) *) intros H'0; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))) *) elim H'0; intros y E0; try exact E0; clear H'0. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))) *) exists y; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)) *) apply NNPP; auto with *. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) (* Goal: @ex (Carrier A) (fun y : Carrier A => not (not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) apply not_all_ex_not with (P := fun y : A => ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y))); auto with *. (* Goal: @ex (Carrier A) (fun x : Carrier A => not (forall y : Carrier A, not (and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y))))) *) apply not_all_ex_not with (P := fun x : A => forall y : A, ~ (~ Equal x y /\ Equal (Ap f x) (Ap f y))); auto with *. (* Goal: not (forall n y : Carrier A, not (and (not (@Equal A n y)) (@Equal B (@Ap A B f n) (@Ap A B f y)))) *) red in |- *. (* Goal: forall _ : forall n y : Carrier A, not (and (not (@Equal A n y)) (@Equal B (@Ap A B f n) (@Ap A B f y))), False *) intros H'0; try assumption. (* Goal: False *) apply H'. (* Goal: forall (x y : Carrier A) (_ : @Equal B (@Ap A B f x) (@Ap A B f y)), @Equal A x y *) intros x y H'1; try assumption. (* Goal: @Equal A x y *) specialize H'0 with (n := x) (y := y); rename H'0 into H'3; try exact H'3. (* Goal: @Equal A x y *) apply NNPP; tauto. Qed. Lemma not_surjective_prop : forall (A B : Setoid) (f : MAP A B), ~ surjective f -> exists y : B, ~ in_part y (image_map f). Proof. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (_ : not (@surjective A B f)), @ex (Carrier B) (fun y : Carrier B => not (@in_part B y (@image_map A B f))) *) intros A B f H'; try assumption. (* Goal: @ex (Carrier B) (fun y : Carrier B => not (@in_part B y (@image_map A B f))) *) apply not_all_ex_not with (P := fun y : B => in_part y (image_map f)). (* Goal: not (forall n : Carrier B, @in_part B n (@image_map A B f)) *) red in |- *. (* Goal: forall _ : forall n : Carrier B, @in_part B n (@image_map A B f), False *) red in H'. (* Goal: forall _ : forall n : Carrier B, @in_part B n (@image_map A B f), False *) intros H'0; try assumption. (* Goal: False *) lapply H'; [ intros H'1; try exact H'1; clear H' | clear H' ]. (* Goal: @surjective A B f *) red in |- *. (* Goal: forall y : Carrier B, @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) simpl in H'0. (* Goal: forall y : Carrier B, @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) intros y; try assumption. (* Goal: @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) elim (H'0 y); intros x E; elim E; intros H'1 H'2; try exact H'2; clear E. (* Goal: @ex (Carrier A) (fun x : Carrier A => @Equal B y (@Ap A B f x)) *) exists x; try assumption. Qed. Parameter image_empty : forall (E F : Setoid) (f : MAP E F) (A : part_set E), Equal A (empty E) -> Equal (image f A) (empty F). Hint Resolve image_empty: algebra. Parameter image_union : forall (E F : Setoid) (f : MAP E F) (A B : part_set E), Equal (image f (union A B)) (union (image f A) (image f B)). Hint Resolve image_union: algebra. Parameter image_single : forall (E F : Setoid) (f : MAP E F) (A : part_set E) (x : E), Equal (image f (single x)) (single (f x)). Hint Resolve image_single: algebra. Parameter union_single_in : forall (E : Setoid) (A : part_set E) (x : E), in_part x A -> Equal (union A (single x)) A. Hint Resolve union_single_in: algebra. Lemma cardinal_image_lesser : forall (E F : Setoid) (f : MAP E F) (A : part_set E) (n : nat), cardinal A n -> exists m : nat, cardinal (image f A) m /\ m <= n. Proof. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (A : Carrier (part_set E)) (n : nat) (_ : @cardinal E A n), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m n)) *) intros E F f A n H'; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m n)) *) apply cardinal_ind2 with (P := fun (n : nat) (A : part_set E) (c : cardinal A n) => ex (fun m : nat => cardinal (image f A) m /\ m <= n)). (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) (* Goal: forall (A : Carrier (part_set E)) (_ : @cardinal E A O), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m O)) *) intros A0 H'0; try assumption. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m O)) *) exists 0; split; [ idtac | auto with * ]. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) (* Goal: @cardinal F (@image E F f A0) O *) apply cardinal_empty; auto with *. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n), @ex nat (fun m : nat => and (@cardinal F (@image E F f B) m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A) m) (le m (S n))) *) intros n0 H'0 A0 B x H'1 H'2 H'3; try assumption. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) case (classic (in_part (f x) (image f B))). (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: forall _ : @in_part F (@Ap E F f x) (@image E F f B), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) intros H'4; try assumption. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) elim (H'0 B); [ intros m E0; elim E0; intros H'7 H'8; try exact H'7; clear E0 | idtac ]. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) exists m; split; [ idtac | try assumption ]. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: le m (S n0) *) (* Goal: @cardinal F (@image E F f A0) m *) apply cardinal_comp with (image f B) m; auto with *. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: le m (S n0) *) (* Goal: @Equal (part_set F) (@image E F f B) (@image E F f A0) *) apply Sym. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: le m (S n0) *) (* Goal: @Equal (part_set F) (@image E F f A0) (@image E F f B) *) apply Trans with (image f (add_part B x)); auto with *. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: le m (S n0) *) (* Goal: @Equal (part_set F) (@image E F f (@add_part E B x)) (@image E F f B) *) unfold add_part in |- *. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: le m (S n0) *) (* Goal: @Equal (part_set F) (@image E F f (@union E B (@single E x))) (@image E F f B) *) apply Trans with (union (image f B) (image f (single x))); auto with *. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: le m (S n0) *) (* Goal: @Equal (part_set F) (@union F (@image E F f B) (@image E F f (@single E x))) (@image E F f B) *) apply Trans with (union (image f B) (single (Ap f x))); auto with *. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) (* Goal: le m (S n0) *) auto with *. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) (* Goal: @cardinal E B n0 *) apply cardinal_S with A0 x; auto with *. (* Goal: @cardinal E A n *) (* Goal: forall _ : not (@in_part F (@Ap E F f x) (@image E F f B)), @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) intros H'4; try assumption. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) elim (H'0 B); [ intros m E0; elim E0; intros H'7 H'8; try exact H'7; clear E0 | idtac ]. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image E F f A0) m) (le m (S n0))) *) exists (S m); split; [ try assumption | idtac ]. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) (* Goal: le (S m) (S n0) *) (* Goal: @cardinal F (@image E F f A0) (S m) *) apply cardinal_add with (image f B) (Ap f x); auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) (* Goal: le (S m) (S n0) *) (* Goal: @Equal (part_set F) (@image E F f A0) (@add_part F (@image E F f B) (@Ap E F f x)) *) unfold add_part in |- *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) (* Goal: le (S m) (S n0) *) (* Goal: @Equal (part_set F) (@image E F f A0) (@union F (@image E F f B) (@single F (@Ap E F f x))) *) unfold add_part in H'2. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) (* Goal: le (S m) (S n0) *) (* Goal: @Equal (part_set F) (@image E F f A0) (@union F (@image E F f B) (@single F (@Ap E F f x))) *) apply Trans with (image f (union B (single x))); auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) (* Goal: le (S m) (S n0) *) (* Goal: @Equal (part_set F) (@image E F f (@union E B (@single E x))) (@union F (@image E F f B) (@single F (@Ap E F f x))) *) apply Trans with (union (image f B) (image f (single x))); auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) (* Goal: le (S m) (S n0) *) auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E B n0 *) apply cardinal_S with A0 x; auto with *. (* Goal: @cardinal E A n *) auto with *. Qed. Lemma cardinal_image_injective : forall (E F : Setoid) (f : MAP E F) (A : part_set E) (n : nat), cardinal A n -> injective f -> cardinal (image f A) n. Parameter not_in_part_comp_r : forall (E : Setoid) (A B : part_set E) (x : E), ~ in_part x A -> Equal A B -> ~ in_part x B. Parameter diff_single_not_in : forall (E : Setoid) (A : part_set E) (x : E), ~ in_part x (diff A (single x)). Hint Resolve diff_single_not_in: algebra. Parameter diff_el_union_single : forall (E : Setoid) (A : part_set E) (x : E), in_part x A -> Equal A (union (diff A (single x)) (single x)). Hint Resolve diff_el_union_single: algebra. Lemma cardinal_image_strict_lesser : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> ~ injective f -> exists m : nat, cardinal (image_map f) m /\ m < n. Proof. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m n)) *) intros E F f n; try assumption. (* Goal: forall (_ : @cardinal E (full E) n) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m n)) *) case n. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) (* Goal: forall (_ : @cardinal E (full E) O) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m O)) *) intros H' H'0; try assumption. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m O)) *) case (not_injective_prop H'0). (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) (* Goal: forall (x : Carrier E) (_ : @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m O)) *) intros x H'1; try assumption. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m O)) *) absurd (in_part x (full E)); auto with *. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) (* Goal: not (@in_part E x (full E)) *) apply not_in_part_comp_r with (empty E); auto with *. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) (* Goal: @Equal (part_set E) (empty E) (full E) *) inversion H'. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) (* Goal: @Equal (part_set E) (empty E) (full E) *) auto with *. (* Goal: forall (n : nat) (_ : @cardinal E (full E) (S n)) (_ : not (@injective E F f)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n))) *) intros n0 H' H'0; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) case (not_injective_prop H'0). (* Goal: forall (x : Carrier E) (_ : @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) intros x H'1; try assumption. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) elim H'1; intros y E0; elim E0; intros H'2 H'3; try exact H'2; clear E0 H'1. (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) cut (cardinal (diff (full E) (single x)) n0). (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: forall _ : @cardinal E (@diff E (full E) (@single E x)) n0, @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) intros H'1; try assumption. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) case (cardinal_image_lesser f H'1). (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: forall (x0 : nat) (_ : and (@cardinal F (@image E F f (@diff E (full E) (@single E x))) x0) (le x0 n0)), @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) intros m H'4; try assumption. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: @ex nat (fun m : nat => and (@cardinal F (@image_map E F f) m) (lt m (S n0))) *) exists m; split; [ try assumption | idtac ]. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @cardinal F (@image_map E F f) m *) elim H'4; intros H'5 H'6; try exact H'5; clear H'4. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @cardinal F (@image_map E F f) m *) apply cardinal_comp with (image f (diff (full E) (single x))) m; auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @Equal (part_set F) (@image E F f (@diff E (full E) (@single E x))) (@image_map E F f) *) apply included_antisym. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @included F (@image_map E F f) (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @included F (@image E F f (@diff E (full E) (@single E x))) (@image_map E F f) *) unfold image_map in |- *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @included F (@image_map E F f) (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @included F (@image E F f (@diff E (full E) (@single E x))) (@image E F f (full E)) *) apply image_included; auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @included F (@image_map E F f) (@image E F f (@diff E (full E) (@single E x))) *) unfold image_map in |- *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @included F (@image E F f (full E)) (@image E F f (@diff E (full E) (@single E x))) *) unfold included in |- *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall (x0 : Carrier F) (_ : @in_part F x0 (@image E F f (full E))), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) intros x0 H'4; try assumption. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) elim H'4. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall (x1 : Carrier E) (_ : and (@in_part E x1 (full E)) (@Equal F x0 (@Ap E F f x1))), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) intros x1 H'7; try assumption. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) case (classic (Equal x1 x)). (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: forall _ : @Equal E x1 x, @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) intros H'8; try assumption. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) simpl in |- *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @ex (Carrier E) (fun x1 : Carrier E => and (and True (not (@Equal E x1 x))) (@Equal F x0 (@Ap E F f x1))) *) exists y; split; [ idtac | try assumption ]. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @Equal F x0 (@Ap E F f y) *) (* Goal: and True (not (@Equal E y x)) *) split; [ idtac | try assumption ]. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @Equal F x0 (@Ap E F f y) *) (* Goal: not (@Equal E y x) *) (* Goal: True *) auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @Equal F x0 (@Ap E F f y) *) (* Goal: not (@Equal E y x) *) auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @Equal F x0 (@Ap E F f y) *) apply Trans with (f x); auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @Equal F x0 (@Ap E F f x) *) elim H'7; intros H'9 H'10; try exact H'10; clear H'7. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) (* Goal: @Equal F x0 (@Ap E F f x) *) apply Trans with (f x1); auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: forall _ : not (@Equal E x1 x), @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) intros H'8; try assumption. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @in_part F x0 (@image E F f (@diff E (full E) (@single E x))) *) simpl in |- *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @ex (Carrier E) (fun x1 : Carrier E => and (and True (not (@Equal E x1 x))) (@Equal F x0 (@Ap E F f x1))) *) exists x1; split; [ idtac | try assumption ]. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @Equal F x0 (@Ap E F f x1) *) (* Goal: and True (not (@Equal E x1 x)) *) auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) (* Goal: @Equal F x0 (@Ap E F f x1) *) elim H'7; intros H'9 H'10; try exact H'10; clear H'7. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) (* Goal: lt m (S n0) *) elim H'4; intros H'5 H'6; try exact H'6; clear H'4; auto with *. (* Goal: @cardinal E (@diff E (full E) (@single E x)) n0 *) apply cardinal_S with (full E) x; auto with *. (* Goal: @Equal (part_set E) (full E) (@add_part E (@diff E (full E) (@single E x)) x) *) unfold add_part in |- *. (* Goal: @Equal (part_set E) (full E) (@union E (@diff E (full E) (@single E x)) (@single E x)) *) auto with *. Qed. Lemma cardinal_image_equal_injective : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> cardinal (image_map f) n -> injective f. Proof. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : @cardinal F (@image_map E F f) n), @injective E F f *) intros E F f n H' H'0; try assumption. (* Goal: @injective E F f *) apply NNPP. (* Goal: not (not (@injective E F f)) *) red in |- *; intros H'1; try exact H'1. (* Goal: False *) case (cardinal_image_strict_lesser H' H'1). (* Goal: forall (x : nat) (_ : and (@cardinal F (@image_map E F f) x) (lt x n)), False *) intros x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2. (* Goal: False *) absurd (x = n); auto with *. (* Goal: @eq nat x n *) (* Goal: not (@eq nat x n) *) red in |- *; intros H'2; try exact H'2. (* Goal: @eq nat x n *) (* Goal: False *) absurd (x < n); auto with *. (* Goal: @eq nat x n *) (* Goal: not (lt x n) *) rewrite H'2. (* Goal: @eq nat x n *) (* Goal: not (lt n n) *) auto with *. (* Goal: @eq nat x n *) apply cardinal_unique with (E := F) (A := image_map f); auto with *. Qed. Parameter cardinal_equal_included_equal : forall (E : Setoid) (A B : part_set E) (n : nat), cardinal A n -> cardinal B n -> included B A -> Equal B A. Parameter image_full_surjective : forall (E F : Setoid) (f : MAP E F), Equal (image_map f) (full F) -> surjective f. Hint Resolve image_full_surjective: algebra. Lemma finite_injective_surjective : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> cardinal (full F) n -> injective f -> surjective f. Proof. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : @cardinal F (full F) n) (_ : @injective E F f), @surjective E F f *) intros E F f n H' H'0 H'1; try assumption. (* Goal: @surjective E F f *) generalize (cardinal_image_injective H' H'1). (* Goal: forall _ : @cardinal F (@image E F f (full E)) n, @surjective E F f *) intros H'2; try assumption. (* Goal: @surjective E F f *) apply image_full_surjective; auto with *. (* Goal: @Equal (part_set F) (@image_map E F f) (full F) *) unfold image_map in |- *. (* Goal: @Equal (part_set F) (@image E F f (full E)) (full F) *) apply cardinal_equal_included_equal with n; auto with *. Qed. Parameter surjective_image_full : forall (E F : Setoid) (f : MAP E F), surjective f -> Equal (image_map f) (full F). Hint Resolve surjective_image_full: algebra. Lemma finite_surjective_injective : forall (E F : Setoid) (f : MAP E F) (n : nat), cardinal (full E) n -> cardinal (full F) n -> surjective f -> injective f. Proof. (* Goal: forall (E F : Setoid) (f : Carrier (MAP E F)) (n : nat) (_ : @cardinal E (full E) n) (_ : @cardinal F (full F) n) (_ : @surjective E F f), @injective E F f *) intros E F f n H' H'0 H'1; try assumption. (* Goal: @injective E F f *) apply cardinal_image_equal_injective with n; auto with *. (* Goal: @cardinal F (@image_map E F f) n *) apply cardinal_comp with (full F) n; auto with *. (* Goal: @Equal (part_set F) (full F) (@image_map E F f) *) apply Sym; auto with *. Qed. Lemma not_included_exist : forall (E : Setoid) (A B : part_set E), included B A -> ~ Equal B A -> exists x : E, in_part x A /\ ~ in_part x B. Proof. (* Goal: forall (E : Setoid) (A B : Carrier (part_set E)) (_ : @included E B A) (_ : not (@Equal (part_set E) B A)), @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) intros E A B; simpl in |- *. (* Goal: forall (_ : @included E B A) (_ : not (@eq_part E B A)), @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) unfold eq_part in |- *; simpl in |- *. (* Goal: forall (_ : @included E B A) (_ : not (forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))), @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) intros H' H'0; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) cut (ex (fun x : E => ~ ((in_part x B -> in_part x A) /\ (in_part x A -> in_part x B)))). (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: forall _ : @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))), @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) intros H'1; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) elim H'1; intros x E0; try exact E0; clear H'1. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: @ex (Carrier E) (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *) exists x; split; [ try assumption | idtac ]. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: @in_part E x A *) red in E0. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: @in_part E x A *) apply NNPP. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: not (not (@in_part E x A)) *) red in |- *; intros H'1; try exact H'1. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: False *) lapply E0; [ intros H'2; apply H'2; clear E0 | clear E0 ]. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B) *) split; [ idtac | intros H'2; try assumption ]. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: @in_part E x B *) (* Goal: forall _ : @in_part E x B, @in_part E x A *) intros H'2; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: @in_part E x B *) (* Goal: @in_part E x A *) apply H'; auto with *. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) (* Goal: @in_part E x B *) absurd (in_part x A); auto with *. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: not (@in_part E x B) *) red in |- *. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: forall _ : @in_part E x B, False *) red in E0. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: forall _ : @in_part E x B, False *) intros H'1; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: False *) lapply E0; [ intros H'2; apply H'2; clear E0 | clear E0 ]. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B) *) split; [ try assumption | idtac ]. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: forall _ : @in_part E x A, @in_part E x B *) (* Goal: forall _ : @in_part E x B, @in_part E x A *) intros H'2; try assumption. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: forall _ : @in_part E x A, @in_part E x B *) (* Goal: @in_part E x A *) apply H'; auto with *. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) (* Goal: forall _ : @in_part E x A, @in_part E x B *) auto with *. (* Goal: @ex (Carrier E) (fun x : Carrier E => not (and (forall _ : @in_part E x B, @in_part E x A) (forall _ : @in_part E x A, @in_part E x B))) *) apply not_all_ex_not with (P := fun x : E => (in_part x B -> in_part x A) /\ (in_part x A -> in_part x B)); auto with *. Qed. Lemma cardinal_included : forall (E : Setoid) (A : part_set E) (n : nat), cardinal A n -> forall B : part_set E, included B A -> exists m : nat, cardinal B m /\ m <= n. Proof. (* Goal: forall (E : Setoid) (A : Carrier (part_set E)) (n : nat) (_ : @cardinal E A n) (B : Carrier (part_set E)) (_ : @included E B A), @ex nat (fun m : nat => and (@cardinal E B m) (le m n)) *) intros E A n H'; try assumption. (* Goal: forall (B : Carrier (part_set E)) (_ : @included E B A), @ex nat (fun m : nat => and (@cardinal E B m) (le m n)) *) apply cardinal_ind2 with (P := fun (n : nat) (A : part_set E) (c : cardinal A n) => forall B : part_set E, included B A -> ex (fun m : nat => cardinal B m /\ m <= n)). (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: forall (A : Carrier (part_set E)) (_ : @cardinal E A O) (B : Carrier (part_set E)) (_ : @included E B A), @ex nat (fun m : nat => and (@cardinal E B m) (le m O)) *) intros A0 H'0 B H'1; exists 0; split; [ try assumption | idtac ]; auto with *. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: @cardinal E B O *) apply cardinal_empty. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: @Equal (part_set E) B (empty E) *) inversion H'0. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: @Equal (part_set E) B (empty E) *) cut (included B (empty E)); auto with *. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) (* Goal: @included E B (empty E) *) apply included_comp with B A0; auto with *. (* Goal: @cardinal E A n *) (* Goal: forall (n : nat) (_ : forall (B : Carrier (part_set E)) (_ : @cardinal E B n) (B0 : Carrier (part_set E)) (_ : @included E B0 B), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m n))) (A B : Carrier (part_set E)) (x : Carrier E) (_ : not (@in_part E x B)) (_ : @Equal (part_set E) A (@add_part E B x)) (_ : @cardinal E A (S n)) (B0 : Carrier (part_set E)) (_ : @included E B0 A), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n))) *) intros n0 H'0 A0 B x H'1 H'2 H'3 B0 H'4; try assumption. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) case (classic (Equal B0 A0)); intros. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) exists (S n0); split; [ idtac | try assumption ]. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: le (S n0) (S n0) *) (* Goal: @cardinal E B0 (S n0) *) apply cardinal_comp with A0 (S n0); auto with *. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) (* Goal: le (S n0) (S n0) *) auto with *. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) case (not_included_exist H'4 H). (* Goal: @cardinal E A n *) (* Goal: forall (x : Carrier E) (_ : and (@in_part E x A0) (not (@in_part E x B0))), @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) intros x0 H'5; try assumption. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) elim H'5; intros H'6 H'7; try exact H'6; clear H'5. (* Goal: @cardinal E A n *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) lapply (H'0 (minus_part A0 x0)); [ intros H'8; elim (H'8 B0); [ intros m E0; elim E0; intros H'11 H'12; try exact H'11; clear E0 | idtac ] | idtac ]; auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @included E B0 (@minus_part E A0 x0) *) (* Goal: @ex nat (fun m : nat => and (@cardinal E B0 m) (le m (S n0))) *) exists m; split; [ try assumption | idtac ]. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @included E B0 (@minus_part E A0 x0) *) (* Goal: le m (S n0) *) apply le_trans with n0; auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @included E B0 (@minus_part E A0 x0) *) unfold minus_part in |- *; simpl in |- *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @included E B0 (@diff E A0 (@single E x0)) *) red in |- *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: forall (x : Carrier E) (_ : @in_part E x B0), @in_part E x (@diff E A0 (@single E x0)) *) intros x1 H'5; try assumption. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @in_part E x1 (@diff E A0 (@single E x0)) *) simpl in |- *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: and (@in_part E x1 A0) (not (@Equal E x1 x0)) *) split; [ try assumption | idtac ]. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: not (@Equal E x1 x0) *) (* Goal: @in_part E x1 A0 *) apply H'4; auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: not (@Equal E x1 x0) *) red in |- *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: forall _ : @Equal E x1 x0, False *) intros H'9; try assumption. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: False *) apply H'7. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) (* Goal: @in_part E x0 B0 *) apply in_part_comp_l with x1; auto with *. (* Goal: @cardinal E A n *) (* Goal: @cardinal E (@minus_part E A0 x0) n0 *) apply cardinal_S with A0 x0; auto with *. (* Goal: @cardinal E A n *) (* Goal: @Equal (part_set E) A0 (@add_part E (@minus_part E A0 x0) x0) *) apply Sym. (* Goal: @cardinal E A n *) (* Goal: @Equal (part_set E) (@add_part E (@minus_part E A0 x0) x0) A0 *) apply minus_add; auto with *. (* Goal: @cardinal E A n *) auto with *. Qed. Lemma map_not_injective : forall (A B : Setoid) (f : MAP A B) (n m : nat), cardinal (full A) n -> cardinal (full B) m -> m < n -> ~ injective f. Proof. (* Goal: forall (A B : Setoid) (f : Carrier (MAP A B)) (n m : nat) (_ : @cardinal A (full A) n) (_ : @cardinal B (full B) m) (_ : lt m n), not (@injective A B f) *) intros A B f n m H' H'0 H'1; red in |- *; intros H'2; try exact H'2. (* Goal: False *) red in H'2. (* Goal: False *) case (tiroirs (E:=A) (F:=B) (f:=f) H' H'0 H'1); auto with *. (* Goal: forall (x : Carrier A) (_ : @ex (Carrier A) (fun y : Carrier A => and (not (@Equal A x y)) (@Equal B (@Ap A B f x) (@Ap A B f y)))), False *) intros x H'3; try assumption. (* Goal: False *) elim H'3; intros y E; elim E; intros H'4 H'5; try exact H'4; clear E H'3; auto with *. Qed. Definition finite (A : Setoid) := exists n : nat, cardinal (full A) n.
Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelsymmetric. Require Export GeoCoq.Elements.OriginalProofs.proposition_29. Section Euclid. Context `{Ax:euclidean_euclidean}. Lemma proposition_30A : forall A B C D E F G H K, Par A B E F -> Par C D E F -> BetS G H K -> BetS A G B -> BetS E H F -> BetS C K D -> TS A G H F -> TS F H K C -> Par A B C D. Proof. (* Goal: forall (A B C D E F G H K : @Point Ax0) (_ : @Par Ax0 A B E F) (_ : @Par Ax0 C D E F) (_ : @BetS Ax0 G H K) (_ : @BetS Ax0 A G B) (_ : @BetS Ax0 E H F) (_ : @BetS Ax0 C K D) (_ : @TS Ax0 A G H F) (_ : @TS Ax0 F H K C), @Par Ax0 A B C D *) intros. (* Goal: @Par Ax0 A B C D *) assert (Par E F C D) by (conclude lemma_parallelsymmetric). (* Goal: @Par Ax0 A B C D *) assert (neq G H) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq H G) by (conclude lemma_inequalitysymmetric). (* Goal: @Par Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists P, (BetS H G P /\ Cong G P G H)) by (conclude lemma_extension);destruct Tf as [P];spliter. (* Goal: @Par Ax0 A B C D *) assert (BetS P G H) by (conclude axiom_betweennesssymmetry). (* Goal: @Par Ax0 A B C D *) assert (BetS P G K) by (conclude lemma_3_7b). (* Goal: @Par Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists M, (BetS A M F /\ Col G H M /\ nCol G H A)) by (conclude_def TS );destruct Tf as [M];spliter. (* Goal: @Par Ax0 A B C D *) let Tf:=fresh in assert (Tf:exists N, (BetS F N C /\ Col H K N /\ nCol H K F)) by (conclude_def TS );destruct Tf as [N];spliter. (* Goal: @Par Ax0 A B C D *) assert (~ Meet C D E F) by (conclude_def Par ). (* Goal: @Par Ax0 A B C D *) assert (nCol G H A) by (conclude_def TS ). (* Goal: @Par Ax0 A B C D *) assert (neq A G) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq G A) by (conclude lemma_inequalitysymmetric). (* Goal: @Par Ax0 A B C D *) assert (neq G H) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (nCol A G H) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (CongA A G H G H F) by (conclude (proposition_29 A B E F P G H)). (* Goal: @Par Ax0 A B C D *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A B C D *) assert (Out G A A) by (conclude lemma_ray4). (* Goal: @Par Ax0 A B C D *) assert (Out G H K) by (conclude lemma_ray4). (* Goal: @Par Ax0 A B C D *) assert (CongA A G H A G H) by (conclude lemma_equalanglesreflexive). (* Goal: @Par Ax0 A B C D *) assert (CongA A G H A G K) by (conclude lemma_equalangleshelper). (* Goal: @Par Ax0 A B C D *) assert (CongA A G K A G H) by (conclude lemma_equalanglessymmetric). (* Goal: @Par Ax0 A B C D *) assert (CongA A G K G H F) by (conclude lemma_equalanglestransitive). (* Goal: @Par Ax0 A B C D *) assert (BetS C N F) by (conclude axiom_betweennesssymmetry). (* Goal: @Par Ax0 A B C D *) assert (eq H H) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A B C D *) assert (nCol F H K) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (Col E H F) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (Col F H E) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (Col F H H) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq E H) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (nCol E H K) by (conclude lemma_NChelper). (* Goal: @Par Ax0 A B C D *) assert (Col E H F) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (Col E H H) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq H F) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq F H) by (conclude lemma_inequalitysymmetric). (* Goal: @Par Ax0 A B C D *) assert (nCol F H K) by (conclude lemma_NChelper). (* Goal: @Par Ax0 A B C D *) assert (nCol H K F) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (eq H H) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A B C D *) assert (Col H K H) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (Col K H N) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (Col C K D) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (Col E H F) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq C K) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq C D) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq H F) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq E F) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (BetS K N H) by (conclude lemma_collinearbetween). (* Goal: @Par Ax0 A B C D *) assert (neq N H) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq H N) by (conclude lemma_inequalitysymmetric). (* Goal: @Par Ax0 A B C D *) assert (nCol H N F) by (conclude lemma_NChelper). (* Goal: @Par Ax0 A B C D *) assert (nCol F N H) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (BetS F N C) by (conclude axiom_betweennesssymmetry). (* Goal: @Par Ax0 A B C D *) assert (Col F N C) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (eq N N) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A B C D *) assert (Col F N N) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq C N) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (nCol C N H) by (conclude lemma_NChelper). (* Goal: @Par Ax0 A B C D *) assert (nCol H N C) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (BetS H N K) by (conclude axiom_betweennesssymmetry). (* Goal: @Par Ax0 A B C D *) assert (Col H N K) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (Col H N H) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq H K) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (nCol H K C) by (conclude lemma_NChelper). (* Goal: @Par Ax0 A B C D *) assert (nCol H K E) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (OS E C H K) by (conclude_def OS ). (* Goal: @Par Ax0 A B C D *) assert (eq K K) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A B C D *) assert (Col H K K) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (TS C H K D) by (conclude_def TS ). (* Goal: @Par Ax0 A B C D *) assert (TS E H K D) by (conclude lemma_planeseparation). (* Goal: @Par Ax0 A B C D *) assert (CongA G H F H K D) by (conclude proposition_29). (* Goal: @Par Ax0 A B C D *) assert (nCol C K H) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (Col C K D) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (eq K K) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A B C D *) assert (Col C K K) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq K D) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (neq D K) by (conclude lemma_inequalitysymmetric). (* Goal: @Par Ax0 A B C D *) assert (nCol D K H) by (conclude lemma_NChelper). (* Goal: @Par Ax0 A B C D *) assert (nCol H K D) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (CongA H K D H K D) by (conclude lemma_equalanglesreflexive). (* Goal: @Par Ax0 A B C D *) assert (eq D D) by (conclude cn_equalityreflexive). (* Goal: @Par Ax0 A B C D *) assert (Out K D D) by (conclude lemma_ray4). (* Goal: @Par Ax0 A B C D *) assert (BetS K H G) by (conclude axiom_betweennesssymmetry). (* Goal: @Par Ax0 A B C D *) assert (neq K H) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (Out K H G) by (conclude lemma_ray4). (* Goal: @Par Ax0 A B C D *) assert (CongA H K D G K D) by (conclude lemma_equalangleshelper). (* Goal: @Par Ax0 A B C D *) assert (CongA G H F G K D) by (conclude lemma_equalanglestransitive). (* Goal: @Par Ax0 A B C D *) assert (CongA A G K G K D) by (conclude lemma_equalanglestransitive). (* Goal: @Par Ax0 A B C D *) assert (Col G H K) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq G H) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (Col H M K) by (conclude lemma_collinear4). (* Goal: @Par Ax0 A B C D *) assert (Col H K M) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (Col H K G) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (neq H K) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (Col K M G) by (conclude lemma_collinear4). (* Goal: @Par Ax0 A B C D *) assert (Col G K M) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (Col H K G) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (Col K N G) by (conclude lemma_collinear4). (* Goal: @Par Ax0 A B C D *) assert (Col G K N) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (nCol A G K) by (conclude lemma_equalanglesNC). (* Goal: @Par Ax0 A B C D *) assert (nCol G K A) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (nCol H K C) by (forward_using lemma_NCorder). (* Goal: @Par Ax0 A B C D *) assert (Col H K G) by (forward_using lemma_collinearorder). (* Goal: @Par Ax0 A B C D *) assert (Col H K K) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (neq G K) by (forward_using lemma_betweennotequal). (* Goal: @Par Ax0 A B C D *) assert (nCol G K C) by (conclude lemma_NChelper). (* Goal: @Par Ax0 A B C D *) assert (OS A C G K) by (conclude_def OS ). (* Goal: @Par Ax0 A B C D *) assert (Col G K K) by (conclude_def Col ). (* Goal: @Par Ax0 A B C D *) assert (TS C G K D) by (conclude_def TS ). (* Goal: @Par Ax0 A B C D *) assert (TS A G K D) by (conclude lemma_planeseparation). (* Goal: @Par Ax0 A B C D *) assert (Par A B C D) by (conclude proposition_27). (* Goal: @Par Ax0 A B C D *) close. Qed. End Euclid.
Set Implicit Arguments. Unset Strict Implicit. Require Export Abelian_group_cat. Section Objects. Definition dist_r (E : SET) (f g : law_of_composition E) := forall x y z : E, Equal (f (couple (g (couple x y)) z)) (g (couple (f (couple x z)) (f (couple y z)))). Definition dist_l (E : SET) (f g : law_of_composition E) := forall x y z : E, Equal (f (couple x (g (couple y z)))) (g (couple (f (couple x y)) (f (couple x z)))). Record ring_on (R : abelian_group) : Type := {ring_mult_sgroup : sgroup_on R; ring_mult_monoid : monoid_on ring_mult_sgroup; ring_monoid :> monoid_on ring_mult_monoid; ring_dist_r_prf : dist_r (sgroup_law_map ring_mult_sgroup) (sgroup_law_map R); ring_dist_l_prf : dist_l (sgroup_law_map ring_mult_sgroup) (sgroup_law_map R)}. Record ring : Type := {ring_group :> abelian_group; ring_on_def :> ring_on ring_group}. Coercion Build_ring : ring_on >-> ring. Definition ring_mult (R : ring) (x y : R) : R := sgroup_law_map (ring_mult_sgroup R) (couple x y). Definition ring_unit (R : ring) : R := monoid_unit (ring_monoid R). Record cring_on (R : ring) : Type := {cring_com_prf : commutative (sgroup_law_map (ring_mult_monoid R))}. Record cring : Type := {cring_ring :> ring; cring_on_def :> cring_on cring_ring}. Coercion Build_cring : cring_on >-> cring. Definition cring_monoid : cring -> abelian_monoid. Proof. (* Goal: forall _ : cring, abelian_monoid *) intros R; try assumption. (* Goal: abelian_monoid *) apply (Build_abelian_monoid (abelian_monoid_monoid:=ring_monoid R)). (* Goal: abelian_monoid_on (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) *) apply (Build_abelian_monoid_on (M:=ring_monoid R)). (* Goal: abelian_sgroup_on (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) *) apply (Build_abelian_sgroup_on (A:=ring_monoid R)). (* Goal: @commutative (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))))) (@sgroup_law_map (sgroup_set (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))))) (sgroup_on_def (monoid_sgroup (@Build_monoid (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring R)))))) (@ring_mult_sgroup (ring_group (cring_ring R)) (ring_on_def (cring_ring R)))) (@ring_mult_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))) (@ring_monoid (ring_group (cring_ring R)) (ring_on_def (cring_ring R))))))) *) exact (cring_com_prf R). Qed. End Objects. Section Hom. Variable E F : ring. Definition ring_mult_hom_unit_prop (f : Map E F) := Equal (f (ring_unit E)) (ring_unit F). Definition ring_mult_hom_prop (f : Map E F) := forall x y : E, Equal (f (ring_mult x y)) (ring_mult (f x) (f y)). Record ring_hom : Type := {ring_plus_hom :> monoid_hom E F; ring_mult_hom_unit : ring_mult_hom_unit_prop ring_plus_hom; ring_mult_hom_prf : ring_mult_hom_prop ring_plus_hom}. End Hom. Definition ring_hom_comp : forall E F G : ring, ring_hom F G -> ring_hom E F -> ring_hom E G. Proof. (* Goal: forall (E F G : ring) (_ : ring_hom F G) (_ : ring_hom E F), ring_hom E G *) intros E F G g f; try assumption. (* Goal: ring_hom E G *) apply (Build_ring_hom (ring_plus_hom:=monoid_hom_comp g f)). (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @ring_mult_hom_unit_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) unfold ring_mult_hom_unit_prop in |- *; auto with algebra. (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) (ring_unit E)) (ring_unit G) *) simpl in |- *. (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E)) (ring_unit G) *) unfold comp_map_fun in |- *. (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E))) (ring_unit G) *) apply Trans with (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom g))) (ring_unit F)); auto with algebra. (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) (ring_unit G) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) *) cut (Equal (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) (ring_unit E)) (ring_unit F)). (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) (ring_unit G) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E)) (ring_unit F) *) (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E)) (ring_unit F), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) *) auto with algebra. (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) (ring_unit G) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (ring_unit E)) (ring_unit F) *) apply (ring_mult_hom_unit f). (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (ring_unit F)) (ring_unit G) *) apply (ring_mult_hom_unit g). (* Goal: @ring_mult_hom_prop E G (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) *) unfold ring_mult_hom_prop in |- *; auto with algebra. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) (@ring_mult E x y)) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group G))) (@monoid_hom_comp (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g) (@ring_plus_hom E F f)))) y)) *) simpl in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y)) (@ring_mult G (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@comp_map_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y)) *) unfold comp_map_fun in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) intros x y; try assumption. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) apply Trans with (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom g))) (ring_mult (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) x) (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) y))); auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) cut (Equal (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) (ring_mult x y)) (ring_mult (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) x) (Ap (sgroup_map (monoid_sgroup_hom (ring_plus_hom f))) y))). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y)) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y)) *) (* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y)) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) auto with algebra. (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) (@ring_mult E x y)) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y)) *) apply (ring_mult_hom_prf f). (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@ring_mult F (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) (@ring_mult G (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) x)) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group G))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group G)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group F))) (group_monoid (abelian_group_group (ring_group G))) (@ring_plus_hom F G g))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group F))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group F)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group F))) (@ring_plus_hom E F f))) y))) *) apply (ring_mult_hom_prf g). Qed. Definition ring_id : forall E : ring, ring_hom E E. Proof. (* Goal: forall E : ring, ring_hom E E *) intros E; try assumption. (* Goal: ring_hom E E *) apply (Build_ring_hom (ring_plus_hom:=monoid_id E)). (* Goal: @ring_mult_hom_prop E E (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) *) (* Goal: @ring_mult_hom_unit_prop E E (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) *) red in |- *. (* Goal: @ring_mult_hom_prop E E (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) (ring_unit E)) (ring_unit E) *) simpl in |- *; auto with algebra. (* Goal: @ring_mult_hom_prop E E (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) *) red in |- *. (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) (@ring_mult E x y)) (@ring_mult E (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group E))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group E)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group E))) (group_monoid (abelian_group_group (ring_group E))) (monoid_id (group_monoid (abelian_group_group (ring_group E)))))) y)) *) simpl in |- *; auto with algebra. Qed. Definition RING : category. Proof. (* Goal: category *) apply (subcat (C:=ABELIAN_GROUP) (C':=ring) (i:=ring_group) (homC':=fun E F : ring => Build_subtype_image (E:=Hom (c:=ABELIAN_GROUP) E F) (subtype_image_carrier:=ring_hom E F) (ring_plus_hom (E:=E) (F:=F))) (CompC':=ring_hom_comp) (idC':=ring_id)). (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) (* Goal: forall a : ring, @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group a)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group a)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group a)) (ring_hom a a) (@ring_plus_hom a a)) (ring_id a)) (@Hom_id ABELIAN_GROUP (ring_group a)) *) simpl in |- *. (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) (* Goal: forall a : ring, @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) *) intros a; try assumption. (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) *) red in |- *. (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))))) x) *) auto with algebra. (* Goal: forall (a b c : ring) (g : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) b c)) (f : Carrier (@subcat_Hom ABELIAN_GROUP ring ring_group (fun E F : ring => @Build_subtype_image (@Hom ABELIAN_GROUP (ring_group E) (ring_group F)) (ring_hom E F) (@ring_plus_hom E F)) a b)), @Equal (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group c)) (ring_hom a c) (@ring_plus_hom a c)) (@ring_hom_comp a b c g f)) (@comp_hom ABELIAN_GROUP (ring_group a) (ring_group b) (ring_group c) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group b) (ring_group c)) (ring_hom b c) (@ring_plus_hom b c)) g) (@subtype_image_inj (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (@Build_subtype_image (@Hom ABELIAN_GROUP (ring_group a) (ring_group b)) (ring_hom a b) (@ring_plus_hom a b)) f)) *) simpl in |- *. (* Goal: forall (a b c : ring) (g : ring_hom b c) (f : ring_hom a b), @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) *) intros a b c g f; try assumption. (* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) *) red in |- *. (* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@comp_map_map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group a))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group b))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group c))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group c)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group b))) (group_monoid (abelian_group_group (ring_group c))) (@ring_plus_hom b c g))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (ring_group a)))) (monoid_sgroup (group_monoid (abelian_group_group (ring_group b)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (ring_group a))) (group_monoid (abelian_group_group (ring_group b))) (@ring_plus_hom a b f)))) x) *) auto with algebra. Qed. Definition CRING := full_subcat (C:=RING) (C':=cring) cring_ring.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool eqtype ssrnat div seq choice fintype. From mathcomp Require Import finfun bigop prime binomial. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Reserved Notation "+%R" (at level 0). Reserved Notation "-%R" (at level 0). Reserved Notation "*%R" (at level 0, format " *%R"). Reserved Notation "*:%R" (at level 0, format " *:%R"). Reserved Notation "n %:R" (at level 2, left associativity, format "n %:R"). Reserved Notation "k %:A" (at level 2, left associativity, format "k %:A"). Reserved Notation "[ 'char' F ]" (at level 0, format "[ 'char' F ]"). Reserved Notation "x %:T" (at level 2, left associativity, format "x %:T"). Reserved Notation "''X_' i" (at level 8, i at level 2, format "''X_' i"). Reserved Notation "''exists' ''X_' i , f" (at level 199, i at level 2, right associativity, format "'[hv' ''exists' ''X_' i , '/ ' f ']'"). Reserved Notation "''forall' ''X_' i , f" (at level 199, i at level 2, right associativity, format "'[hv' ''forall' ''X_' i , '/ ' f ']'"). Reserved Notation "x ^f" (at level 2, left associativity, format "x ^f"). Reserved Notation "\0" (at level 0). Reserved Notation "f \+ g" (at level 50, left associativity). Reserved Notation "f \- g" (at level 50, left associativity). Reserved Notation "a \*o f" (at level 40). Reserved Notation "a \o* f" (at level 40). Reserved Notation "a \*: f" (at level 40). Delimit Scope ring_scope with R. Delimit Scope term_scope with T. Local Open Scope ring_scope. Module Import GRing. Import Monoid.Theory. Module Zmodule. Record mixin_of (V : Type) : Type := Mixin { zero : V; opp : V -> V; add : V -> V -> V; _ : associative add; _ : commutative add; _ : left_id zero add; _ : left_inverse zero opp add }. Section ClassDef. Record class_of T := Class { base : Choice.class_of T; mixin : mixin_of T }. Local Coercion base : class_of >-> Choice.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack m := fun bT b & phant_id (Choice.class bT) b => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Choice.class_of. Coercion mixin : class_of >-> mixin_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Notation zmodType := type. Notation ZmodType T m := (@pack T m _ _ id). Notation ZmodMixin := Mixin. Notation "[ 'zmodType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'zmodType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'zmodType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'zmodType' 'of' T ]") : form_scope. End Exports. End Zmodule. Import Zmodule.Exports. Definition zero V := Zmodule.zero (Zmodule.class V). Definition opp V := Zmodule.opp (Zmodule.class V). Definition add V := Zmodule.add (Zmodule.class V). Local Notation "0" := (zero _) : ring_scope. Local Notation "-%R" := (@opp _) : ring_scope. Local Notation "- x" := (opp x) : ring_scope. Local Notation "+%R" := (@add _) : ring_scope. Local Notation "x + y" := (add x y) : ring_scope. Local Notation "x - y" := (x + - y) : ring_scope. Definition natmul V x n := nosimpl iterop _ n +%R x (zero V). Local Notation "x *+ n" := (natmul x n) : ring_scope. Local Notation "x *- n" := (- (x *+ n)) : ring_scope. Local Notation "\sum_ ( i <- r | P ) F" := (\big[+%R/0]_(i <- r | P) F). Local Notation "\sum_ ( m <= i < n ) F" := (\big[+%R/0]_(m <= i < n) F). Local Notation "\sum_ ( i < n ) F" := (\big[+%R/0]_(i < n) F). Local Notation "\sum_ ( i 'in' A ) F" := (\big[+%R/0]_(i in A) F). Local Notation "s `_ i" := (nth 0 s i) : ring_scope. Section ZmoduleTheory. Variable V : zmodType. Implicit Types x y : V. Lemma addrA : @associative V +%R. Proof. by case V => T [? []]. Qed. Proof. (* Goal: @associative (Zmodule.sort V) (@add V) *) by case V => T [? []]. Qed. Lemma add0r : @left_id V V 0 +%R. Proof. by case V => T [? []]. Qed. Proof. (* Goal: @left_id (Zmodule.sort V) (Zmodule.sort V) (zero V) (@add V) *) by case V => T [? []]. Qed. Lemma addr0 : @right_id V V 0 +%R. Proof. (* Goal: @right_id (Zmodule.sort V) (Zmodule.sort V) (zero V) (@add V) *) by move=> x; rewrite addrC add0r. Qed. Lemma addrN : @right_inverse V V V 0 -%R +%R. Proof. (* Goal: @right_inverse (Zmodule.sort V) (Zmodule.sort V) (Zmodule.sort V) (zero V) (@opp V) (@add V) *) by move=> x; rewrite addrC addNr. Qed. Definition subrr := addrN. Lemma addrAC : @right_commutative V V +%R. Proof. exact: mulmAC. Qed. Proof. (* Goal: @right_commutative (Zmodule.sort V) (Zmodule.sort V) (@add V) *) exact: mulmAC. Qed. Lemma addKr : @left_loop V V -%R +%R. Proof. (* Goal: @left_loop (Zmodule.sort V) (Zmodule.sort V) (@opp V) (@add V) *) by move=> x y; rewrite addrA addNr add0r. Qed. Lemma addNKr : @rev_left_loop V V -%R +%R. Proof. (* Goal: @rev_left_loop (Zmodule.sort V) (Zmodule.sort V) (@opp V) (@add V) *) by move=> x y; rewrite addrA addrN add0r. Qed. Lemma addrK : @right_loop V V -%R +%R. Proof. (* Goal: @right_loop (Zmodule.sort V) (Zmodule.sort V) (@opp V) (@add V) *) by move=> x y; rewrite -addrA addrN addr0. Qed. Lemma addrNK : @rev_right_loop V V -%R +%R. Proof. (* Goal: @rev_right_loop (Zmodule.sort V) (Zmodule.sort V) (@opp V) (@add V) *) by move=> x y; rewrite -addrA addNr addr0. Qed. Definition subrK := addrNK. Lemma subKr x : involutive (fun y => x - y). Proof. (* Goal: @involutive (Zmodule.sort V) (fun y : Zmodule.sort V => @add V x (@opp V y)) *) by move=> y; apply: (canLR (addrK _)); rewrite addrC subrK. Qed. Lemma addrI : @right_injective V V V +%R. Proof. (* Goal: @right_injective (Zmodule.sort V) (Zmodule.sort V) (Zmodule.sort V) (@add V) *) by move=> x; apply: can_inj (addKr x). Qed. Lemma addIr : @left_injective V V V +%R. Proof. (* Goal: @left_injective (Zmodule.sort V) (Zmodule.sort V) (Zmodule.sort V) (@add V) *) by move=> y; apply: can_inj (addrK y). Qed. Lemma subrI : right_injective (fun x y => x - y). Proof. (* Goal: @right_injective (Zmodule.sort V) (Zmodule.sort V) (Zmodule.sort V) (fun x y : Zmodule.sort V => @add V x (@opp V y)) *) by move=> x; apply: can_inj (subKr x). Qed. Lemma subIr : left_injective (fun x y => x - y). Proof. (* Goal: @left_injective (Zmodule.sort V) (Zmodule.sort V) (Zmodule.sort V) (fun x y : Zmodule.sort V => @add V x (@opp V y)) *) by move=> y; apply: addIr. Qed. Lemma opprK : @involutive V -%R. Proof. (* Goal: @involutive (Zmodule.sort V) (@opp V) *) by move=> x; apply: (@subIr x); rewrite addNr addrN. Qed. Lemma oppr_inj : @injective V V -%R. Proof. (* Goal: @injective (Zmodule.sort V) (Zmodule.sort V) (@opp V) *) exact: inv_inj opprK. Qed. Lemma oppr0 : -0 = 0 :> V. Proof. (* Goal: @eq (Zmodule.sort V) (@opp V (zero V)) (zero V) *) by rewrite -[-0]add0r subrr. Qed. Lemma oppr_eq0 x : (- x == 0) = (x == 0). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType V) (@opp V x) (zero V)) (@eq_op (Zmodule.eqType V) x (zero V)) *) by rewrite (inv_eq opprK) oppr0. Qed. Lemma subr0 x : x - 0 = x. Proof. by rewrite oppr0 addr0. Qed. Proof. (* Goal: @eq (Zmodule.sort V) (@add V x (@opp V (zero V))) x *) by rewrite oppr0 addr0. Qed. Lemma opprB x y : - (x - y) = y - x. Proof. (* Goal: @eq (Zmodule.sort V) (@opp V (@add V x (@opp V y))) (@add V y (@opp V x)) *) by apply: (canRL (addrK x)); rewrite addrC subKr. Qed. Lemma opprD : {morph -%R: x y / x + y : V}. Proof. (* Goal: @morphism_2 (Zmodule.sort V) (Zmodule.sort V) (@opp V) (fun x y : Zmodule.sort V => @add V x y : Zmodule.sort V) (fun x y : Zmodule.sort V => @add V x y : Zmodule.sort V) *) by move=> x y; rewrite -[y in LHS]opprK opprB addrC. Qed. Lemma addrKA z x y : (x + z) - (z + y) = x - y. Proof. (* Goal: @eq (Zmodule.sort V) (@add V (@add V x z) (@opp V (@add V z y))) (@add V x (@opp V y)) *) by rewrite opprD addrA addrK. Qed. Lemma subrKA z x y : (x - z) + (z + y) = x + y. Proof. (* Goal: @eq (Zmodule.sort V) (@add V (@add V x (@opp V z)) (@add V z y)) (@add V x y) *) by rewrite addrA addrNK. Qed. Lemma addr0_eq x y : x + y = 0 -> - x = y. Proof. (* Goal: forall _ : @eq (Zmodule.sort V) (@add V x y) (zero V), @eq (Zmodule.sort V) (@opp V x) y *) by rewrite -[-x]addr0 => <-; rewrite addKr. Qed. Lemma subr_eq x y z : (x - z == y) = (x == y + z). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType V) (@add V x (@opp V z)) y) (@eq_op (Zmodule.eqType V) x (@add V y z)) *) exact: can2_eq (subrK z) (addrK z) x y. Qed. Lemma subr_eq0 x y : (x - y == 0) = (x == y). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType V) (@add V x (@opp V y)) (zero V)) (@eq_op (Zmodule.eqType V) x y) *) by rewrite subr_eq add0r. Qed. Lemma addr_eq0 x y : (x + y == 0) = (x == - y). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType V) (@add V x y) (zero V)) (@eq_op (Zmodule.eqType V) x (@opp V y)) *) by rewrite -[y in LHS]opprK subr_eq0. Qed. Lemma eqr_opp x y : (- x == - y) = (x == y). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType V) (@opp V x) (@opp V y)) (@eq_op (Zmodule.eqType V) x y) *) exact: can_eq opprK x y. Qed. Lemma eqr_oppLR x y : (- x == y) = (x == - y). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType V) (@opp V x) y) (@eq_op (Zmodule.eqType V) x (@opp V y)) *) exact: inv_eq opprK x y. Qed. Lemma mulr1n x : x *+ 1 = x. Proof. by []. Qed. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x (S O)) x *) by []. Qed. Lemma mulrS x n : x *+ n.+1 = x + x *+ n. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x (S n)) (@add V x (@natmul V x n)) *) by case: n => //=; rewrite addr0. Qed. Lemma mulrSr x n : x *+ n.+1 = x *+ n + x. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x (S n)) (@add V (@natmul V x n) x) *) by rewrite addrC mulrS. Qed. Lemma mulrb x (b : bool) : x *+ b = (if b then x else 0). Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x (nat_of_bool b)) (if b then x else zero V) *) by case: b. Qed. Lemma mul0rn n : 0 *+ n = 0 :> V. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V (zero V) n) (zero V) *) by elim: n => // n IHn; rewrite mulrS add0r. Qed. Lemma mulNrn x n : (- x) *+ n = x *- n. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V (@opp V x) n) (@opp V (@natmul V x n)) *) by elim: n => [|n IHn]; rewrite ?oppr0 // !mulrS opprD IHn. Qed. Lemma mulrnDl n : {morph (fun x => x *+ n) : x y / x + y}. Proof. (* Goal: @morphism_2 (Zmodule.sort V) (Zmodule.sort V) (fun x : Zmodule.sort V => @natmul V x n) (fun x y : Zmodule.sort V => @add V x y) (fun x y : Zmodule.sort V => @add V x y) *) move=> x y; elim: n => [|n IHn]; rewrite ?addr0 // !mulrS. (* Goal: @eq (Zmodule.sort V) (@add V (@add V x y) (@natmul V (@add V x y) n)) (@add V (@add V x (@natmul V x n)) (@add V y (@natmul V y n))) *) by rewrite addrCA -!addrA -IHn -addrCA. Qed. Lemma mulrnDr x m n : x *+ (m + n) = x *+ m + x *+ n. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x (addn m n)) (@add V (@natmul V x m) (@natmul V x n)) *) elim: m => [|m IHm]; first by rewrite add0r. (* Goal: @eq (Zmodule.sort V) (@natmul V x (addn (S m) n)) (@add V (@natmul V x (S m)) (@natmul V x n)) *) by rewrite !mulrS IHm addrA. Qed. Lemma mulrnBl n : {morph (fun x => x *+ n) : x y / x - y}. Lemma mulrnBr x m n : n <= m -> x *+ (m - n) = x *+ m - x *+ n. Proof. (* Goal: forall _ : is_true (leq n m), @eq (Zmodule.sort V) (@natmul V x (subn m n)) (@add V (@natmul V x m) (@opp V (@natmul V x n))) *) elim: m n => [|m IHm] [|n le_n_m]; rewrite ?subr0 // {}IHm //. (* Goal: @eq (Zmodule.sort V) (@add V (@natmul V x m) (@opp V (@natmul V x n))) (@add V (@natmul V x (S m)) (@opp V (@natmul V x (S n)))) *) by rewrite mulrSr mulrS opprD addrA addrK. Qed. Lemma mulrnA x m n : x *+ (m * n) = x *+ m *+ n. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x (muln m n)) (@natmul V (@natmul V x m) n) *) by rewrite mulnC; elim: n => //= n IHn; rewrite mulrS mulrnDr IHn. Qed. Lemma mulrnAC x m n : x *+ m *+ n = x *+ n *+ m. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V (@natmul V x m) n) (@natmul V (@natmul V x n) m) *) by rewrite -!mulrnA mulnC. Qed. Lemma sumrN I r P (F : I -> V) : (\sum_(i <- r | P i) - F i = - (\sum_(i <- r | P i) F i)). Proof. (* Goal: @eq (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (@opp V (F i)))) (@opp V (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (F i)))) *) by rewrite (big_morph _ opprD oppr0). Qed. Lemma sumrB I r (P : pred I) (F1 F2 : I -> V) : \sum_(i <- r | P i) (F1 i - F2 i) = \sum_(i <- r | P i) F1 i - \sum_(i <- r | P i) F2 i. Proof. (* Goal: @eq (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (@add V (F1 i) (@opp V (F2 i))))) (@add V (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (F1 i))) (@opp V (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (F2 i))))) *) by rewrite -sumrN -big_split /=. Qed. Lemma sumrMnl I r P (F : I -> V) n : \sum_(i <- r | P i) F i *+ n = (\sum_(i <- r | P i) F i) *+ n. Proof. (* Goal: @eq (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (@natmul V (F i) n))) (@natmul V (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (F i))) n) *) by rewrite (big_morph _ (mulrnDl n) (mul0rn _)). Qed. Lemma sumrMnr x I r P (F : I -> nat) : \sum_(i <- r | P i) x *+ F i = x *+ (\sum_(i <- r | P i) F i). Proof. (* Goal: @eq (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (@natmul V x (F i)))) (@natmul V x (@BigOp.bigop nat I O r (fun i : I => @BigBody nat I i addn (P i) (F i)))) *) by rewrite (big_morph _ (mulrnDr x) (erefl _)). Qed. Lemma sumr_const (I : finType) (A : pred I) (x : V) : \sum_(i in A) x = x *+ #|A|. Proof. (* Goal: @eq (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) (Finite.sort I) (zero V) (index_enum I) (fun i : Finite.sort I => @BigBody (Zmodule.sort V) (Finite.sort I) i (@add V) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) x)) (@natmul V x (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) *) by rewrite big_const -iteropE. Qed. Lemma telescope_sumr n m (f : nat -> V) : n <= m -> \sum_(n <= k < m) (f k.+1 - f k) = f m - f n. Proof. (* Goal: forall _ : is_true (leq n m), @eq (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) nat (zero V) (index_iota n m) (fun k : nat => @BigBody (Zmodule.sort V) nat k (@add V) true (@add V (f (S k)) (@opp V (f k))))) (@add V (f m) (@opp V (f n))) *) rewrite leq_eqVlt => /predU1P[-> | ]; first by rewrite subrr big_geq. (* Goal: forall _ : is_true (leq (S n) m), @eq (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) nat (zero V) (index_iota n m) (fun k : nat => @BigBody (Zmodule.sort V) nat k (@add V) true (@add V (f (S k)) (@opp V (f k))))) (@add V (f m) (@opp V (f n))) *) case: m => // m lenm; rewrite sumrB big_nat_recr // big_nat_recl //=. (* Goal: @eq (Zmodule.sort V) (@add V (@add V (@BigOp.bigop (Zmodule.sort V) nat (zero V) (index_iota n m) (fun i : nat => @BigBody (Zmodule.sort V) nat i (@add V) true (f (S i)))) (f (S m))) (@opp V (@add V (f n) (@BigOp.bigop (Zmodule.sort V) nat (zero V) (index_iota n m) (fun i : nat => @BigBody (Zmodule.sort V) nat i (@add V) true (f (S i))))))) (@add V (f (S m)) (@opp V (f n))) *) by rewrite addrC opprD addrA subrK addrC. Qed. Section ClosedPredicates. Variable S : predPredType V. Definition addr_closed := 0 \in S /\ {in S &, forall u v, u + v \in S}. Definition oppr_closed := {in S, forall u, - u \in S}. Definition subr_2closed := {in S &, forall u v, u - v \in S}. Definition zmod_closed := 0 \in S /\ subr_2closed. Lemma zmod_closedN : zmod_closed -> oppr_closed. Proof. (* Goal: forall _ : zmod_closed, oppr_closed *) by case=> S0 SB y Sy; rewrite -sub0r !SB. Qed. Lemma zmod_closedD : zmod_closed -> addr_closed. Proof. (* Goal: forall _ : zmod_closed, addr_closed *) by case=> S0 SB; split=> // y z Sy Sz; rewrite -[z]opprK -[- z]sub0r !SB. Qed. End ClosedPredicates. End ZmoduleTheory. Arguments addrI {V} y [x1 x2]. Arguments addIr {V} x [x1 x2]. Arguments opprK {V}. Arguments oppr_inj {V} [x1 x2]. Module Ring. Record mixin_of (R : zmodType) : Type := Mixin { one : R; mul : R -> R -> R; _ : associative mul; _ : left_id one mul; _ : right_id one mul; _ : left_distributive mul +%R; _ : right_distributive mul +%R; _ : one != 0 }. Definition EtaMixin R one mul mulA mul1x mulx1 mul_addl mul_addr nz1 := let _ := @Mixin R one mul mulA mul1x mulx1 mul_addl mul_addr nz1 in @Mixin (Zmodule.Pack (Zmodule.class R)) _ _ mulA mul1x mulx1 mul_addl mul_addr nz1. Section ClassDef. Record class_of (R : Type) : Type := Class { base : Zmodule.class_of R; mixin : mixin_of (Zmodule.Pack base) }. Local Coercion base : class_of >-> Zmodule.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (m0 : mixin_of (@Zmodule.Pack T b0)) := fun bT b & phant_id (Zmodule.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Zmodule.class_of. Coercion mixin : class_of >-> mixin_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Notation ringType := type. Notation RingType T m := (@pack T _ m _ _ id _ id). Notation RingMixin := Mixin. Notation "[ 'ringType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'ringType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'ringType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'ringType' 'of' T ]") : form_scope. End Exports. End Ring. Import Ring.Exports. Definition one (R : ringType) : R := Ring.one (Ring.class R). Definition mul (R : ringType) : R -> R -> R := Ring.mul (Ring.class R). Definition exp R x n := nosimpl iterop _ n (@mul R) x (one R). Notation sign R b := (exp (- one R) (nat_of_bool b)) (only parsing). Definition comm R x y := @mul R x y = mul y x. Definition lreg R x := injective (@mul R x). Definition rreg R x := injective ((@mul R)^~ x). Local Notation "1" := (one _) : ring_scope. Local Notation "- 1" := (- (1)) : ring_scope. Local Notation "n %:R" := (1 *+ n) : ring_scope. Local Notation "*%R" := (@mul _). Local Notation "x * y" := (mul x y) : ring_scope. Local Notation "x ^+ n" := (exp x n) : ring_scope. Local Notation "\prod_ ( i <- r | P ) F" := (\big[*%R/1]_(i <- r | P) F). Local Notation "\prod_ ( i | P ) F" := (\big[*%R/1]_(i | P) F). Local Notation "\prod_ ( i 'in' A ) F" := (\big[*%R/1]_(i in A) F). Local Notation "\prod_ ( m <= i < n ) F" := (\big[*%R/1%R]_(m <= i < n) F%R). Definition char (R : Ring.type) of phant R : nat_pred := [pred p | prime p & p%:R == 0 :> R]. Local Notation "[ 'char' R ]" := (char (Phant R)) : ring_scope. Definition converse R : Type := R. Lemma mul1r : @left_id R R 1 *%R. Proof. by case R => T [? []]. Qed. Proof. (* Goal: @left_id (Ring.sort R) (Ring.sort R) (one R) (@mul R) *) by case R => T [? []]. Qed. Lemma mulrDl : @left_distributive R R *%R +%R. Proof. (* Goal: @left_distributive (Ring.sort R) (Ring.sort R) (@mul R) (@add (Ring.zmodType R)) *) by case R => T [? []]. Qed. Lemma mulrDr : @right_distributive R R *%R +%R. Proof. (* Goal: @right_distributive (Ring.sort R) (Ring.sort R) (@mul R) (@add (Ring.zmodType R)) *) by case R => T [? []]. Qed. Lemma oner_neq0 : 1 != 0 :> R. Proof. by case R => T [? []]. Qed. Proof. (* Goal: is_true (negb (@eq_op (Ring.eqType R) (one R : Ring.sort R) (zero (Ring.zmodType R) : Ring.sort R))) *) by case R => T [? []]. Qed. Lemma mul0r : @left_zero R R 0 *%R. Proof. (* Goal: @left_zero (Ring.sort R) (Ring.sort R) (zero (Ring.zmodType R)) (@mul R) *) by move=> x; apply: (addIr (1 * x)); rewrite -mulrDl !add0r mul1r. Qed. Lemma mulr0 : @right_zero R R 0 *%R. Proof. (* Goal: @right_zero (Ring.sort R) (Ring.sort R) (zero (Ring.zmodType R)) (@mul R) *) by move=> x; apply: (addIr (x * 1)); rewrite -mulrDr !add0r mulr1. Qed. Lemma mulrN x y : x * (- y) = - (x * y). Proof. (* Goal: @eq (Ring.sort R) (@mul R x (@opp (Ring.zmodType R) y)) (@opp (Ring.zmodType R) (@mul R x y)) *) by apply: (addrI (x * y)); rewrite -mulrDr !subrr mulr0. Qed. Lemma mulNr x y : (- x) * y = - (x * y). Proof. (* Goal: @eq (Ring.sort R) (@mul R (@opp (Ring.zmodType R) x) y) (@opp (Ring.zmodType R) (@mul R x y)) *) by apply: (addrI (x * y)); rewrite -mulrDl !subrr mul0r. Qed. Lemma mulrNN x y : (- x) * (- y) = x * y. Proof. (* Goal: @eq (Ring.sort R) (@mul R (@opp (Ring.zmodType R) x) (@opp (Ring.zmodType R) y)) (@mul R x y) *) by rewrite mulrN mulNr opprK. Qed. Lemma mulN1r x : -1 * x = - x. Proof. (* Goal: @eq (Ring.sort R) (@mul R (@opp (Ring.zmodType R) (one R)) x) (@opp (Ring.zmodType R) x) *) by rewrite mulNr mul1r. Qed. Lemma mulrN1 x : x * -1 = - x. Proof. (* Goal: @eq (Ring.sort R) (@mul R x (@opp (Ring.zmodType R) (one R))) (@opp (Ring.zmodType R) x) *) by rewrite mulrN mulr1. Qed. Canonical mul_monoid := Monoid.Law mulrA mul1r mulr1. Canonical muloid := Monoid.MulLaw mul0r mulr0. Canonical addoid := Monoid.AddLaw mulrDl mulrDr. Lemma mulr_suml I r P (F : I -> R) x : (\sum_(i <- r | P i) F i) * x = \sum_(i <- r | P i) F i * x. Proof. (* Goal: @eq (Ring.sort R) (@mul R (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) I (zero (Ring.zmodType R)) r (fun i : I => @BigBody (Zmodule.sort (Ring.zmodType R)) I i (@add (Ring.zmodType R)) (P i) (F i))) x) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) I (zero (Ring.zmodType R)) r (fun i : I => @BigBody (Zmodule.sort (Ring.zmodType R)) I i (@add (Ring.zmodType R)) (P i) (@mul R (F i) x))) *) exact: big_distrl. Qed. Lemma mulr_sumr I r P (F : I -> R) x : x * (\sum_(i <- r | P i) F i) = \sum_(i <- r | P i) x * F i. Proof. (* Goal: @eq (Ring.sort R) (@mul R x (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) I (zero (Ring.zmodType R)) r (fun i : I => @BigBody (Zmodule.sort (Ring.zmodType R)) I i (@add (Ring.zmodType R)) (P i) (F i)))) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) I (zero (Ring.zmodType R)) r (fun i : I => @BigBody (Zmodule.sort (Ring.zmodType R)) I i (@add (Ring.zmodType R)) (P i) (@mul R x (F i)))) *) exact: big_distrr. Qed. Lemma mulrBl x y z : (y - z) * x = y * x - z * x. Proof. (* Goal: @eq (Ring.sort R) (@mul R (@add (Ring.zmodType R) y (@opp (Ring.zmodType R) z)) x) (@add (Ring.zmodType R) (@mul R y x) (@opp (Ring.zmodType R) (@mul R z x))) *) by rewrite mulrDl mulNr. Qed. Lemma mulrBr x y z : x * (y - z) = x * y - x * z. Proof. (* Goal: @eq (Ring.sort R) (@mul R x (@add (Ring.zmodType R) y (@opp (Ring.zmodType R) z))) (@add (Ring.zmodType R) (@mul R x y) (@opp (Ring.zmodType R) (@mul R x z))) *) by rewrite mulrDr mulrN. Qed. Lemma mulrnAl x y n : (x *+ n) * y = (x * y) *+ n. Proof. (* Goal: @eq (Ring.sort R) (@mul R (@natmul (Ring.zmodType R) x n) y) (@natmul (Ring.zmodType R) (@mul R x y) n) *) by elim: n => [|n IHn]; rewrite ?mul0r // !mulrS mulrDl IHn. Qed. Lemma mulrnAr x y n : x * (y *+ n) = (x * y) *+ n. Proof. (* Goal: @eq (Ring.sort R) (@mul R x (@natmul (Ring.zmodType R) y n)) (@natmul (Ring.zmodType R) (@mul R x y) n) *) by elim: n => [|n IHn]; rewrite ?mulr0 // !mulrS mulrDr IHn. Qed. Lemma mulr_natl x n : n%:R * x = x *+ n. Proof. (* Goal: @eq (Ring.sort R) (@mul R (@natmul (Ring.zmodType R) (one R) n) x) (@natmul (Ring.zmodType R) x n) *) by rewrite mulrnAl mul1r. Qed. Lemma mulr_natr x n : x * n%:R = x *+ n. Proof. (* Goal: @eq (Ring.sort R) (@mul R x (@natmul (Ring.zmodType R) (one R) n)) (@natmul (Ring.zmodType R) x n) *) by rewrite mulrnAr mulr1. Qed. Lemma natrD m n : (m + n)%:R = m%:R + n%:R :> R. Proof. (* Goal: @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) (addn m n)) (@add (Ring.zmodType R) (@natmul (Ring.zmodType R) (one R) m) (@natmul (Ring.zmodType R) (one R) n)) *) exact: mulrnDr. Qed. Lemma natrB m n : n <= m -> (m - n)%:R = m%:R - n%:R :> R. Proof. (* Goal: forall _ : is_true (leq n m), @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) (subn m n)) (@add (Ring.zmodType R) (@natmul (Ring.zmodType R) (one R) m) (@opp (Ring.zmodType R) (@natmul (Ring.zmodType R) (one R) n))) *) exact: mulrnBr. Qed. Definition natr_sum := big_morph (natmul 1) natrD (mulr0n 1). Lemma natrM m n : (m * n)%:R = m%:R * n%:R :> R. Proof. (* Goal: @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) (muln m n)) (@mul R (@natmul (Ring.zmodType R) (one R) m) (@natmul (Ring.zmodType R) (one R) n)) *) by rewrite mulrnA -mulr_natr. Qed. Lemma expr1 x : x ^+ 1 = x. Proof. by []. Qed. Proof. (* Goal: @eq (Ring.sort R) (@exp R x (S O)) x *) by []. Qed. Lemma exprS x n : x ^+ n.+1 = x * x ^+ n. Proof. (* Goal: @eq (Ring.sort R) (@exp R x (S n)) (@mul R x (@exp R x n)) *) by case: n => //; rewrite mulr1. Qed. Lemma expr0n n : 0 ^+ n = (n == 0%N)%:R :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (zero (Ring.zmodType R)) n) (@natmul (Ring.zmodType R) (one R) (nat_of_bool (@eq_op nat_eqType n O))) *) by case: n => // n; rewrite exprS mul0r. Qed. Lemma expr1n n : 1 ^+ n = 1 :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (one R) n) (one R) *) by elim: n => // n IHn; rewrite exprS mul1r. Qed. Lemma exprD x m n : x ^+ (m + n) = x ^+ m * x ^+ n. Proof. (* Goal: @eq (Ring.sort R) (@exp R x (addn m n)) (@mul R (@exp R x m) (@exp R x n)) *) by elim: m => [|m IHm]; rewrite ?mul1r // !exprS -mulrA -IHm. Qed. Lemma exprSr x n : x ^+ n.+1 = x ^+ n * x. Proof. (* Goal: @eq (Ring.sort R) (@exp R x (S n)) (@mul R (@exp R x n) x) *) by rewrite -addn1 exprD expr1. Qed. Lemma commr_sym x y : comm x y -> comm y x. Proof. by []. Qed. Proof. (* Goal: forall _ : @comm R x y, @comm R y x *) by []. Qed. Lemma commr0 x : comm x 0. Proof. (* Goal: @comm R x (zero (Ring.zmodType R)) *) by rewrite /comm mulr0 mul0r. Qed. Lemma commr1 x : comm x 1. Proof. (* Goal: @comm R x (one R) *) by rewrite /comm mulr1 mul1r. Qed. Lemma commrN x y : comm x y -> comm x (- y). Proof. (* Goal: forall _ : @comm R x y, @comm R x (@opp (Ring.zmodType R) y) *) by move=> com_xy; rewrite /comm mulrN com_xy mulNr. Qed. Lemma commrN1 x : comm x (-1). Proof. (* Goal: @comm R x (@opp (Ring.zmodType R) (one R)) *) exact/commrN/commr1. Qed. Lemma commrD x y z : comm x y -> comm x z -> comm x (y + z). Proof. (* Goal: forall (_ : @comm R x y) (_ : @comm R x z), @comm R x (@add (Ring.zmodType R) y z) *) by rewrite /comm mulrDl mulrDr => -> ->. Qed. Lemma commrMn x y n : comm x y -> comm x (y *+ n). Proof. (* Goal: forall _ : @comm R x y, @comm R x (@natmul (Ring.zmodType R) y n) *) rewrite /comm => com_xy. (* Goal: @eq (Ring.sort R) (@mul R x (@natmul (Ring.zmodType R) y n)) (@mul R (@natmul (Ring.zmodType R) y n) x) *) by elim: n => [|n IHn]; rewrite ?commr0 // mulrS commrD. Qed. Lemma commrM x y z : comm x y -> comm x z -> comm x (y * z). Proof. (* Goal: forall (_ : @comm R x y) (_ : @comm R x z), @comm R x (@mul R y z) *) by move=> com_xy; rewrite /comm mulrA com_xy -!mulrA => ->. Qed. Lemma commr_nat x n : comm x n%:R. Proof. (* Goal: @comm R x (@natmul (Ring.zmodType R) (one R) n) *) exact/commrMn/commr1. Qed. Lemma commrX x y n : comm x y -> comm x (y ^+ n). Proof. (* Goal: forall _ : @comm R x y, @comm R x (@exp R y n) *) rewrite /comm => com_xy. (* Goal: @eq (Ring.sort R) (@mul R x (@exp R y n)) (@mul R (@exp R y n) x) *) by elim: n => [|n IHn]; rewrite ?commr1 // exprS commrM. Qed. Lemma exprMn_comm x y n : comm x y -> (x * y) ^+ n = x ^+ n * y ^+ n. Proof. (* Goal: forall _ : @comm R x y, @eq (Ring.sort R) (@exp R (@mul R x y) n) (@mul R (@exp R x n) (@exp R y n)) *) move=> com_xy; elim: n => /= [|n IHn]; first by rewrite mulr1. (* Goal: @eq (Ring.sort R) (@exp R (@mul R x y) (S n)) (@mul R (@exp R x (S n)) (@exp R y (S n))) *) by rewrite !exprS IHn !mulrA; congr (_ * _); rewrite -!mulrA -commrX. Qed. Lemma commr_sign x n : comm x ((-1) ^+ n). Proof. (* Goal: @comm R x (@exp R (@opp (Ring.zmodType R) (one R)) n) *) exact: (commrX n (commrN1 x)). Qed. Lemma exprMn_n x m n : (x *+ m) ^+ n = x ^+ n *+ (m ^ n) :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@natmul (Ring.zmodType R) x m) n) (@natmul (Ring.zmodType R) (@exp R x n) (expn m n)) *) elim: n => [|n IHn]; first by rewrite mulr1n. (* Goal: @eq (Ring.sort R) (@exp R (@natmul (Ring.zmodType R) x m) (S n)) (@natmul (Ring.zmodType R) (@exp R x (S n)) (expn m (S n))) *) rewrite exprS IHn -mulr_natr -mulrA -commr_nat mulr_natr -mulrnA -expnSr. (* Goal: @eq (Ring.sort R) (@mul R x (@natmul (Ring.zmodType R) (@exp R x n) (expn m (S n)))) (@natmul (Ring.zmodType R) (@exp R x (S n)) (expn m (S n))) *) by rewrite -mulr_natr mulrA -exprS mulr_natr. Qed. Lemma exprM x m n : x ^+ (m * n) = x ^+ m ^+ n. Proof. (* Goal: @eq (Ring.sort R) (@exp R x (muln m n)) (@exp R (@exp R x m) n) *) elim: m => [|m IHm]; first by rewrite expr1n. (* Goal: @eq (Ring.sort R) (@exp R x (muln (S m) n)) (@exp R (@exp R x (S m)) n) *) by rewrite mulSn exprD IHm exprS exprMn_comm //; apply: commrX. Qed. Lemma exprAC x m n : (x ^+ m) ^+ n = (x ^+ n) ^+ m. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@exp R x m) n) (@exp R (@exp R x n) m) *) by rewrite -!exprM mulnC. Qed. Lemma expr_mod n x i : x ^+ n = 1 -> x ^+ (i %% n) = x ^+ i. Proof. (* Goal: forall _ : @eq (Ring.sort R) (@exp R x n) (one R), @eq (Ring.sort R) (@exp R x (modn i n)) (@exp R x i) *) move=> xn1; rewrite {2}(divn_eq i n) exprD mulnC exprM xn1. (* Goal: @eq (Ring.sort R) (@exp R x (modn i n)) (@mul R (@exp R (one R) (divn i n)) (@exp R x (modn i n))) *) by rewrite expr1n mul1r. Qed. Lemma expr_dvd n x i : x ^+ n = 1 -> n %| i -> x ^+ i = 1. Proof. (* Goal: forall (_ : @eq (Ring.sort R) (@exp R x n) (one R)) (_ : is_true (dvdn n i)), @eq (Ring.sort R) (@exp R x i) (one R) *) by move=> xn1 dvd_n_i; rewrite -(expr_mod i xn1) (eqnP dvd_n_i). Qed. Lemma natrX n k : (n ^ k)%:R = n%:R ^+ k :> R. Proof. (* Goal: @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) (expn n k)) (@exp R (@natmul (Ring.zmodType R) (one R) n) k) *) by rewrite exprMn_n expr1n. Qed. Lemma signr_odd n : (-1) ^+ (odd n) = (-1) ^+ n :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool (odd n))) (@exp R (@opp (Ring.zmodType R) (one R)) n) *) elim: n => //= n IHn; rewrite exprS -{}IHn. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool (negb (odd n)))) (@mul R (@opp (Ring.zmodType R) (one R)) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool (odd n)))) *) by case/odd: n; rewrite !mulN1r ?opprK. Qed. Lemma signr_eq0 n : ((-1) ^+ n == 0 :> R) = false. Proof. (* Goal: @eq bool (@eq_op (Ring.eqType R) (@exp R (@opp (Ring.zmodType R) (one R)) n : Ring.sort R) (zero (Ring.zmodType R) : Ring.sort R)) false *) by rewrite -signr_odd; case: odd; rewrite ?oppr_eq0 oner_eq0. Qed. Lemma mulr_sign (b : bool) x : (-1) ^+ b * x = (if b then - x else x). Proof. (* Goal: @eq (Ring.sort R) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b)) x) (if b then @opp (Ring.zmodType R) x else x) *) by case: b; rewrite ?mulNr mul1r. Qed. Lemma signr_addb b1 b2 : (-1) ^+ (b1 (+) b2) = (-1) ^+ b1 * (-1) ^+ b2 :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool (addb b1 b2))) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b1)) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b2))) *) by rewrite mulr_sign; case: b1 b2 => [] []; rewrite ?opprK. Qed. Lemma signrE (b : bool) : (-1) ^+ b = 1 - b.*2%:R :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b)) (@add (Ring.zmodType R) (one R) (@opp (Ring.zmodType R) (@natmul (Ring.zmodType R) (one R) (double (nat_of_bool b))))) *) by case: b; rewrite ?subr0 // opprD addNKr. Qed. Lemma signrN b : (-1) ^+ (~~ b) = - (-1) ^+ b :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool (negb b))) (@opp (Ring.zmodType R) (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b))) *) by case: b; rewrite ?opprK. Qed. Lemma mulr_signM (b1 b2 : bool) x1 x2 : ((-1) ^+ b1 * x1) * ((-1) ^+ b2 * x2) = (-1) ^+ (b1 (+) b2) * (x1 * x2). Proof. (* Goal: @eq (Ring.sort R) (@mul R (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b1)) x1) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b2)) x2)) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool (addb b1 b2))) (@mul R x1 x2)) *) by rewrite signr_addb -!mulrA; congr (_ * _); rewrite !mulrA commr_sign. Qed. Lemma exprNn x n : (- x) ^+ n = (-1) ^+ n * x ^+ n :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) x) n) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) n) (@exp R x n)) *) by rewrite -mulN1r exprMn_comm // /comm mulN1r mulrN mulr1. Qed. Lemma sqrrN x : (- x) ^+ 2 = x ^+ 2. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) x) (S (S O))) (@exp R x (S (S O))) *) exact: mulrNN. Qed. Lemma sqrr_sign n : ((-1) ^+ n) ^+ 2 = 1 :> R. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@exp R (@opp (Ring.zmodType R) (one R)) n) (S (S O))) (one R) *) by rewrite exprAC sqrrN !expr1n. Qed. Lemma signrMK n : @involutive R ( *%R ((-1) ^+ n)). Proof. (* Goal: @involutive (Ring.sort R) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) n)) *) by move=> x; rewrite mulrA -expr2 sqrr_sign mul1r. Qed. Lemma lastr_eq0 (s : seq R) x : x != 0 -> (last x s == 0) = (last 1 s == 0). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Ring.eqType R) x (zero (Ring.zmodType R)))), @eq bool (@eq_op (Ring.eqType R) (@last (Ring.sort R) x s) (zero (Ring.zmodType R))) (@eq_op (Ring.eqType R) (@last (Ring.sort R) (one R) s) (zero (Ring.zmodType R))) *) by case: s => [|y s] /negPf // ->; rewrite oner_eq0. Qed. Lemma mulrI_eq0 x y : lreg x -> (x * y == 0) = (y == 0). Proof. (* Goal: forall _ : @lreg R x, @eq bool (@eq_op (Ring.eqType R) (@mul R x y) (zero (Ring.zmodType R))) (@eq_op (Ring.eqType R) y (zero (Ring.zmodType R))) *) by move=> reg_x; rewrite -{1}(mulr0 x) (inj_eq reg_x). Qed. Lemma lreg_neq0 x : lreg x -> x != 0. Proof. (* Goal: forall _ : @lreg R x, is_true (negb (@eq_op (Ring.eqType R) x (zero (Ring.zmodType R)))) *) by move=> reg_x; rewrite -[x]mulr1 mulrI_eq0 ?oner_eq0. Qed. Lemma mulrI0_lreg x : (forall y, x * y = 0 -> y = 0) -> lreg x. Proof. (* Goal: forall _ : forall (y : Ring.sort R) (_ : @eq (Ring.sort R) (@mul R x y) (zero (Ring.zmodType R))), @eq (Ring.sort R) y (zero (Ring.zmodType R)), @lreg R x *) move=> reg_x y z eq_xy_xz; apply/eqP; rewrite -subr_eq0 [y - z]reg_x //. (* Goal: @eq (Ring.sort R) (@mul R x (@add (Ring.zmodType R) y (@opp (Ring.zmodType R) z))) (zero (Ring.zmodType R)) *) by rewrite mulrBr eq_xy_xz subrr. Qed. Lemma lregN x : lreg x -> lreg (- x). Proof. (* Goal: forall _ : @lreg R x, @lreg R (@opp (Ring.zmodType R) x) *) by move=> reg_x y z; rewrite !mulNr => /oppr_inj/reg_x. Qed. Lemma lreg1 : lreg (1 : R). Proof. (* Goal: @lreg R (one R : Ring.sort R) *) by move=> x y; rewrite !mul1r. Qed. Lemma lregM x y : lreg x -> lreg y -> lreg (x * y). Proof. (* Goal: forall (_ : @lreg R x) (_ : @lreg R y), @lreg R (@mul R x y) *) by move=> reg_x reg_y z t; rewrite -!mulrA => /reg_x/reg_y. Qed. Lemma lregX x n : lreg x -> lreg (x ^+ n). Proof. (* Goal: forall _ : @lreg R x, @lreg R (@exp R x n) *) by move=> reg_x; elim: n => [|n]; [apply: lreg1 | rewrite exprS; apply: lregM]. Qed. Lemma lreg_sign n : lreg ((-1) ^+ n : R). Proof. (* Goal: @lreg R (@exp R (@opp (Ring.zmodType R) (one R)) n : Ring.sort R) *) by apply: lregX; apply: lregN; apply: lreg1. Qed. Lemma prodr_const (I : finType) (A : pred I) (x : R) : \prod_(i in A) x = x ^+ #|A|. Proof. (* Goal: @eq (Ring.sort R) (@BigOp.bigop (Ring.sort R) (Finite.sort I) (one R) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort R) (Finite.sort I) i (@mul R) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) x)) (@exp R x (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) *) by rewrite big_const -iteropE. Qed. Lemma prodrXr x I r P (F : I -> nat) : \prod_(i <- r | P i) x ^+ F i = x ^+ (\sum_(i <- r | P i) F i). Proof. (* Goal: @eq (Ring.sort R) (@BigOp.bigop (Ring.sort R) I (one R) r (fun i : I => @BigBody (Ring.sort R) I i (@mul R) (P i) (@exp R x (F i)))) (@exp R x (@BigOp.bigop nat I O r (fun i : I => @BigBody nat I i addn (P i) (F i)))) *) by rewrite (big_morph _ (exprD _) (erefl _)). Qed. Lemma prodrN (I : finType) (A : pred I) (F : I -> R) : \prod_(i in A) - F i = (- 1) ^+ #|A| * \prod_(i in A) F i. Proof. (* Goal: @eq (Ring.sort R) (@BigOp.bigop (Ring.sort R) (Finite.sort I) (one R) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort R) (Finite.sort I) i (@mul R) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (@opp (Ring.zmodType R) (F i)))) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A))) (@BigOp.bigop (Ring.sort R) (Finite.sort I) (one R) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort R) (Finite.sort I) i (@mul R) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (F i)))) *) rewrite -sum1_card; elim/big_rec3: _ => [|i x n _ _ ->]; first by rewrite mulr1. (* Goal: @eq (Ring.sort R) (@mul R (@opp (Ring.zmodType R) (F i)) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) n) x)) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (addn (S O) n)) (@mul R (F i) x)) *) by rewrite exprS !mulrA mulN1r !mulNr commrX //; apply: commrN1. Qed. Lemma prodrMn n (I : finType) (A : pred I) (F : I -> R) : \prod_(i in A) (F i *+ n) = \prod_(i in A) F i *+ n ^ #|A|. Proof. (* Goal: @eq (Ring.sort R) (@BigOp.bigop (Ring.sort R) (Finite.sort I) (one R) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort R) (Finite.sort I) i (@mul R) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (@natmul (Ring.zmodType R) (F i) n))) (@natmul (Ring.zmodType R) (@BigOp.bigop (Ring.sort R) (Finite.sort I) (one R) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort R) (Finite.sort I) i (@mul R) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)) (F i))) (expn n (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) A)))) *) rewrite -sum1_card; elim/big_rec3: _ => // i x m _ _ ->. (* Goal: @eq (Ring.sort R) (@mul R (@natmul (Ring.zmodType R) (F i) n) (@natmul (Ring.zmodType R) m (expn n x))) (@natmul (Ring.zmodType R) (@mul R (F i) m) (expn n (addn (S O) x))) *) by rewrite mulrnAr mulrnAl expnS mulrnA. Qed. Lemma natr_prod I r P (F : I -> nat) : (\prod_(i <- r | P i) F i)%:R = \prod_(i <- r | P i) (F i)%:R :> R. Proof. (* Goal: @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) (@BigOp.bigop nat I (S O) r (fun i : I => @BigBody nat I i muln (P i) (F i)))) (@BigOp.bigop (Ring.sort R) I (one R) r (fun i : I => @BigBody (Ring.sort R) I i (@mul R) (P i) (@natmul (Ring.zmodType R) (one R) (F i)))) *) exact: (big_morph _ natrM). Qed. Lemma exprDn_comm x y n (cxy : comm x y) : (x + y) ^+ n = \sum_(i < n.+1) (x ^+ (n - i) * y ^+ i) *+ 'C(n, i). Lemma exprBn_comm x y n (cxy : comm x y) : (x - y) ^+ n = \sum_(i < n.+1) ((-1) ^+ i * x ^+ (n - i) * y ^+ i) *+ 'C(n, i). Proof. (* Goal: @eq (Ring.sort R) (@exp R (@add (Ring.zmodType R) x (@opp (Ring.zmodType R) y)) n) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal (S n)) i (@add (Ring.zmodType R)) true (@natmul (Ring.zmodType R) (@mul R (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (@nat_of_ord (S n) i)) (@exp R x (subn n (@nat_of_ord (S n) i)))) (@exp R y (@nat_of_ord (S n) i))) (binomial n (@nat_of_ord (S n) i))))) *) rewrite exprDn_comm; last exact: commrN. (* Goal: @eq (Ring.sort R) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal (S n)) i (@add (Ring.zmodType R)) true (@natmul (Ring.zmodType R) (@mul R (@exp R x (subn n (@nat_of_ord (S n) i))) (@exp R (@opp (Ring.zmodType R) y) (@nat_of_ord (S n) i))) (binomial n (@nat_of_ord (S n) i))))) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal (S n)) i (@add (Ring.zmodType R)) true (@natmul (Ring.zmodType R) (@mul R (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) (@nat_of_ord (S n) i)) (@exp R x (subn n (@nat_of_ord (S n) i)))) (@exp R y (@nat_of_ord (S n) i))) (binomial n (@nat_of_ord (S n) i))))) *) by apply: eq_bigr => i _; congr (_ *+ _); rewrite -commr_sign -mulrA -exprNn. Qed. Lemma subrXX_comm x y n (cxy : comm x y) : x ^+ n - y ^+ n = (x - y) * (\sum_(i < n) x ^+ (n.-1 - i) * y ^+ i). Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@add (Ring.zmodType R) (@exp R x n) (@opp (Ring.zmodType R) (@exp R y n))) (@mul R (@add (Ring.zmodType R) x (@opp (Ring.zmodType R) y)) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType n)) (zero (Ring.zmodType R)) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal n) i (@add (Ring.zmodType R)) true (@mul R (@exp R x (subn (Nat.pred n) (@nat_of_ord n i))) (@exp R y (@nat_of_ord n i)))))) *) case: n => [|n]; first by rewrite big_ord0 mulr0 subrr. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@add (Ring.zmodType R) (@exp R x (S n)) (@opp (Ring.zmodType R) (@exp R y (S n)))) (@mul R (@add (Ring.zmodType R) x (@opp (Ring.zmodType R) y)) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal (S n)) i (@add (Ring.zmodType R)) true (@mul R (@exp R x (subn (Nat.pred (S n)) (@nat_of_ord (S n) i))) (@exp R y (@nat_of_ord (S n) i)))))) *) rewrite mulrBl !big_distrr big_ord_recl big_ord_recr /= subnn mulr1 mul1r. (* Goal: @eq (Ring.sort R) (@add (Ring.zmodType R) (@exp R x (S n)) (@opp (Ring.zmodType R) (@exp R y (S n)))) (@add (Ring.zmodType R) (@add (Ring.zmodType R) (@mul R x (@exp R x (subn n O))) (@BigOp.bigop (Ring.sort R) (ordinal n) (zero (Ring.zmodType R)) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (Ring.sort R) (ordinal n) i (@add (Ring.zmodType R)) true (@mul R x (@mul R (@exp R x (subn n (bump O (@nat_of_ord n i)))) (@exp R y (bump O (@nat_of_ord n i)))))))) (@opp (Ring.zmodType R) (@add (Ring.zmodType R) (@BigOp.bigop (Ring.sort R) (ordinal n) (zero (Ring.zmodType R)) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (Ring.sort R) (ordinal n) i (@add (Ring.zmodType R)) true (@mul R y (@mul R (@exp R x (subn n (@nat_of_ord n i))) (@exp R y (@nat_of_ord n i)))))) (@mul R y (@exp R y n))))) *) rewrite subn0 -!exprS opprD -!addrA; congr (_ + _); rewrite addrA -sumrB. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@opp (Ring.zmodType R) (@exp R y (S n))) (@add (Ring.zmodType R) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (ordinal n) (zero (Ring.zmodType R)) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal n) i (@add (Ring.zmodType R)) true (@add (Ring.zmodType R) (@mul R x (@mul R (@exp R x (subn n (bump O (@nat_of_ord n i)))) (@exp R y (bump O (@nat_of_ord n i))))) (@opp (Ring.zmodType R) (@mul R y (@mul R (@exp R x (subn n (@nat_of_ord n i))) (@exp R y (@nat_of_ord n i)))))))) (@opp (Ring.zmodType R) (@exp R y (S n)))) *) rewrite big1 ?add0r // => i _; rewrite !mulrA -exprS -subSn ?(valP i) //. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@add (Ring.zmodType R) (@mul R (@exp R x (subn (S n) (bump O (@nat_of_ord n i)))) (@exp R y (bump O (@nat_of_ord n i)))) (@opp (Ring.zmodType R) (@mul R (@mul R y (@exp R x (subn n (@nat_of_ord n i)))) (@exp R y (@nat_of_ord n i))))) (zero (Ring.zmodType R)) *) by rewrite subSS (commrX _ (commr_sym cxy)) -mulrA -exprS subrr. Qed. Lemma exprD1n x n : (x + 1) ^+ n = \sum_(i < n.+1) x ^+ i *+ 'C(n, i). Proof. (* Goal: @eq (Ring.sort R) (@exp R (@add (Ring.zmodType R) x (one R)) n) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal (S n)) i (@add (Ring.zmodType R)) true (@natmul (Ring.zmodType R) (@exp R x (@nat_of_ord (S n) i)) (binomial n (@nat_of_ord (S n) i))))) *) rewrite addrC (exprDn_comm n (commr_sym (commr1 x))). (* Goal: @eq (Ring.sort R) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal (S n)) i (@add (Ring.zmodType R)) true (@natmul (Ring.zmodType R) (@mul R (@exp R (one R) (subn n (@nat_of_ord (S n) i))) (@exp R x (@nat_of_ord (S n) i))) (binomial n (@nat_of_ord (S n) i))))) (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType R)) (ordinal (S n)) i (@add (Ring.zmodType R)) true (@natmul (Ring.zmodType R) (@exp R x (@nat_of_ord (S n) i)) (binomial n (@nat_of_ord (S n) i))))) *) by apply: eq_bigr => i _; rewrite expr1n mul1r. Qed. Lemma subrX1 x n : x ^+ n - 1 = (x - 1) * (\sum_(i < n) x ^+ i). Lemma sqrrD1 x : (x + 1) ^+ 2 = x ^+ 2 + x *+ 2 + 1. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@add (Ring.zmodType R) x (one R)) (S (S O))) (@add (Ring.zmodType R) (@add (Ring.zmodType R) (@exp R x (S (S O))) (@natmul (Ring.zmodType R) x (S (S O)))) (one R)) *) rewrite exprD1n !big_ord_recr big_ord0 /= add0r. (* Goal: @eq (Ring.sort R) (@add (Ring.zmodType R) (@add (Ring.zmodType R) (@natmul (Ring.zmodType R) (@exp R x O) (binomial (S (S O)) O)) (@natmul (Ring.zmodType R) (@exp R x (S O)) (binomial (S (S O)) (S O)))) (@natmul (Ring.zmodType R) (@exp R x (S (S O))) (binomial (S (S O)) (S (S O))))) (@add (Ring.zmodType R) (@add (Ring.zmodType R) (@exp R x (S (S O))) (@natmul (Ring.zmodType R) x (S (S O)))) (one R)) *) by rewrite addrC addrA addrAC. Qed. Lemma sqrrB1 x : (x - 1) ^+ 2 = x ^+ 2 - x *+ 2 + 1. Proof. (* Goal: @eq (Ring.sort R) (@exp R (@add (Ring.zmodType R) x (@opp (Ring.zmodType R) (one R))) (S (S O))) (@add (Ring.zmodType R) (@add (Ring.zmodType R) (@exp R x (S (S O))) (@opp (Ring.zmodType R) (@natmul (Ring.zmodType R) x (S (S O))))) (one R)) *) by rewrite -sqrrN opprB addrC sqrrD1 sqrrN mulNrn. Qed. Lemma subr_sqr_1 x : x ^+ 2 - 1 = (x - 1) * (x + 1). Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@add (Ring.zmodType R) (@exp R x (S (S O))) (@opp (Ring.zmodType R) (one R))) (@mul R (@add (Ring.zmodType R) x (@opp (Ring.zmodType R) (one R))) (@add (Ring.zmodType R) x (one R))) *) by rewrite subrX1 !big_ord_recr big_ord0 /= addrAC add0r. Qed. Definition Frobenius_aut p of p \in [char R] := fun x => x ^+ p. Lemma charf_prime : prime p. Proof. by case/andP: charFp. Qed. Proof. (* Goal: is_true (prime p) *) by case/andP: charFp. Qed. Lemma natr_mod_char n : (n %% p)%:R = n%:R :> R. Proof. (* Goal: @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) (modn n p)) (@natmul (Ring.zmodType R) (one R) n) *) by rewrite {2}(divn_eq n p) natrD mulrnA mulrn_char add0r. Qed. Lemma dvdn_charf n : (p %| n)%N = (n%:R == 0 :> R). Proof. (* Goal: @eq bool (dvdn p n) (@eq_op (Ring.eqType R) (@natmul (Ring.zmodType R) (one R) n : Ring.sort R) (zero (Ring.zmodType R) : Ring.sort R)) *) apply/idP/eqP=> [/dvdnP[n' ->]|n0]; first by rewrite natrM charf0 mulr0. (* Goal: is_true (dvdn p n) *) apply/idPn; rewrite -prime_coprime // => /eqnP pn1. (* Goal: False *) have [a _ /dvdnP[b]] := Bezoutl n (prime_gt0 charf_prime). (* Goal: forall _ : @eq nat (addn (gcdn p n) (muln a n)) (muln b p), False *) move/(congr1 (fun m => m%:R : R))/eqP. (* Goal: forall _ : is_true (@eq_op (Ring.eqType R) (@natmul (Ring.zmodType R) (one R) (addn (gcdn p n) (muln a n))) (@natmul (Ring.zmodType R) (one R) (muln b p))), False *) by rewrite natrD !natrM charf0 n0 !mulr0 pn1 addr0 oner_eq0. Qed. Lemma charf_eq : [char R] =i (p : nat_pred). Proof. (* Goal: @eq_mem nat (@mem nat nat_pred_pred (@char R (Phant (Ring.sort R)))) (@mem nat nat_pred_pred (nat_pred_of_nat p : nat_pred)) *) move=> q; apply/andP/eqP=> [[q_pr q0] | ->]; last by rewrite charf0. (* Goal: @eq (Equality.sort nat_eqType) q p *) by apply/eqP; rewrite eq_sym -dvdn_prime2 // dvdn_charf. Qed. Lemma bin_lt_charf_0 k : 0 < k < p -> 'C(p, k)%:R = 0 :> R. Proof. (* Goal: forall _ : is_true (andb (leq (S O) k) (leq (S k) p)), @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) (binomial p k)) (zero (Ring.zmodType R)) *) by move=> lt0kp; apply/eqP; rewrite -dvdn_charf prime_dvd_bin. Qed. Local Notation fE := Frobenius_autE. Lemma Frobenius_aut0 : 0^f = 0. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (zero (Ring.zmodType R))) (zero (Ring.zmodType R)) *) by rewrite fE -(prednK (prime_gt0 charf_prime)) exprS mul0r. Qed. Lemma Frobenius_aut1 : 1^f = 1. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (one R)) (one R) *) by rewrite fE expr1n. Qed. Lemma Frobenius_autD_comm x y (cxy : comm x y) : (x + y)^f = x^f + y^f. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (@add (Ring.zmodType R) x y)) (@add (Ring.zmodType R) (@Frobenius_aut p charFp x) (@Frobenius_aut p charFp y)) *) have defp := prednK (prime_gt0 charf_prime). (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (@add (Ring.zmodType R) x y)) (@add (Ring.zmodType R) (@Frobenius_aut p charFp x) (@Frobenius_aut p charFp y)) *) rewrite !fE exprDn_comm // big_ord_recr subnn -defp big_ord_recl /= defp. (* Goal: @eq (Ring.sort R) (@add (Ring.zmodType R) (@add (Ring.zmodType R) (@natmul (Ring.zmodType R) (@mul R (@exp R x (subn p O)) (@exp R y O)) (binomial p O)) (@BigOp.bigop (Ring.sort R) (ordinal (Nat.pred p)) (zero (Ring.zmodType R)) (index_enum (ordinal_finType (Nat.pred p))) (fun i : ordinal (Nat.pred p) => @BigBody (Ring.sort R) (ordinal (Nat.pred p)) i (@add (Ring.zmodType R)) true (@natmul (Ring.zmodType R) (@mul R (@exp R x (subn p (bump O (@nat_of_ord (Nat.pred p) i)))) (@exp R y (bump O (@nat_of_ord (Nat.pred p) i)))) (binomial p (bump O (@nat_of_ord (Nat.pred p) i))))))) (@natmul (Ring.zmodType R) (@mul R (@exp R x O) (@exp R y p)) (binomial p p))) (@add (Ring.zmodType R) (@exp R x p) (@exp R y p)) *) rewrite subn0 mulr1 mul1r bin0 binn big1 ?addr0 // => i _. (* Goal: @eq (Ring.sort R) (@natmul (Ring.zmodType R) (@mul R (@exp R x (subn p (bump O (@nat_of_ord (Nat.pred p) i)))) (@exp R y (bump O (@nat_of_ord (Nat.pred p) i)))) (binomial p (bump O (@nat_of_ord (Nat.pred p) i)))) (zero (Ring.zmodType R)) *) by rewrite -mulr_natl bin_lt_charf_0 ?mul0r //= -{2}defp ltnS (valP i). Qed. Lemma Frobenius_autMn x n : (x *+ n)^f = x^f *+ n. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (@natmul (Ring.zmodType R) x n)) (@natmul (Ring.zmodType R) (@Frobenius_aut p charFp x) n) *) elim: n => [|n IHn]; first exact: Frobenius_aut0. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (@natmul (Ring.zmodType R) x (S n))) (@natmul (Ring.zmodType R) (@Frobenius_aut p charFp x) (S n)) *) by rewrite !mulrS Frobenius_autD_comm ?IHn //; apply: commrMn. Qed. Lemma Frobenius_aut_nat n : (n%:R)^f = n%:R. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (@natmul (Ring.zmodType R) (one R) n)) (@natmul (Ring.zmodType R) (one R) n) *) by rewrite Frobenius_autMn Frobenius_aut1. Qed. Lemma Frobenius_autM_comm x y : comm x y -> (x * y)^f = x^f * y^f. Proof. (* Goal: forall _ : @comm R x y, @eq (Ring.sort R) (@Frobenius_aut p charFp (@mul R x y)) (@mul R (@Frobenius_aut p charFp x) (@Frobenius_aut p charFp y)) *) exact: exprMn_comm. Qed. Lemma Frobenius_autX x n : (x ^+ n)^f = x^f ^+ n. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (@exp R x n)) (@exp R (@Frobenius_aut p charFp x) n) *) by rewrite !fE -!exprM mulnC. Qed. Lemma Frobenius_autN x : (- x)^f = - x^f. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp (@opp (Ring.zmodType R) x)) (@opp (Ring.zmodType R) (@Frobenius_aut p charFp x)) *) apply/eqP; rewrite -subr_eq0 opprK addrC. (* Goal: is_true (@eq_op (Zmodule.eqType (Ring.zmodType R)) (@add (Ring.zmodType R) (@Frobenius_aut p charFp x) (@Frobenius_aut p charFp (@opp (Ring.zmodType R) x))) (zero (Ring.zmodType R))) *) by rewrite -(Frobenius_autD_comm (commrN _)) // subrr Frobenius_aut0. Qed. Lemma Frobenius_autB_comm x y : comm x y -> (x - y)^f = x^f - y^f. Proof. (* Goal: forall _ : @comm R x y, @eq (Ring.sort R) (@Frobenius_aut p charFp (@add (Ring.zmodType R) x (@opp (Ring.zmodType R) y))) (@add (Ring.zmodType R) (@Frobenius_aut p charFp x) (@opp (Ring.zmodType R) (@Frobenius_aut p charFp y))) *) by move/commrN/Frobenius_autD_comm->; rewrite Frobenius_autN. Qed. End FrobeniusAutomorphism. Lemma exprNn_char x n : [char R].-nat n -> (- x) ^+ n = - (x ^+ n). Proof. (* Goal: forall _ : is_true (pnat (@char R (Phant (Ring.sort R))) n), @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) x) n) (@opp (Ring.zmodType R) (@exp R x n)) *) pose p := pdiv n; have [|n_gt1 charRn] := leqP n 1; first by case: (n) => [|[]]. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) x) n) (@opp (Ring.zmodType R) (@exp R x n)) *) have charRp: p \in [char R] by rewrite (pnatPpi charRn) // pi_pdiv. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) x) n) (@opp (Ring.zmodType R) (@exp R x n)) *) have /p_natP[e ->]: p.-nat n by rewrite -(eq_pnat _ (charf_eq charRp)). (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) x) (expn p e)) (@opp (Ring.zmodType R) (@exp R x (expn p e))) *) elim: e => // e IHe; rewrite expnSr !exprM {}IHe. (* Goal: @eq (Ring.sort R) (@exp R (@opp (Ring.zmodType R) (@exp R x (expn p e))) p) (@opp (Ring.zmodType R) (@exp R (@exp R x (expn p e)) p)) *) by rewrite -Frobenius_autE Frobenius_autN. Qed. Lemma oppr_char2 x : - x = x. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@opp (Ring.zmodType R) x) x *) by apply/esym/eqP; rewrite -addr_eq0 addrr_char2. Qed. Lemma addrK_char2 x : involutive (+%R^~ x). Proof. (* Goal: @involutive (Zmodule.sort (Ring.zmodType R)) (fun x0 : Zmodule.sort (Ring.zmodType R) => @add (Ring.zmodType R) x0 x) *) by move=> y; rewrite /= -subr_char2 addrK. Qed. Lemma addKr_char2 x : involutive (+%R x). Proof. (* Goal: @involutive (Zmodule.sort (Ring.zmodType R)) (@add (Ring.zmodType R) x) *) by move=> y; rewrite -{1}[x]oppr_char2 addKr. Qed. End Char2. Canonical converse_eqType := [eqType of R^c]. Canonical converse_choiceType := [choiceType of R^c]. Canonical converse_zmodType := [zmodType of R^c]. Definition converse_ringMixin := let mul' x y := y * x in let mulrA' x y z := esym (mulrA z y x) in let mulrDl' x y z := mulrDr z x y in let mulrDr' x y z := mulrDl y z x in @Ring.Mixin converse_zmodType 1 mul' mulrA' mulr1 mul1r mulrDl' mulrDr' oner_neq0. Canonical converse_ringType := RingType R^c converse_ringMixin. Section ClosedPredicates. Variable S : predPredType R. Definition mulr_2closed := {in S &, forall u v, u * v \in S}. Definition mulr_closed := 1 \in S /\ mulr_2closed. Definition smulr_closed := -1 \in S /\ mulr_2closed. Definition semiring_closed := addr_closed S /\ mulr_closed. Definition subring_closed := [/\ 1 \in S, subr_2closed S & mulr_2closed]. Lemma smulr_closedM : smulr_closed -> mulr_closed. Proof. (* Goal: forall _ : smulr_closed, mulr_closed *) by case=> SN1 SM; split=> //; rewrite -[1]mulr1 -mulrNN SM. Qed. Lemma smulr_closedN : smulr_closed -> oppr_closed S. Proof. (* Goal: forall _ : smulr_closed, @oppr_closed (Ring.zmodType R) S *) by case=> SN1 SM x Sx; rewrite -mulN1r SM. Qed. Lemma semiring_closedD : semiring_closed -> addr_closed S. Proof. by case. Qed. Proof. (* Goal: forall _ : semiring_closed, @addr_closed (Ring.zmodType R) S *) by case. Qed. Lemma subring_closedB : subring_closed -> zmod_closed S. Proof. (* Goal: forall _ : subring_closed, @zmod_closed (Ring.zmodType R) S *) by case=> S1 SB _; split; rewrite // -(subrr 1) SB. Qed. Lemma subring_closedM : subring_closed -> smulr_closed. Proof. (* Goal: forall _ : subring_closed, smulr_closed *) by case=> S1 SB SM; split; rewrite ?(zmod_closedN (subring_closedB _)). Qed. Lemma subring_closed_semi : subring_closed -> semiring_closed. Proof. (* Goal: forall _ : subring_closed, semiring_closed *) by move=> ringS; split; [apply/zmod_closedD/subring_closedB | case: ringS]. Qed. End ClosedPredicates. End RingTheory. Section RightRegular. Variable R : ringType. Implicit Types x y : R. Let Rc := converse_ringType R. Lemma mulIr_eq0 x y : rreg x -> (y * x == 0) = (y == 0). Proof. (* Goal: forall _ : @rreg R x, @eq bool (@eq_op (Ring.eqType R) (@mul R y x) (zero (Ring.zmodType R))) (@eq_op (Ring.eqType R) y (zero (Ring.zmodType R))) *) exact: (@mulrI_eq0 Rc). Qed. Lemma mulIr0_rreg x : (forall y, y * x = 0 -> y = 0) -> rreg x. Proof. (* Goal: forall _ : forall (y : Ring.sort R) (_ : @eq (Ring.sort R) (@mul R y x) (zero (Ring.zmodType R))), @eq (Ring.sort R) y (zero (Ring.zmodType R)), @rreg R x *) exact: (@mulrI0_lreg Rc). Qed. Lemma rreg_neq0 x : rreg x -> x != 0. Proof. (* Goal: forall _ : @rreg R x, is_true (negb (@eq_op (Ring.eqType R) x (zero (Ring.zmodType R)))) *) exact: (@lreg_neq0 Rc). Qed. Lemma rregN x : rreg x -> rreg (- x). Proof. (* Goal: forall _ : @rreg R x, @rreg R (@opp (Ring.zmodType R) x) *) exact: (@lregN Rc). Qed. Lemma rreg1 : rreg (1 : R). Proof. (* Goal: @rreg R (one R : Ring.sort R) *) exact: (@lreg1 Rc). Qed. Lemma rregM x y : rreg x -> rreg y -> rreg (x * y). Proof. (* Goal: forall (_ : @rreg R x) (_ : @rreg R y), @rreg R (@mul R x y) *) by move=> reg_x reg_y; apply: (@lregM Rc). Qed. Lemma revrX x n : (x : Rc) ^+ n = (x : R) ^+ n. Proof. (* Goal: @eq (Ring.sort Rc) (@exp Rc (x : Ring.sort Rc) n) (@exp R (x : Ring.sort R) n) *) by elim: n => // n IHn; rewrite exprS exprSr IHn. Qed. Lemma rregX x n : rreg x -> rreg (x ^+ n). Proof. (* Goal: forall _ : @rreg R x, @rreg R (@exp R x n) *) by move/(@lregX Rc x n); rewrite revrX. Qed. End RightRegular. Module Lmodule. Structure mixin_of (R : ringType) (V : zmodType) : Type := Mixin { scale : R -> V -> V; _ : forall a b v, scale a (scale b v) = scale (a * b) v; _ : left_id 1 scale; _ : right_distributive scale +%R; _ : forall v, {morph scale^~ v: a b / a + b} }. Section ClassDef. Variable R : ringType. Structure class_of V := Class { base : Zmodule.class_of V; mixin : mixin_of R (Zmodule.Pack base) }. Local Coercion base : class_of >-> Zmodule.class_of. Structure type (phR : phant R) := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (phR : phant R) (T : Type) (cT : type phR). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack phR T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (m0 : mixin_of R (@Zmodule.Pack T b0)) := fun bT b & phant_id (Zmodule.class bT) b => fun m & phant_id m0 m => Pack phR (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. End ClassDef. Module Import Exports. Coercion base : class_of >-> Zmodule.class_of. Coercion mixin : class_of >-> mixin_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Notation lmodType R := (type (Phant R)). Notation LmodType R T m := (@pack _ (Phant R) T _ m _ _ id _ id). Notation LmodMixin := Mixin. Notation "[ 'lmodType' R 'of' T 'for' cT ]" := (@clone _ (Phant R) T cT _ idfun) (at level 0, format "[ 'lmodType' R 'of' T 'for' cT ]") : form_scope. Notation "[ 'lmodType' R 'of' T ]" := (@clone _ (Phant R) T _ _ id) (at level 0, format "[ 'lmodType' R 'of' T ]") : form_scope. End Exports. End Lmodule. Import Lmodule.Exports. Definition scale (R : ringType) (V : lmodType R) := Lmodule.scale (Lmodule.class V). Local Notation "*:%R" := (@scale _ _). Local Notation "a *: v" := (scale a v) : ring_scope. Section LmoduleTheory. Variables (R : ringType) (V : lmodType R). Implicit Types (a b c : R) (u v : V). Local Notation "*:%R" := (@scale R V). Lemma scalerA a b v : a *: (b *: v) = a * b *: v. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V a (@scale R V b v)) (@scale R V (@mul R a b) v) *) by case: V v => ? [] ? []. Qed. Lemma scale1r : @left_id R V 1 *:%R. Proof. (* Goal: @left_id (Ring.sort R) (@Lmodule.sort R (Phant (Ring.sort R)) V) (one R) (@scale R V) *) by case: V => ? [] ? []. Qed. Lemma scalerDr a : {morph *:%R a : u v / u + v}. Proof. (* Goal: @morphism_2 (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V a) (fun u v : Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) => @add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) u v) (fun u v : Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) => @add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) u v) *) by case: V a => ? [] ? []. Qed. Lemma scalerDl v : {morph *:%R^~ v : a b / a + b}. Proof. (* Goal: @morphism_2 (Ring.sort R) (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (fun x : Ring.sort R => @scale R V x v) (fun a b : Ring.sort R => @add (Ring.zmodType R) a b) (fun a b : Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) => @add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) a b) *) by case: V v => ? [] ? []. Qed. Lemma scale0r v : 0 *: v = 0. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (zero (Ring.zmodType R)) v) (zero (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) *) by apply: (addIr (1 *: v)); rewrite -scalerDl !add0r. Qed. Lemma scaler0 a : a *: 0 = 0 :> V. Proof. (* Goal: @eq (@Lmodule.sort R (Phant (Ring.sort R)) V) (@scale R V a (zero (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))))) (zero (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) *) by rewrite -{1}(scale0r 0) scalerA mulr0 scale0r. Qed. Lemma scaleNr a v : - a *: v = - (a *: v). Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@opp (Ring.zmodType R) a) v) (@opp (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v)) *) by apply: (addIr (a *: v)); rewrite -scalerDl !addNr scale0r. Qed. Lemma scaleN1r v : (- 1) *: v = - v. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@opp (Ring.zmodType R) (one R)) v) (@opp (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v) *) by rewrite scaleNr scale1r. Qed. Lemma scalerN a v : a *: (- v) = - (a *: v). Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V a (@opp (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v)) (@opp (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v)) *) by apply: (addIr (a *: v)); rewrite -scalerDr !addNr scaler0. Qed. Lemma scalerBl a b v : (a - b) *: v = a *: v - b *: v. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@add (Ring.zmodType R) a (@opp (Ring.zmodType R) b)) v) (@add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v) (@opp (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V b v))) *) by rewrite scalerDl scaleNr. Qed. Lemma scalerBr a u v : a *: (u - v) = a *: u - a *: v. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V a (@add (@Lmodule.zmodType R (Phant (Ring.sort R)) V) u (@opp (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v))) (@add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a u) (@opp (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v))) *) by rewrite scalerDr scalerN. Qed. Lemma scaler_nat n v : n%:R *: v = v *+ n. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@natmul (Ring.zmodType R) (one R) n) v) (@natmul (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v n) *) elim: n => /= [|n ]; first by rewrite scale0r. (* Goal: forall _ : @eq (@Lmodule.sort R (Phant (Ring.sort R)) V) (@scale R V (@natmul (Ring.zmodType R) (one R) n) v) (@natmul (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v n), @eq (@Lmodule.sort R (Phant (Ring.sort R)) V) (@scale R V (@natmul (Ring.zmodType R) (one R) (S n)) v) (@natmul (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v (S n)) *) by rewrite !mulrS scalerDl ?scale1r => ->. Qed. Lemma scaler_sign (b : bool) v: (-1) ^+ b *: v = (if b then - v else v). Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@exp R (@opp (Ring.zmodType R) (one R)) (nat_of_bool b)) v) (if b then @opp (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v else v) *) by case: b; rewrite ?scaleNr scale1r. Qed. Lemma signrZK n : @involutive V ( *:%R ((-1) ^+ n)). Proof. (* Goal: @involutive (@Lmodule.sort R (Phant (Ring.sort R)) V) (@scale R V (@exp R (@opp (Ring.zmodType R) (one R)) n)) *) by move=> u; rewrite scalerA -expr2 sqrr_sign scale1r. Qed. Lemma scalerMnl a v n : a *: v *+ n = (a *+ n) *: v. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@natmul (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v) n) (@scale R V (@natmul (Ring.zmodType R) a n) v) *) elim: n => [|n IHn]; first by rewrite !mulr0n scale0r. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@natmul (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v) (S n)) (@scale R V (@natmul (Ring.zmodType R) a (S n)) v) *) by rewrite !mulrSr IHn scalerDl. Qed. Lemma scalerMnr a v n : a *: v *+ n = a *: (v *+ n). Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@natmul (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v) n) (@scale R V a (@natmul (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v n)) *) elim: n => [|n IHn]; first by rewrite !mulr0n scaler0. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@natmul (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V a v) (S n)) (@scale R V a (@natmul (@Lmodule.zmodType R (Phant (Ring.sort R)) V) v (S n))) *) by rewrite !mulrSr IHn scalerDr. Qed. Lemma scaler_suml v I r (P : pred I) F : (\sum_(i <- r | P i) F i) *: v = \sum_(i <- r | P i) F i *: v. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) I (zero (Ring.zmodType R)) r (fun i : I => @BigBody (Zmodule.sort (Ring.zmodType R)) I i (@add (Ring.zmodType R)) (P i) (F i))) v) (@BigOp.bigop (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) I (zero (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) r (fun i : I => @BigBody (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) I i (@add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (P i) (@scale R V (F i) v))) *) exact: (big_morph _ (scalerDl v) (scale0r v)). Qed. Lemma scaler_sumr a I r (P : pred I) (F : I -> V) : a *: (\sum_(i <- r | P i) F i) = \sum_(i <- r | P i) a *: F i. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V a (@BigOp.bigop (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) I (zero (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) r (fun i : I => @BigBody (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) I i (@add (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (P i) (F i)))) (@BigOp.bigop (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) I (zero (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) r (fun i : I => @BigBody (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) I i (@add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (P i) (@scale R V a (F i)))) *) exact: big_endo (scalerDr a) (scaler0 a) I r P F. Qed. Section ClosedPredicates. Variable S : predPredType V. Definition scaler_closed := forall a, {in S, forall v, a *: v \in S}. Definition linear_closed := forall a, {in S &, forall u v, a *: u + v \in S}. Definition submod_closed := 0 \in S /\ linear_closed. Lemma linear_closedB : linear_closed -> subr_2closed S. Proof. (* Goal: forall _ : linear_closed, @subr_2closed (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S *) by move=> Slin u v Su Sv; rewrite addrC -scaleN1r Slin. Qed. Lemma submod_closedB : submod_closed -> zmod_closed S. Proof. (* Goal: forall _ : submod_closed, @zmod_closed (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S *) by case=> S0 /linear_closedB. Qed. Lemma submod_closedZ : submod_closed -> scaler_closed. Proof. (* Goal: forall _ : submod_closed, scaler_closed *) by case=> S0 Slin a v Sv; rewrite -[a *: v]addr0 Slin. Qed. End ClosedPredicates. End LmoduleTheory. Module Lalgebra. Definition axiom (R : ringType) (V : lmodType R) (mul : V -> V -> V) := forall a u v, a *: mul u v = mul (a *: u) v. Section ClassDef. Variable R : ringType. Record class_of (T : Type) : Type := Class { base : Ring.class_of T; mixin : Lmodule.mixin_of R (Zmodule.Pack base); ext : @axiom R (Lmodule.Pack _ (Lmodule.Class mixin)) (Ring.mul base) }. Definition base2 R m := Lmodule.Class (@mixin R m). Local Coercion base : class_of >-> Ring.class_of. Local Coercion base2 : class_of >-> Lmodule.class_of. Structure type (phR : phant R) := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (phR : phant R) (T : Type) (cT : type phR). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack phR T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack T b0 mul0 (axT : @axiom R (@Lmodule.Pack R _ T b0) mul0) := fun bT b & phant_id (Ring.class bT) (b : Ring.class_of T) => fun mT m & phant_id (@Lmodule.class R phR mT) (@Lmodule.Class R T b m) => fun ax & phant_id axT ax => Pack (Phant R) (@Class T b m ax). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition lmodType := @Lmodule.Pack R phR cT xclass. Definition lmod_ringType := @Lmodule.Pack R phR ringType xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Ring.class_of. Coercion base2 : class_of >-> Lmodule.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Coercion lmodType : type >-> Lmodule.type. Canonical lmodType. Canonical lmod_ringType. Notation lalgType R := (type (Phant R)). Notation LalgType R T a := (@pack _ (Phant R) T _ _ a _ _ id _ _ id _ id). Notation "[ 'lalgType' R 'of' T 'for' cT ]" := (@clone _ (Phant R) T cT _ idfun) (at level 0, format "[ 'lalgType' R 'of' T 'for' cT ]") : form_scope. Notation "[ 'lalgType' R 'of' T ]" := (@clone _ (Phant R) T _ _ id) (at level 0, format "[ 'lalgType' R 'of' T ]") : form_scope. End Exports. End Lalgebra. Import Lalgebra.Exports. Local Notation "k %:A" := (k *: 1) : ring_scope. Definition regular R : Type := R. Local Notation "R ^o" := (regular R) (at level 2, format "R ^o") : type_scope. Section LalgebraTheory. Variables (R : ringType) (A : lalgType R). Implicit Types x y : A. Lemma scalerAl k (x y : A) : k *: (x * y) = k *: x * y. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (@Lmodule.class R (Phant (Ring.sort R)) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A))))) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A) k (@mul (@Lalgebra.ringType R (Phant (Ring.sort R)) A) x y)) (@mul (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmodType R (Phant (Ring.sort R)) A) k x) y) *) by case: A k x y => ? []. Qed. Lemma mulr_algl a x : a%:A * x = a *: x. Proof. (* Goal: @eq (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) A)) (@mul (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A) a (one (@Lalgebra.ringType R (Phant (Ring.sort R)) A))) x) (@scale R (@Lalgebra.lmodType R (Phant (Ring.sort R)) A) a x) *) by rewrite -scalerAl mul1r. Qed. Canonical regular_eqType := [eqType of R^o]. Canonical regular_choiceType := [choiceType of R^o]. Canonical regular_zmodType := [zmodType of R^o]. Canonical regular_ringType := [ringType of R^o]. Definition regular_lmodMixin := let mkMixin := @Lmodule.Mixin R regular_zmodType (@mul R) in mkMixin (@mulrA R) (@mul1r R) (@mulrDr R) (fun v a b => mulrDl a b v). Canonical regular_lmodType := LmodType R R^o regular_lmodMixin. Canonical regular_lalgType := LalgType R R^o (@mulrA regular_ringType). Section ClosedPredicates. Variable S : predPredType A. Definition subalg_closed := [/\ 1 \in S, linear_closed S & mulr_2closed S]. Lemma subalg_closedZ : subalg_closed -> submod_closed S. Proof. (* Goal: forall _ : subalg_closed, @submod_closed R (@Lalgebra.lmodType R (Phant (Ring.sort R)) A) S *) by case=> S1 Slin _; split; rewrite // -(subrr 1) linear_closedB. Qed. Lemma subalg_closedBM : subalg_closed -> subring_closed S. Proof. (* Goal: forall _ : subalg_closed, @subring_closed (@Lalgebra.ringType R (Phant (Ring.sort R)) A) S *) by case=> S1 Slin SM; split=> //; apply: linear_closedB. Qed. End ClosedPredicates. End LalgebraTheory. Module Additive. Section ClassDef. Variables U V : zmodType. Definition axiom (f : U -> V) := {morph f : x y / x - y}. Structure map (phUV : phant (U -> V)) := Pack {apply; _ : axiom apply}. Local Coercion apply : map >-> Funclass. Variables (phUV : phant (U -> V)) (f g : U -> V) (cF : map phUV). Definition class := let: Pack _ c as cF' := cF return axiom cF' in c. Definition clone fA of phant_id g (apply cF) & phant_id fA class := @Pack phUV f fA. End ClassDef. Module Exports. Notation additive f := (axiom f). Coercion apply : map >-> Funclass. Notation Additive fA := (Pack (Phant _) fA). Notation "{ 'additive' fUV }" := (map (Phant fUV)) (at level 0, format "{ 'additive' fUV }") : ring_scope. Notation "[ 'additive' 'of' f 'as' g ]" := (@clone _ _ _ f g _ _ idfun id) (at level 0, format "[ 'additive' 'of' f 'as' g ]") : form_scope. Notation "[ 'additive' 'of' f ]" := (@clone _ _ _ f f _ _ id id) (at level 0, format "[ 'additive' 'of' f ]") : form_scope. End Exports. End Additive. Include Additive.Exports. Section LiftedZmod. Variables (U : Type) (V : zmodType). Definition null_fun_head (phV : phant V) of U : V := let: Phant := phV in 0. Definition add_fun_head t (f g : U -> V) x := let: tt := t in f x + g x. Definition sub_fun_head t (f g : U -> V) x := let: tt := t in f x - g x. End LiftedZmod. Section LiftedRing. Variables (R : ringType) (T : Type). Implicit Type f : T -> R. Definition mull_fun_head t a f x := let: tt := t in a * f x. Definition mulr_fun_head t a f x := let: tt := t in f x * a. End LiftedRing. Section LiftedScale. Variables (R : ringType) (U : Type) (V : lmodType R) (A : lalgType R). Definition scale_fun_head t a (f : U -> V) x := let: tt := t in a *: f x. Definition in_alg_head (phA : phant A) k : A := let: Phant := phA in k%:A. Lemma raddf0 : f 0 = 0. Proof. (* Goal: @eq (Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f (zero U)) (zero V) *) by rewrite -[0]subr0 raddfB subrr. Qed. Lemma raddf_eq0 x : injective f -> (f x == 0) = (x == 0). Proof. (* Goal: forall _ : @injective (Zmodule.sort V) (Zmodule.sort U) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f), @eq bool (@eq_op (Zmodule.eqType V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f x) (zero V)) (@eq_op (Zmodule.eqType U) x (zero U)) *) by move=> /inj_eq <-; rewrite raddf0. Qed. Lemma raddfN : {morph f : x / - x}. Proof. (* Goal: @morphism_1 (Zmodule.sort U) (Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f) (fun x : Zmodule.sort U => @opp U x) (fun x : Zmodule.sort V => @opp V x) *) by move=> x /=; rewrite -sub0r raddfB raddf0 sub0r. Qed. Lemma raddfD : {morph f : x y / x + y}. Proof. (* Goal: @morphism_2 (Zmodule.sort U) (Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f) (fun x y : Zmodule.sort U => @add U x y) (fun x y : Zmodule.sort V => @add V x y) *) by move=> x y; rewrite -[y]opprK raddfB -raddfN. Qed. Lemma raddfMn n : {morph f : x / x *+ n}. Proof. (* Goal: @morphism_1 (Zmodule.sort U) (Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f) (fun x : Zmodule.sort U => @natmul U x n) (fun x : Zmodule.sort V => @natmul V x n) *) by elim: n => [|n IHn] x /=; rewrite ?raddf0 // !mulrS raddfD IHn. Qed. Lemma raddfMNn n : {morph f : x / x *- n}. Proof. (* Goal: @morphism_1 (Zmodule.sort U) (Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f) (fun x : Zmodule.sort U => @opp U (@natmul U x n)) (fun x : Zmodule.sort V => @opp V (@natmul V x n)) *) by move=> x /=; rewrite raddfN raddfMn. Qed. Lemma raddf_sum I r (P : pred I) E : f (\sum_(i <- r | P i) E i) = \sum_(i <- r | P i) f (E i). Proof. (* Goal: @eq (Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f (@BigOp.bigop (Zmodule.sort U) I (zero U) r (fun i : I => @BigBody (Zmodule.sort U) I i (@add U) (P i) (E i)))) (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f (E i)))) *) exact: (big_morph f raddfD raddf0). Qed. Lemma can2_additive f' : cancel f f' -> cancel f' f -> additive f'. Proof. (* Goal: forall (_ : @cancel (Zmodule.sort V) (Zmodule.sort U) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f) f') (_ : @cancel (Zmodule.sort U) (Zmodule.sort V) f' (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f)), @Additive.axiom V U f' *) by move=> fK f'K x y /=; apply: (canLR fK); rewrite raddfB !f'K. Qed. Lemma bij_additive : bijective f -> exists2 f' : {additive V -> U}, cancel f f' & cancel f' f. Proof. (* Goal: forall _ : @bijective (Zmodule.sort V) (Zmodule.sort U) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f), @ex2 (@Additive.map V U (Phant (forall _ : Zmodule.sort V, Zmodule.sort U))) (fun f' : @Additive.map V U (Phant (forall _ : Zmodule.sort V, Zmodule.sort U)) => @cancel (Zmodule.sort V) (Zmodule.sort U) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f) (@Additive.apply V U (Phant (forall _ : Zmodule.sort V, Zmodule.sort U)) f')) (fun f' : @Additive.map V U (Phant (forall _ : Zmodule.sort V, Zmodule.sort U)) => @cancel (Zmodule.sort U) (Zmodule.sort V) (@Additive.apply V U (Phant (forall _ : Zmodule.sort V, Zmodule.sort U)) f') (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f)) *) by case=> f' fK f'K; exists (Additive (can2_additive fK f'K)). Qed. Fact locked_is_additive : additive (locked_with k (f : U -> V)). Proof. (* Goal: @Additive.axiom U V (@locked_with k (forall _ : Zmodule.sort U, Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f : forall _ : Zmodule.sort U, Zmodule.sort V)) *) by case: k f => [] []. Qed. Canonical locked_additive := Additive locked_is_additive. End Properties. Section RingProperties. Variables (R S : ringType) (f : {additive R -> S}). Lemma raddfMnat n x : f (n%:R * x) = n%:R * f x. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@Additive.apply (Ring.zmodType R) (Ring.zmodType S) (Phant (forall _ : Ring.sort R, Ring.sort S)) f (@mul R (@natmul (Ring.zmodType R) (one R) n) x)) (@mul S (@natmul (Ring.zmodType S) (one S) n) (@Additive.apply (Ring.zmodType R) (Ring.zmodType S) (Phant (forall _ : Ring.sort R, Ring.sort S)) f x)) *) by rewrite !mulr_natl raddfMn. Qed. Lemma raddfMsign n x : f ((-1) ^+ n * x) = (-1) ^+ n * f x. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@Additive.apply (Ring.zmodType R) (Ring.zmodType S) (Phant (forall _ : Ring.sort R, Ring.sort S)) f (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) n) x)) (@mul S (@exp S (@opp (Ring.zmodType S) (one S)) n) (@Additive.apply (Ring.zmodType R) (Ring.zmodType S) (Phant (forall _ : Ring.sort R, Ring.sort S)) f x)) *) by rewrite !(mulr_sign, =^~ signr_odd) (fun_if f) raddfN. Qed. Variables (U : lmodType R) (V : lmodType S) (h : {additive U -> V}). Lemma raddfZnat n u : h (n%:R *: u) = n%:R *: h u. Proof. (* Goal: @eq (Zmodule.sort (@Lmodule.zmodType S (Phant (Ring.sort S)) V)) (@Additive.apply (@Lmodule.zmodType R (Phant (Ring.sort R)) U) (@Lmodule.zmodType S (Phant (Ring.sort S)) V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort S (Phant (Ring.sort S)) V)) h (@scale R U (@natmul (Ring.zmodType R) (one R) n) u)) (@scale S V (@natmul (Ring.zmodType S) (one S) n) (@Additive.apply (@Lmodule.zmodType R (Phant (Ring.sort R)) U) (@Lmodule.zmodType S (Phant (Ring.sort S)) V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort S (Phant (Ring.sort S)) V)) h u)) *) by rewrite !scaler_nat raddfMn. Qed. Lemma raddfZsign n u : h ((-1) ^+ n *: u) = (-1) ^+ n *: h u. Proof. (* Goal: @eq (Zmodule.sort (@Lmodule.zmodType S (Phant (Ring.sort S)) V)) (@Additive.apply (@Lmodule.zmodType R (Phant (Ring.sort R)) U) (@Lmodule.zmodType S (Phant (Ring.sort S)) V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort S (Phant (Ring.sort S)) V)) h (@scale R U (@exp R (@opp (Ring.zmodType R) (one R)) n) u)) (@scale S V (@exp S (@opp (Ring.zmodType S) (one S)) n) (@Additive.apply (@Lmodule.zmodType R (Phant (Ring.sort R)) U) (@Lmodule.zmodType S (Phant (Ring.sort S)) V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort S (Phant (Ring.sort S)) V)) h u)) *) by rewrite !(scaler_sign, =^~ signr_odd) (fun_if h) raddfN. Qed. End RingProperties. Section AddFun. Variables (U V W : zmodType) (f g : {additive V -> W}) (h : {additive U -> V}). Fact idfun_is_additive : additive (@idfun U). Proof. (* Goal: @Additive.axiom U U (@id_head (Zmodule.sort U) explicit_id_key) *) by []. Qed. Canonical idfun_additive := Additive idfun_is_additive. Fact comp_is_additive : additive (f \o h). Proof. (* Goal: @Additive.axiom U W (@funcomp (Zmodule.sort W) (Zmodule.sort V) (Zmodule.sort U) tt (@Additive.apply V W (Phant (forall _ : Zmodule.sort V, Zmodule.sort W)) f) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) h)) *) by move=> x y /=; rewrite !raddfB. Qed. Canonical comp_additive := Additive comp_is_additive. Fact opp_is_additive : additive (-%R : U -> U). Proof. (* Goal: @Additive.axiom U U (@opp U : forall _ : Zmodule.sort U, Zmodule.sort U) *) by move=> x y; rewrite /= opprD. Qed. Canonical opp_additive := Additive opp_is_additive. Fact null_fun_is_additive : additive (\0 : U -> V). Proof. (* Goal: @Additive.axiom U V (@null_fun_head (Zmodule.sort U) V (Phant (Zmodule.sort V)) : forall _ : Zmodule.sort U, Zmodule.sort V) *) by move=> /=; rewrite subr0. Qed. Canonical null_fun_additive := Additive null_fun_is_additive. Fact add_fun_is_additive : additive (f \+ g). Proof. (* Goal: @Additive.axiom V W (@add_fun_head (Zmodule.sort V) W tt (@Additive.apply V W (Phant (forall _ : Zmodule.sort V, Zmodule.sort W)) f) (@Additive.apply V W (Phant (forall _ : Zmodule.sort V, Zmodule.sort W)) g)) *) by move=> x y /=; rewrite !raddfB addrCA -!addrA addrCA -opprD. Qed. Canonical add_fun_additive := Additive add_fun_is_additive. Fact sub_fun_is_additive : additive (f \- g). Proof. (* Goal: @Additive.axiom V W (@sub_fun_head (Zmodule.sort V) W tt (@Additive.apply V W (Phant (forall _ : Zmodule.sort V, Zmodule.sort W)) f) (@Additive.apply V W (Phant (forall _ : Zmodule.sort V, Zmodule.sort W)) g)) *) by move=> x y /=; rewrite !raddfB addrAC -!addrA -!opprD addrAC addrA. Qed. Canonical sub_fun_additive := Additive sub_fun_is_additive. End AddFun. Section MulFun. Variables (R : ringType) (U : zmodType). Variables (a : R) (f : {additive U -> R}). Fact mull_fun_is_additive : additive (a \*o f). Proof. (* Goal: @Additive.axiom U (Ring.zmodType R) (@mull_fun_head R (Zmodule.sort U) tt a (@Additive.apply U (Ring.zmodType R) (Phant (forall _ : Zmodule.sort U, Ring.sort R)) f)) *) by move=> x y /=; rewrite raddfB mulrBr. Qed. Canonical mull_fun_additive := Additive mull_fun_is_additive. Fact mulr_fun_is_additive : additive (a \o* f). Proof. (* Goal: @Additive.axiom U (Ring.zmodType R) (@mulr_fun_head R (Zmodule.sort U) tt a (@Additive.apply U (Ring.zmodType R) (Phant (forall _ : Zmodule.sort U, Ring.sort R)) f)) *) by move=> x y /=; rewrite raddfB mulrBl. Qed. Canonical mulr_fun_additive := Additive mulr_fun_is_additive. End MulFun. Section ScaleFun. Variables (R : ringType) (U : zmodType) (V : lmodType R). Variables (a : R) (f : {additive U -> V}). Canonical scale_additive := Additive (@scalerBr R V a). Canonical scale_fun_additive := [additive of a \*: f as f \; *:%R a]. End ScaleFun. End AdditiveTheory. Module RMorphism. Section ClassDef. Variables R S : ringType. Definition mixin_of (f : R -> S) := {morph f : x y / x * y}%R * (f 1 = 1) : Prop. Record class_of f : Prop := Class {base : additive f; mixin : mixin_of f}. Local Coercion base : class_of >-> additive. Structure map (phRS : phant (R -> S)) := Pack {apply; _ : class_of apply}. Local Coercion apply : map >-> Funclass. Variables (phRS : phant (R -> S)) (f g : R -> S) (cF : map phRS). Definition class := let: Pack _ c as cF' := cF return class_of cF' in c. Definition clone fM of phant_id g (apply cF) & phant_id fM class := @Pack phRS f fM. Definition pack (fM : mixin_of f) := fun (bF : Additive.map phRS) fA & phant_id (Additive.class bF) fA => Pack phRS (Class fA fM). Canonical additive := Additive.Pack phRS class. End ClassDef. Module Exports. Notation multiplicative f := (mixin_of f). Notation rmorphism f := (class_of f). Coercion base : rmorphism >-> Additive.axiom. Coercion mixin : rmorphism >-> multiplicative. Coercion apply : map >-> Funclass. Notation RMorphism fM := (Pack (Phant _) fM). Notation AddRMorphism fM := (pack fM id). Notation "{ 'rmorphism' fRS }" := (map (Phant fRS)) (at level 0, format "{ 'rmorphism' fRS }") : ring_scope. Notation "[ 'rmorphism' 'of' f 'as' g ]" := (@clone _ _ _ f g _ _ idfun id) (at level 0, format "[ 'rmorphism' 'of' f 'as' g ]") : form_scope. Notation "[ 'rmorphism' 'of' f ]" := (@clone _ _ _ f f _ _ id id) (at level 0, format "[ 'rmorphism' 'of' f ]") : form_scope. Coercion additive : map >-> Additive.map. Canonical additive. End Exports. End RMorphism. Include RMorphism.Exports. Section RmorphismTheory. Section Properties. Variables (R S : ringType) (k : unit) (f : {rmorphism R -> S}). Lemma rmorph0 : f 0 = 0. Proof. exact: raddf0. Qed. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (zero (Ring.zmodType R))) (zero (Ring.zmodType S)) *) exact: raddf0. Qed. Lemma rmorphD : {morph f : x y / x + y}. Proof. exact: raddfD. Qed. Proof. (* Goal: @morphism_2 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x y : Zmodule.sort (Ring.zmodType R) => @add (Ring.zmodType R) x y) (fun x y : Zmodule.sort (Ring.zmodType S) => @add (Ring.zmodType S) x y) *) exact: raddfD. Qed. Lemma rmorphMn n : {morph f : x / x *+ n}. Proof. exact: raddfMn. Qed. Proof. (* Goal: @morphism_1 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x : Zmodule.sort (Ring.zmodType R) => @natmul (Ring.zmodType R) x n) (fun x : Zmodule.sort (Ring.zmodType S) => @natmul (Ring.zmodType S) x n) *) exact: raddfMn. Qed. Lemma rmorph_sum I r (P : pred I) E : f (\sum_(i <- r | P i) E i) = \sum_(i <- r | P i) f (E i). Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (@BigOp.bigop (Zmodule.sort (Ring.zmodType R)) I (zero (Ring.zmodType R)) r (fun i : I => @BigBody (Zmodule.sort (Ring.zmodType R)) I i (@add (Ring.zmodType R)) (P i) (E i)))) (@BigOp.bigop (Zmodule.sort (Ring.zmodType S)) I (zero (Ring.zmodType S)) r (fun i : I => @BigBody (Zmodule.sort (Ring.zmodType S)) I i (@add (Ring.zmodType S)) (P i) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (E i)))) *) exact: raddf_sum. Qed. Lemma rmorphMsign n : {morph f : x / (- 1) ^+ n * x}. Proof. (* Goal: @morphism_1 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x : Zmodule.sort (Ring.zmodType R) => @mul R (@exp R (@opp (Ring.zmodType R) (one R)) n) x) (fun x : Zmodule.sort (Ring.zmodType S) => @mul S (@exp S (@opp (Ring.zmodType S) (one S)) n) x) *) exact: raddfMsign. Qed. Lemma rmorphismP : rmorphism f. Proof. exact: RMorphism.class. Qed. Proof. (* Goal: @RMorphism.class_of R S (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) *) exact: RMorphism.class. Qed. Lemma rmorph1 : f 1 = 1. Proof. by case: rmorphismMP. Qed. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (one R)) (one S) *) by case: rmorphismMP. Qed. Lemma rmorph_prod I r (P : pred I) E : f (\prod_(i <- r | P i) E i) = \prod_(i <- r | P i) f (E i). Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (@BigOp.bigop (Ring.sort R) I (one R) r (fun i : I => @BigBody (Ring.sort R) I i (@mul R) (P i) (E i)))) (@BigOp.bigop (Ring.sort S) I (one S) r (fun i : I => @BigBody (Ring.sort S) I i (@mul S) (P i) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (E i)))) *) exact: (big_morph f rmorphM rmorph1). Qed. Lemma rmorphX n : {morph f: x / x ^+ n}. Proof. (* Goal: @morphism_1 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x : Zmodule.sort (Ring.zmodType R) => @exp R x n) (fun x : Zmodule.sort (Ring.zmodType S) => @exp S x n) *) by elim: n => [|n IHn] x; rewrite ?rmorph1 // !exprS rmorphM IHn. Qed. Lemma rmorph_nat n : f n%:R = n%:R. Proof. by rewrite rmorphMn rmorph1. Qed. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (@natmul (Ring.zmodType R) (one R) n)) (@natmul (Ring.zmodType S) (one S) n) *) by rewrite rmorphMn rmorph1. Qed. Lemma rmorph_sign n : f ((- 1) ^+ n) = (- 1) ^+ n. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (@exp R (@opp (Ring.zmodType R) (one R)) n)) (@exp S (@opp (Ring.zmodType S) (one S)) n) *) by rewrite rmorphX rmorphN1. Qed. Lemma rmorph_char p : p \in [char R] -> p \in [char S]. Proof. (* Goal: forall _ : is_true (@in_mem nat p (@mem nat nat_pred_pred (@char R (Phant (Ring.sort R))))), is_true (@in_mem nat p (@mem nat nat_pred_pred (@char S (Phant (Ring.sort S))))) *) by rewrite !inE -rmorph_nat => /andP[-> /= /eqP->]; rewrite rmorph0. Qed. Lemma rmorph_eq_nat x n : injective f -> (f x == n%:R) = (x == n%:R). Proof. (* Goal: forall _ : @injective (Zmodule.sort (Ring.zmodType S)) (Zmodule.sort (Ring.zmodType R)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f), @eq bool (@eq_op (Zmodule.eqType (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f x) (@natmul (Ring.zmodType S) (one S) n)) (@eq_op (Zmodule.eqType (Ring.zmodType R)) x (@natmul (Ring.zmodType R) (one R) n)) *) by move/inj_eq <-; rewrite rmorph_nat. Qed. Lemma rmorph_eq1 x : injective f -> (f x == 1) = (x == 1). Proof. (* Goal: forall _ : @injective (Zmodule.sort (Ring.zmodType S)) (Zmodule.sort (Ring.zmodType R)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f), @eq bool (@eq_op (Zmodule.eqType (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f x) (one S)) (@eq_op (Zmodule.eqType (Ring.zmodType R)) x (one R)) *) exact: rmorph_eq_nat 1%N. Qed. Lemma can2_rmorphism f' : cancel f f' -> cancel f' f -> rmorphism f'. Proof. (* Goal: forall (_ : @cancel (Zmodule.sort (Ring.zmodType S)) (Zmodule.sort (Ring.zmodType R)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) f') (_ : @cancel (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) f' (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f)), @RMorphism.class_of S R f' *) move=> fK f'K; split; first exact: can2_additive fK f'K. (* Goal: @RMorphism.mixin_of S R f' *) by split=> [x y|]; apply: (canLR fK); rewrite /= (rmorphM, rmorph1) ?f'K. Qed. Lemma bij_rmorphism : bijective f -> exists2 f' : {rmorphism S -> R}, cancel f f' & cancel f' f. Proof. (* Goal: forall _ : @bijective (Zmodule.sort (Ring.zmodType S)) (Zmodule.sort (Ring.zmodType R)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f), @ex2 (@RMorphism.map S R (Phant (forall _ : Ring.sort S, Ring.sort R))) (fun f' : @RMorphism.map S R (Phant (forall _ : Ring.sort S, Ring.sort R)) => @cancel (Zmodule.sort (Ring.zmodType S)) (Zmodule.sort (Ring.zmodType R)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (@RMorphism.apply S R (Phant (forall _ : Ring.sort S, Ring.sort R)) f')) (fun f' : @RMorphism.map S R (Phant (forall _ : Ring.sort S, Ring.sort R)) => @cancel (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply S R (Phant (forall _ : Ring.sort S, Ring.sort R)) f') (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f)) *) by case=> f' fK f'K; exists (RMorphism (can2_rmorphism fK f'K)). Qed. Fact locked_is_multiplicative : multiplicative (locked_with k (f : R -> S)). Proof. (* Goal: @RMorphism.mixin_of R S (@locked_with k (forall _ : Ring.sort R, Ring.sort S) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f : forall _ : Ring.sort R, Ring.sort S)) *) by case: k f => [] [? []]. Qed. Canonical locked_rmorphism := AddRMorphism locked_is_multiplicative. End Properties. Section Projections. Variables (R S T : ringType) (f : {rmorphism S -> T}) (g : {rmorphism R -> S}). Fact idfun_is_multiplicative : multiplicative (@idfun R). Proof. (* Goal: @RMorphism.mixin_of R R (@id_head (Ring.sort R) explicit_id_key) *) by []. Qed. Canonical idfun_rmorphism := AddRMorphism idfun_is_multiplicative. Fact comp_is_multiplicative : multiplicative (f \o g). Proof. (* Goal: @RMorphism.mixin_of R T (@funcomp (Zmodule.sort (Ring.zmodType T)) (Zmodule.sort (Ring.zmodType S)) (Zmodule.sort (Ring.zmodType R)) tt (@RMorphism.apply S T (Phant (forall _ : Ring.sort S, Ring.sort T)) f) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) g)) *) by split=> [x y|] /=; rewrite ?rmorph1 ?rmorphM. Qed. Canonical comp_rmorphism := AddRMorphism comp_is_multiplicative. End Projections. Section InAlgebra. Variables (R : ringType) (A : lalgType R). Fact in_alg_is_rmorphism : rmorphism (in_alg_loc A). Proof. (* Goal: @RMorphism.class_of R (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@in_alg_head R A (Phant (@Lalgebra.sort R (Phant (Ring.sort R)) A))) *) split=> [x y|]; first exact: scalerBl. (* Goal: @RMorphism.mixin_of R (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@in_alg_head R A (Phant (@Lalgebra.sort R (Phant (Ring.sort R)) A))) *) by split=> [x y|] /=; rewrite ?scale1r // -scalerAl mul1r scalerA. Qed. End InAlgebra. End RmorphismTheory. Module Scale. Section ScaleLaw. Structure law (R : ringType) (V : zmodType) (s : R -> V -> V) := Law { op : R -> V -> V; _ : op = s; _ : op (-1) =1 -%R; _ : forall a, additive (op a) }. Definition mul_law R := Law (erefl *%R) (@mulN1r R) (@mulrBr R). Definition scale_law R U := Law (erefl *:%R) (@scaleN1r R U) (@scalerBr R U). Lemma N1op : s_op (-1) =1 -%R. Proof. by case: s_law. Qed. Proof. (* Goal: @eqfun (Zmodule.sort V) (Zmodule.sort V) (@op R V s s_law (@opp (Ring.zmodType R) (one R))) (@opp V) *) by case: s_law. Qed. Definition op_additive a := Additive (opB a). Fact compN1op : (nu \; s_op) (-1) =1 -%R. Proof. (* Goal: @eqfun (Zmodule.sort V) (Zmodule.sort V) (@catcomp (forall _ : Zmodule.sort V, Zmodule.sort V) (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType aR)) tt (@RMorphism.apply aR R (Phant (forall _ : Ring.sort aR, Ring.sort R)) nu) (@op R V s s_law) (@opp (Ring.zmodType aR) (one aR))) (@opp V) *) by move=> v; rewrite /= rmorphN1 N1op. Qed. Definition comp_law : law (nu \; s) := Law comp_opE compN1op (fun a => opB _). End ScaleLaw. End Scale. Module Linear. Section ClassDef. Variables (R : ringType) (U : lmodType R) (V : zmodType) (s : R -> V -> V). Implicit Type phUV : phant (U -> V). Local Coercion Scale.op : Scale.law >-> Funclass. Definition axiom (f : U -> V) (s_law : Scale.law s) of s = s_law := forall a, {morph f : u v / a *: u + v >-> s a u + v}. Definition mixin_of (f : U -> V) := forall a, {morph f : v / a *: v >-> s a v}. Record class_of f : Prop := Class {base : additive f; mixin : mixin_of f}. Local Coercion base : class_of >-> additive. Lemma class_of_axiom f s_law Ds : @axiom f s_law Ds -> class_of f. Proof. (* Goal: forall _ : @axiom f s_law Ds, class_of f *) move=> fL; have fB: additive f. (* Goal: class_of f *) (* Goal: @Additive.axiom (@Lmodule.zmodType R (Phant (Ring.sort R)) U) V f *) by move=> x y /=; rewrite -scaleN1r addrC fL Ds Scale.N1op addrC. (* Goal: class_of f *) by split=> // a v /=; rewrite -[a *: v](addrK v) fB fL addrK Ds. Qed. Structure map (phUV : phant (U -> V)) := Pack {apply; _ : class_of apply}. Local Coercion apply : map >-> Funclass. Variables (phUV : phant (U -> V)) (f g : U -> V) (cF : map phUV). Definition class := let: Pack _ c as cF' := cF return class_of cF' in c. Definition clone fL of phant_id g (apply cF) & phant_id fL class := @Pack phUV f fL. Definition pack (fZ : mixin_of f) := fun (bF : Additive.map phUV) fA & phant_id (Additive.class bF) fA => Pack phUV (Class fA fZ). Canonical additive := Additive.Pack phUV class. Notation mapUV := (map (Phant (U -> V))). Definition map_class := mapUV. Definition map_at (a : R) := mapUV. Structure map_for a s_a := MapFor {map_for_map : mapUV; _ : s a = s_a}. Definition unify_map_at a (f : map_at a) := MapFor f (erefl (s a)). Structure wrapped := Wrap {unwrap : mapUV}. Definition wrap (f : map_class) := Wrap f. End ClassDef. Module Exports. Canonical Scale.mul_law. Canonical Scale.scale_law. Canonical Scale.comp_law. Canonical Scale.op_additive. Delimit Scope linear_ring_scope with linR. Notation "a *: u" := (@Scale.op _ _ *:%R _ a u) : linear_ring_scope. Notation "a * u" := (@Scale.op _ _ *%R _ a u) : linear_ring_scope. Notation "a *:^ nu u" := (@Scale.op _ _ (nu \; *:%R) _ a u) (at level 40, nu at level 1, format "a *:^ nu u") : linear_ring_scope. Notation "a *^ nu u" := (@Scale.op _ _ (nu \; *%R) _ a u) (at level 40, nu at level 1, format "a *^ nu u") : linear_ring_scope. Notation scalable_for s f := (mixin_of s f). Notation scalable f := (scalable_for *:%R f). Notation linear_for s f := (axiom f (erefl s)). Notation linear f := (linear_for *:%R f). Notation scalar f := (linear_for *%R f). Notation lmorphism_for s f := (class_of s f). Notation lmorphism f := (lmorphism_for *:%R f). Coercion class_of_axiom : axiom >-> lmorphism_for. Coercion base : lmorphism_for >-> Additive.axiom. Coercion mixin : lmorphism_for >-> scalable. Coercion apply : map >-> Funclass. Notation Linear fL := (Pack (Phant _) fL). Notation AddLinear fZ := (pack fZ id). Notation "{ 'linear' fUV | s }" := (map s (Phant fUV)) (at level 0, format "{ 'linear' fUV | s }") : ring_scope. Notation "{ 'linear' fUV }" := {linear fUV | *:%R} (at level 0, format "{ 'linear' fUV }") : ring_scope. Notation "{ 'scalar' U }" := {linear U -> _ | *%R} (at level 0, format "{ 'scalar' U }") : ring_scope. Notation "[ 'linear' 'of' f 'as' g ]" := (@clone _ _ _ _ _ f g _ _ idfun id) (at level 0, format "[ 'linear' 'of' f 'as' g ]") : form_scope. Notation "[ 'linear' 'of' f ]" := (@clone _ _ _ _ _ f f _ _ id id) (at level 0, format "[ 'linear' 'of' f ]") : form_scope. Coercion additive : map >-> Additive.map. Canonical additive. Coercion map_for_map : map_for >-> map. Coercion unify_map_at : map_at >-> map_for. Canonical unify_map_at. Coercion unwrap : wrapped >-> map. Coercion wrap : map_class >-> wrapped. Canonical wrap. End Exports. End Linear. Include Linear.Exports. Section LinearTheory. Variable R : ringType. Section GenericProperties. Variables (U : lmodType R) (V : zmodType) (s : R -> V -> V) (k : unit). Variable f : {linear U -> V | s}. Lemma linear0 : f 0 = 0. Proof. exact: raddf0. Qed. Proof. (* Goal: @eq (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f (zero (@Lmodule.zmodType R (Phant (Ring.sort R)) U))) (zero V) *) exact: raddf0. Qed. Lemma linearD : {morph f : x y / x + y}. Proof. exact: raddfD. Qed. Proof. (* Goal: @morphism_2 (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (fun x y : Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U) => @add (@Lmodule.zmodType R (Phant (Ring.sort R)) U) x y) (fun x y : Zmodule.sort V => @add V x y) *) exact: raddfD. Qed. Lemma linearMn n : {morph f : x / x *+ n}. Proof. exact: raddfMn. Qed. Proof. (* Goal: @morphism_1 (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (fun x : Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U) => @natmul (@Lmodule.zmodType R (Phant (Ring.sort R)) U) x n) (fun x : Zmodule.sort V => @natmul V x n) *) exact: raddfMn. Qed. Lemma linear_sum I r (P : pred I) E : f (\sum_(i <- r | P i) E i) = \sum_(i <- r | P i) f (E i). Proof. (* Goal: @eq (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f (@BigOp.bigop (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) I (zero (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) r (fun i : I => @BigBody (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) I i (@add (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (P i) (E i)))) (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f (E i)))) *) exact: raddf_sum. Qed. Lemma linearP a : {morph f : u v / a *: u + v >-> s a u + v}. Proof. (* Goal: @morphism_2 (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (fun u v : Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U) => @add (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U a u) v) (fun u v : Zmodule.sort V => @add V (s a u) v) *) by move=> u v /=; rewrite linearD linearZ_LR. Qed. Fact locked_is_scalable : scalable_for s (locked_with k (f : U -> V)). Proof. (* Goal: @Linear.mixin_of R U V s (@locked_with k (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f : forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) *) by case: k f => [] [? []]. Qed. Canonical locked_linear := AddLinear locked_is_scalable. End GenericProperties. Section BidirectionalLinearZ. Variables (U : lmodType R) (V : zmodType) (s : R -> V -> V). Variables (S : ringType) (h : S -> V -> V) (h_law : Scale.law h). Lemma linearZ c a (h_c := Scale.op h_law c) (f : Linear.map_for U s a h_c) u : Proof. (* Goal: @eq (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) (@Linear.map_for_map R U V s a h_c f) (@scale R U a u)) (h_c (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) (@Linear.unwrap R U V s (@Linear.wrap R U V s (@Linear.map_for_map R U V s a h_c f))) u)) *) by rewrite linearZ_LR; case: f => f /= ->. Qed. End BidirectionalLinearZ. Section LmodProperties. Variables (U V : lmodType R) (f : {linear U -> V}). Lemma linearZZ : scalable f. Proof. exact: linearZ_LR. Qed. Proof. (* Goal: @Linear.mixin_of R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) V)) f) *) exact: linearZ_LR. Qed. Lemma can2_linear f' : cancel f f' -> cancel f' f -> linear f'. Proof. (* Goal: forall (_ : @cancel (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) V)) f) f') (_ : @cancel (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) f' (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) V)) f)), @Linear.axiom R V (@Lmodule.zmodType R (Phant (Ring.sort R)) U) (@scale R U) f' (@Scale.scale_law R U) (@Logic.eq_refl (forall (_ : Ring.sort R) (_ : Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U)))), Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U)))) (@scale R U)) *) by move=> fK f'K a x y /=; apply: (canLR fK); rewrite linearP !f'K. Qed. Lemma bij_linear : bijective f -> exists2 f' : {linear V -> U}, cancel f f' & cancel f' f. Proof. (* Goal: forall _ : @bijective (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) V)) f), @ex2 (@Linear.map R V (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) V, @Lmodule.sort R (Phant (Ring.sort R)) U))) (fun f' : @Linear.map R V (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) V, @Lmodule.sort R (Phant (Ring.sort R)) U)) => @cancel (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) V)) f) (@Linear.apply R V (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) V, @Lmodule.sort R (Phant (Ring.sort R)) U)) f')) (fun f' : @Linear.map R V (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) V, @Lmodule.sort R (Phant (Ring.sort R)) U)) => @cancel (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U)))) (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@Linear.apply R V (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) V, @Lmodule.sort R (Phant (Ring.sort R)) U)) f') (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) V)) f)) *) by case=> f' fK f'K; exists (Linear (can2_linear fK f'K)). Qed. Lemma scalarP : scalar f. Proof. exact: linearP. Qed. Proof. (* Goal: @Linear.axiom R U (Ring.zmodType R) (@mul R) (@Linear.apply R U (Ring.zmodType R) (@mul R) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort (Ring.zmodType R))) f) (Scale.mul_law R) (@Logic.eq_refl (forall (_ : Ring.sort R) (_ : Ring.sort R), Ring.sort R) (@mul R)) *) exact: linearP. Qed. Canonical idfun_linear := AddLinear idfun_is_scalable. Lemma opp_is_scalable : scalable (-%R : U -> U). Proof. (* Goal: @Linear.mixin_of R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U) (@opp (@Lmodule.zmodType R (Phant (Ring.sort R)) U) : forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) U) *) by move=> a v /=; rewrite scalerN. Qed. Canonical opp_linear := AddLinear opp_is_scalable. Lemma comp_is_scalable : scalable_for s (f \o h). Proof. (* Goal: @Linear.mixin_of R W V s (@funcomp (Zmodule.sort V) (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) W)) tt (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (@Linear.apply R W (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) U) (@Lmodule.class R (Phant (Ring.sort R)) U))) (@scale R U) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) W, @Lmodule.sort R (Phant (Ring.sort R)) U)) h)) *) by move=> a v /=; rewrite !linearZ_LR. Qed. Lemma null_fun_is_scalable : scalable_for (Scale.op s_law) (\0 : U -> V). Proof. (* Goal: @Linear.mixin_of R U V (@Scale.op R V s s_law) (@null_fun_head (@Lmodule.sort R (Phant (Ring.sort R)) U) V (Phant (Zmodule.sort V)) : forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V) *) by move=> a v /=; rewrite raddf0. Qed. Canonical null_fun_linear := AddLinear null_fun_is_scalable. Lemma add_fun_is_scalable : scalable_for s (f \+ g). Proof. (* Goal: @Linear.mixin_of R U V s (@add_fun_head (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) V tt (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (@Linear.apply R U V (@Scale.op R V s s_law) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) g)) *) by move=> a u; rewrite /= !linearZ_LR !Ds raddfD. Qed. Canonical add_fun_linear := AddLinear add_fun_is_scalable. Lemma sub_fun_is_scalable : scalable_for s (f \- g). Proof. (* Goal: @Linear.mixin_of R U V s (@sub_fun_head (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) V tt (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (@Linear.apply R U V (@Scale.op R V s s_law) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) g)) *) by move=> a u; rewrite /= !linearZ_LR !Ds raddfB. Qed. Canonical sub_fun_linear := AddLinear sub_fun_is_scalable. End LinearLmod. Section LinearLalg. Variables (A : lalgType R) (U : lmodType R). Variables (a : A) (f : {linear U -> A}). Fact mulr_fun_is_scalable : scalable (a \o* f). Proof. (* Goal: @Linear.mixin_of R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (@Lmodule.class R (Phant (Ring.sort R)) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)))) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (@mulr_fun_head (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) tt a (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)) (@Lmodule.class R (Phant (Ring.sort R)) (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)))) (@scale R (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lalgebra.sort R (Phant (Ring.sort R)) A)) f)) *) by move=> k x /=; rewrite linearZ scalerAl. Qed. Canonical mulr_fun_linear := AddLinear mulr_fun_is_scalable. End LinearLalg. End LinearTheory. Module LRMorphism. Section ClassDef. Variables (R : ringType) (A : lalgType R) (B : ringType) (s : R -> B -> B). Record class_of (f : A -> B) : Prop := Class {base : rmorphism f; mixin : scalable_for s f}. Local Coercion base : class_of >-> rmorphism. Definition base2 f (fLM : class_of f) := Linear.Class fLM (mixin fLM). Local Coercion base2 : class_of >-> lmorphism. Structure map (phAB : phant (A -> B)) := Pack {apply; _ : class_of apply}. Local Coercion apply : map >-> Funclass. Variables (phAB : phant (A -> B)) (f : A -> B) (cF : map phAB). Definition class := let: Pack _ c as cF' := cF return class_of cF' in c. Definition clone := fun (g : RMorphism.map phAB) fM & phant_id (RMorphism.class g) fM => fun (h : Linear.map s phAB) fZ & phant_id (Linear.mixin (Linear.class h)) fZ => Pack phAB (@Class f fM fZ). Definition pack (fZ : scalable_for s f) := fun (g : RMorphism.map phAB) fM & phant_id (RMorphism.class g) fM => Pack phAB (Class fM fZ). Canonical additive := Additive.Pack phAB class. Canonical rmorphism := RMorphism.Pack phAB class. Canonical linear := Linear.Pack phAB class. Canonical join_rmorphism := @RMorphism.Pack _ _ phAB linear class. Canonical join_linear := @Linear.Pack R A B s phAB rmorphism class. End ClassDef. Module Exports. Notation lrmorphism_for s f := (class_of s f). Notation lrmorphism f := (lrmorphism_for *:%R f). Coercion base : lrmorphism_for >-> RMorphism.class_of. Coercion base2 : lrmorphism_for >-> lmorphism_for. Coercion apply : map >-> Funclass. Notation LRMorphism f_lrM := (Pack (Phant _) (Class f_lrM f_lrM)). Notation AddLRMorphism fZ := (pack fZ id). Notation "{ 'lrmorphism' fAB | s }" := (map s (Phant fAB)) (at level 0, format "{ 'lrmorphism' fAB | s }") : ring_scope. Notation "{ 'lrmorphism' fAB }" := {lrmorphism fAB | *:%R} (at level 0, format "{ 'lrmorphism' fAB }") : ring_scope. Notation "[ 'lrmorphism' 'of' f ]" := (@clone _ _ _ _ _ f _ _ id _ _ id) (at level 0, format "[ 'lrmorphism' 'of' f ]") : form_scope. Coercion additive : map >-> Additive.map. Canonical additive. Coercion rmorphism : map >-> RMorphism.map. Canonical rmorphism. Coercion linear : map >-> Linear.map. Canonical linear. Canonical join_rmorphism. Canonical join_linear. End Exports. End LRMorphism. Include LRMorphism.Exports. Section LRMorphismTheory. Variables (R : ringType) (A B : lalgType R) (C : ringType) (s : R -> C -> C). Variables (k : unit) (f : {lrmorphism A -> B}) (g : {lrmorphism B -> C | s}). Definition idfun_lrmorphism := [lrmorphism of @idfun A]. Definition comp_lrmorphism := [lrmorphism of g \o f]. Definition locked_lrmorphism := [lrmorphism of locked_with k (f : A -> B)]. Lemma rmorph_alg a : f a%:A = a%:A. Proof. (* Goal: @eq (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) B)) (@LRMorphism.apply R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) A, @Lalgebra.sort R (Phant (Ring.sort R)) B)) f (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A) a (one (@Lalgebra.ringType R (Phant (Ring.sort R)) A)))) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B) a (one (@Lalgebra.ringType R (Phant (Ring.sort R)) B))) *) by rewrite linearZ rmorph1. Qed. Lemma can2_lrmorphism f' : cancel f f' -> cancel f' f -> lrmorphism f'. Proof. (* Goal: forall (_ : @cancel (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) B)) (@Lalgebra.sort R (Phant (Ring.sort R)) A) (@LRMorphism.apply R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) A, @Lalgebra.sort R (Phant (Ring.sort R)) B)) f) f') (_ : @cancel (@Lalgebra.sort R (Phant (Ring.sort R)) A) (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) B)) f' (@LRMorphism.apply R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) A, @Lalgebra.sort R (Phant (Ring.sort R)) B)) f)), @LRMorphism.class_of R B (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) f' *) by move=> fK f'K; split; [apply: (can2_rmorphism fK) | apply: (can2_linear fK)]. Qed. Lemma bij_lrmorphism : bijective f -> exists2 f' : {lrmorphism B -> A}, cancel f f' & cancel f' f. Proof. (* Goal: forall _ : @bijective (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) B)) (@Lalgebra.sort R (Phant (Ring.sort R)) A) (@LRMorphism.apply R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) A, @Lalgebra.sort R (Phant (Ring.sort R)) B)) f), @ex2 (@LRMorphism.map R B (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) B, @Lalgebra.sort R (Phant (Ring.sort R)) A))) (fun f' : @LRMorphism.map R B (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) B, @Lalgebra.sort R (Phant (Ring.sort R)) A)) => @cancel (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) B)) (@Lalgebra.sort R (Phant (Ring.sort R)) A) (@LRMorphism.apply R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) A, @Lalgebra.sort R (Phant (Ring.sort R)) B)) f) (@LRMorphism.apply R B (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) B, @Lalgebra.sort R (Phant (Ring.sort R)) A)) f')) (fun f' : @LRMorphism.map R B (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) B, @Lalgebra.sort R (Phant (Ring.sort R)) A)) => @cancel (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) A)) (@Lalgebra.sort R (Phant (Ring.sort R)) B) (@LRMorphism.apply R B (@Lalgebra.ringType R (Phant (Ring.sort R)) A) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) B, @Lalgebra.sort R (Phant (Ring.sort R)) A)) f') (@LRMorphism.apply R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) A, @Lalgebra.sort R (Phant (Ring.sort R)) B)) f)) *) by case/bij_rmorphism=> f' fK f'K; exists (AddLRMorphism (can2_linear fK f'K)). Qed. End LRMorphismTheory. Module ComRing. Definition RingMixin R one mul mulA mulC mul1x mul_addl := let mulx1 := Monoid.mulC_id mulC mul1x in let mul_addr := Monoid.mulC_dist mulC mul_addl in @Ring.EtaMixin R one mul mulA mul1x mulx1 mul_addl mul_addr. Section ClassDef. Record class_of R := Class {base : Ring.class_of R; mixin : commutative (Ring.mul base)}. Local Coercion base : class_of >-> Ring.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack mul0 (m0 : @commutative T T mul0) := fun bT b & phant_id (Ring.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Ring.class_of. Arguments mixin [R]. Coercion mixin : class_of >-> commutative. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Notation comRingType := type. Notation ComRingType T m := (@pack T _ m _ _ id _ id). Notation ComRingMixin := RingMixin. Notation "[ 'comRingType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'comRingType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'comRingType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'comRingType' 'of' T ]") : form_scope. End Exports. End ComRing. Import ComRing.Exports. Section ComRingTheory. Variable R : comRingType. Implicit Types x y : R. Lemma mulrC : @commutative R R *%R. Proof. by case: R => T []. Qed. Proof. (* Goal: @commutative (ComRing.sort R) (ComRing.sort R) (@mul (ComRing.ringType R)) *) by case: R => T []. Qed. Lemma mulrAC : @right_commutative R R *%R. Proof. exact: mulmAC. Qed. Proof. (* Goal: @right_commutative (ComRing.sort R) (ComRing.sort R) (@mul (ComRing.ringType R)) *) exact: mulmAC. Qed. Lemma exprMn n : {morph (fun x => x ^+ n) : x y / x * y}. Proof. (* Goal: @morphism_2 (ComRing.sort R) (Ring.sort (ComRing.ringType R)) (fun x : ComRing.sort R => @exp (ComRing.ringType R) x n) (fun x y : ComRing.sort R => @mul (ComRing.ringType R) x y) (fun x y : Ring.sort (ComRing.ringType R) => @mul (ComRing.ringType R) x y) *) by move=> x y; apply: exprMn_comm; apply: mulrC. Qed. Lemma prodrXl n I r (P : pred I) (F : I -> R) : \prod_(i <- r | P i) F i ^+ n = (\prod_(i <- r | P i) F i) ^+ n. Proof. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@BigOp.bigop (Ring.sort (ComRing.ringType R)) I (one (ComRing.ringType R)) r (fun i : I => @BigBody (Ring.sort (ComRing.ringType R)) I i (@mul (ComRing.ringType R)) (P i) (@exp (ComRing.ringType R) (F i) n))) (@exp (ComRing.ringType R) (@BigOp.bigop (Ring.sort (ComRing.ringType R)) I (one (ComRing.ringType R)) r (fun i : I => @BigBody (Ring.sort (ComRing.ringType R)) I i (@mul (ComRing.ringType R)) (P i) (F i))) n) *) by rewrite (big_morph _ (exprMn n) (expr1n _ n)). Qed. Lemma prodr_undup_exp_count (I : eqType) r (P : pred I) (F : I -> R) : \prod_(i <- undup r | P i) F i ^+ count_mem i r = \prod_(i <- r | P i) F i. Proof. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@BigOp.bigop (Ring.sort (ComRing.ringType R)) (Equality.sort I) (one (ComRing.ringType R)) (@undup I r) (fun i : Equality.sort I => @BigBody (Ring.sort (ComRing.ringType R)) (Equality.sort I) i (@mul (ComRing.ringType R)) (P i) (@exp (ComRing.ringType R) (F i) (@count (Equality.sort I) (@pred_of_simpl (Equality.sort I) (@pred1 I i)) r)))) (@BigOp.bigop (Ring.sort (ComRing.ringType R)) (Equality.sort I) (one (ComRing.ringType R)) r (fun i : Equality.sort I => @BigBody (Ring.sort (ComRing.ringType R)) (Equality.sort I) i (@mul (ComRing.ringType R)) (P i) (F i))) *) exact: big_undup_iterop_count. Qed. Lemma exprDn x y n : (x + y) ^+ n = \sum_(i < n.+1) (x ^+ (n - i) * y ^+ i) *+ 'C(n, i). Proof. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x y) n) (@BigOp.bigop (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType (ComRing.ringType R))) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (ordinal (S n)) i (@add (Ring.zmodType (ComRing.ringType R))) true (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) (@exp (ComRing.ringType R) x (subn n (@nat_of_ord (S n) i))) (@exp (ComRing.ringType R) y (@nat_of_ord (S n) i))) (binomial n (@nat_of_ord (S n) i))))) *) by rewrite exprDn_comm //; apply: mulrC. Qed. Lemma exprBn x y n : (x - y) ^+ n = \sum_(i < n.+1) ((-1) ^+ i * x ^+ (n - i) * y ^+ i) *+ 'C(n, i). Proof. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x (@opp (ComRing.zmodType R) y)) n) (@BigOp.bigop (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType (ComRing.ringType R))) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (ordinal (S n)) i (@add (Ring.zmodType (ComRing.ringType R))) true (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) (@mul (ComRing.ringType R) (@exp (ComRing.ringType R) (@opp (Ring.zmodType (ComRing.ringType R)) (one (ComRing.ringType R))) (@nat_of_ord (S n) i)) (@exp (ComRing.ringType R) x (subn n (@nat_of_ord (S n) i)))) (@exp (ComRing.ringType R) y (@nat_of_ord (S n) i))) (binomial n (@nat_of_ord (S n) i))))) *) by rewrite exprBn_comm //; apply: mulrC. Qed. Lemma subrXX x y n : x ^+ n - y ^+ n = (x - y) * (\sum_(i < n) x ^+ (n.-1 - i) * y ^+ i). Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x n) (@opp (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) y n))) (@mul (ComRing.ringType R) (@add (ComRing.zmodType R) x (@opp (ComRing.zmodType R) y)) (@BigOp.bigop (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (Finite.sort (ordinal_finType n)) (zero (Ring.zmodType (ComRing.ringType R))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (ordinal n) i (@add (Ring.zmodType (ComRing.ringType R))) true (@mul (ComRing.ringType R) (@exp (ComRing.ringType R) x (subn (Nat.pred n) (@nat_of_ord n i))) (@exp (ComRing.ringType R) y (@nat_of_ord n i)))))) *) by rewrite -subrXX_comm //; apply: mulrC. Qed. Lemma sqrrD x y : (x + y) ^+ 2 = x ^+ 2 + x * y *+ 2 + y ^+ 2. Proof. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x y) (S (S O))) (@add (Ring.zmodType (ComRing.ringType R)) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x (S (S O))) (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) x y) (S (S O)))) (@exp (ComRing.ringType R) y (S (S O)))) *) by rewrite exprDn !big_ord_recr big_ord0 /= add0r mulr1 mul1r. Qed. Lemma sqrrB x y : (x - y) ^+ 2 = x ^+ 2 - x * y *+ 2 + y ^+ 2. Proof. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x (@opp (ComRing.zmodType R) y)) (S (S O))) (@add (Ring.zmodType (ComRing.ringType R)) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x (S (S O))) (@opp (Ring.zmodType (ComRing.ringType R)) (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) x y) (S (S O))))) (@exp (ComRing.ringType R) y (S (S O)))) *) by rewrite sqrrD mulrN mulNrn sqrrN. Qed. Lemma subr_sqr x y : x ^+ 2 - y ^+ 2 = (x - y) * (x + y). Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x (S (S O))) (@opp (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) y (S (S O))))) (@mul (ComRing.ringType R) (@add (ComRing.zmodType R) x (@opp (ComRing.zmodType R) y)) (@add (ComRing.zmodType R) x y)) *) by rewrite subrXX !big_ord_recr big_ord0 /= add0r mulr1 mul1r. Qed. Lemma subr_sqrDB x y : (x + y) ^+ 2 - (x - y) ^+ 2 = x * y *+ 4. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x y) (S (S O))) (@opp (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x (@opp (ComRing.zmodType R) y)) (S (S O))))) (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) x y) (S (S (S (S O))))) *) rewrite sqrrD sqrrB -!(addrAC _ (y ^+ 2)) opprB. (* Goal: @eq (Zmodule.sort (Ring.zmodType (ComRing.ringType R))) (@add (Ring.zmodType (ComRing.ringType R)) (@add (Ring.zmodType (ComRing.ringType R)) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x (S (S O))) (@exp (ComRing.ringType R) y (S (S O)))) (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) x y) (S (S O)))) (@add (Ring.zmodType (ComRing.ringType R)) (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) x y) (S (S O))) (@opp (Ring.zmodType (ComRing.ringType R)) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x (S (S O))) (@exp (ComRing.ringType R) y (S (S O))))))) (@natmul (Ring.zmodType (ComRing.ringType R)) (@mul (ComRing.ringType R) x y) (S (S (S (S O))))) *) by rewrite addrC addrA subrK -mulrnDr. Qed. Section FrobeniusAutomorphism. Variables (p : nat) (charRp : p \in [char R]). Lemma Frobenius_aut_is_rmorphism : rmorphism (Frobenius_aut charRp). Proof. (* Goal: @RMorphism.class_of (ComRing.ringType R) (ComRing.ringType R) (@Frobenius_aut (ComRing.ringType R) p charRp) *) split=> [x y|]; first exact: Frobenius_autB_comm (mulrC _ _). (* Goal: @RMorphism.mixin_of (ComRing.ringType R) (ComRing.ringType R) (@Frobenius_aut (ComRing.ringType R) p charRp) *) split=> [x y|]; first exact: Frobenius_autM_comm (mulrC _ _). (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@Frobenius_aut (ComRing.ringType R) p charRp (one (ComRing.ringType R))) (one (ComRing.ringType R)) *) exact: Frobenius_aut1. Qed. Canonical Frobenius_aut_additive := Additive Frobenius_aut_is_rmorphism. Canonical Frobenius_aut_rmorphism := RMorphism Frobenius_aut_is_rmorphism. End FrobeniusAutomorphism. Lemma exprDn_char x y n : [char R].-nat n -> (x + y) ^+ n = x ^+ n + y ^+ n. Proof. (* Goal: forall _ : is_true (pnat (@char (ComRing.ringType R) (Phant (ComRing.sort R))) n), @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x y) n) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x n) (@exp (ComRing.ringType R) y n)) *) pose p := pdiv n; have [|n_gt1 charRn] := leqP n 1; first by case: (n) => [|[]]. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x y) n) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x n) (@exp (ComRing.ringType R) y n)) *) have charRp: p \in [char R] by rewrite (pnatPpi charRn) ?pi_pdiv. (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x y) n) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x n) (@exp (ComRing.ringType R) y n)) *) have{charRn} /p_natP[e ->]: p.-nat n by rewrite -(eq_pnat _ (charf_eq charRp)). (* Goal: @eq (Ring.sort (ComRing.ringType R)) (@exp (ComRing.ringType R) (@add (ComRing.zmodType R) x y) (expn p e)) (@add (Ring.zmodType (ComRing.ringType R)) (@exp (ComRing.ringType R) x (expn p e)) (@exp (ComRing.ringType R) y (expn p e))) *) by elim: e => // e IHe; rewrite !expnSr !exprM IHe -Frobenius_autE rmorphD. Qed. Lemma rmorph_comm (S : ringType) (f : {rmorphism R -> S}) x y : comm (f x) (f y). Proof. (* Goal: @comm S (@RMorphism.apply (ComRing.ringType R) S (Phant (forall _ : ComRing.sort R, Ring.sort S)) f x) (@RMorphism.apply (ComRing.ringType R) S (Phant (forall _ : ComRing.sort R, Ring.sort S)) f y) *) by red; rewrite -!rmorphM mulrC. Qed. Section ScaleLinear. Variables (U V : lmodType R) (b : R) (f : {linear U -> V}). Lemma scale_is_scalable : scalable ( *:%R b : V -> V). Proof. (* Goal: @Linear.mixin_of (ComRing.ringType R) V (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V))) (@scale (ComRing.ringType R) V) (@scale (ComRing.ringType R) V b : forall _ : @Lmodule.sort (ComRing.ringType R) (Phant (ComRing.sort R)) V, @Lmodule.sort (ComRing.ringType R) (Phant (ComRing.sort R)) V) *) by move=> a v /=; rewrite !scalerA mulrC. Qed. Canonical scale_linear := AddLinear scale_is_scalable. Lemma scale_fun_is_scalable : scalable (b \*: f). Proof. (* Goal: @Linear.mixin_of (ComRing.ringType R) U (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V))) (@scale (ComRing.ringType R) V) (@scale_fun_head (ComRing.ringType R) (Zmodule.sort (@Lmodule.zmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) U)) V tt b (@Linear.apply (ComRing.ringType R) U (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) V))) (@scale (ComRing.ringType R) V) (Phant (forall _ : @Lmodule.sort (ComRing.ringType R) (Phant (ComRing.sort R)) U, @Lmodule.sort (ComRing.ringType R) (Phant (ComRing.sort R)) V)) f)) *) by move=> a v /=; rewrite !linearZ. Qed. Canonical scale_fun_linear := AddLinear scale_fun_is_scalable. End ScaleLinear. End ComRingTheory. Module Algebra. Section Mixin. Variables (R : ringType) (A : lalgType R). Definition axiom := forall k (x y : A), k *: (x * y) = x * (k *: y). Lemma comm_axiom : phant A -> commutative (@mul A) -> axiom. Proof. (* Goal: forall (_ : phant (@Lalgebra.sort R (Phant (Ring.sort R)) A)) (_ : @commutative (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) A)) (Ring.sort (@Lalgebra.ringType R (Phant (Ring.sort R)) A)) (@mul (@Lalgebra.ringType R (Phant (Ring.sort R)) A))), axiom *) by move=> _ commA k x y; rewrite commA scalerAl commA. Qed. End Mixin. Section ClassDef. Variable R : ringType. Record class_of (T : Type) : Type := Class { base : Lalgebra.class_of R T; mixin : axiom (Lalgebra.Pack _ base) }. Local Coercion base : class_of >-> Lalgebra.class_of. Structure type (phR : phant R) := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (phR : phant R) (T : Type) (cT : type phR). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack phR T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (ax0 : @axiom R b0) := fun bT b & phant_id (@Lalgebra.class R phR bT) b => fun ax & phant_id ax0 ax => Pack phR (@Class T b ax). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition lmodType := @Lmodule.Pack R phR cT xclass. Definition lalgType := @Lalgebra.Pack R phR cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Lalgebra.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Coercion lmodType : type >-> Lmodule.type. Canonical lmodType. Coercion lalgType : type >-> Lalgebra.type. Canonical lalgType. Notation algType R := (type (Phant R)). Notation AlgType R A ax := (@pack _ (Phant R) A _ ax _ _ id _ id). Notation CommAlgType R A := (AlgType R A (comm_axiom (Phant A) (@mulrC _))). Notation "[ 'algType' R 'of' T 'for' cT ]" := (@clone _ (Phant R) T cT _ idfun) (at level 0, format "[ 'algType' R 'of' T 'for' cT ]") : form_scope. Notation "[ 'algType' R 'of' T ]" := (@clone _ (Phant R) T _ _ id) (at level 0, format "[ 'algType' R 'of' T ]") : form_scope. End Exports. End Algebra. Import Algebra.Exports. Section AlgebraTheory. Variables (R : comRingType) (A : algType R). Implicit Types (k : R) (x y : A). Lemma scalerAr k x y : k *: (x * y) = x * (k *: y). Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)))))) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) k (@mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x y)) (@mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) k y)) *) by case: A k x y => T []. Qed. Lemma scalerCA k x y : k *: x * y = x * (k *: y). Proof. (* Goal: @eq (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@mul (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) k x) y) (@mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) k y)) *) by rewrite -scalerAl scalerAr. Qed. Lemma mulr_algr a x : x * a%:A = a *: x. Proof. (* Goal: @eq (Ring.sort (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) (@mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) a (one (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))))) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) a x) *) by rewrite -scalerAr mulr1. Qed. Lemma exprZn k x n : (k *: x) ^+ n = k ^+ n *: x ^+ n. Proof. (* Goal: @eq (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@exp (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) k x) n) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@exp (ComRing.ringType R) k n) (@exp (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x n)) *) elim: n => [|n IHn]; first by rewrite !expr0 scale1r. (* Goal: @eq (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@exp (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) k x) (S n)) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@exp (ComRing.ringType R) k (S n)) (@exp (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x (S n))) *) by rewrite !exprS IHn -scalerA scalerAr scalerAl. Qed. Lemma scaler_prod I r (P : pred I) (F : I -> R) (G : I -> A) : \prod_(i <- r | P i) (F i *: G i) = \prod_(i <- r | P i) F i *: \prod_(i <- r | P i) G i. Proof. (* Goal: @eq (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@BigOp.bigop (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) I (one (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) r (fun i : I => @BigBody (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) I i (@mul (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (P i) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) (F i) (G i)))) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@BigOp.bigop (Ring.sort (ComRing.ringType R)) I (one (ComRing.ringType R)) r (fun i : I => @BigBody (Ring.sort (ComRing.ringType R)) I i (@mul (ComRing.ringType R)) (P i) (F i))) (@BigOp.bigop (Ring.sort (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) I (one (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) r (fun i : I => @BigBody (Ring.sort (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) I i (@mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) (P i) (G i)))) *) elim/big_rec3: _ => [|i x a _ _ ->]; first by rewrite scale1r. (* Goal: @eq (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@mul (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) (F i) (G i)) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) a x)) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@mul (ComRing.ringType R) (F i) a) (@mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) (G i) x)) *) by rewrite -scalerAl -scalerAr scalerA. Qed. Lemma scaler_prodl (I : finType) (S : pred I) (F : I -> A) k : \prod_(i in S) (k *: F i) = k ^+ #|S| *: \prod_(i in S) F i. Proof. (* Goal: @eq (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@BigOp.bigop (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (Finite.sort I) (one (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (Finite.sort I) i (@mul (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) S)) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) k (F i)))) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@exp (ComRing.ringType R) k (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) S))) (@BigOp.bigop (Ring.sort (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) (Finite.sort I) (one (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) (Finite.sort I) i (@mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A)) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) S)) (F i)))) *) by rewrite scaler_prod prodr_const. Qed. Lemma scaler_prodr (I : finType) (S : pred I) (F : I -> R) x : \prod_(i in S) (F i *: x) = \prod_(i in S) F i *: x ^+ #|S|. Proof. (* Goal: @eq (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@BigOp.bigop (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (Finite.sort I) (one (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (Finite.sort I) i (@mul (@Lalgebra.ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) S)) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A) (F i) x))) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@BigOp.bigop (Ring.sort (ComRing.ringType R)) (Finite.sort I) (one (ComRing.ringType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort (ComRing.ringType R)) (Finite.sort I) i (@mul (ComRing.ringType R)) (@in_mem (Finite.sort I) i (@mem (Finite.sort I) (predPredType (Finite.sort I)) S)) (F i))) (@exp (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x (@card I (@mem (Finite.sort I) (predPredType (Finite.sort I)) S)))) *) by rewrite scaler_prod prodr_const. Qed. Canonical regular_comRingType := [comRingType of R^o]. Canonical regular_algType := CommAlgType R R^o. Variables (U : lmodType R) (a : A) (f : {linear U -> A}). Lemma mull_fun_is_scalable : scalable (a \*o f). Proof. (* Goal: @Linear.mixin_of (ComRing.ringType R) U (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))))) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A))) (@mull_fun_head (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) (Zmodule.sort (@Lmodule.zmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) U)) tt a (@Linear.apply (ComRing.ringType R) U (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)))) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (Phant (forall _ : @Lmodule.sort (ComRing.ringType R) (Phant (ComRing.sort R)) U, @Algebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) A)) f)) *) by move=> k x /=; rewrite linearZ scalerAr. Qed. Canonical mull_fun_linear := AddLinear mull_fun_is_scalable. End AlgebraTheory. Module UnitRing. Record mixin_of (R : ringType) : Type := Mixin { unit : pred R; inv : R -> R; _ : {in unit, left_inverse 1 inv *%R}; _ : {in unit, right_inverse 1 inv *%R}; _ : forall x y, y * x = 1 /\ x * y = 1 -> unit x; _ : {in [predC unit], inv =1 id} }. Definition EtaMixin R unit inv mulVr mulrV unitP inv_out := let _ := @Mixin R unit inv mulVr mulrV unitP inv_out in @Mixin (Ring.Pack (Ring.class R)) unit inv mulVr mulrV unitP inv_out. Section ClassDef. Record class_of (R : Type) : Type := Class { base : Ring.class_of R; mixin : mixin_of (Ring.Pack base) }. Local Coercion base : class_of >-> Ring.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (m0 : mixin_of (@Ring.Pack T b0)) := fun bT b & phant_id (Ring.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Ring.class_of. Coercion mixin : class_of >-> mixin_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Notation unitRingType := type. Notation UnitRingType T m := (@pack T _ m _ _ id _ id). Notation UnitRingMixin := EtaMixin. Notation "[ 'unitRingType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'unitRingType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'unitRingType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'unitRingType' 'of' T ]") : form_scope. End Exports. End UnitRing. Import UnitRing.Exports. Definition unit {R : unitRingType} := [qualify a u : R | UnitRing.unit (UnitRing.class R) u]. Canonical unit_keyed R := KeyedQualifier (@unit_key R). Definition inv {R : unitRingType} : R -> R := UnitRing.inv (UnitRing.class R). Local Notation "x ^-1" := (inv x). Local Notation "x / y" := (x * y^-1). Local Notation "x ^- n" := ((x ^+ n)^-1). Section UnitRingTheory. Variable R : unitRingType. Implicit Types x y : R. Lemma divrr : {in unit, right_inverse 1 (@inv R) *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun x : UnitRing.sort R => @eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x (@inv R x)) (one (UnitRing.ringType R))) (inPhantom (@right_inverse (UnitRing.sort R) (UnitRing.sort R) (Ring.sort (UnitRing.ringType R)) (one (UnitRing.ringType R)) (@inv R) (@mul (UnitRing.ringType R)))) *) by case: R => T [? []]. Qed. Definition mulrV := divrr. Proof. (* Goal: @prop_in1 (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (@mem (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (predPredType (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T)) (@has_quality (Datatypes.S O) (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) unitT)) (fun x : @sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T => @eq (Ring.sort T') (@mul T' x (invT x)) (one T' : Ring.sort T')) (inPhantom (@right_inverse (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (Ring.sort T') (one T' : Ring.sort T') invT (@mul T'))) *) by move=> u Uu; apply: val_inj; rewrite val1 valM SubK mulrV. Qed. Lemma mulVr : {in unit, left_inverse 1 (@inv R) *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun x : UnitRing.sort R => @eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) (@inv R x) x) (one (UnitRing.ringType R))) (inPhantom (@left_inverse (UnitRing.sort R) (UnitRing.sort R) (Ring.sort (UnitRing.ringType R)) (one (UnitRing.ringType R)) (@inv R) (@mul (UnitRing.ringType R)))) *) by case: R => T [? []]. Qed. Lemma invr_out x : x \isn't a unit -> x^-1 = x. Proof. (* Goal: forall _ : is_true (negb (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))), @eq (UnitRing.sort R) (@inv R x) x *) by case: R x => T [? []]. Qed. Lemma unitrP x : reflect (exists y, y * x = 1 /\ x * y = 1) (x \is a unit). Proof. (* Goal: Bool.reflect (@ex (UnitRing.sort R) (fun y : UnitRing.sort R => and (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) y x) (one (UnitRing.ringType R))) (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (one (UnitRing.ringType R))))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) apply: (iffP idP) => [Ux | []]; last by case: R x => T [? []]. (* Goal: @ex (UnitRing.sort R) (fun y : UnitRing.sort R => and (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) y x) (one (UnitRing.ringType R))) (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (one (UnitRing.ringType R)))) *) by exists x^-1; rewrite divrr ?mulVr. Qed. Lemma mulKr : {in unit, left_loop (@inv R) *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun x : UnitRing.sort R => @cancel (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x) (@mul (UnitRing.ringType R) (@inv R x))) (inPhantom (@left_loop (UnitRing.sort R) (Ring.sort (UnitRing.ringType R)) (@inv R) (@mul (UnitRing.ringType R)))) *) by move=> x Ux y; rewrite mulrA mulVr ?mul1r. Qed. Lemma mulVKr : {in unit, rev_left_loop (@inv R) *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun x : UnitRing.sort R => @cancel (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) (@inv R x)) (@mul (UnitRing.ringType R) x)) (inPhantom (@rev_left_loop (UnitRing.sort R) (Ring.sort (UnitRing.ringType R)) (@inv R) (@mul (UnitRing.ringType R)))) *) by move=> x Ux y; rewrite mulrA mulrV ?mul1r. Qed. Lemma mulrK : {in unit, right_loop (@inv R) *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun y : UnitRing.sort R => @cancel (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (fun x : Ring.sort (UnitRing.ringType R) => @mul (UnitRing.ringType R) x y) (fun x : Ring.sort (UnitRing.ringType R) => @mul (UnitRing.ringType R) x (@inv R y))) (inPhantom (@right_loop (Ring.sort (UnitRing.ringType R)) (UnitRing.sort R) (@inv R) (@mul (UnitRing.ringType R)))) *) by move=> x Ux y; rewrite -mulrA divrr ?mulr1. Qed. Lemma mulrVK : {in unit, rev_right_loop (@inv R) *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun y : UnitRing.sort R => @cancel (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (fun x : Ring.sort (UnitRing.ringType R) => @mul (UnitRing.ringType R) x (@inv R y)) (fun x : Ring.sort (UnitRing.ringType R) => @mul (UnitRing.ringType R) x y)) (inPhantom (@rev_right_loop (Ring.sort (UnitRing.ringType R)) (UnitRing.sort R) (@inv R) (@mul (UnitRing.ringType R)))) *) by move=> x Ux y; rewrite -mulrA mulVr ?mulr1. Qed. Definition divrK := mulrVK. Lemma mulrI : {in @unit R, right_injective *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun y : Ring.sort (UnitRing.ringType R) => @injective (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) y)) (inPhantom (@right_injective (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R)))) *) by move=> x Ux; apply: can_inj (mulKr Ux). Qed. Lemma mulIr : {in @unit R, left_injective *%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun x : Ring.sort (UnitRing.ringType R) => @injective (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (fun x0 : Ring.sort (UnitRing.ringType R) => @mul (UnitRing.ringType R) x0 x)) (inPhantom (@left_injective (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R)))) *) by move=> x Ux; apply: can_inj (mulrK Ux). Qed. Lemma telescope_prodr n m (f : nat -> R) : (forall k, n < k < m -> f k \is a unit) -> n < m -> \prod_(n <= k < m) (f k / f k.+1) = f n / f m. Lemma commrV x y : comm x y -> comm x y^-1. Proof. (* Goal: forall _ : @comm (UnitRing.ringType R) x y, @comm (UnitRing.ringType R) x (@inv R y) *) have [Uy cxy | /invr_out-> //] := boolP (y \in unit). (* Goal: @comm (UnitRing.ringType R) x (@inv R y) *) by apply: (canLR (mulrK Uy)); rewrite -mulrA cxy mulKr. Qed. Lemma unitrE x : (x \is a unit) = (x / x == 1). Proof. (* Goal: @eq bool (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@eq_op (Ring.eqType (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x (@inv R x)) (one (UnitRing.ringType R))) *) apply/idP/eqP=> [Ux | xx1]; first exact: divrr. (* Goal: is_true (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by apply/unitrP; exists x^-1; rewrite -commrV. Qed. Lemma invrK : involutive (@inv R). Proof. (* Goal: @involutive (UnitRing.sort R) (@inv R) *) move=> x; case Ux: (x \in unit); last by rewrite !invr_out ?Ux. (* Goal: @eq (UnitRing.sort R) (@inv R (@inv R x)) x *) rewrite -(mulrK Ux _^-1) -mulrA commrV ?mulKr //. (* Goal: is_true (@in_mem (UnitRing.sort R) (@inv R x) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by apply/unitrP; exists x; rewrite divrr ?mulVr. Qed. Lemma invr_inj : injective (@inv R). Proof. (* Goal: @injective (UnitRing.sort R) (UnitRing.sort R) (@inv R) *) exact: inv_inj invrK. Qed. Lemma unitrV x : (x^-1 \in unit) = (x \in unit). Proof. (* Goal: @eq bool (@in_mem (UnitRing.sort R) (@inv R x) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by rewrite !unitrE invrK commrV. Qed. Lemma unitr1 : 1 \in @unit R. Proof. (* Goal: is_true (@in_mem (Ring.sort (UnitRing.ringType R)) (one (UnitRing.ringType R)) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by apply/unitrP; exists 1; rewrite mulr1. Qed. Lemma invr1 : 1^-1 = 1 :> R. Proof. (* Goal: @eq (UnitRing.sort R) (@inv R (one (UnitRing.ringType R))) (one (UnitRing.ringType R)) *) by rewrite -{2}(mulVr unitr1) mulr1. Qed. Lemma div1r x : 1 / x = x^-1. Proof. by rewrite mul1r. Qed. Proof. (* Goal: @eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) (one (UnitRing.ringType R)) (@inv R x)) (@inv R x) *) by rewrite mul1r. Qed. Lemma natr_div m d : d %| m -> d%:R \is a @unit R -> (m %/ d)%:R = m%:R / d%:R :> R. Proof. (* Goal: forall (_ : is_true (dvdn d m)) (_ : is_true (@in_mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) d) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))), @eq (UnitRing.sort R) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (divn m d)) (@mul (UnitRing.ringType R) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) m) (@inv R (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) d))) *) by rewrite dvdn_eq => /eqP def_m unit_d; rewrite -{2}def_m natrM mulrK. Qed. Lemma divrI : {in unit, right_injective (fun x y => x / y)}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun y : UnitRing.sort R => @injective (Ring.sort (UnitRing.ringType R)) (UnitRing.sort R) ((fun x y0 : UnitRing.sort R => @mul (UnitRing.ringType R) x (@inv R y0)) y)) (inPhantom (@right_injective (UnitRing.sort R) (UnitRing.sort R) (Ring.sort (UnitRing.ringType R)) (fun x y : UnitRing.sort R => @mul (UnitRing.ringType R) x (@inv R y)))) *) by move=> x /mulrI/inj_comp; apply; apply: invr_inj. Qed. Lemma divIr : {in unit, left_injective (fun x y => x / y)}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun x : UnitRing.sort R => @injective (Ring.sort (UnitRing.ringType R)) (UnitRing.sort R) (fun x0 : UnitRing.sort R => (fun x1 y : UnitRing.sort R => @mul (UnitRing.ringType R) x1 (@inv R y)) x0 x)) (inPhantom (@left_injective (UnitRing.sort R) (UnitRing.sort R) (Ring.sort (UnitRing.ringType R)) (fun x y : UnitRing.sort R => @mul (UnitRing.ringType R) x (@inv R y)))) *) by move=> x; rewrite -unitrV => /mulIr. Qed. Lemma unitr0 : (0 \is a @unit R) = false. Proof. (* Goal: @eq bool (@in_mem (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) false *) by apply/unitrP=> [[x [_ /esym/eqP]]]; rewrite mul0r oner_eq0. Qed. Lemma invr0 : 0^-1 = 0 :> R. Proof. (* Goal: @eq (UnitRing.sort R) (@inv R (zero (UnitRing.zmodType R))) (zero (UnitRing.zmodType R)) *) by rewrite invr_out ?unitr0. Qed. Lemma unitrN1 : -1 \is a @unit R. Proof. (* Goal: is_true (@in_mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by apply/unitrP; exists (-1); rewrite mulrNN mulr1. Qed. Lemma invrN1 : (-1)^-1 = -1 :> R. Proof. (* Goal: @eq (UnitRing.sort R) (@inv R (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)))) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) *) by rewrite -{2}(divrr unitrN1) mulN1r opprK. Qed. Lemma invr_sign n : ((-1) ^- n) = (-1) ^+ n :> R. Proof. (* Goal: @eq (UnitRing.sort R) (@inv R (@exp (UnitRing.ringType R) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) n)) (@exp (UnitRing.ringType R) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) n) *) by rewrite -signr_odd; case: (odd n); rewrite (invr1, invrN1). Qed. Lemma unitrMl x y : y \is a unit -> (x * y \is a unit) = (x \is a unit). Proof. (* Goal: forall _ : is_true (@in_mem (UnitRing.sort R) y (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))), @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) move=> Uy; wlog Ux: x y Uy / x \is a unit => [WHxy|]. (* Goal: @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) (* Goal: @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by apply/idP/idP=> Ux; first rewrite -(mulrK Uy x); rewrite WHxy ?unitrV. (* Goal: @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) rewrite Ux; apply/unitrP; exists (y^-1 * x^-1). (* Goal: and (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) (@mul (UnitRing.ringType R) (@inv R y) (@inv R x)) (@mul (UnitRing.ringType R) x y)) (one (UnitRing.ringType R))) (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) (@mul (UnitRing.ringType R) x y) (@mul (UnitRing.ringType R) (@inv R y) (@inv R x))) (one (UnitRing.ringType R))) *) by rewrite -!mulrA mulKr ?mulrA ?mulrK ?divrr ?mulVr. Qed. Lemma unitrMr x y : x \is a unit -> (x * y \is a unit) = (y \is a unit). Proof. (* Goal: forall _ : is_true (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))), @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) y (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) move=> Ux; apply/idP/idP=> [Uxy | Uy]; last by rewrite unitrMl. (* Goal: is_true (@in_mem (UnitRing.sort R) y (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by rewrite -(mulKr Ux y) unitrMl ?unitrV. Qed. Lemma invrM : {in unit &, forall x y, (x * y)^-1 = y^-1 * x^-1}. Proof. (* Goal: @prop_in2 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))) (fun x y : UnitRing.sort R => @eq (UnitRing.sort R) (@inv R (@mul (UnitRing.ringType R) x y)) (@mul (UnitRing.ringType R) (@inv R y) (@inv R x))) (inPhantom (forall x y : UnitRing.sort R, @eq (UnitRing.sort R) (@inv R (@mul (UnitRing.ringType R) x y)) (@mul (UnitRing.ringType R) (@inv R y) (@inv R x)))) *) move=> x y Ux Uy; have Uxy: (x * y \in unit) by rewrite unitrMl. (* Goal: @eq (UnitRing.sort R) (@inv R (@mul (UnitRing.ringType R) x y)) (@mul (UnitRing.ringType R) (@inv R y) (@inv R x)) *) by apply: (mulrI Uxy); rewrite divrr ?mulrA ?mulrK ?divrr. Qed. Lemma unitrM_comm x y : comm x y -> (x * y \is a unit) = (x \is a unit) && (y \is a unit). Proof. (* Goal: forall _ : @comm (UnitRing.ringType R) x y, @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (andb (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) y (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) *) move=> cxy; apply/idP/andP=> [Uxy | [Ux Uy]]; last by rewrite unitrMl. (* Goal: and (is_true (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) (is_true (@in_mem (UnitRing.sort R) y (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) *) suffices Ux: x \in unit by rewrite unitrMr in Uxy. (* Goal: is_true (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) apply/unitrP; case/unitrP: Uxy => z [zxy xyz]; exists (y * z). (* Goal: and (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) (@mul (UnitRing.ringType R) y z) x) (one (UnitRing.ringType R))) (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x (@mul (UnitRing.ringType R) y z)) (one (UnitRing.ringType R))) *) rewrite mulrA xyz -{1}[y]mul1r -{1}zxy cxy -!mulrA (mulrA x) (mulrA _ z) xyz. (* Goal: and (@eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) z (@mul (UnitRing.ringType R) y (@mul (UnitRing.ringType R) (one (UnitRing.ringType R)) x))) (one (UnitRing.ringType R))) (@eq (Ring.sort (UnitRing.ringType R)) (one (UnitRing.ringType R)) (one (UnitRing.ringType R))) *) by rewrite mul1r -cxy. Qed. Lemma unitrX x n : x \is a unit -> x ^+ n \is a unit. Proof. (* Goal: forall _ : is_true (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))), is_true (@in_mem (Ring.sort (UnitRing.ringType R)) (@exp (UnitRing.ringType R) x n) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by move=> Ux; elim: n => [|n IHn]; rewrite ?unitr1 // exprS unitrMl. Qed. Lemma unitrX_pos x n : n > 0 -> (x ^+ n \in unit) = (x \in unit). Proof. (* Goal: forall _ : is_true (leq (S O) n), @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@exp (UnitRing.ringType R) x n) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) case: n => // n _; rewrite exprS unitrM_comm; last exact: commrX. (* Goal: @eq bool (andb (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) (@exp (UnitRing.ringType R) x n) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by case Ux: (x \is a unit); rewrite // unitrX. Qed. Lemma exprVn x n : x^-1 ^+ n = x ^- n. Proof. (* Goal: @eq (Ring.sort (UnitRing.ringType R)) (@exp (UnitRing.ringType R) (@inv R x) n) (@inv R (@exp (UnitRing.ringType R) x n)) *) elim: n => [|n IHn]; first by rewrite !expr0 ?invr1. (* Goal: @eq (Ring.sort (UnitRing.ringType R)) (@exp (UnitRing.ringType R) (@inv R x) (S n)) (@inv R (@exp (UnitRing.ringType R) x (S n))) *) case Ux: (x \is a unit); first by rewrite exprSr exprS IHn -invrM // unitrX. (* Goal: @eq (Ring.sort (UnitRing.ringType R)) (@exp (UnitRing.ringType R) (@inv R x) (S n)) (@inv R (@exp (UnitRing.ringType R) x (S n))) *) by rewrite !invr_out ?unitrX_pos ?Ux. Qed. Lemma exprB m n x : n <= m -> x \is a unit -> x ^+ (m - n) = x ^+ m / x ^+ n. Proof. (* Goal: forall (_ : is_true (leq n m)) (_ : is_true (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))), @eq (Ring.sort (UnitRing.ringType R)) (@exp (UnitRing.ringType R) x (subn m n)) (@mul (UnitRing.ringType R) (@exp (UnitRing.ringType R) x m) (@inv R (@exp (UnitRing.ringType R) x n))) *) by move/subnK=> {2}<- Ux; rewrite exprD mulrK ?unitrX. Qed. Lemma invr_neq0 x : x != 0 -> x^-1 != 0. Proof. (* Goal: forall _ : is_true (negb (@eq_op (UnitRing.eqType R) x (zero (UnitRing.zmodType R)))), is_true (negb (@eq_op (UnitRing.eqType R) (@inv R x) (zero (UnitRing.zmodType R)))) *) move=> nx0; case Ux: (x \is a unit); last by rewrite invr_out ?Ux. (* Goal: is_true (negb (@eq_op (UnitRing.eqType R) (@inv R x) (zero (UnitRing.zmodType R)))) *) by apply/eqP=> x'0; rewrite -unitrV x'0 unitr0 in Ux. Qed. Lemma invr_eq0 x : (x^-1 == 0) = (x == 0). Proof. (* Goal: @eq bool (@eq_op (UnitRing.eqType R) (@inv R x) (zero (UnitRing.zmodType R))) (@eq_op (UnitRing.eqType R) x (zero (UnitRing.zmodType R))) *) by apply: negb_inj; apply/idP/idP; move/invr_neq0; rewrite ?invrK. Qed. Lemma invr_eq1 x : (x^-1 == 1) = (x == 1). Proof. (* Goal: @eq bool (@eq_op (UnitRing.eqType R) (@inv R x) (one (UnitRing.ringType R))) (@eq_op (UnitRing.eqType R) x (one (UnitRing.ringType R))) *) by rewrite (inv_eq invrK) invr1. Qed. Lemma rev_unitrP (x y : R^c) : y * x = 1 /\ x * y = 1 -> x \is a unit. Proof. (* Goal: forall _ : and (@eq (Ring.sort (converse_ringType (UnitRing.ringType R))) (@mul (converse_ringType (UnitRing.ringType R)) y x) (one (converse_ringType (UnitRing.ringType R)))) (@eq (Ring.sort (converse_ringType (UnitRing.ringType R))) (@mul (converse_ringType (UnitRing.ringType R)) x y) (one (converse_ringType (UnitRing.ringType R)))), is_true (@in_mem (converse (UnitRing.sort R)) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by case=> [yx1 xy1]; apply/unitrP; exists y. Qed. Definition converse_unitRingMixin := @UnitRing.Mixin _ ((unit : pred_class) : pred R^c) _ mulrV mulVr rev_unitrP invr_out. Canonical converse_unitRingType := UnitRingType R^c converse_unitRingMixin. Canonical regular_unitRingType := [unitRingType of R^o]. Section ClosedPredicates. Variables S : predPredType R. Definition invr_closed := {in S, forall x, x^-1 \in S}. Definition divr_2closed := {in S &, forall x y, x / y \in S}. Definition divr_closed := 1 \in S /\ divr_2closed. Definition sdivr_closed := -1 \in S /\ divr_2closed. Definition divring_closed := [/\ 1 \in S, subr_2closed S & divr_2closed]. Lemma divr_closedV : divr_closed -> invr_closed. Proof. (* Goal: forall _ : divr_closed, invr_closed *) by case=> S1 Sdiv x Sx; rewrite -[x^-1]mul1r Sdiv. Qed. Lemma divr_closedM : divr_closed -> mulr_closed S. Proof. (* Goal: forall _ : divr_closed, @mulr_closed (UnitRing.ringType R) S *) by case=> S1 Sdiv; split=> // x y Sx Sy; rewrite -[y]invrK -[y^-1]mul1r !Sdiv. Qed. Lemma sdivr_closed_div : sdivr_closed -> divr_closed. Proof. (* Goal: forall _ : sdivr_closed, divr_closed *) by case=> SN1 Sdiv; split; rewrite // -(divrr unitrN1) Sdiv. Qed. Lemma sdivr_closedM : sdivr_closed -> smulr_closed S. Proof. (* Goal: forall _ : sdivr_closed, @smulr_closed (UnitRing.ringType R) S *) by move=> Sdiv; have [_ SM] := divr_closedM (sdivr_closed_div Sdiv); case: Sdiv. Qed. Lemma divring_closedBM : divring_closed -> subring_closed S. Proof. (* Goal: forall _ : divring_closed, @subring_closed (UnitRing.ringType R) S *) by case=> S1 SB Sdiv; split=> //; case: divr_closedM. Qed. Lemma divring_closed_div : divring_closed -> sdivr_closed. Proof. (* Goal: forall _ : divring_closed, sdivr_closed *) case=> S1 SB Sdiv; split; rewrite ?zmod_closedN //. (* Goal: @zmod_closed (Ring.zmodType (UnitRing.ringType R)) S *) exact/subring_closedB/divring_closedBM. Qed. End ClosedPredicates. End UnitRingTheory. Arguments invrK {R}. Arguments invr_inj {R} [x1 x2]. Section UnitRingMorphism. Variables (R S : unitRingType) (f : {rmorphism R -> S}). Lemma rmorph_unit x : x \in unit -> f x \in unit. Lemma rmorphV : {in unit, {morph f: x / x^-1}}. Proof. (* Goal: @prop_in1 (UnitRing.sort R) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (Datatypes.S O) (UnitRing.sort R) (@unit R))) (fun x : Zmodule.sort (Ring.zmodType (UnitRing.ringType R)) => @eq (Zmodule.sort (Ring.zmodType (UnitRing.ringType S))) (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f ((fun x0 : Zmodule.sort (Ring.zmodType (UnitRing.ringType R)) => @inv R x0) x)) ((fun x0 : Zmodule.sort (Ring.zmodType (UnitRing.ringType S)) => @inv S x0) (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f x))) (inPhantom (@morphism_1 (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (Zmodule.sort (Ring.zmodType (UnitRing.ringType S))) (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f) (fun x : Zmodule.sort (Ring.zmodType (UnitRing.ringType R)) => @inv R x) (fun x : Zmodule.sort (Ring.zmodType (UnitRing.ringType S)) => @inv S x))) *) move=> x Ux; rewrite /= -[(f x)^-1]mul1r. (* Goal: @eq (UnitRing.sort S) (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f (@inv R x)) (@mul (UnitRing.ringType S) (one (UnitRing.ringType S)) (@inv S (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f x))) *) by apply: (canRL (mulrK (rmorph_unit Ux))); rewrite -rmorphM mulVr ?rmorph1. Qed. Lemma rmorph_div x y : y \in unit -> f (x / y) = f x / f y. Proof. (* Goal: forall _ : is_true (@in_mem (UnitRing.sort R) y (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (Datatypes.S O) (UnitRing.sort R) (@unit R)))), @eq (Zmodule.sort (Ring.zmodType (UnitRing.ringType S))) (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f (@mul (UnitRing.ringType R) x (@inv R y))) (@mul (UnitRing.ringType S) (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f x) (@inv S (@RMorphism.apply (UnitRing.ringType R) (UnitRing.ringType S) (Phant (forall _ : UnitRing.sort R, UnitRing.sort S)) f y))) *) by move=> Uy; rewrite rmorphM rmorphV. Qed. End UnitRingMorphism. Module ComUnitRing. Section Mixin. Variables (R : comRingType) (unit : pred R) (inv : R -> R). Hypothesis mulVx : {in unit, left_inverse 1 inv *%R}. Hypothesis unitPl : forall x y, y * x = 1 -> unit x. Fact mulC_mulrV : {in unit, right_inverse 1 inv *%R}. Proof. (* Goal: @prop_in1 (ComRing.sort R) (@mem (ComRing.sort R) (predPredType (ComRing.sort R)) unit) (fun x : ComRing.sort R => @eq (Ring.sort (ComRing.ringType R)) (@mul (ComRing.ringType R) x (inv x)) (one (ComRing.ringType R))) (inPhantom (@right_inverse (ComRing.sort R) (ComRing.sort R) (Ring.sort (ComRing.ringType R)) (one (ComRing.ringType R)) inv (@mul (ComRing.ringType R)))) *) by move=> x Ux /=; rewrite mulrC mulVx. Qed. Fact mulC_unitP x y : y * x = 1 /\ x * y = 1 -> unit x. Proof. (* Goal: forall _ : and (@eq (Ring.sort (ComRing.ringType R)) (@mul (ComRing.ringType R) y x) (one (ComRing.ringType R))) (@eq (Ring.sort (ComRing.ringType R)) (@mul (ComRing.ringType R) x y) (one (ComRing.ringType R))), is_true (unit x) *) by case=> yx _; apply: unitPl yx. Qed. Definition Mixin := UnitRingMixin mulVx mulC_mulrV mulC_unitP. Proof. (* Goal: mixin_of (IntegralDomain.unitRingType IdomainType) *) by []. Qed. End Mixin. Section ClassDef. Record class_of (R : Type) : Type := Class { base : ComRing.class_of R; mixin : UnitRing.mixin_of (Ring.Pack base) }. Local Coercion base : class_of >-> ComRing.class_of. Definition base2 R m := UnitRing.Class (@mixin R m). Local Coercion base2 : class_of >-> UnitRing.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack := fun bT b & phant_id (ComRing.class bT) (b : ComRing.class_of T) => fun mT m & phant_id (UnitRing.class mT) (@UnitRing.Class T b m) => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition comRingType := @ComRing.Pack cT xclass. Definition unitRingType := @UnitRing.Pack cT xclass. Definition com_unitRingType := @UnitRing.Pack comRingType xclass. End ClassDef. Module Import Exports. Coercion base : class_of >-> ComRing.class_of. Coercion mixin : class_of >-> UnitRing.mixin_of. Coercion base2 : class_of >-> UnitRing.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Coercion comRingType : type >-> ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> UnitRing.type. Canonical unitRingType. Canonical com_unitRingType. Notation comUnitRingType := type. Notation ComUnitRingMixin := Mixin. Notation "[ 'comUnitRingType' 'of' T ]" := (@pack T _ _ id _ _ id) (at level 0, format "[ 'comUnitRingType' 'of' T ]") : form_scope. End Exports. End ComUnitRing. Import ComUnitRing.Exports. Module UnitAlgebra. Section ClassDef. Variable R : ringType. Record class_of (T : Type) : Type := Class { base : Algebra.class_of R T; mixin : GRing.UnitRing.mixin_of (Ring.Pack base) }. Definition base2 R m := UnitRing.Class (@mixin R m). Local Coercion base : class_of >-> Algebra.class_of. Local Coercion base2 : class_of >-> UnitRing.class_of. Structure type (phR : phant R) := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (phR : phant R) (T : Type) (cT : type phR). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack := fun bT b & phant_id (@Algebra.class R phR bT) (b : Algebra.class_of R T) => fun mT m & phant_id (UnitRing.mixin (UnitRing.class mT)) m => Pack (Phant R) (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition unitRingType := @UnitRing.Pack cT xclass. Definition lmodType := @Lmodule.Pack R phR cT xclass. Definition lalgType := @Lalgebra.Pack R phR cT xclass. Definition algType := @Algebra.Pack R phR cT xclass. Definition lmod_unitRingType := @Lmodule.Pack R phR unitRingType xclass. Definition lalg_unitRingType := @Lalgebra.Pack R phR unitRingType xclass. Definition alg_unitRingType := @Algebra.Pack R phR unitRingType xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Algebra.class_of. Coercion base2 : class_of >-> UnitRing.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Coercion unitRingType : type >-> UnitRing.type. Canonical unitRingType. Coercion lmodType : type >-> Lmodule.type. Canonical lmodType. Coercion lalgType : type >-> Lalgebra.type. Canonical lalgType. Coercion algType : type >-> Algebra.type. Canonical algType. Canonical lmod_unitRingType. Canonical lalg_unitRingType. Canonical alg_unitRingType. Notation unitAlgType R := (type (Phant R)). Notation "[ 'unitAlgType' R 'of' T ]" := (@pack _ (Phant R) T _ _ id _ _ id) (at level 0, format "[ 'unitAlgType' R 'of' T ]") : form_scope. End Exports. End UnitAlgebra. Import UnitAlgebra.Exports. Section ComUnitRingTheory. Variable R : comUnitRingType. Implicit Types x y : R. Lemma unitrM x y : (x * y \in unit) = (x \in unit) && (y \in unit). Proof. (* Goal: @eq bool (@in_mem (Ring.sort (ComUnitRing.ringType R)) (@mul (ComUnitRing.ringType R) x y) (@mem (UnitRing.sort (ComUnitRing.unitRingType R)) (predPredType (UnitRing.sort (ComUnitRing.unitRingType R))) (@has_quality (S O) (UnitRing.sort (ComUnitRing.unitRingType R)) (@unit (ComUnitRing.unitRingType R))))) (andb (@in_mem (ComUnitRing.sort R) x (@mem (UnitRing.sort (ComUnitRing.unitRingType R)) (predPredType (UnitRing.sort (ComUnitRing.unitRingType R))) (@has_quality (S O) (UnitRing.sort (ComUnitRing.unitRingType R)) (@unit (ComUnitRing.unitRingType R))))) (@in_mem (ComUnitRing.sort R) y (@mem (UnitRing.sort (ComUnitRing.unitRingType R)) (predPredType (UnitRing.sort (ComUnitRing.unitRingType R))) (@has_quality (S O) (UnitRing.sort (ComUnitRing.unitRingType R)) (@unit (ComUnitRing.unitRingType R)))))) *) by apply: unitrM_comm; apply: mulrC. Qed. Lemma unitrPr x : reflect (exists y, x * y = 1) (x \in unit). Proof. (* Goal: Bool.reflect (@ex (ComUnitRing.sort R) (fun y : ComUnitRing.sort R => @eq (Ring.sort (ComUnitRing.ringType R)) (@mul (ComUnitRing.ringType R) x y) (one (ComUnitRing.ringType R)))) (@in_mem (ComUnitRing.sort R) x (@mem (UnitRing.sort (ComUnitRing.unitRingType R)) (predPredType (UnitRing.sort (ComUnitRing.unitRingType R))) (@has_quality (S O) (UnitRing.sort (ComUnitRing.unitRingType R)) (@unit (ComUnitRing.unitRingType R))))) *) by apply: (iffP (unitrP x)) => [[y []] | [y]]; exists y; rewrite // mulrC. Qed. Lemma mulr1_eq x y : x * y = 1 -> x^-1 = y. Proof. (* Goal: forall _ : @eq (Ring.sort (ComUnitRing.ringType R)) (@mul (ComUnitRing.ringType R) x y) (one (ComUnitRing.ringType R)), @eq (UnitRing.sort (ComUnitRing.unitRingType R)) (@inv (ComUnitRing.unitRingType R) x) y *) by move=> xy_eq1; rewrite -[LHS]mulr1 -xy_eq1; apply/mulKr/unitrPr; exists y. Qed. Lemma divKr x : x \is a unit -> {in unit, involutive (fun y => x / y)}. Proof. (* Goal: forall _ : is_true (@in_mem (ComUnitRing.sort R) x (@mem (UnitRing.sort (ComUnitRing.unitRingType R)) (predPredType (UnitRing.sort (ComUnitRing.unitRingType R))) (@has_quality (S O) (UnitRing.sort (ComUnitRing.unitRingType R)) (@unit (ComUnitRing.unitRingType R))))), @prop_in1 (UnitRing.sort (ComUnitRing.unitRingType R)) (@mem (UnitRing.sort (ComUnitRing.unitRingType R)) (predPredType (UnitRing.sort (ComUnitRing.unitRingType R))) (@has_quality (S O) (UnitRing.sort (ComUnitRing.unitRingType R)) (@unit (ComUnitRing.unitRingType R)))) (fun x0 : ComUnitRing.sort R => @eq (ComUnitRing.sort R) ((fun y : ComUnitRing.sort R => @mul (ComUnitRing.ringType R) x (@inv (ComUnitRing.unitRingType R) y)) ((fun y : ComUnitRing.sort R => @mul (ComUnitRing.ringType R) x (@inv (ComUnitRing.unitRingType R) y)) x0)) x0) (inPhantom (@involutive (ComUnitRing.sort R) (fun y : ComUnitRing.sort R => @mul (ComUnitRing.ringType R) x (@inv (ComUnitRing.unitRingType R) y)))) *) by move=> Ux y Uy; rewrite /= invrM ?unitrV // invrK mulrC divrK. Qed. Lemma expr_div_n x y n : (x / y) ^+ n = x ^+ n / y ^+ n. Proof. (* Goal: @eq (Ring.sort (ComUnitRing.ringType R)) (@exp (ComUnitRing.ringType R) (@mul (ComUnitRing.ringType R) x (@inv (ComUnitRing.unitRingType R) y)) n) (@mul (ComUnitRing.ringType R) (@exp (ComUnitRing.ringType R) x n) (@inv (ComUnitRing.unitRingType R) (@exp (ComUnitRing.ringType R) y n))) *) by rewrite exprMn exprVn. Qed. Canonical regular_comUnitRingType := [comUnitRingType of R^o]. Canonical regular_unitAlgType := [unitAlgType R of R^o]. End ComUnitRingTheory. Section UnitAlgebraTheory. Variable (R : comUnitRingType) (A : unitAlgType R). Implicit Types (k : R) (x y : A). Lemma scaler_injl : {in unit, @right_injective R A A *:%R}. Proof. (* Goal: @prop_in1 (UnitRing.sort (ComUnitRing.unitRingType R)) (@mem (UnitRing.sort (ComUnitRing.unitRingType R)) (predPredType (UnitRing.sort (ComUnitRing.unitRingType R))) (@has_quality (S O) (UnitRing.sort (ComUnitRing.unitRingType R)) (@unit (ComUnitRing.unitRingType R)))) (fun y : ComUnitRing.sort R => @injective (@UnitAlgebra.sort (ComUnitRing.ringType R) (Phant (ComUnitRing.sort R)) A) (@UnitAlgebra.sort (ComUnitRing.ringType R) (Phant (ComUnitRing.sort R)) A) (@scale (ComUnitRing.ringType R) (@UnitAlgebra.lmodType (ComUnitRing.ringType R) (Phant (Ring.sort (ComUnitRing.ringType R))) A) y)) (inPhantom (@right_injective (ComUnitRing.sort R) (@UnitAlgebra.sort (ComUnitRing.ringType R) (Phant (ComUnitRing.sort R)) A) (@UnitAlgebra.sort (ComUnitRing.ringType R) (Phant (ComUnitRing.sort R)) A) (@scale (ComUnitRing.ringType R) (@UnitAlgebra.lmodType (ComUnitRing.ringType R) (Phant (Ring.sort (ComUnitRing.ringType R))) A)))) *) move=> k Uk x1 x2 Hx1x2. (* Goal: @eq (@UnitAlgebra.sort (ComUnitRing.ringType R) (Phant (ComUnitRing.sort R)) A) x1 x2 *) by rewrite -[x1]scale1r -(mulVr Uk) -scalerA Hx1x2 scalerA mulVr // scale1r. Qed. Lemma scaler_unit k x : k \in unit -> (k *: x \in unit) = (x \in unit). Lemma invrZ k x : k \in unit -> x \in unit -> (k *: x)^-1 = k^-1 *: x^-1. Section ClosedPredicates. Variables S : predPredType A. Definition divalg_closed := [/\ 1 \in S, linear_closed S & divr_2closed S]. Lemma divalg_closedBdiv : divalg_closed -> divring_closed S. Proof. (* Goal: forall _ : divalg_closed, @divring_closed (@UnitAlgebra.unitRingType (ComUnitRing.ringType R) (Phant (ComUnitRing.sort R)) A) S *) by case=> S1 /linear_closedB. Qed. Lemma divalg_closedZ : divalg_closed -> subalg_closed S. Proof. (* Goal: forall _ : divalg_closed, @subalg_closed (ComUnitRing.ringType R) (@UnitAlgebra.lalgType (ComUnitRing.ringType R) (Phant (Ring.sort (ComUnitRing.ringType R))) A) S *) by case=> S1 Slin Sdiv; split=> //; have [] := @divr_closedM A S. Qed. Fact semiring_mulr R S : @semiring R S -> mulr_closed S. Proof. by []. Qed. Proof. (* Goal: forall _ : @semiring R S, @mulr_closed R S *) by []. Qed. Fact submod_scaler R V S : @submod R V S -> scaler_closed S. Proof. by []. Qed. Proof. (* Goal: forall _ : @submod R V S, @scaler_closed R V S *) by []. Qed. Fact sdiv_invr R S : @sdiv R S -> invr_closed S. Proof. by []. Qed. Proof. (* Goal: forall _ : @sdiv R S, @invr_closed R S *) by []. Qed. Fact divring_invr R S : @divring R S -> invr_closed S. Proof. by []. Qed. Proof. (* Goal: forall _ : @divring R S, @invr_closed R S *) by []. Qed. Definition zmod_opp R S (addS : @zmod R S) := Opp (add_key (zmod_add addS)) (zmod_oppr addS). Definition semiring_mul R S (ringS : @semiring R S) := Mul (add_key (semiring_add ringS)) (semiring_mulr ringS). Definition smul_mul R S (mulS : @smul R S) := Mul (opp_key (smul_opp mulS)) (smul_mulr mulS). Definition subring_semi R S (ringS : @subring R S) := Semiring (zmod_add (subring_zmod ringS)) (subring_mulr ringS). Definition subring_smul R S (ringS : @subring R S) := Smul (zmod_opp (subring_zmod ringS)) (subring_mulr ringS). Definition sdiv_div R S (divS : @sdiv R S) := Div (smul_mul (sdiv_smul divS)) (sdiv_invr divS). Definition subalg_submod R A S (algS : @subalg R A S) := Submod (subring_zmod (subalg_ring algS)) (subalg_scaler algS). Definition divring_sdiv R S (ringS : @divring R S) := Sdiv (subring_smul (divring_ring ringS)) (divring_invr ringS). Definition divalg_alg R A S (algS : @divalg R A S) := Subalg (divring_ring (divalg_ring algS)) (divalg_scaler algS). End Subtyping. Section Extensionality. Lemma opp_ext (U : zmodType) S k (kS : @keyed_pred U S k) : oppr_closed kS -> oppr_closed S. Proof. (* Goal: forall _ : @oppr_closed U (@unkey_pred (Zmodule.sort U) S k kS), @oppr_closed U S *) by move=> oppS x; rewrite -!(keyed_predE kS); apply: oppS. Qed. Lemma add_ext (U : zmodType) S k (kS : @keyed_pred U S k) : addr_closed kS -> addr_closed S. Proof. (* Goal: forall _ : @addr_closed U (@unkey_pred (Zmodule.sort U) S k kS), @addr_closed U S *) by case=> S0 addS; split=> [|x y]; rewrite -!(keyed_predE kS) //; apply: addS. Qed. Lemma mul_ext (R : ringType) S k (kS : @keyed_pred R S k) : mulr_closed kS -> mulr_closed S. Proof. (* Goal: forall _ : @mulr_closed R (@unkey_pred (Ring.sort R) S k kS), @mulr_closed R S *) by case=> S1 mulS; split=> [|x y]; rewrite -!(keyed_predE kS) //; apply: mulS. Qed. Lemma scale_ext (R : ringType) (U : lmodType R) S k (kS : @keyed_pred U S k) : scaler_closed kS -> scaler_closed S. Proof. (* Goal: forall _ : @scaler_closed R U (@unkey_pred (@Lmodule.sort R (Phant (Ring.sort R)) U) S k kS), @scaler_closed R U S *) by move=> linS a x; rewrite -!(keyed_predE kS); apply: linS. Qed. Lemma inv_ext (R : unitRingType) S k (kS : @keyed_pred R S k) : invr_closed kS -> invr_closed S. Proof. (* Goal: forall _ : @invr_closed R (@unkey_pred (UnitRing.sort R) S k kS), @invr_closed R S *) by move=> invS x; rewrite -!(keyed_predE kS); apply: invS. Qed. End Extensionality. Module Default. Definition opp V S oppS := @Opp V S (DefaultPredKey S) oppS. Definition add V S addS := @Add V S (DefaultPredKey S) addS. Definition mul R S mulS := @Mul R S (DefaultPredKey S) mulS. Definition zmod V S addS oppS := @Zmod V S (add addS) oppS. Definition semiring R S addS mulS := @Semiring R S (add addS) mulS. Definition smul R S oppS mulS := @Smul R S (opp oppS) mulS. Definition div R S mulS invS := @Div R S (mul mulS) invS. Definition submod R V S addS oppS linS := @Submod R V S (zmod addS oppS) linS. Definition subring R S addS oppS mulS := @Subring R S (zmod addS oppS) mulS. Definition sdiv R S oppS mulS invS := @Sdiv R S (smul oppS mulS) invS. Definition subalg R A S addS oppS mulS linS := @Subalg R A S (subring addS oppS mulS) linS. Definition divring R S addS oppS mulS invS := @Divring R S (subring addS oppS mulS) invS. Definition divalg R A S addS oppS mulS invS linS := @Divalg R A S (divring addS oppS mulS invS) linS. End Default. Module Exports. Notation oppr_closed := oppr_closed. Notation addr_closed := addr_closed. Notation mulr_closed := mulr_closed. Notation zmod_closed := zmod_closed. Notation smulr_closed := smulr_closed. Notation invr_closed := invr_closed. Notation divr_closed := divr_closed. Notation scaler_closed := scaler_closed. Notation linear_closed := linear_closed. Notation submod_closed := submod_closed. Notation semiring_closed := semiring_closed. Notation subring_closed := subring_closed. Notation sdivr_closed := sdivr_closed. Notation subalg_closed := subalg_closed. Notation divring_closed := divring_closed. Notation divalg_closed := divalg_closed. Coercion zmod_closedD : zmod_closed >-> addr_closed. Coercion zmod_closedN : zmod_closed >-> oppr_closed. Coercion smulr_closedN : smulr_closed >-> oppr_closed. Coercion smulr_closedM : smulr_closed >-> mulr_closed. Coercion divr_closedV : divr_closed >-> invr_closed. Coercion divr_closedM : divr_closed >-> mulr_closed. Coercion submod_closedZ : submod_closed >-> scaler_closed. Coercion submod_closedB : submod_closed >-> zmod_closed. Coercion semiring_closedD : semiring_closed >-> addr_closed. Coercion semiring_closedM : semiring_closed >-> mulr_closed. Coercion subring_closedB : subring_closed >-> zmod_closed. Coercion subring_closedM : subring_closed >-> smulr_closed. Coercion subring_closed_semi : subring_closed >-> semiring_closed. Coercion sdivr_closedM : sdivr_closed >-> smulr_closed. Coercion sdivr_closed_div : sdivr_closed >-> divr_closed. Coercion subalg_closedZ : subalg_closed >-> submod_closed. Coercion subalg_closedBM : subalg_closed >-> subring_closed. Coercion divring_closedBM : divring_closed >-> subring_closed. Coercion divring_closed_div : divring_closed >-> sdivr_closed. Coercion divalg_closedZ : divalg_closed >-> subalg_closed. Coercion divalg_closedBdiv : divalg_closed >-> divring_closed. Coercion opp_key : opp >-> pred_key. Coercion add_key : add >-> pred_key. Coercion mul_key : mul >-> pred_key. Coercion zmod_opp : zmod >-> opp. Canonical zmod_opp. Coercion zmod_add : zmod >-> add. Coercion semiring_add : semiring >-> add. Coercion semiring_mul : semiring >-> mul. Canonical semiring_mul. Coercion smul_opp : smul >-> opp. Coercion smul_mul : smul >-> mul. Canonical smul_mul. Coercion div_mul : div >-> mul. Coercion submod_zmod : submod >-> zmod. Coercion subring_zmod : subring >-> zmod. Coercion subring_semi : subring >-> semiring. Canonical subring_semi. Coercion subring_smul : subring >-> smul. Canonical subring_smul. Coercion sdiv_smul : sdiv >-> smul. Coercion sdiv_div : sdiv >-> div. Canonical sdiv_div. Coercion subalg_submod : subalg >-> submod. Canonical subalg_submod. Coercion subalg_ring : subalg >-> subring. Coercion divring_ring : divring >-> subring. Coercion divring_sdiv : divring >-> sdiv. Canonical divring_sdiv. Coercion divalg_alg : divalg >-> subalg. Canonical divalg_alg. Coercion divalg_ring : divalg >-> divring. Notation opprPred := opp. Notation addrPred := add. Notation mulrPred := mul. Notation zmodPred := zmod. Notation semiringPred := semiring. Notation smulrPred := smul. Notation divrPred := div. Notation submodPred := submod. Notation subringPred := subring. Notation sdivrPred := sdiv. Notation subalgPred := subalg. Notation divringPred := divring. Notation divalgPred := divalg. Definition OpprPred U S k kS NkS := Opp k (@opp_ext U S k kS NkS). Definition AddrPred U S k kS DkS := Add k (@add_ext U S k kS DkS). Definition MulrPred R S k kS MkS := Mul k (@mul_ext R S k kS MkS). Definition ZmodPred U S k kS NkS := Zmod k (@opp_ext U S k kS NkS). Definition SemiringPred R S k kS MkS := Semiring k (@mul_ext R S k kS MkS). Definition SmulrPred R S k kS MkS := Smul k (@mul_ext R S k kS MkS). Definition DivrPred R S k kS VkS := Div k (@inv_ext R S k kS VkS). Definition SubmodPred R U S k kS ZkS := Submod k (@scale_ext R U S k kS ZkS). Definition SubringPred R S k kS MkS := Subring k (@mul_ext R S k kS MkS). Definition SdivrPred R S k kS VkS := Sdiv k (@inv_ext R S k kS VkS). Definition SubalgPred (R : ringType) (A : lalgType R) S k kS ZkS := Subalg k (@scale_ext R A S k kS ZkS). Definition DivringPred R S k kS VkS := Divring k (@inv_ext R S k kS VkS). Definition DivalgPred (R : ringType) (A : unitAlgType R) S k kS ZkS := Divalg k (@scale_ext R A S k kS ZkS). End Exports. End Pred. Import Pred.Exports. Module DefaultPred. Canonical Pred.Default.opp. Canonical Pred.Default.add. Canonical Pred.Default.mul. Canonical Pred.Default.zmod. Canonical Pred.Default.semiring. Canonical Pred.Default.smul. Canonical Pred.Default.div. Canonical Pred.Default.submod. Canonical Pred.Default.subring. Canonical Pred.Default.sdiv. Canonical Pred.Default.subalg. Canonical Pred.Default.divring. Canonical Pred.Default.divalg. End DefaultPred. Section ZmodulePred. Variables (V : zmodType) (S : predPredType V). Section Add. Variables (addS : addrPred S) (kS : keyed_pred addS). Lemma rpred0D : addr_closed kS. Proof. (* Goal: @addr_closed V (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS) *) by split=> [|x y]; rewrite !keyed_predE; case: addS => _ [_]//; apply. Qed. Lemma rpred0 : 0 \in kS. Proof. (* Goal: is_true (@in_mem (Zmodule.sort V) (zero V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS))) *) by case: rpred0D. Qed. Lemma rpredD : {in kS &, forall u v, u + v \in kS}. Proof. (* Goal: @prop_in2 (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS)) (fun u v : Zmodule.sort V => is_true (@in_mem (Zmodule.sort V) (@add V u v) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS)))) (inPhantom (forall u v : Zmodule.sort V, is_true (@in_mem (Zmodule.sort V) (@add V u v) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS))))) *) by case: rpred0D. Qed. Lemma rpred_sum I r (P : pred I) F : (forall i, P i -> F i \in kS) -> \sum_(i <- r | P i) F i \in kS. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@in_mem (Zmodule.sort V) (F i) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS))), is_true (@in_mem (Zmodule.sort V) (@BigOp.bigop (Zmodule.sort V) I (zero V) r (fun i : I => @BigBody (Zmodule.sort V) I i (@add V) (P i) (F i))) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS))) *) by move=> IH; elim/big_ind: _; [apply: rpred0 | apply: rpredD |]. Qed. Lemma rpredMn n : {in kS, forall u, u *+ n \in kS}. Proof. (* Goal: @prop_in1 (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS)) (fun u : Zmodule.sort V => is_true (@in_mem (Zmodule.sort V) (@natmul V u n) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS)))) (inPhantom (forall u : Zmodule.sort V, is_true (@in_mem (Zmodule.sort V) (@natmul V u n) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.add_key V S addS) kS))))) *) by move=> u Su; rewrite -(card_ord n) -sumr_const rpred_sum. Qed. End Add. Section Opp. Variables (oppS : opprPred S) (kS : keyed_pred oppS). Lemma rpredNr : oppr_closed kS. Proof. (* Goal: @oppr_closed V (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S oppS) kS) *) by move=> x; rewrite !keyed_predE; case: oppS => _; apply. Qed. Lemma rpredN : {mono -%R: u / u \in kS}. Proof. (* Goal: @monomorphism_1 (Zmodule.sort V) (Zmodule.sort V) bool (@opp V) (fun u : Zmodule.sort V => @in_mem (Zmodule.sort V) u (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S oppS) kS))) (fun u : Zmodule.sort V => @in_mem (Zmodule.sort V) u (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S oppS) kS))) *) by move=> u; apply/idP/idP=> /rpredNr; rewrite ?opprK; apply. Qed. End Opp. Section Sub. Variables (subS : zmodPred S) (kS : keyed_pred subS). Lemma rpredB : {in kS &, forall u v, u - v \in kS}. Proof. (* Goal: @prop_in2 (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)) (fun u v : Zmodule.sort V => is_true (@in_mem (Zmodule.sort V) (@add V u (@opp V v)) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) (inPhantom (forall u v : Zmodule.sort V, is_true (@in_mem (Zmodule.sort V) (@add V u (@opp V v)) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))))) *) by move=> u v Su Sv; rewrite /= rpredD ?rpredN. Qed. Lemma rpredMNn n : {in kS, forall u, u *- n \in kS}. Proof. (* Goal: @prop_in1 (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)) (fun u : Zmodule.sort V => is_true (@in_mem (Zmodule.sort V) (@opp V (@natmul V u n)) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) (inPhantom (forall u : Zmodule.sort V, is_true (@in_mem (Zmodule.sort V) (@opp V (@natmul V u n)) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))))) *) by move=> u Su; rewrite /= rpredN rpredMn. Qed. Lemma rpredDr x y : x \in kS -> (y + x \in kS) = (y \in kS). Proof. (* Goal: forall _ : is_true (@in_mem (Zmodule.sort V) x (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))), @eq bool (@in_mem (Zmodule.sort V) (@add V y x) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) (@in_mem (Zmodule.sort V) y (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) *) move=> Sx; apply/idP/idP=> [Sxy | /rpredD-> //]. (* Goal: is_true (@in_mem (Zmodule.sort V) y (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) *) by rewrite -(addrK x y) rpredB. Qed. Lemma rpredDl x y : x \in kS -> (x + y \in kS) = (y \in kS). Proof. (* Goal: forall _ : is_true (@in_mem (Zmodule.sort V) x (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))), @eq bool (@in_mem (Zmodule.sort V) (@add V x y) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) (@in_mem (Zmodule.sort V) y (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) *) by rewrite addrC; apply: rpredDr. Qed. Lemma rpredBr x y : x \in kS -> (y - x \in kS) = (y \in kS). Proof. (* Goal: forall _ : is_true (@in_mem (Zmodule.sort V) x (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))), @eq bool (@in_mem (Zmodule.sort V) (@add V y (@opp V x)) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) (@in_mem (Zmodule.sort V) y (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) *) by rewrite -rpredN; apply: rpredDr. Qed. Lemma rpredBl x y : x \in kS -> (x - y \in kS) = (y \in kS). Proof. (* Goal: forall _ : is_true (@in_mem (Zmodule.sort V) x (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))), @eq bool (@in_mem (Zmodule.sort V) (@add V x (@opp V y)) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) (@in_mem (Zmodule.sort V) y (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS))) *) by rewrite -(rpredN _ y); apply: rpredDl. Qed. End Sub. End ZmodulePred. Section RingPred. Variables (R : ringType) (S : predPredType R). Lemma rpredMsign (oppS : opprPred S) (kS : keyed_pred oppS) n x : ((-1) ^+ n * x \in kS) = (x \in kS). Proof. (* Goal: @eq bool (@in_mem (Ring.sort R) (@mul R (@exp R (@opp (Ring.zmodType R) (one R)) n) x) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S oppS) kS))) (@in_mem (Ring.sort R) x (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S oppS) kS))) *) by rewrite -signr_odd mulr_sign; case: ifP => // _; rewrite rpredN. Qed. Section Mul. Variables (mulS : mulrPred S) (kS : keyed_pred mulS). Lemma rpred1M : mulr_closed kS. Proof. (* Goal: @mulr_closed R (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS) *) by split=> [|x y]; rewrite !keyed_predE; case: mulS => _ [_] //; apply. Qed. Lemma rpred1 : 1 \in kS. Proof. (* Goal: is_true (@in_mem (Ring.sort R) (one R) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS))) *) by case: rpred1M. Qed. Lemma rpredM : {in kS &, forall u v, u * v \in kS}. Proof. (* Goal: @prop_in2 (Ring.sort R) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS)) (fun u v : Ring.sort R => is_true (@in_mem (Ring.sort R) (@mul R u v) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS)))) (inPhantom (forall u v : Ring.sort R, is_true (@in_mem (Ring.sort R) (@mul R u v) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS))))) *) by case: rpred1M. Qed. Lemma rpred_prod I r (P : pred I) F : (forall i, P i -> F i \in kS) -> \prod_(i <- r | P i) F i \in kS. Proof. (* Goal: forall _ : forall (i : I) (_ : is_true (P i)), is_true (@in_mem (Ring.sort R) (F i) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS))), is_true (@in_mem (Ring.sort R) (@BigOp.bigop (Ring.sort R) I (one R) r (fun i : I => @BigBody (Ring.sort R) I i (@mul R) (P i) (F i))) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS))) *) by move=> IH; elim/big_ind: _; [apply: rpred1 | apply: rpredM |]. Qed. Lemma rpredX n : {in kS, forall u, u ^+ n \in kS}. Proof. (* Goal: @prop_in1 (Ring.sort R) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS)) (fun u : Ring.sort R => is_true (@in_mem (Ring.sort R) (@exp R u n) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS)))) (inPhantom (forall u : Ring.sort R, is_true (@in_mem (Ring.sort R) (@exp R u n) (@mem (Ring.sort R) (predPredType (Ring.sort R)) (@unkey_pred (Ring.sort R) S (@Pred.mul_key R S mulS) kS))))) *) by move=> u Su; rewrite -(card_ord n) -prodr_const rpred_prod. Qed. End Mul. Lemma rpred_nat (rngS : semiringPred S) (kS : keyed_pred rngS) n : n%:R \in kS. Proof. (* Goal: is_true (@in_mem (Zmodule.sort (Ring.zmodType R)) (@natmul (Ring.zmodType R) (one R) n) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.add_key (Ring.zmodType R) S (@Pred.semiring_add R S rngS)) kS))) *) by rewrite rpredMn ?rpred1. Qed. Lemma rpredN1 (mulS : smulrPred S) (kS : keyed_pred mulS) : -1 \in kS. Proof. (* Goal: is_true (@in_mem (Zmodule.sort (Ring.zmodType R)) (@opp (Ring.zmodType R) (one R)) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S (@Pred.smul_opp R S mulS)) kS))) *) by rewrite rpredN rpred1. Qed. Lemma rpred_sign (mulS : smulrPred S) (kS : keyed_pred mulS) n : (-1) ^+ n \in kS. Proof. (* Goal: is_true (@in_mem (Ring.sort R) (@exp R (@opp (Ring.zmodType R) (one R)) n) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S (@Pred.smul_opp R S mulS)) kS))) *) by rewrite rpredX ?rpredN1. Qed. End RingPred. Section LmodPred. Variables (R : ringType) (V : lmodType R) (S : predPredType V). Lemma rpredZsign (oppS : opprPred S) (kS : keyed_pred oppS) n u : ((-1) ^+ n *: u \in kS) = (u \in kS). Proof. (* Goal: @eq bool (@in_mem (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@exp R (@opp (Ring.zmodType R) (one R)) n) u) (@mem (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.opp_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S oppS) kS))) (@in_mem (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) u (@mem (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.opp_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S oppS) kS))) *) by rewrite -signr_odd scaler_sign fun_if if_arg rpredN if_same. Qed. Lemma rpredZnat (addS : addrPred S) (kS : keyed_pred addS) n : {in kS, forall u, n%:R *: u \in kS}. Proof. (* Goal: @prop_in1 (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@mem (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.add_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S addS) kS)) (fun u : Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) => is_true (@in_mem (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@natmul (Ring.zmodType R) (one R) n) u) (@mem (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.add_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S addS) kS)))) (inPhantom (forall u : Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))), is_true (@in_mem (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V (@natmul (Ring.zmodType R) (one R) n) u) (@mem (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.add_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S addS) kS))))) *) by move=> u Su; rewrite /= scaler_nat rpredMn. Qed. Lemma rpredZ (linS : submodPred S) (kS : keyed_pred linS) : scaler_closed kS. Proof. (* Goal: @scaler_closed R V (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.opp_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S (@Pred.zmod_opp (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S (@Pred.submod_zmod R V S linS))) kS) *) by move=> a u; rewrite !keyed_predE; case: {kS}linS => _; apply. Qed. End LmodPred. Section UnitRingPred. Variable R : unitRingType. Section Div. Variables (S : predPredType R) (divS : divrPred S) (kS : keyed_pred divS). Lemma rpredVr x : x \in kS -> x^-1 \in kS. Proof. (* Goal: forall _ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))), is_true (@in_mem (UnitRing.sort R) (@inv R x) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) by rewrite !keyed_predE; case: divS x. Qed. Lemma rpredV x : (x^-1 \in kS) = (x \in kS). Proof. (* Goal: @eq bool (@in_mem (UnitRing.sort R) (@inv R x) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) (@in_mem (UnitRing.sort R) x (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) by apply/idP/idP=> /rpredVr; rewrite ?invrK. Qed. Lemma rpred_div : {in kS &, forall x y, x / y \in kS}. Proof. (* Goal: @prop_in2 (Ring.sort (UnitRing.ringType R)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)) (fun (x : Ring.sort (UnitRing.ringType R)) (y : UnitRing.sort R) => is_true (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x (@inv R y)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)))) (inPhantom (forall (x : Ring.sort (UnitRing.ringType R)) (y : UnitRing.sort R), is_true (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x (@inv R y)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))))) *) by move=> x y Sx Sy; rewrite /= rpredM ?rpredV. Qed. Lemma rpredXN n : {in kS, forall x, x ^- n \in kS}. Proof. (* Goal: @prop_in1 (Ring.sort (UnitRing.ringType R)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)) (fun x : Ring.sort (UnitRing.ringType R) => is_true (@in_mem (UnitRing.sort R) (@inv R (@exp (UnitRing.ringType R) x n)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)))) (inPhantom (forall x : Ring.sort (UnitRing.ringType R), is_true (@in_mem (UnitRing.sort R) (@inv R (@exp (UnitRing.ringType R) x n)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))))) *) by move=> x Sx; rewrite /= rpredV rpredX. Qed. Lemma rpredMl x y : x \in kS -> x \is a unit-> (x * y \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)))) (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (Datatypes.S O) (UnitRing.sort R) (@unit R))))), @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x y) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) (@in_mem (Ring.sort (UnitRing.ringType R)) y (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) move=> Sx Ux; apply/idP/idP=> [Sxy | /(rpredM Sx)-> //]. (* Goal: is_true (@in_mem (Ring.sort (UnitRing.ringType R)) y (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) by rewrite -(mulKr Ux y); rewrite rpredM ?rpredV. Qed. Lemma rpredMr x y : x \in kS -> x \is a unit -> (y * x \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)))) (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (Datatypes.S O) (UnitRing.sort R) (@unit R))))), @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) y x) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) (@in_mem (Ring.sort (UnitRing.ringType R)) y (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) move=> Sx Ux; apply/idP/idP=> [Sxy | /rpredM-> //]. (* Goal: is_true (@in_mem (Ring.sort (UnitRing.ringType R)) y (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) by rewrite -(mulrK Ux y); rewrite rpred_div. Qed. Lemma rpred_divr x y : x \in kS -> x \is a unit -> (y / x \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)))) (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (Datatypes.S O) (UnitRing.sort R) (@unit R))))), @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) y (@inv R x)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) (@in_mem (Ring.sort (UnitRing.ringType R)) y (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) by rewrite -rpredV -unitrV; apply: rpredMr. Qed. Lemma rpred_divl x y : x \in kS -> x \is a unit -> (x / y \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS)))) (_ : is_true (@in_mem (Ring.sort (UnitRing.ringType R)) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (Datatypes.S O) (UnitRing.sort R) (@unit R))))), @eq bool (@in_mem (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x (@inv R y)) (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) (@in_mem (UnitRing.sort R) y (@mem (Ring.sort (UnitRing.ringType R)) (predPredType (Ring.sort (UnitRing.ringType R))) (@unkey_pred (Ring.sort (UnitRing.ringType R)) S (@Pred.mul_key (UnitRing.ringType R) S (@Pred.div_mul R S divS)) kS))) *) by rewrite -(rpredV y); apply: rpredMl. Qed. End Div. Fact unitr_sdivr_closed : @sdivr_closed R unit. Proof. (* Goal: @sdivr_closed R (@has_quality (S O) (UnitRing.sort R) (@unit R)) *) by split=> [|x y Ux Uy]; rewrite ?unitrN1 // unitrMl ?unitrV. Qed. Lemma invrN x : (- x)^-1 = - x^-1. Proof. (* Goal: @eq (UnitRing.sort R) (@inv R (@opp (UnitRing.zmodType R) x)) (@opp (UnitRing.zmodType R) (@inv R x)) *) have [Ux | U'x] := boolP (x \is a unit); last by rewrite !invr_out ?unitrN. (* Goal: @eq (UnitRing.sort R) (@inv R (@opp (UnitRing.zmodType R) x)) (@opp (UnitRing.zmodType R) (@inv R x)) *) by rewrite -mulN1r invrM ?unitrN1 // invrN1 mulrN1. Qed. Lemma invr_signM n x : ((-1) ^+ n * x)^-1 = (-1) ^+ n * x^-1. Proof. (* Goal: @eq (UnitRing.sort R) (@inv R (@mul (UnitRing.ringType R) (@exp (UnitRing.ringType R) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) n) x)) (@mul (UnitRing.ringType R) (@exp (UnitRing.ringType R) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) n) (@inv R x)) *) by rewrite -signr_odd !mulr_sign; case: ifP => // _; rewrite invrN. Qed. Lemma divr_signM (b1 b2 : bool) x1 x2: ((-1) ^+ b1 * x1) / ((-1) ^+ b2 * x2) = (-1) ^+ (b1 (+) b2) * (x1 / x2). Proof. (* Goal: @eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) (@mul (UnitRing.ringType R) (@exp (UnitRing.ringType R) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) (nat_of_bool b1)) x1) (@inv R (@mul (UnitRing.ringType R) (@exp (UnitRing.ringType R) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) (nat_of_bool b2)) x2))) (@mul (UnitRing.ringType R) (@exp (UnitRing.ringType R) (@opp (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R))) (nat_of_bool (addb b1 b2))) (@mul (UnitRing.ringType R) x1 (@inv R x2))) *) by rewrite invr_signM mulr_signM. Qed. End UnitRingPred. Section TermDef. Variable R : Type. Inductive term : Type := | Var of nat | Const of R | NatConst of nat | Add of term & term | Opp of term | NatMul of term & nat | Mul of term & term | Inv of term | Exp of term & nat. Inductive formula : Type := | Bool of bool | Equal of term & term | Unit of term | And of formula & formula | Or of formula & formula | Implies of formula & formula | Not of formula | Exists of nat & formula | Forall of nat & formula. End TermDef. Bind Scope term_scope with term. Bind Scope term_scope with formula. Arguments Add {R} t1%T t2%T. Arguments Opp {R} t1%T. Arguments NatMul {R} t1%T n%N. Arguments Mul {R} t1%T t2%T. Arguments Inv {R} t1%T. Arguments Exp {R} t1%T n%N. Arguments Equal {R} t1%T t2%T. Arguments Unit {R} t1%T. Arguments And {R} f1%T f2%T. Arguments Or {R} f1%T f2%T. Arguments Implies {R} f1%T f2%T. Arguments Not {R} f1%T. Arguments Exists {R} i%N f1%T. Arguments Forall {R} i%N f1%T. Arguments Bool {R} b. Arguments Const {R} x. Notation True := (Bool true). Notation False := (Bool false). Local Notation "''X_' i" := (Var _ i) : term_scope. Local Notation "n %:R" := (NatConst _ n) : term_scope. Local Notation "x %:T" := (Const x) : term_scope. Local Notation "0" := 0%:R%T : term_scope. Local Notation "1" := 1%:R%T : term_scope. Local Infix "+" := Add : term_scope. Local Notation "- t" := (Opp t) : term_scope. Local Notation "t - u" := (Add t (- u)) : term_scope. Local Infix "*" := Mul : term_scope. Local Infix "*+" := NatMul : term_scope. Local Notation "t ^-1" := (Inv t) : term_scope. Local Notation "t / u" := (Mul t u^-1) : term_scope. Local Infix "^+" := Exp : term_scope. Local Infix "==" := Equal : term_scope. Local Infix "/\" := And : term_scope. Local Infix "\/" := Or : term_scope. Local Infix "==>" := Implies : term_scope. Local Notation "~ f" := (Not f) : term_scope. Local Notation "x != y" := (Not (x == y)) : term_scope. Local Notation "''exists' ''X_' i , f" := (Exists i f) : term_scope. Local Notation "''forall' ''X_' i , f" := (Forall i f) : term_scope. Section Substitution. Variable R : Type. Fixpoint tsubst (t : term R) (s : nat * term R) := match t with | 'X_i => if i == s.1 then s.2 else t | _%:T | _%:R => t | t1 + t2 => tsubst t1 s + tsubst t2 s | - t1 => - tsubst t1 s | t1 *+ n => tsubst t1 s *+ n | t1 * t2 => tsubst t1 s * tsubst t2 s | t1^-1 => (tsubst t1 s)^-1 | t1 ^+ n => tsubst t1 s ^+ n end%T. Fixpoint fsubst (f : formula R) (s : nat * term R) := match f with | Bool _ => f | t1 == t2 => tsubst t1 s == tsubst t2 s | Unit t1 => Unit (tsubst t1 s) | f1 /\ f2 => fsubst f1 s /\ fsubst f2 s | f1 \/ f2 => fsubst f1 s \/ fsubst f2 s | f1 ==> f2 => fsubst f1 s ==> fsubst f2 s | ~ f1 => ~ fsubst f1 s | ('exists 'X_i, f1) => 'exists 'X_i, if i == s.1 then f1 else fsubst f1 s | ('forall 'X_i, f1) => 'forall 'X_i, if i == s.1 then f1 else fsubst f1 s end%T. End Substitution. Section EvalTerm. Variable R : unitRingType. Fixpoint eval (e : seq R) (t : term R) {struct t} : R := match t with | ('X_i)%T => e`_i | (x%:T)%T => x | (n%:R)%T => n%:R | (t1 + t2)%T => eval e t1 + eval e t2 | (- t1)%T => - eval e t1 | (t1 *+ n)%T => eval e t1 *+ n | (t1 * t2)%T => eval e t1 * eval e t2 | t1^-1%T => (eval e t1)^-1 | (t1 ^+ n)%T => eval e t1 ^+ n end. Definition same_env (e e' : seq R) := nth 0 e =1 nth 0 e'. Lemma eq_eval e e' t : same_env e e' -> eval e t = eval e' t. Proof. (* Goal: forall _ : same_env e e', @eq (UnitRing.sort R) (eval e t) (eval e' t) *) by move=> eq_e; elim: t => //= t1 -> // t2 ->. Qed. Lemma eval_tsubst e t s : eval e (tsubst t s) = eval (set_nth 0 e s.1 (eval e s.2)) t. Proof. (* Goal: @eq (UnitRing.sort R) (eval e (@tsubst (UnitRing.sort R) t s)) (eval (@set_nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e (@fst nat (term (UnitRing.sort R)) s) (eval e (@snd nat (term (UnitRing.sort R)) s))) t) *) case: s => i u; elim: t => //=; do 2?[move=> ? -> //] => j. (* Goal: @eq (UnitRing.sort R) (eval e (if @eq_op nat_eqType j i then u else Var (UnitRing.sort R) j)) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i (eval e u)) j) *) by rewrite nth_set_nth /=; case: (_ == _). Qed. Fixpoint holds (e : seq R) (f : formula R) {struct f} : Prop := match f with | Bool b => b | (t1 == t2)%T => eval e t1 = eval e t2 | Unit t1 => eval e t1 \in unit | (f1 /\ f2)%T => holds e f1 /\ holds e f2 | (f1 \/ f2)%T => holds e f1 \/ holds e f2 | (f1 ==> f2)%T => holds e f1 -> holds e f2 | (~ f1)%T => ~ holds e f1 | ('exists 'X_i, f1)%T => exists x, holds (set_nth 0 e i x) f1 | ('forall 'X_i, f1)%T => forall x, holds (set_nth 0 e i x) f1 end. Lemma same_env_sym e e' : same_env e e' -> same_env e' e. Proof. (* Goal: forall _ : same_env e e', same_env e' e *) exact: fsym. Qed. Lemma eq_holds e e' f : same_env e e' -> holds e f -> holds e' f. Proof. (* Goal: forall (_ : same_env e e') (_ : holds e f), holds e' f *) pose sv := set_nth (0 : R). (* Goal: forall (_ : same_env e e') (_ : holds e f), holds e' f *) have eq_i i v e1 e2: same_env e1 e2 -> same_env (sv e1 i v) (sv e2 i v). (* Goal: forall (_ : same_env e e') (_ : holds e f), holds e' f *) (* Goal: forall _ : same_env e1 e2, same_env (sv e1 i v) (sv e2 i v) *) by move=> eq_e j; rewrite !nth_set_nth /= eq_e. (* Goal: forall (_ : same_env e e') (_ : holds e f), holds e' f *) elim: f e e' => //=. (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : and (holds e f) (holds e f0)), and (holds e' f) (holds e' f0) *) (* Goal: forall (t : term (UnitRing.sort R)) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))), is_true (@in_mem (UnitRing.sort R) (eval e' t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @eq (UnitRing.sort R) (eval e t) (eval e t0)), @eq (UnitRing.sort R) (eval e' t) (eval e' t0) *) - (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : and (holds e f) (holds e f0)), and (holds e' f) (holds e' f0) *) (* Goal: forall (t : term (UnitRing.sort R)) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))), is_true (@in_mem (UnitRing.sort R) (eval e' t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @eq (UnitRing.sort R) (eval e t) (eval e t0)), @eq (UnitRing.sort R) (eval e' t) (eval e' t0) *) by move=> t1 t2 e e' eq_e; rewrite !(eq_eval _ eq_e). (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : and (holds e f) (holds e f0)), and (holds e' f) (holds e' f0) *) (* Goal: forall (t : term (UnitRing.sort R)) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))), is_true (@in_mem (UnitRing.sort R) (eval e' t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) - (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : and (holds e f) (holds e f0)), and (holds e' f) (holds e' f0) *) (* Goal: forall (t : term (UnitRing.sort R)) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))), is_true (@in_mem (UnitRing.sort R) (eval e' t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) by move=> t e e' eq_e; rewrite (eq_eval _ eq_e). (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : and (holds e f) (holds e f0)), and (holds e' f) (holds e' f0) *) - (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : and (holds e f) (holds e f0)), and (holds e' f) (holds e' f0) *) by move=> f1 IH1 f2 IH2 e e' eq_e; move/IH2: (eq_e); move/IH1: eq_e; tauto. (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) - (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : or (holds e f) (holds e f0)), or (holds e' f) (holds e' f0) *) by move=> f1 IH1 f2 IH2 e e' eq_e; move/IH2: (eq_e); move/IH1: eq_e; tauto. (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) - (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (f0 : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f0), holds e' f0) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall _ : holds e f, holds e f0) (_ : holds e' f), holds e' f0 *) by move=> f1 IH1 f2 IH2 e e' eq_e f12; move/IH1: (same_env_sym eq_e); eauto. (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) - (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : not (holds e f)), not (holds e' f) *) by move=> f1 IH1 e e'; move/same_env_sym; move/IH1; tauto. (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) - (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)), @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f) *) by move=> i f1 IH1 e e'; move/(eq_i i)=> eq_e [x f_ex]; exists x; eauto. (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : holds e f), holds e' f) (e e' : list (UnitRing.sort R)) (_ : same_env e e') (_ : forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) (x : UnitRing.sort R), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' n x) f *) by move=> i f1 IH1 e e'; move/(eq_i i); eauto. Qed. Lemma holds_fsubst e f i v : holds e (fsubst f (i, v%:T)%T) <-> holds (set_nth 0 e i v) f. Proof. (* Goal: iff (holds e (@fsubst (UnitRing.sort R) f (@pair nat (term (UnitRing.sort R)) i (@Const (UnitRing.sort R) v)))) (holds (@set_nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e i v) f) *) elim: f e => //=; do [ by move=> *; rewrite !eval_tsubst | move=> f1 IHf1 f2 IHf2 e; move: (IHf1 e) (IHf2 e); tauto | move=> f IHf e; move: (IHf e); tauto | move=> j f IHf e]. (* Goal: iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j x) (if @eq_op nat_eqType j i then f else @fsubst (UnitRing.sort R) f (@pair nat (term (UnitRing.sort R)) i (@Const (UnitRing.sort R) v)))) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i v) j x) f) *) (* Goal: iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j x) (if @eq_op nat_eqType j i then f else @fsubst (UnitRing.sort R) f (@pair nat (term (UnitRing.sort R)) i (@Const (UnitRing.sort R) v))))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i v) j x) f)) *) - (* Goal: iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j x) (if @eq_op nat_eqType j i then f else @fsubst (UnitRing.sort R) f (@pair nat (term (UnitRing.sort R)) i (@Const (UnitRing.sort R) v)))) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i v) j x) f) *) (* Goal: iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j x) (if @eq_op nat_eqType j i then f else @fsubst (UnitRing.sort R) f (@pair nat (term (UnitRing.sort R)) i (@Const (UnitRing.sort R) v))))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i v) j x) f)) *) case eq_ji: (j == i); first rewrite (eqP eq_ji). (* Goal: iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j x) (if @eq_op nat_eqType j i then f else @fsubst (UnitRing.sort R) f (@pair nat (term (UnitRing.sort R)) i (@Const (UnitRing.sort R) v)))) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i v) j x) f) *) (* Goal: iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j x) (@fsubst (UnitRing.sort R) f (@pair nat (term (UnitRing.sort R)) i (@Const (UnitRing.sort R) v))))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i v) j x) f)) *) (* Goal: iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i x) f)) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i v) i x) f)) *) by split=> [] [x f_x]; exists x; rewrite set_set_nth eqxx in f_x *. split=> [] [x f_x]; exists x; move: f_x; rewrite set_set_nth eq_sym eq_ji; have:= IHf (set_nth 0 e j x); tauto. case eq_ji: (j == i); first rewrite (eqP eq_ji). by split=> [] f_ x; move: (f_ x); rewrite set_set_nth eqxx. split=> [] f_ x; move: (IHf (set_nth 0 e j x)) (f_ x); by rewrite set_set_nth eq_sym eq_ji; tauto. Qed. Qed. Fixpoint rterm (t : term R) := match t with | _^-1 => false | t1 + t2 | t1 * t2 => rterm t1 && rterm t2 | - t1 | t1 *+ _ | t1 ^+ _ => rterm t1 | _ => true end%T. Fixpoint rformula (f : formula R) := match f with | Bool _ => true | t1 == t2 => rterm t1 && rterm t2 | Unit t1 => false | f1 /\ f2 | f1 \/ f2 | f1 ==> f2 => rformula f1 && rformula f2 | ~ f1 | ('exists 'X__, f1) | ('forall 'X__, f1) => rformula f1 end%T. Fixpoint ub_var (t : term R) := match t with | 'X_i => i.+1 | t1 + t2 | t1 * t2 => maxn (ub_var t1) (ub_var t2) | - t1 | t1 *+ _ | t1 ^+ _ | t1^-1 => ub_var t1 | _ => 0%N end%T. Fixpoint to_rterm (t : term R) (r : seq (term R)) (n : nat) {struct t} := match t with | t1^-1 => let: (t1', r1) := to_rterm t1 r n in ('X_(n + size r1), rcons r1 t1') | t1 + t2 => let: (t1', r1) := to_rterm t1 r n in let: (t2', r2) := to_rterm t2 r1 n in (t1' + t2', r2) | - t1 => let: (t1', r1) := to_rterm t1 r n in (- t1', r1) | t1 *+ m => let: (t1', r1) := to_rterm t1 r n in (t1' *+ m, r1) | t1 * t2 => let: (t1', r1) := to_rterm t1 r n in let: (t2', r2) := to_rterm t2 r1 n in (Mul t1' t2', r2) | t1 ^+ m => let: (t1', r1) := to_rterm t1 r n in (t1' ^+ m, r1) | _ => (t, r) end%T. Lemma to_rterm_id t r n : rterm t -> to_rterm t r n = (t, r). Proof. (* Goal: forall _ : is_true (rterm t), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r) *) elim: t r n => //. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@NatMul (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@NatMul (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Opp (UnitRing.sort R) t))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Opp (UnitRing.sort R) t) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Add (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Add (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t t0) r) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@NatMul (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@NatMul (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Opp (UnitRing.sort R) t))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Opp (UnitRing.sort R) t) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Add (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Add (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t t0) r) *) by move=> t1 IHt1 t2 IHt2 r n /= /andP[rt1 rt2]; rewrite {}IHt1 // IHt2. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@NatMul (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@NatMul (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Opp (UnitRing.sort R) t))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Opp (UnitRing.sort R) t) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t) r) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@NatMul (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@NatMul (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Opp (UnitRing.sort R) t))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Opp (UnitRing.sort R) t) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t) r) *) by move=> t IHt r n /= rt; rewrite {}IHt. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@NatMul (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@NatMul (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t n) r) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@NatMul (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@NatMul (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t n) r) *) by move=> t IHt r n m /= rt; rewrite {}IHt. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (t0 : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t0)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t0 r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t0 r)) (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm (@Mul (UnitRing.sort R) t t0))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Mul (UnitRing.sort R) t t0) r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t t0) r) *) by move=> t1 IHt1 t2 IHt2 r n /= /andP[rt1 rt2]; rewrite {}IHt1 // IHt2. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r : list (term (UnitRing.sort R))) (n : nat) (_ : is_true (rterm t)), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm t r n) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) t r)) (n : nat) (r : list (term (UnitRing.sort R))) (n0 : nat) (_ : is_true (rterm (@Exp (UnitRing.sort R) t n))), @eq (prod (term (UnitRing.sort R)) (list (term (UnitRing.sort R)))) (to_rterm (@Exp (UnitRing.sort R) t n) r n0) (@pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t n) r) *) by move=> t IHt r n m /= rt; rewrite {}IHt. Qed. Definition eq0_rform t1 := let m := ub_var t1 in let: (t1', r1) := to_rterm t1 [::] m in let fix loop r i := match r with | [::] => t1' == 0 | t :: r' => let f := 'X_i * t == 1 /\ t * 'X_i == 1 in 'forall 'X_i, (f \/ 'X_i == t /\ ~ ('exists 'X_i, f)) ==> loop r' i.+1 end%T in loop r1 m. Fixpoint to_rform f := match f with | Bool b => f | t1 == t2 => eq0_rform (t1 - t2) | Unit t1 => eq0_rform (t1 * t1^-1 - 1) | f1 /\ f2 => to_rform f1 /\ to_rform f2 | f1 \/ f2 => to_rform f1 \/ to_rform f2 | f1 ==> f2 => to_rform f1 ==> to_rform f2 | ~ f1 => ~ to_rform f1 | ('exists 'X_i, f1) => 'exists 'X_i, to_rform f1 | ('forall 'X_i, f1) => 'forall 'X_i, to_rform f1 end%T. Lemma to_rform_rformula f : rformula (to_rform f). Proof. (* Goal: is_true (rformula (to_rform f)) *) suffices eq0_ring t1: rformula (eq0_rform t1) by elim: f => //= => f1 ->. (* Goal: is_true (rformula (eq0_rform t1)) *) rewrite /eq0_rform; move: (ub_var t1) => m; set tr := _ m. (* Goal: is_true (rformula (let 'pair t1' r1 := tr in (fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 m)) *) suffices: all rterm (tr.1 :: tr.2). (* Goal: is_true (@all (term (UnitRing.sort R)) rterm (@cons (term (UnitRing.sort R)) (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr) (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm (@cons (term (UnitRing.sort R)) (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr) (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr))), is_true (rformula (let 'pair t1' r1 := tr in (fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 m)) *) case: tr => {t1} t1 r /= /andP[t1_r]. (* Goal: is_true (@all (term (UnitRing.sort R)) rterm (@cons (term (UnitRing.sort R)) (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr) (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (rformula ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1 (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r m)) *) by elim: r m => [|t r IHr] m; rewrite /= ?andbT // => /andP[->]; apply: IHr. (* Goal: is_true (@all (term (UnitRing.sort R)) rterm (@cons (term (UnitRing.sort R)) (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr) (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr))) *) have: all rterm [::] by []. (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm (@nil (term (UnitRing.sort R)))), is_true (@all (term (UnitRing.sort R)) rterm (@cons (term (UnitRing.sort R)) (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr) (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) tr))) *) rewrite {}/tr; elim: t1 [::] => //=. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1' t2') r2)))) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1' t2') r2)))) *) move=> t1 IHt1 t2 IHt2 r. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1)))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t1 r m in let 'pair t2' r2 := to_rterm t2 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t1 r m in let 'pair t2' r2 := to_rterm t2 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1' t2') r2)))) *) move/IHt1; case: to_rterm => {t1 r IHt1} t1 r /= /andP[t1_r]. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1)))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t2' r2 := to_rterm t2 r m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1 t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t2' r2 := to_rterm t2 r m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Add (UnitRing.sort R) t1 t2') r2)))) *) move/IHt2; case: to_rterm => {t2 r IHt2} t2 r /= /andP[t2_r]. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1)))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (andb (andb (rterm t1) (rterm t2)) (@all (term (UnitRing.sort R)) rterm r)) *) by rewrite t1_r t2_r. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1)))) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Opp (UnitRing.sort R) t1') r1)))) *) by move=> t1 IHt1 r /IHt1; case: to_rterm. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@NatMul (UnitRing.sort R) t1' n) r1)))) *) by move=> t1 IHt1 n r /IHt1; case: to_rterm. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (t0 : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t0 l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in let 'pair t2' r2 := to_rterm t0 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) move=> t1 IHt1 t2 IHt2 r. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t1 r m in let 'pair t2' r2 := to_rterm t2 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t1 r m in let 'pair t2' r2 := to_rterm t2 r1 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1' t2') r2)))) *) move/IHt1; case: to_rterm => {t1 r IHt1} t1 r /= /andP[t1_r]. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t2' r2 := to_rterm t2 r m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1 t2') r2))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t2' r2 := to_rterm t2 r m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Mul (UnitRing.sort R) t1 t2') r2)))) *) move/IHt2; case: to_rterm => {t2 r IHt2} t2 r /= /andP[t2_r]. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (andb (andb (rterm t1) (rterm t2)) (@all (term (UnitRing.sort R)) rterm r)) *) by rewrite t1_r t2_r. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) move=> t1 IHt1 r. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) (* Goal: forall _ : is_true (@all (term (UnitRing.sort R)) rterm r), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t1 r m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1')))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t1 r m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1'))))) *) by move/IHt1; case: to_rterm => {t1 r IHt1} t1 r /=; rewrite all_rcons. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) - (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (to_rterm t l m))))) (n : nat) (l : list (term (UnitRing.sort R))) (_ : is_true (@all (term (UnitRing.sort R)) rterm l)), is_true (andb (rterm (@fst (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1))) (@all (term (UnitRing.sort R)) rterm (@snd (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (let 'pair t1' r1 := to_rterm t l m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (@Exp (UnitRing.sort R) t1' n) r1)))) *) by move=> t1 IHt1 n r /IHt1; case: to_rterm. Qed. Lemma to_rformP e f : holds e (to_rform f) <-> holds e f. Proof. (* Goal: iff (holds e (to_rform f)) (holds e f) *) suffices{e f} equal0_equiv e t1 t2: holds e (eq0_rform (t1 - t2)) <-> (eval e t1 == eval e t2). (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: iff (holds e (to_rform f)) (holds e f) *) - (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: iff (holds e (to_rform f)) (holds e f) *) elim: f e => /=; try tauto. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (and (holds e (to_rform f)) (holds e (to_rform f0))) (and (holds e f) (holds e f0)) *) (* Goal: forall (t : term (UnitRing.sort R)) (e : list (UnitRing.sort R)), iff (holds e (eq0_rform (@Add (UnitRing.sort R) (@Mul (UnitRing.sort R) t (@Inv (UnitRing.sort R) t)) (@Opp (UnitRing.sort R) (NatConst (UnitRing.sort R) (S O)))))) (is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (e : list (UnitRing.sort R)), iff (holds e (eq0_rform (@Add (UnitRing.sort R) t (@Opp (UnitRing.sort R) t0)))) (@eq (UnitRing.sort R) (eval e t) (eval e t0)) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (and (holds e (to_rform f)) (holds e (to_rform f0))) (and (holds e f) (holds e f0)) *) (* Goal: forall (t : term (UnitRing.sort R)) (e : list (UnitRing.sort R)), iff (holds e (eq0_rform (@Add (UnitRing.sort R) (@Mul (UnitRing.sort R) t (@Inv (UnitRing.sort R) t)) (@Opp (UnitRing.sort R) (NatConst (UnitRing.sort R) (S O)))))) (is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (e : list (UnitRing.sort R)), iff (holds e (eq0_rform (@Add (UnitRing.sort R) t (@Opp (UnitRing.sort R) t0)))) (@eq (UnitRing.sort R) (eval e t) (eval e t0)) *) move=> t1 t2 e. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (and (holds e (to_rform f)) (holds e (to_rform f0))) (and (holds e f) (holds e f0)) *) (* Goal: forall (t : term (UnitRing.sort R)) (e : list (UnitRing.sort R)), iff (holds e (eq0_rform (@Add (UnitRing.sort R) (@Mul (UnitRing.sort R) t (@Inv (UnitRing.sort R) t)) (@Opp (UnitRing.sort R) (NatConst (UnitRing.sort R) (S O)))))) (is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) *) (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (@eq (UnitRing.sort R) (eval e t1) (eval e t2)) *) by split; [move/equal0_equiv/eqP | move/eqP/equal0_equiv]. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (and (holds e (to_rform f)) (holds e (to_rform f0))) (and (holds e f) (holds e f0)) *) (* Goal: forall (t : term (UnitRing.sort R)) (e : list (UnitRing.sort R)), iff (holds e (eq0_rform (@Add (UnitRing.sort R) (@Mul (UnitRing.sort R) t (@Inv (UnitRing.sort R) t)) (@Opp (UnitRing.sort R) (NatConst (UnitRing.sort R) (S O)))))) (is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (and (holds e (to_rform f)) (holds e (to_rform f0))) (and (holds e f) (holds e f0)) *) (* Goal: forall (t : term (UnitRing.sort R)) (e : list (UnitRing.sort R)), iff (holds e (eq0_rform (@Add (UnitRing.sort R) (@Mul (UnitRing.sort R) t (@Inv (UnitRing.sort R) t)) (@Opp (UnitRing.sort R) (NatConst (UnitRing.sort R) (S O)))))) (is_true (@in_mem (UnitRing.sort R) (eval e t) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R))))) *) by move=> t1 e; rewrite unitrE; apply: equal0_equiv. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (and (holds e (to_rform f)) (holds e (to_rform f0))) (and (holds e f) (holds e f0)) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (and (holds e (to_rform f)) (holds e (to_rform f0))) (and (holds e f) (holds e f0)) *) by move=> f1 IHf1 f2 IHf2 e; move: (IHf1 e) (IHf2 e); tauto. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (or (holds e (to_rform f)) (holds e (to_rform f0))) (or (holds e f) (holds e f0)) *) by move=> f1 IHf1 f2 IHf2 e; move: (IHf1 e) (IHf2 e); tauto. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (f0 : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f0)) (holds e f0)) (e : list (UnitRing.sort R)), iff (forall _ : holds e (to_rform f), holds e (to_rform f0)) (forall _ : holds e f, holds e f0) *) by move=> f1 IHf1 f2 IHf2 e; move: (IHf1 e) (IHf2 e); tauto. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (not (holds e (to_rform f))) (not (holds e f)) *) by move=> f1 IHf1 e; move: (IHf1 e); tauto. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f))) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f)) *) by move=> n f1 IHf1 e; split=> [] [x] /IHf1; exists x. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) + (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) (* Goal: forall (n : nat) (f : formula (UnitRing.sort R)) (_ : forall e : list (UnitRing.sort R), iff (holds e (to_rform f)) (holds e f)) (e : list (UnitRing.sort R)), iff (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) (to_rform f)) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e n x) f) *) by move=> n f1 IHf1 e; split=> Hx x; apply/IHf1. (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (UnitRing.eqType R) (eval e t1) (eval e t2))) *) rewrite -(add0r (eval e t2)) -(can2_eq (subrK _) (addrK _)). (* Goal: iff (holds e (eq0_rform (@Add (UnitRing.sort R) t1 (@Opp (UnitRing.sort R) t2)))) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (@add (UnitRing.zmodType R) (eval e t1) (@opp (UnitRing.zmodType R) (eval e t2))) (zero (UnitRing.zmodType R)))) *) rewrite -/(eval e (t1 - t2)); move: (t1 - t2)%T => {t1 t2} t. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) have sub_var_tsubst s t0: s.1 >= ub_var t0 -> tsubst t0 s = t0. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0 *) elim: t0 {t} => //=. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Opp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Opp (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Add (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Add (UnitRing.sort R) t t0) *) (* Goal: forall (n : nat) (_ : is_true (leq (S n) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (if @eq_op nat_eqType n (@fst nat (term (UnitRing.sort R)) s) then @snd nat (term (UnitRing.sort R)) s else Var (UnitRing.sort R) n) (Var (UnitRing.sort R) n) *) - (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Opp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Opp (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Add (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Add (UnitRing.sort R) t t0) *) (* Goal: forall (n : nat) (_ : is_true (leq (S n) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (if @eq_op nat_eqType n (@fst nat (term (UnitRing.sort R)) s) then @snd nat (term (UnitRing.sort R)) s else Var (UnitRing.sort R) n) (Var (UnitRing.sort R) n) *) by move=> n; case: ltngtP. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Opp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Opp (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Add (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Add (UnitRing.sort R) t t0) *) - (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Opp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Opp (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Add (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Add (UnitRing.sort R) t t0) *) by move=> t1 IHt1 t2 IHt2; rewrite geq_max => /andP[/IHt1-> /IHt2->]. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Opp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Opp (UnitRing.sort R) t) *) - (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Opp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Opp (UnitRing.sort R) t) *) by move=> t1 IHt1 /IHt1->. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) - (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@NatMul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@NatMul (UnitRing.sort R) t n) *) by move=> t1 IHt1 n /IHt1->. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) - (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (t0 : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t0) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t0 s) t0) (_ : is_true (leq (maxn (ub_var t) (ub_var t0)) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Mul (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) (@tsubst (UnitRing.sort R) t0 s)) (@Mul (UnitRing.sort R) t t0) *) by move=> t1 IHt1 t2 IHt2; rewrite geq_max => /andP[/IHt1-> /IHt2->]. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) - (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s)) (@Inv (UnitRing.sort R) t) *) by move=> t1 IHt1 /IHt1->. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) - (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall _ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s)), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) t s) t) (n : nat) (_ : is_true (leq (ub_var t) (@fst nat (term (UnitRing.sort R)) s))), @eq (term (UnitRing.sort R)) (@Exp (UnitRing.sort R) (@tsubst (UnitRing.sort R) t s) n) (@Exp (UnitRing.sort R) t n) *) by move=> t1 IHt1 n /IHt1->. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) pose fix rsub t' m r : term R := if r is u :: r' then tsubst (rsub t' m.+1 r') (m, u^-1)%T else t'. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) pose fix ub_sub m r : Prop := if r is u :: r' then ub_var u <= m /\ ub_sub m.+1 r' else true. (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) suffices{t} rsub_to_r t r0 m: m >= ub_var t -> ub_sub m r0 -> let: (t', r) := to_rterm t r0 m in [/\ take (size r0) r = r0, ub_var t' <= m + size r, ub_sub m r & rsub t' m r = t]. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) - (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: iff (holds e (eq0_rform t)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) have:= rsub_to_r t [::] _ (leqnn _); rewrite /eq0_rform. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall _ : forall _ : ub_sub (ub_var t) (@nil (term (UnitRing.sort R))), let 'pair t' r := to_rterm t (@nil (term (UnitRing.sort R))) (ub_var t) in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) (@nil (term (UnitRing.sort R)))) r) (@nil (term (UnitRing.sort R)))) (is_true (leq (ub_var t') (addn (ub_var t) (@size (term (UnitRing.sort R)) r)))) (ub_sub (ub_var t) r) (@eq (term (UnitRing.sort R)) (rsub t' (ub_var t) r) t), iff (holds e (let 'pair t1' r1 := to_rterm t (@nil (term (UnitRing.sort R))) (ub_var t) in (fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (ub_var t))) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) case: (to_rterm _ _ _) => [t1' r1] [//|_ _ ub_r1 def_t]. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: iff (holds e ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (ub_var t))) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t) (zero (UnitRing.zmodType R)))) *) rewrite -{2}def_t {def_t}. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: iff (holds e ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (ub_var t))) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e (rsub t1' (ub_var t) r1)) (zero (UnitRing.zmodType R)))) *) elim: r1 (ub_var t) e ub_r1 => [|u r1 IHr1] m e /= => [_|[ub_u ub_r1]]. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: iff (forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m))) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e (@tsubst (UnitRing.sort R) (rsub t1' (S m) r1) (@pair nat (term (UnitRing.sort R)) m (@Inv (UnitRing.sort R) u)))) (zero (UnitRing.zmodType R)))) *) (* Goal: iff (@eq (UnitRing.sort R) (eval e t1') (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) O)) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e t1') (zero (UnitRing.zmodType R)))) *) by split=> /eqP. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: iff (forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m))) (is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval e (@tsubst (UnitRing.sort R) (rsub t1' (S m) r1) (@pair nat (term (UnitRing.sort R)) m (@Inv (UnitRing.sort R) u)))) (zero (UnitRing.zmodType R)))) *) rewrite eval_tsubst /=; set y := eval e u; split=> t_eq0. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: is_true (@eq_op (Zmodule.eqType (UnitRing.zmodType R)) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) (rsub t1' (S m) r1)) (zero (UnitRing.zmodType R))) *) apply/IHr1=> //; apply: t_eq0. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) u)) (not (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))))))) *) rewrite nth_set_nth /= eqxx -(eval_tsubst e u (m, Const _)). (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@inv R y) (eval e (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) (@UnitRing.inv (@Ring.Pack (UnitRing.sort R) (@UnitRing.base (UnitRing.sort R) (UnitRing.class R))) (@UnitRing.mixin (UnitRing.sort R) (UnitRing.class R)) y)))))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval e (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) (@UnitRing.inv (@Ring.Pack (UnitRing.sort R) (@UnitRing.base (UnitRing.sort R) (UnitRing.class R))) (@UnitRing.mixin (UnitRing.sort R) (UnitRing.class R)) y))))) (@inv R y)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@inv R y) (eval e (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) (@UnitRing.inv (@Ring.Pack (UnitRing.sort R) (@UnitRing.base (UnitRing.sort R) (UnitRing.class R))) (@UnitRing.mixin (UnitRing.sort R) (UnitRing.class R)) y)))))) (not (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))))))) *) rewrite sub_var_tsubst //= -/y. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@inv R y) y) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) y (@inv R y)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@inv R y) y) (not (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))))))) *) case Uy: (y \in unit); [left | right]; first by rewrite mulVr ?divrr. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: and (@eq (UnitRing.sort R) (@inv R y) y) (not (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))) *) split=> [|[z]]; first by rewrite invr_out ?Uy. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: forall _ : and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m z) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m z) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m z) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m z) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))), Logic.False *) rewrite nth_set_nth /= eqxx. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: forall _ : and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) z (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m z) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m (@inv R y)) m z) u) z) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))), Logic.False *) rewrite -!(eval_tsubst _ _ (m, Const _)) !sub_var_tsubst // -/y => yz1. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) (* Goal: Logic.False *) by case/unitrP: Uy; exists z. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall (x : UnitRing.sort R) (_ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))))))), holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) ((fix loop (r : list (term (UnitRing.sort R))) (i : nat) {struct r} : formula (UnitRing.sort R) := match r with | nil => @Equal (UnitRing.sort R) t1' (NatConst (UnitRing.sort R) O) | cons t r' => @Forall (UnitRing.sort R) i (@Implies (UnitRing.sort R) (@Or (UnitRing.sort R) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))) (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (@Not (UnitRing.sort R) (@Exists (UnitRing.sort R) i (@And (UnitRing.sort R) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) (Var (UnitRing.sort R) i) t) (NatConst (UnitRing.sort R) (S O))) (@Equal (UnitRing.sort R) (@Mul (UnitRing.sort R) t (Var (UnitRing.sort R) i)) (NatConst (UnitRing.sort R) (S O)))))))) (loop r' (S i))) end) r1 (S m)) *) move=> x def_x; apply/IHr1=> //; suff ->: x = y^-1 by []; move: def_x. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall _ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) u)) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))))))), @eq (UnitRing.sort R) x (@inv R y) *) rewrite nth_set_nth /= eqxx -(eval_tsubst e u (m, Const _)). (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall _ : or (and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) x (eval e (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) x))))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval e (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) x)))) x) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O)))) (and (@eq (UnitRing.sort R) x (eval e (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) x))))) (not (@ex (UnitRing.sort R) (fun x0 : UnitRing.sort R => and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m x0) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))))))), @eq (UnitRing.sort R) x (@inv R y) *) rewrite sub_var_tsubst //= -/y; case=> [[xy1 yx1] | [xy nUy]]. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: @eq (UnitRing.sort R) x (@inv R y) *) (* Goal: @eq (UnitRing.sort R) x (@inv R y) *) by rewrite -[y^-1]mul1r -[1]xy1 mulrK //; apply/unitrP; exists x. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: @eq (UnitRing.sort R) x (@inv R y) *) rewrite invr_out //; apply/unitrP=> [[z yz1]]; case: nUy; exists z. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m z) m) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m z) u)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m z) u) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e m x) m z) m)) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) *) rewrite nth_set_nth /= eqxx -!(eval_tsubst _ _ (m, _%:T)%T). (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: and (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) z (eval e (@tsubst (UnitRing.sort R) (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) z))) (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) x))))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) (@eq (UnitRing.sort R) (@mul (UnitRing.ringType R) (eval e (@tsubst (UnitRing.sort R) (@tsubst (UnitRing.sort R) u (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) z))) (@pair nat (term (UnitRing.sort R)) m (@Const (UnitRing.sort R) x)))) z) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) (S O))) *) by rewrite !sub_var_tsubst. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) have rsub_id r t0 n: ub_var t0 <= n -> rsub t0 n r = t0. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall _ : is_true (leq (ub_var t0) n), @eq (term (UnitRing.sort R)) (rsub t0 n r) t0 *) by elim: r n => //= t1 r IHr n let0n; rewrite IHr ?sub_var_tsubst ?leqW. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) have rsub_acc r s t1 m1: ub_var t1 <= m1 + size r -> rsub t1 m1 (r ++ s) = rsub t1 m1 r. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall _ : is_true (leq (ub_var t1) (addn m1 (@size (term (UnitRing.sort R)) r))), @eq (term (UnitRing.sort R)) (rsub t1 m1 (@cat (term (UnitRing.sort R)) r s)) (rsub t1 m1 r) *) elim: r t1 m1 => [|t1 r IHr] t2 m1 /=; first by rewrite addn0; apply: rsub_id. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) (* Goal: forall _ : is_true (leq (ub_var t2) (addn m1 (S (@size (term (UnitRing.sort R)) r)))), @eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) (rsub t2 (S m1) (@cat (term (UnitRing.sort R)) r s)) (@pair nat (term (UnitRing.sort R)) m1 (@Inv (UnitRing.sort R) t1))) (@tsubst (UnitRing.sort R) (rsub t2 (S m1) r) (@pair nat (term (UnitRing.sort R)) m1 (@Inv (UnitRing.sort R) t1))) *) by move=> letmr; rewrite IHr ?addSnnS. (* Goal: forall (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t) *) elim: t r0 m => /=; try do [ by move=> n r m hlt hub; rewrite take_size (ltn_addr _ hlt) rsub_id | by move=> n r m hlt hub; rewrite leq0n take_size rsub_id | move=> t1 IHt1 t2 IHt2 r m; rewrite geq_max; case/andP=> hub1 hub2 hmr; case: to_rterm {IHt1 hub1 hmr}(IHt1 r m hub1 hmr) => t1' r1; case=> htake1 hub1' hsub1 <-; case: to_rterm {IHt2 hub2 hsub1}(IHt2 r1 m hub2 hsub1) => t2' r2 /=; rewrite geq_max; case=> htake2 -> hsub2 /= <-; rewrite -{1 2}(cat_take_drop (size r1) r2) htake2; set r3 := drop _ _; rewrite size_cat addnA (leq_trans _ (leq_addr _ _)) //; split=> {hsub2}//; first by [rewrite takel_cat // -htake1 size_take geq_min leqnn orbT]; rewrite -(rsub_acc r1 r3 t1') {hub1'}// -{htake1}htake2 {r3}cat_take_drop; by elim: r2 m => //= u r2 IHr2 m; rewrite IHr2 | do [ move=> t1 IHt1 r m; do 2!move/IHt1=> {IHt1}IHt1 | move=> t1 IHt1 n r m; do 2!move/IHt1=> {IHt1}IHt1]; case: to_rterm IHt1 => t1' r1 [-> -> hsub1 <-]; split=> {hsub1}//; by elim: r1 m => //= u r1 IHr1 m; rewrite IHr1]. (* Goal: forall (t : term (UnitRing.sort R)) (_ : forall (r0 : list (term (UnitRing.sort R))) (m : nat) (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := to_rterm t r0 m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) t)) (r0 : list (term (UnitRing.sort R))) (m : nat) (_ : is_true (leq (ub_var t) m)) (_ : ub_sub m r0), let 'pair t' r := let 'pair t1' r1 := to_rterm t r0 m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1') in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r0) r) r0) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r)))) (ub_sub m r) (@eq (term (UnitRing.sort R)) (rsub t' m r) (@Inv (UnitRing.sort R) t)) *) move=> t1 IH r m letm /IH {IH} /(_ letm) {letm}. (* Goal: forall _ : let 'pair t' r0 := to_rterm t1 r m in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r) r0) r) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r0)))) (ub_sub m r0) (@eq (term (UnitRing.sort R)) (rsub t' m r0) t1), let 'pair t' r0 := let 'pair t1' r1 := to_rterm t1 r m in @pair (term (UnitRing.sort R)) (list (term (UnitRing.sort R))) (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) (@rcons (term (UnitRing.sort R)) r1 t1') in and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r) r0) r) (is_true (leq (ub_var t') (addn m (@size (term (UnitRing.sort R)) r0)))) (ub_sub m r0) (@eq (term (UnitRing.sort R)) (rsub t' m r0) (@Inv (UnitRing.sort R) t1)) *) case: to_rterm => t1' r1 /= [def_r ub_t1' ub_r1 <-]. (* Goal: and4 (@eq (list (term (UnitRing.sort R))) (@take (term (UnitRing.sort R)) (@size (term (UnitRing.sort R)) r) (@rcons (term (UnitRing.sort R)) r1 t1')) r) (is_true (leq (S (addn m (@size (term (UnitRing.sort R)) r1))) (addn m (@size (term (UnitRing.sort R)) (@rcons (term (UnitRing.sort R)) r1 t1'))))) (ub_sub m (@rcons (term (UnitRing.sort R)) r1 t1')) (@eq (term (UnitRing.sort R)) (rsub (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) m (@rcons (term (UnitRing.sort R)) r1 t1')) (@Inv (UnitRing.sort R) (rsub t1' m r1))) *) rewrite size_rcons addnS leqnn -{1}cats1 takel_cat ?def_r; last first. (* Goal: and4 (@eq (list (term (UnitRing.sort R))) r r) (is_true true) (ub_sub m (@rcons (term (UnitRing.sort R)) r1 t1')) (@eq (term (UnitRing.sort R)) (rsub (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) m (@rcons (term (UnitRing.sort R)) r1 t1')) (@Inv (UnitRing.sort R) (rsub t1' m r1))) *) (* Goal: is_true (leq (@size (term (UnitRing.sort R)) r) (@size (term (UnitRing.sort R)) r1)) *) by rewrite -def_r size_take geq_min leqnn orbT. (* Goal: and4 (@eq (list (term (UnitRing.sort R))) r r) (is_true true) (ub_sub m (@rcons (term (UnitRing.sort R)) r1 t1')) (@eq (term (UnitRing.sort R)) (rsub (Var (UnitRing.sort R) (addn m (@size (term (UnitRing.sort R)) r1))) m (@rcons (term (UnitRing.sort R)) r1 t1')) (@Inv (UnitRing.sort R) (rsub t1' m r1))) *) elim: r1 m ub_r1 ub_t1' {def_r} => /= [|u r1 IHr1] m => [_|[->]]. (* Goal: forall (_ : ub_sub (S m) r1) (_ : is_true (leq (ub_var t1') (addn m (S (@size (term (UnitRing.sort R)) r1))))), and4 (@eq (list (term (UnitRing.sort R))) r r) (is_true true) (and (is_true true) (ub_sub (S m) (@rcons (term (UnitRing.sort R)) r1 t1'))) (@eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) (rsub (Var (UnitRing.sort R) (addn m (S (@size (term (UnitRing.sort R)) r1)))) (S m) (@rcons (term (UnitRing.sort R)) r1 t1')) (@pair nat (term (UnitRing.sort R)) m (@Inv (UnitRing.sort R) u))) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) (rsub t1' (S m) r1) (@pair nat (term (UnitRing.sort R)) m (@Inv (UnitRing.sort R) u))))) *) (* Goal: forall _ : is_true (leq (ub_var t1') (addn m O)), and4 (@eq (list (term (UnitRing.sort R))) r r) (is_true true) (and (is_true (leq (ub_var t1') m)) (is_true true)) (@eq (term (UnitRing.sort R)) (if @eq_op nat_eqType (addn m O) m then @Inv (UnitRing.sort R) t1' else Var (UnitRing.sort R) (addn m O)) (@Inv (UnitRing.sort R) t1')) *) by rewrite addn0 eqxx. (* Goal: forall (_ : ub_sub (S m) r1) (_ : is_true (leq (ub_var t1') (addn m (S (@size (term (UnitRing.sort R)) r1))))), and4 (@eq (list (term (UnitRing.sort R))) r r) (is_true true) (and (is_true true) (ub_sub (S m) (@rcons (term (UnitRing.sort R)) r1 t1'))) (@eq (term (UnitRing.sort R)) (@tsubst (UnitRing.sort R) (rsub (Var (UnitRing.sort R) (addn m (S (@size (term (UnitRing.sort R)) r1)))) (S m) (@rcons (term (UnitRing.sort R)) r1 t1')) (@pair nat (term (UnitRing.sort R)) m (@Inv (UnitRing.sort R) u))) (@Inv (UnitRing.sort R) (@tsubst (UnitRing.sort R) (rsub t1' (S m) r1) (@pair nat (term (UnitRing.sort R)) m (@Inv (UnitRing.sort R) u))))) *) by rewrite -addSnnS => /IHr1 IH /IH[_ _ ub_r1 ->]. Qed. Fixpoint qf_form (f : formula R) := match f with | Bool _ | _ == _ | Unit _ => true | f1 /\ f2 | f1 \/ f2 | f1 ==> f2 => qf_form f1 && qf_form f2 | ~ f1 => qf_form f1 | _ => false end%T. Definition qf_eval e := fix loop (f : formula R) : bool := match f with | Bool b => b | t1 == t2 => (eval e t1 == eval e t2)%bool | Unit t1 => eval e t1 \in unit | f1 /\ f2 => loop f1 && loop f2 | f1 \/ f2 => loop f1 || loop f2 | f1 ==> f2 => (loop f1 ==> loop f2)%bool | ~ f1 => ~~ loop f1 |_ => false end%T. Lemma qf_evalP e f : qf_form f -> reflect (holds e f) (qf_eval e f). Proof. (* Goal: forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f) *) elim: f => //=; try by move=> *; apply: idP. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (or (holds e f) (holds e f0)) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (and (holds e f) (holds e f0)) (andb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (_ : is_true true), Bool.reflect (@eq (UnitRing.sort R) (eval e t) (eval e t0)) (@eq_op (UnitRing.eqType R) (eval e t) (eval e t0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (or (holds e f) (holds e f0)) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (and (holds e f) (holds e f0)) (andb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (_ : is_true true), Bool.reflect (@eq (UnitRing.sort R) (eval e t) (eval e t0)) (@eq_op (UnitRing.eqType R) (eval e t) (eval e t0)) *) by move=> t1 t2 _; apply: eqP. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (or (holds e f) (holds e f0)) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (and (holds e f) (holds e f0)) (andb (qf_eval e f) (qf_eval e f0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (or (holds e f) (holds e f0)) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (and (holds e f) (holds e f0)) (andb (qf_eval e f) (qf_eval e f0)) *) move=> f1 IHf1 f2 IHf2 /= /andP[/IHf1[] f1T]; last by right; case. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (or (holds e f) (holds e f0)) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall _ : is_true (qf_form f2), Bool.reflect (and (holds e f1) (holds e f2)) (andb true (qf_eval e f2)) *) by case/IHf2; [left | right; case]. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (or (holds e f) (holds e f0)) (orb (qf_eval e f) (qf_eval e f0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (or (holds e f) (holds e f0)) (orb (qf_eval e f) (qf_eval e f0)) *) move=> f1 IHf1 f2 IHf2 /= /andP[/IHf1[] f1F]; first by do 2 left. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall _ : is_true (qf_form f2), Bool.reflect (or (holds e f1) (holds e f2)) (orb false (qf_eval e f2)) *) by case/IHf2; [left; right | right; case]. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f0), Bool.reflect (holds e f0) (qf_eval e f0)) (_ : is_true (andb (qf_form f) (qf_form f0))), Bool.reflect (forall _ : holds e f, holds e f0) (implb (qf_eval e f) (qf_eval e f0)) *) move=> f1 IHf1 f2 IHf2 /= /andP[/IHf1[] f1T]; last by left. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) (* Goal: forall _ : is_true (qf_form f2), Bool.reflect (forall _ : holds e f1, holds e f2) (implb true (qf_eval e f2)) *) by case/IHf2; [left | right; move/(_ f1T)]. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (qf_form f), Bool.reflect (holds e f) (qf_eval e f)) (_ : is_true (qf_form f)), Bool.reflect (not (holds e f)) (negb (qf_eval e f)) *) by move=> f1 IHf1 /IHf1[]; [right | left]. Qed. Implicit Type bc : seq (term R) * seq (term R). Definition and_dnf bcs1 bcs2 := \big[cat/nil]_(bc1 <- bcs1) map (fun bc2 => (bc1.1 ++ bc2.1, bc1.2 ++ bc2.2)) bcs2. Fixpoint qf_to_dnf (f : formula R) (neg : bool) {struct f} := match f with | Bool b => if b (+) neg then [:: ([::], [::])] else [::] | t1 == t2 => [:: if neg then ([::], [:: t1 - t2]) else ([:: t1 - t2], [::])] | f1 /\ f2 => (if neg then cat else and_dnf) [rec f1, neg] [rec f2, neg] | f1 \/ f2 => (if neg then and_dnf else cat) [rec f1, neg] [rec f2, neg] | f1 ==> f2 => (if neg then and_dnf else cat) [rec f1, ~~ neg] [rec f2, neg] | ~ f1 => [rec f1, ~~ neg] | _ => if neg then [:: ([::], [::])] else [::] end%T where "[ 'rec' f , neg ]" := (qf_to_dnf f neg). Definition dnf_to_form := let pos_lit t := And (t == 0) in let neg_lit t := And (t != 0) in let cls bc := Or (foldr pos_lit True bc.1 /\ foldr neg_lit True bc.2) in foldr cls False. Lemma cat_dnfP e bcs1 bcs2 : qf_eval e (dnf_to_form (bcs1 ++ bcs2)) = qf_eval e (dnf_to_form bcs1 \/ dnf_to_form bcs2). Proof. (* Goal: @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) bcs1 bcs2))) (qf_eval e (@Or (UnitRing.sort R) (dnf_to_form bcs1) (dnf_to_form bcs2))) *) by elim: bcs1 => //= bc1 bcs1 IH1; rewrite -orbA; congr orb; rewrite IH1. Qed. Lemma and_dnfP e bcs1 bcs2 : qf_eval e (dnf_to_form (and_dnf bcs1 bcs2)) = qf_eval e (dnf_to_form bcs1 /\ dnf_to_form bcs2). Lemma qf_to_dnfP e : let qev f b := qf_eval e (dnf_to_form (qf_to_dnf f b)) in forall f, qf_form f && rformula f -> qev f false = qf_eval e f. Proof. (* Goal: let qev := fun (f : formula (UnitRing.sort R)) (b : bool) => qf_eval e (dnf_to_form (qf_to_dnf f b)) in forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) move=> qev; have qevT f: qev f true = ~~ qev f false. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: @eq bool (qev f true) (negb (qev f false)) *) rewrite {}/qev; elim: f => //=; do [by case | move=> f1 IH1 f2 IH2 | ]. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) (* Goal: forall t t0 : term (UnitRing.sort R), @eq bool (orb (andb (negb (@eq_op (UnitRing.eqType R) (@add (UnitRing.zmodType R) (eval e t) (@opp (UnitRing.zmodType R) (eval e t0))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) O))) true) false) (negb (orb (andb (andb (@eq_op (UnitRing.eqType R) (@add (UnitRing.zmodType R) (eval e t) (@opp (UnitRing.zmodType R) (eval e t0))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) O)) true) true) false)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) (* Goal: forall t t0 : term (UnitRing.sort R), @eq bool (orb (andb (negb (@eq_op (UnitRing.eqType R) (@add (UnitRing.zmodType R) (eval e t) (@opp (UnitRing.zmodType R) (eval e t0))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) O))) true) false) (negb (orb (andb (andb (@eq_op (UnitRing.eqType R) (@add (UnitRing.zmodType R) (eval e t) (@opp (UnitRing.zmodType R) (eval e t0))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) O)) true) true) false)) *) by move=> t1 t2; rewrite !andbT !orbF. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) by rewrite and_dnfP cat_dnfP negb_and -IH1 -IH2. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 true) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 false) (qf_to_dnf f2 false))))) *) by rewrite and_dnfP cat_dnfP negb_or -IH1 -IH2. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) (* Goal: @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 true)))) (negb (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false))))) *) by rewrite and_dnfP cat_dnfP /= negb_or IH1 -IH2 negbK. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f false))))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (negb (qf_eval e (dnf_to_form (qf_to_dnf f true)))) *) by move=> t1 ->; rewrite negbK. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qev f false) (qf_eval e f) *) rewrite /qev; elim=> //=; first by case. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f false) (qf_to_dnf f0 false)))) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f false) (qf_to_dnf f0 false)))) (andb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (_ : is_true (andb (rterm t) (rterm t0))), @eq bool (orb (andb (andb (@eq_op (UnitRing.eqType R) (@add (UnitRing.zmodType R) (eval e t) (@opp (UnitRing.zmodType R) (eval e t0))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) O)) true) true) false) (@eq_op (UnitRing.eqType R) (eval e t) (eval e t0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f false) (qf_to_dnf f0 false)))) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f false) (qf_to_dnf f0 false)))) (andb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (t t0 : term (UnitRing.sort R)) (_ : is_true (andb (rterm t) (rterm t0))), @eq bool (orb (andb (andb (@eq_op (UnitRing.eqType R) (@add (UnitRing.zmodType R) (eval e t) (@opp (UnitRing.zmodType R) (eval e t0))) (@natmul (Ring.zmodType (UnitRing.ringType R)) (one (UnitRing.ringType R)) O)) true) true) false) (@eq_op (UnitRing.eqType R) (eval e t) (eval e t0)) *) by move=> t1 t2 _; rewrite subr_eq0 !andbT orbF. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f false) (qf_to_dnf f0 false)))) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f false) (qf_to_dnf f0 false)))) (andb (qf_eval e f) (qf_eval e f0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f false) (qf_to_dnf f0 false)))) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f false) (qf_to_dnf f0 false)))) (andb (qf_eval e f) (qf_eval e f0)) *) move=> f1 IH1 f2 IH2; rewrite andbCA -andbA andbCA andbA; case/andP. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f false) (qf_to_dnf f0 false)))) (orb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (_ : is_true (andb (qf_form f1) (rformula f1))) (_ : is_true (andb (qf_form f2) (rformula f2))), @eq bool (qf_eval e (dnf_to_form (and_dnf (qf_to_dnf f1 false) (qf_to_dnf f2 false)))) (andb (qf_eval e f1) (qf_eval e f2)) *) by rewrite and_dnfP /= => /IH1-> /IH2->. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f false) (qf_to_dnf f0 false)))) (orb (qf_eval e f) (qf_eval e f0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f false) (qf_to_dnf f0 false)))) (orb (qf_eval e f) (qf_eval e f0)) *) move=> f1 IH1 f2 IH2; rewrite andbCA -andbA andbCA andbA; case/andP. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) (* Goal: forall (_ : is_true (andb (qf_form f1) (rformula f1))) (_ : is_true (andb (qf_form f2) (rformula f2))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 false) (qf_to_dnf f2 false)))) (orb (qf_eval e f1) (qf_eval e f2)) *) by rewrite cat_dnfP /= => /IH1-> => /IH2->. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) - (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (f0 : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f0) (rformula f0)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f0 false))) (qf_eval e f0)) (_ : is_true (andb (andb (qf_form f) (qf_form f0)) (andb (rformula f) (rformula f0)))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f true) (qf_to_dnf f0 false)))) (implb (qf_eval e f) (qf_eval e f0)) *) move=> f1 IH1 f2 IH2; rewrite andbCA -andbA andbCA andbA; case/andP. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) (* Goal: forall (_ : is_true (andb (qf_form f1) (rformula f1))) (_ : is_true (andb (qf_form f2) (rformula f2))), @eq bool (qf_eval e (dnf_to_form (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (qf_to_dnf f1 true) (qf_to_dnf f2 false)))) (implb (qf_eval e f1) (qf_eval e f2)) *) by rewrite cat_dnfP /= [qf_eval _ _]qevT -implybE => /IH1 <- /IH2->. (* Goal: forall (f : formula (UnitRing.sort R)) (_ : forall _ : is_true (andb (qf_form f) (rformula f)), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f false))) (qf_eval e f)) (_ : is_true (andb (qf_form f) (rformula f))), @eq bool (qf_eval e (dnf_to_form (qf_to_dnf f true))) (negb (qf_eval e f)) *) by move=> f1 IH1 /IH1 <-; rewrite -qevT. Qed. Lemma dnf_to_form_qf bcs : qf_form (dnf_to_form bcs). Proof. (* Goal: is_true (qf_form (dnf_to_form bcs)) *) by elim: bcs => //= [[clT clF] _ ->] /=; elim: clT => //=; elim: clF. Qed. Definition dnf_rterm cl := all rterm cl.1 && all rterm cl.2. Lemma qf_to_dnf_rterm f b : rformula f -> all dnf_rterm (qf_to_dnf f b). Proof. (* Goal: forall _ : is_true (rformula f), is_true (@all (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) dnf_rterm (qf_to_dnf f b)) *) set ok := all dnf_rterm. (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) have cat_ok bcs1 bcs2: ok bcs1 -> ok bcs2 -> ok (bcs1 ++ bcs2). (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) (* Goal: forall (_ : is_true (ok bcs1)) (_ : is_true (ok bcs2)), is_true (ok (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) bcs1 bcs2)) *) by move=> ok1 ok2; rewrite [ok _]all_cat; apply/andP. (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) have and_ok bcs1 bcs2: ok bcs1 -> ok bcs2 -> ok (and_dnf bcs1 bcs2). (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) (* Goal: forall (_ : is_true (ok bcs1)) (_ : is_true (ok bcs2)), is_true (ok (and_dnf bcs1 bcs2)) *) rewrite /and_dnf unlock; elim: bcs1 => //= cl1 bcs1 IH1; rewrite -andbA. (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) (* Goal: forall (_ : is_true (andb (@all (term (UnitRing.sort R)) rterm (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1)) (andb (@all (term (UnitRing.sort R)) rterm (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1)) (ok bcs1)))) (_ : is_true (ok bcs2)), is_true (ok (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (@map (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (fun bc2 : prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) => @pair (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) (@cat (term (UnitRing.sort R)) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc2)) (@cat (term (UnitRing.sort R)) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc2))) bcs2) (@reducebig (list (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))))) (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (@nil (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))))) bcs1 (fun bc1 : prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) => @BigBody (list (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))))) (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) bc1 (@cat (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))))) true (@map (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (fun bc2 : prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) => @pair (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) (@cat (term (UnitRing.sort R)) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc1) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc2)) (@cat (term (UnitRing.sort R)) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc1) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc2))) bcs2))))) *) case/and3P=> ok11 ok12 ok1 ok2; rewrite cat_ok ?{}IH1 {bcs1 ok1}//. (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) (* Goal: is_true (ok (@map (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R)))) (fun bc2 : prod (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) => @pair (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) (@cat (term (UnitRing.sort R)) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc2)) (@cat (term (UnitRing.sort R)) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) bc2))) bcs2)) *) elim: bcs2 ok2 => //= cl2 bcs2 IH2 /andP[ok2 /IH2->]. (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) (* Goal: is_true (andb (dnf_rterm (@pair (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) (@cat (term (UnitRing.sort R)) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1) (@fst (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl2)) (@cat (term (UnitRing.sort R)) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl1) (@snd (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) cl2)))) true) *) by rewrite /dnf_rterm !all_cat ok11 ok12 /= !andbT. (* Goal: forall _ : is_true (rformula f), is_true (ok (qf_to_dnf f b)) *) elim: f b => //=; [ by do 2!case | | | | | by auto | | ]; try by repeat case/andP || intro; case: ifP; auto. (* Goal: forall (t t0 : term (UnitRing.sort R)) (b : bool) (_ : is_true (andb (rterm t) (rterm t0))), is_true (andb (dnf_rterm (if b then @pair (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) (@nil (term (UnitRing.sort R))) (@cons (term (UnitRing.sort R)) (@Add (UnitRing.sort R) t (@Opp (UnitRing.sort R) t0)) (@nil (term (UnitRing.sort R)))) else @pair (list (term (UnitRing.sort R))) (list (term (UnitRing.sort R))) (@cons (term (UnitRing.sort R)) (@Add (UnitRing.sort R) t (@Opp (UnitRing.sort R) t0)) (@nil (term (UnitRing.sort R)))) (@nil (term (UnitRing.sort R))))) true) *) by rewrite /dnf_rterm => ?? [] /= ->. Qed. Lemma dnf_to_rform bcs : rformula (dnf_to_form bcs) = all dnf_rterm bcs. Section If. Variables (pred_f then_f else_f : formula R). Definition If := (pred_f /\ then_f \/ ~ pred_f /\ else_f)%T. Lemma If_form_qf : qf_form pred_f -> qf_form then_f -> qf_form else_f -> qf_form If. Proof. (* Goal: forall (_ : is_true (qf_form pred_f)) (_ : is_true (qf_form then_f)) (_ : is_true (qf_form else_f)), is_true (qf_form If) *) by move=> /= -> -> ->. Qed. Lemma If_form_rf : rformula pred_f -> rformula then_f -> rformula else_f -> rformula If. Proof. (* Goal: forall (_ : is_true (rformula pred_f)) (_ : is_true (rformula then_f)) (_ : is_true (rformula else_f)), is_true (rformula If) *) by move=> /= -> -> ->. Qed. Lemma eval_If e : let ev := qf_eval e in ev If = (if ev pred_f then ev then_f else ev else_f). Proof. (* Goal: let ev := qf_eval e in @eq bool (ev If) (if ev pred_f then ev then_f else ev else_f) *) by rewrite /=; case: ifP => _; rewrite ?orbF. Qed. End If. Section Pick. Variables (I : finType) (pred_f then_f : I -> formula R) (else_f : formula R). Definition Pick := \big[Or/False]_(p : {ffun pred I}) ((\big[And/True]_i (if p i then pred_f i else ~ pred_f i)) /\ (if pick p is Some i then then_f i else else_f))%T. Lemma Pick_form_qf : (forall i, qf_form (pred_f i)) -> (forall i, qf_form (then_f i)) -> qf_form else_f -> qf_form Pick. Proof. (* Goal: forall (_ : forall i : Finite.sort I, is_true (qf_form (pred_f i))) (_ : forall i : Finite.sort I, is_true (qf_form (then_f i))) (_ : is_true (qf_form else_f)), is_true (qf_form Pick) *) move=> qfp qft qfe; have mA := (big_morph qf_form) true andb. (* Goal: is_true (qf_form Pick) *) rewrite mA // big1 //= => p _. (* Goal: @eq bool (andb (qf_form (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool p i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) (qf_form match @pick I (@FunFinfun.fun_of_fin I bool p) with | Some i => then_f i | None => else_f end)) true *) rewrite mA // big1 => [|i _]; first by case: pick. (* Goal: @eq bool (qf_form (if @FunFinfun.fun_of_fin I bool p i then pred_f i else @Not (UnitRing.sort R) (pred_f i))) true *) by rewrite fun_if if_same /= qfp. Qed. Lemma eval_Pick e (qev := qf_eval e) : let P i := qev (pred_f i) in qev Pick = (if pick P is Some i then qev (then_f i) else qev else_f). Proof. (* Goal: let P := fun i : Finite.sort I => qev (pred_f i) in @eq bool (qev Pick) match @pick I P with | Some i => qev (then_f i) | None => qev else_f end *) move=> P; rewrite ((big_morph qev) false orb) //= big_orE /=. (* Goal: @eq bool (negb (@FiniteQuant.quant0b (finfun_of_finType I bool_finType) (fun i : @finfun_of I bool (Phant (forall _ : Finite.sort I, bool)) => @FiniteQuant.ex_in (finfun_of_finType I bool_finType) true (FiniteQuant.Quantified (andb (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i0 : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i0 (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool i i0 then pred_f i0 else @Not (UnitRing.sort R) (pred_f i0))))) (qev match @pick I (@FunFinfun.fun_of_fin I bool i) with | Some i0 => then_f i0 | None => else_f end))) i))) match @pick I P with | Some i => qev (then_f i) | None => qev else_f end *) apply/existsP/idP=> [[p] | true_at_P]. (* Goal: @ex (Finite.sort (finfun_of_finType I bool_finType)) (fun x : Finite.sort (finfun_of_finType I bool_finType) => is_true (andb true (andb (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool x i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) (qev match @pick I (@FunFinfun.fun_of_fin I bool x) with | Some i => then_f i | None => else_f end)))) *) (* Goal: forall _ : is_true (andb true (andb (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool p i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) (qev match @pick I (@FunFinfun.fun_of_fin I bool p) with | Some i => then_f i | None => else_f end))), is_true match @pick I P with | Some i => qev (then_f i) | None => qev else_f end *) rewrite ((big_morph qev) true andb) //= big_andE /=. (* Goal: @ex (Finite.sort (finfun_of_finType I bool_finType)) (fun x : Finite.sort (finfun_of_finType I bool_finType) => is_true (andb true (andb (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool x i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) (qev match @pick I (@FunFinfun.fun_of_fin I bool x) with | Some i => then_f i | None => else_f end)))) *) (* Goal: forall _ : is_true (andb (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I true (FiniteQuant.Quantified (qev (if @FunFinfun.fun_of_fin I bool p i then pred_f i else @Not (UnitRing.sort R) (pred_f i)))) i)) (qev match @pick I (@FunFinfun.fun_of_fin I bool p) with | Some i => then_f i | None => else_f end)), is_true match @pick I P with | Some i => qev (then_f i) | None => qev else_f end *) case/andP=> /forallP-eq_p_P. (* Goal: @ex (Finite.sort (finfun_of_finType I bool_finType)) (fun x : Finite.sort (finfun_of_finType I bool_finType) => is_true (andb true (andb (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool x i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) (qev match @pick I (@FunFinfun.fun_of_fin I bool x) with | Some i => then_f i | None => else_f end)))) *) (* Goal: forall _ : is_true (qev match @pick I (@FunFinfun.fun_of_fin I bool p) with | Some i => then_f i | None => else_f end), is_true match @pick I P with | Some i => qev (then_f i) | None => qev else_f end *) rewrite (@eq_pick _ _ P) => [|i]; first by case: pick. (* Goal: @ex (Finite.sort (finfun_of_finType I bool_finType)) (fun x : Finite.sort (finfun_of_finType I bool_finType) => is_true (andb true (andb (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool x i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) (qev match @pick I (@FunFinfun.fun_of_fin I bool x) with | Some i => then_f i | None => else_f end)))) *) (* Goal: @eq bool (@FunFinfun.fun_of_fin I bool p i) (P i) *) by move/(_ i): eq_p_P => /=; case: (p i) => //=; move/negbTE. (* Goal: @ex (Finite.sort (finfun_of_finType I bool_finType)) (fun x : Finite.sort (finfun_of_finType I bool_finType) => is_true (andb true (andb (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool x i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) (qev match @pick I (@FunFinfun.fun_of_fin I bool x) with | Some i => then_f i | None => else_f end)))) *) exists [ffun i => P i] => /=; apply/andP; split. (* Goal: is_true (qev match @pick I (@FunFinfun.fun_of_fin I bool (@FunFinfun.finfun I bool (fun i : Finite.sort I => P i))) with | Some i => then_f i | None => else_f end) *) (* Goal: is_true (qev (@BigOp.bigop (formula (UnitRing.sort R)) (Finite.sort I) (@Bool (UnitRing.sort R) true) (index_enum I) (fun i : Finite.sort I => @BigBody (formula (UnitRing.sort R)) (Finite.sort I) i (@And (UnitRing.sort R)) true (if @FunFinfun.fun_of_fin I bool (@FunFinfun.finfun I bool (fun i0 : Finite.sort I => P i0)) i then pred_f i else @Not (UnitRing.sort R) (pred_f i))))) *) rewrite ((big_morph qev) true andb) //= big_andE /=. (* Goal: is_true (qev match @pick I (@FunFinfun.fun_of_fin I bool (@FunFinfun.finfun I bool (fun i : Finite.sort I => P i))) with | Some i => then_f i | None => else_f end) *) (* Goal: is_true (@FiniteQuant.quant0b I (fun i : Finite.sort I => @FiniteQuant.all_in I true (FiniteQuant.Quantified (qev (if @FunFinfun.fun_of_fin I bool (@FunFinfun.finfun I bool (fun i0 : Finite.sort I => P i0)) i then pred_f i else @Not (UnitRing.sort R) (pred_f i)))) i)) *) by apply/forallP=> i; rewrite /= ffunE; case Pi: (P i) => //=; apply: negbT. (* Goal: is_true (qev match @pick I (@FunFinfun.fun_of_fin I bool (@FunFinfun.finfun I bool (fun i : Finite.sort I => P i))) with | Some i => then_f i | None => else_f end) *) rewrite (@eq_pick _ _ P) => [|i]; first by case: pick true_at_P. (* Goal: @eq bool (@FunFinfun.fun_of_fin I bool (@FunFinfun.finfun I bool (fun i : Finite.sort I => P i)) i) (P i) *) by rewrite ffunE. Qed. End Pick. Section MultiQuant. Variable f : formula R. Implicit Types (I : seq nat) (e : seq R). Lemma foldExistsP I e : (exists2 e', {in [predC I], same_env e e'} & holds e' f) <-> holds e (foldr Exists f I). Proof. (* Goal: iff (@ex2 (list (UnitRing.sort R)) (fun e' : list (UnitRing.sort R) => @prop_in1 (Equality.sort nat_eqType) (@mem (Equality.sort nat_eqType) (simplPredType (Equality.sort nat_eqType)) (@predC (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred_of_mem_pred (Equality.sort nat_eqType) (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) I))))) (fun x : nat => @eq (Zmodule.sort (UnitRing.zmodType R)) (@nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e x) (@nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))) (fun e' : list (UnitRing.sort R) => holds e' f)) (holds e (@foldr nat (formula (UnitRing.sort R)) (@Exists (UnitRing.sort R)) f I)) *) elim: I e => /= [|i I IHi] e. (* Goal: iff (@ex2 (list (UnitRing.sort R)) (fun e' : list (UnitRing.sort R) => @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))) (fun e' : list (UnitRing.sort R) => holds e' f)) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i x) (@foldr nat (formula (UnitRing.sort R)) (@Exists (UnitRing.sort R)) f I))) *) (* Goal: iff (@ex2 (list (UnitRing.sort R)) (fun e' : list (UnitRing.sort R) => @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@nil nat)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))) (fun e' : list (UnitRing.sort R) => holds e' f)) (holds e f) *) by split=> [[e' eq_e] |]; [apply: eq_holds => i; rewrite eq_e | exists e]. (* Goal: iff (@ex2 (list (UnitRing.sort R)) (fun e' : list (UnitRing.sort R) => @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))) (fun e' : list (UnitRing.sort R) => holds e' f)) (@ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i x) (@foldr nat (formula (UnitRing.sort R)) (@Exists (UnitRing.sort R)) f I))) *) split=> [[e' eq_e f_e'] | [x]]; last set e_x := set_nth 0 e i x. (* Goal: forall _ : holds e_x (@foldr nat (formula (UnitRing.sort R)) (@Exists (UnitRing.sort R)) f I), @ex2 (list (UnitRing.sort R)) (fun e' : list (UnitRing.sort R) => @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))) (fun e' : list (UnitRing.sort R) => holds e' f) *) (* Goal: @ex (UnitRing.sort R) (fun x : UnitRing.sort R => holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i x) (@foldr nat (formula (UnitRing.sort R)) (@Exists (UnitRing.sort R)) f I)) *) exists e'`_i; apply/IHi; exists e' => // j. (* Goal: forall _ : holds e_x (@foldr nat (formula (UnitRing.sort R)) (@Exists (UnitRing.sort R)) f I), @ex2 (list (UnitRing.sort R)) (fun e' : list (UnitRing.sort R) => @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))) (fun e' : list (UnitRing.sort R) => holds e' f) *) (* Goal: forall _ : is_true (@in_mem nat j (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) I)))))), @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i (@nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e' i)) j) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' j) *) by have:= eq_e j; rewrite nth_set_nth /= !inE; case: eqP => // ->. (* Goal: forall _ : holds e_x (@foldr nat (formula (UnitRing.sort R)) (@Exists (UnitRing.sort R)) f I), @ex2 (list (UnitRing.sort R)) (fun e' : list (UnitRing.sort R) => @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))) (fun e' : list (UnitRing.sort R) => holds e' f) *) case/IHi=> e' eq_e f_e'; exists e' => // j. (* Goal: forall _ : is_true (@in_mem nat j (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I))))))), @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' j) *) by have:= eq_e j; rewrite nth_set_nth /= !inE; case: eqP. Qed. Lemma foldForallP I e : (forall e', {in [predC I], same_env e e'} -> holds e' f) <-> holds e (foldr Forall f I). Proof. (* Goal: iff (forall (e' : list (UnitRing.sort R)) (_ : @prop_in1 (Equality.sort nat_eqType) (@mem (Equality.sort nat_eqType) (simplPredType (Equality.sort nat_eqType)) (@predC (Equality.sort nat_eqType) (@pred_of_simpl (Equality.sort nat_eqType) (@pred_of_mem_pred (Equality.sort nat_eqType) (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) I))))) (fun x : nat => @eq (Zmodule.sort (UnitRing.zmodType R)) (@nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e x) (@nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))), holds e' f) (holds e (@foldr nat (formula (UnitRing.sort R)) (@Forall (UnitRing.sort R)) f I)) *) elim: I e => /= [|i I IHi] e. (* Goal: iff (forall (e' : list (UnitRing.sort R)) (_ : @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))), holds e' f) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i x) (@foldr nat (formula (UnitRing.sort R)) (@Forall (UnitRing.sort R)) f I)) *) (* Goal: iff (forall (e' : list (UnitRing.sort R)) (_ : @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@nil nat)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))), holds e' f) (holds e f) *) by split=> [|f_e e' eq_e]; [apply | apply: eq_holds f_e => i; rewrite eq_e]. (* Goal: iff (forall (e' : list (UnitRing.sort R)) (_ : @prop_in1 nat (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I)))))) (fun x : nat => @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e x) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' x)) (inPhantom (same_env e e'))), holds e' f) (forall x : UnitRing.sort R, holds (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i x) (@foldr nat (formula (UnitRing.sort R)) (@Forall (UnitRing.sort R)) f I)) *) split=> [f_e' x | f_e e' eq_e]; first set e_x := set_nth 0 e i x. (* Goal: holds e' f *) (* Goal: holds e_x (@foldr nat (formula (UnitRing.sort R)) (@Forall (UnitRing.sort R)) f I) *) apply/IHi=> e' eq_e; apply: f_e' => j. (* Goal: holds e' f *) (* Goal: forall _ : is_true (@in_mem nat j (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) (@cons nat i I))))))), @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e j) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' j) *) by have:= eq_e j; rewrite nth_set_nth /= !inE; case: eqP. (* Goal: holds e' f *) move/IHi: (f_e e'`_i); apply=> j. (* Goal: forall _ : is_true (@in_mem nat j (@mem nat (simplPredType nat) (@predC nat (@pred_of_simpl nat (@pred_of_mem_pred nat (@mem nat (seq_predType nat_eqType) I)))))), @eq (UnitRing.sort R) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) (@set_nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e i (@nth (Zmodule.sort (UnitRing.zmodType R)) (zero (UnitRing.zmodType R)) e' i)) j) (@nth (UnitRing.sort R) (zero (UnitRing.zmodType R)) e' j) *) by have:= eq_e j; rewrite nth_set_nth /= !inE; case: eqP => // ->. Qed. End MultiQuant. End EvalTerm. Prenex Implicits dnf_rterm. Module IntegralDomain. Definition axiom (R : ringType) := forall x y : R, x * y = 0 -> (x == 0) || (y == 0). Section ClassDef. Record class_of (R : Type) : Type := Class {base : ComUnitRing.class_of R; mixin : axiom (Ring.Pack base)}. Local Coercion base : class_of >-> ComUnitRing.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (m0 : axiom (@Ring.Pack T b0)) := fun bT b & phant_id (ComUnitRing.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition comRingType := @ComRing.Pack cT xclass. Definition unitRingType := @UnitRing.Pack cT xclass. Definition comUnitRingType := @ComUnitRing.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> ComUnitRing.class_of. Arguments mixin [R] c [x y]. Coercion mixin : class_of >-> axiom. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Coercion comRingType : type >-> ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> ComUnitRing.type. Canonical comUnitRingType. Notation idomainType := type. Notation IdomainType T m := (@pack T _ m _ _ id _ id). Notation "[ 'idomainType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'idomainType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'idomainType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'idomainType' 'of' T ]") : form_scope. End Exports. End IntegralDomain. Import IntegralDomain.Exports. Section IntegralDomainTheory. Variable R : idomainType. Implicit Types x y : R. Lemma mulf_eq0 x y : (x * y == 0) = (x == 0) || (y == 0). Lemma prodf_eq0 (I : finType) (P : pred I) (F : I -> R) : reflect (exists2 i, P i & (F i == 0)) (\prod_(i | P i) F i == 0). Lemma prodf_seq_eq0 I r (P : pred I) (F : I -> R) : (\prod_(i <- r | P i) F i == 0) = has (fun i => P i && (F i == 0)) r. Proof. (* Goal: @eq bool (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@BigOp.bigop (Ring.sort (IntegralDomain.ringType R)) I (one (IntegralDomain.ringType R)) r (fun i : I => @BigBody (Ring.sort (IntegralDomain.ringType R)) I i (@mul (IntegralDomain.ringType R)) (P i) (F i))) (zero (Ring.zmodType (IntegralDomain.ringType R)))) (@has I (fun i : I => andb (P i) (@eq_op (IntegralDomain.eqType R) (F i) (zero (IntegralDomain.zmodType R)))) r) *) by rewrite (big_morph _ mulf_eq0 (oner_eq0 _)) big_has_cond. Qed. Lemma mulf_neq0 x y : x != 0 -> y != 0 -> x * y != 0. Proof. (* Goal: forall (_ : is_true (negb (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R))))) (_ : is_true (negb (@eq_op (IntegralDomain.eqType R) y (zero (IntegralDomain.zmodType R))))), is_true (negb (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@mul (IntegralDomain.ringType R) x y) (zero (Ring.zmodType (IntegralDomain.ringType R))))) *) by move=> x0 y0; rewrite mulf_eq0; apply/norP. Qed. Lemma prodf_neq0 (I : finType) (P : pred I) (F : I -> R) : reflect (forall i, P i -> (F i != 0)) (\prod_(i | P i) F i != 0). Proof. (* Goal: Bool.reflect (forall (i : Finite.sort I) (_ : is_true (P i)), is_true (negb (@eq_op (IntegralDomain.eqType R) (F i) (zero (IntegralDomain.zmodType R))))) (negb (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@BigOp.bigop (Ring.sort (IntegralDomain.ringType R)) (Finite.sort I) (one (IntegralDomain.ringType R)) (index_enum I) (fun i : Finite.sort I => @BigBody (Ring.sort (IntegralDomain.ringType R)) (Finite.sort I) i (@mul (IntegralDomain.ringType R)) (P i) (F i))) (zero (Ring.zmodType (IntegralDomain.ringType R))))) *) by rewrite (sameP (prodf_eq0 _ _) exists_inP) negb_exists_in; apply: forall_inP. Qed. Lemma prodf_seq_neq0 I r (P : pred I) (F : I -> R) : (\prod_(i <- r | P i) F i != 0) = all (fun i => P i ==> (F i != 0)) r. Proof. (* Goal: @eq bool (negb (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@BigOp.bigop (Ring.sort (IntegralDomain.ringType R)) I (one (IntegralDomain.ringType R)) r (fun i : I => @BigBody (Ring.sort (IntegralDomain.ringType R)) I i (@mul (IntegralDomain.ringType R)) (P i) (F i))) (zero (Ring.zmodType (IntegralDomain.ringType R))))) (@all I (fun i : I => implb (P i) (negb (@eq_op (IntegralDomain.eqType R) (F i) (zero (IntegralDomain.zmodType R))))) r) *) rewrite prodf_seq_eq0 -all_predC; apply: eq_all => i /=. (* Goal: @eq bool (negb (andb (P i) (@eq_op (IntegralDomain.eqType R) (F i) (zero (IntegralDomain.zmodType R))))) (implb (P i) (negb (@eq_op (IntegralDomain.eqType R) (F i) (zero (IntegralDomain.zmodType R))))) *) by rewrite implybE negb_and. Qed. Lemma expf_eq0 x n : (x ^+ n == 0) = (n > 0) && (x == 0). Proof. (* Goal: @eq bool (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@exp (IntegralDomain.ringType R) x n) (zero (Ring.zmodType (IntegralDomain.ringType R)))) (andb (leq (S O) n) (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))) *) elim: n => [|n IHn]; first by rewrite oner_eq0. (* Goal: @eq bool (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@exp (IntegralDomain.ringType R) x (S n)) (zero (Ring.zmodType (IntegralDomain.ringType R)))) (andb (leq (S O) (S n)) (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))) *) by rewrite exprS mulf_eq0 IHn andKb. Qed. Lemma expf_neq0 x m : x != 0 -> x ^+ m != 0. Proof. (* Goal: forall _ : is_true (negb (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))), is_true (negb (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@exp (IntegralDomain.ringType R) x m) (zero (Ring.zmodType (IntegralDomain.ringType R))))) *) by move=> x_nz; rewrite expf_eq0; apply/nandP; right. Qed. Lemma natf_neq0 n : (n%:R != 0 :> R) = [char R]^'.-nat n. Proof. (* Goal: @eq bool (negb (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) n : IntegralDomain.sort R) (zero (IntegralDomain.zmodType R) : IntegralDomain.sort R))) (pnat (negn (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R)))) n) *) have [-> | /prod_prime_decomp->] := posnP n; first by rewrite eqxx. (* Goal: @eq bool (negb (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) (@BigOp.bigop nat (prod nat nat) (S O) (prime_decomp n) (fun f : prod nat nat => @BigBody nat (prod nat nat) f muln true (expn (@fst nat nat f) (@snd nat nat f))))) (zero (IntegralDomain.zmodType R)))) (pnat (negn (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R)))) (@BigOp.bigop nat (prod nat nat) (S O) (prime_decomp n) (fun f : prod nat nat => @BigBody nat (prod nat nat) f muln true (expn (@fst nat nat f) (@snd nat nat f))))) *) rewrite !big_seq; elim/big_rec: _ => [|[p e] s /=]; first by rewrite oner_eq0. (* Goal: forall (_ : is_true (@in_mem (prod nat nat) (@pair nat nat p e) (@mem (prod nat nat) (seq_predType (prod_eqType nat_eqType nat_eqType)) (prime_decomp n)))) (_ : @eq bool (negb (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) s) (zero (IntegralDomain.zmodType R)))) (pnat (negn (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R)))) s)), @eq bool (negb (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) (muln (expn p e) s)) (zero (IntegralDomain.zmodType R)))) (pnat (negn (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R)))) (muln (expn p e) s)) *) case/mem_prime_decomp=> p_pr _ _; rewrite pnat_mul pnat_exp eqn0Ngt orbC => <-. (* Goal: @eq bool (negb (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) (muln (expn p e) s)) (zero (IntegralDomain.zmodType R)))) (andb (orb (negb (leq (S O) e)) (pnat (negn (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R)))) p)) (negb (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) s) (zero (IntegralDomain.zmodType R))))) *) by rewrite natrM natrX mulf_eq0 expf_eq0 negb_or negb_and pnatE ?inE p_pr. Qed. Lemma natf0_char n : n > 0 -> n%:R == 0 :> R -> exists p, p \in [char R]. Proof. (* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) n : IntegralDomain.sort R) (zero (IntegralDomain.zmodType R) : IntegralDomain.sort R))), @ex nat (fun p : nat => is_true (@in_mem nat p (@mem nat nat_pred_pred (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R)))))) *) move=> n_gt0 nR_0; exists (pdiv n`_[char R]). (* Goal: is_true (@in_mem nat (pdiv (partn n (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R))))) (@mem nat nat_pred_pred (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R))))) *) apply: pnatP (pdiv_dvd _); rewrite ?part_pnat // ?pdiv_prime //. (* Goal: is_true (leq (S (S O)) (partn n (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R))))) *) by rewrite ltn_neqAle eq_sym partn_eq1 // -natf_neq0 nR_0 /=. Qed. Lemma charf'_nat n : [char R]^'.-nat n = (n%:R != 0 :> R). Lemma charf0P : [char R] =i pred0 <-> (forall n, (n%:R == 0 :> R) = (n == 0)%N). Proof. (* Goal: iff (@eq_mem nat (@mem nat nat_pred_pred (@char (IntegralDomain.ringType R) (Phant (IntegralDomain.sort R)))) (@mem nat (simplPredType nat) (@pred0 nat))) (forall n : nat, @eq bool (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) n : IntegralDomain.sort R) (zero (IntegralDomain.zmodType R) : IntegralDomain.sort R)) (@eq_op nat_eqType n O)) *) split=> charF0 n; last by rewrite !inE charF0 andbC; case: eqP => // ->. (* Goal: @eq bool (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) n) (zero (IntegralDomain.zmodType R))) (@eq_op nat_eqType n O) *) have [-> | n_gt0] := posnP; first exact: eqxx. (* Goal: @eq bool (@eq_op (IntegralDomain.eqType R) (@natmul (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R)) n) (zero (IntegralDomain.zmodType R))) false *) by apply/negP; case/natf0_char=> // p; rewrite charF0. Qed. Lemma eqf_sqr x y : (x ^+ 2 == y ^+ 2) = (x == y) || (x == - y). Proof. (* Goal: @eq bool (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@exp (IntegralDomain.ringType R) x (S (S O))) (@exp (IntegralDomain.ringType R) y (S (S O)))) (orb (@eq_op (IntegralDomain.eqType R) x y) (@eq_op (IntegralDomain.eqType R) x (@opp (IntegralDomain.zmodType R) y))) *) by rewrite -subr_eq0 subr_sqr mulf_eq0 subr_eq0 addr_eq0. Qed. Lemma mulfI x : x != 0 -> injective ( *%R x). Proof. (* Goal: forall _ : is_true (negb (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))), @injective (Ring.sort (IntegralDomain.ringType R)) (Ring.sort (IntegralDomain.ringType R)) (@mul (IntegralDomain.ringType R) x) *) move=> nz_x y z; apply: contra_eq => neq_yz. (* Goal: is_true (negb (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@mul (IntegralDomain.ringType R) x y) (@mul (IntegralDomain.ringType R) x z))) *) by rewrite -subr_eq0 -mulrBr mulf_neq0 ?subr_eq0. Qed. Lemma mulIf x : x != 0 -> injective ( *%R^~ x). Proof. (* Goal: forall _ : is_true (negb (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))), @injective (Ring.sort (IntegralDomain.ringType R)) (Ring.sort (IntegralDomain.ringType R)) (fun x0 : Ring.sort (IntegralDomain.ringType R) => @mul (IntegralDomain.ringType R) x0 x) *) by move=> nz_x y z; rewrite -!(mulrC x); apply: mulfI. Qed. Lemma divfI x : x != 0 -> injective (fun y => x / y). Proof. (* Goal: forall _ : is_true (negb (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))), @injective (Ring.sort (IntegralDomain.ringType R)) (IntegralDomain.sort R) (fun y : IntegralDomain.sort R => @mul (IntegralDomain.ringType R) x (@inv (IntegralDomain.unitRingType R) y)) *) by move/mulfI/inj_comp; apply; apply: invr_inj. Qed. Lemma divIf y : y != 0 -> injective (fun x => x / y). Proof. (* Goal: forall _ : is_true (negb (@eq_op (IntegralDomain.eqType R) y (zero (IntegralDomain.zmodType R)))), @injective (Ring.sort (IntegralDomain.ringType R)) (IntegralDomain.sort R) (fun x : IntegralDomain.sort R => @mul (IntegralDomain.ringType R) x (@inv (IntegralDomain.unitRingType R) y)) *) by rewrite -invr_eq0; apply: mulIf. Qed. Lemma sqrf_eq1 x : (x ^+ 2 == 1) = (x == 1) || (x == -1). Proof. (* Goal: @eq bool (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@exp (IntegralDomain.ringType R) x (S (S O))) (one (IntegralDomain.ringType R))) (orb (@eq_op (IntegralDomain.eqType R) x (one (IntegralDomain.ringType R))) (@eq_op (IntegralDomain.eqType R) x (@opp (Ring.zmodType (IntegralDomain.ringType R)) (one (IntegralDomain.ringType R))))) *) by rewrite -subr_eq0 subr_sqr_1 mulf_eq0 subr_eq0 addr_eq0. Qed. Lemma expfS_eq1 x n : (x ^+ n.+1 == 1) = (x == 1) || (\sum_(i < n.+1) x ^+ i == 0). Proof. (* Goal: @eq bool (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@exp (IntegralDomain.ringType R) x (S n)) (one (IntegralDomain.ringType R))) (orb (@eq_op (IntegralDomain.eqType R) x (one (IntegralDomain.ringType R))) (@eq_op (Zmodule.eqType (Ring.zmodType (IntegralDomain.ringType R))) (@BigOp.bigop (Zmodule.sort (Ring.zmodType (IntegralDomain.ringType R))) (Finite.sort (ordinal_finType (S n))) (zero (Ring.zmodType (IntegralDomain.ringType R))) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Zmodule.sort (Ring.zmodType (IntegralDomain.ringType R))) (ordinal (S n)) i (@add (Ring.zmodType (IntegralDomain.ringType R))) true (@exp (IntegralDomain.ringType R) x (@nat_of_ord (S n) i)))) (zero (Ring.zmodType (IntegralDomain.ringType R))))) *) by rewrite -![_ == 1]subr_eq0 subrX1 mulf_eq0. Qed. Lemma lregP x : reflect (lreg x) (x != 0). Proof. (* Goal: Bool.reflect (@lreg (IntegralDomain.ringType R) x) (negb (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))) *) by apply: (iffP idP) => [/mulfI | /lreg_neq0]. Qed. Lemma rregP x : reflect (rreg x) (x != 0). Proof. (* Goal: Bool.reflect (@rreg (IntegralDomain.ringType R) x) (negb (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R)))) *) by apply: (iffP idP) => [/mulIf | /rreg_neq0]. Qed. Canonical regular_idomainType := [idomainType of R^o]. End IntegralDomainTheory. Arguments lregP {R x}. Arguments rregP {R x}. Module Field. Definition mixin_of (R : unitRingType) := forall x : R, x != 0 -> x \in unit. Lemma IdomainMixin R : mixin_of R -> IntegralDomain.axiom R. Proof. (* Goal: forall _ : mixin_of R, IntegralDomain.axiom (UnitRing.ringType R) *) move=> m x y xy0; apply/norP=> [[]] /m Ux /m. (* Goal: forall _ : is_true (@in_mem (UnitRing.sort R) y (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))), Logic.False *) by rewrite -(unitrMr _ Ux) xy0 unitr0. Qed. Section Mixins. Definition axiom (R : ringType) inv := forall x : R, x != 0 -> inv x * x = 1. Variables (R : comRingType) (inv : R -> R). Hypotheses (mulVf : axiom inv) (inv0 : inv 0 = 0). Fact intro_unit (x y : R) : y * x = 1 -> x != 0. Proof. (* Goal: forall _ : @eq (Ring.sort (ComRing.ringType R)) (@mul (ComRing.ringType R) y x) (one (ComRing.ringType R)), is_true (negb (@eq_op (ComRing.eqType R) x (zero (ComRing.zmodType R)))) *) by move=> yx1; apply: contraNneq (oner_neq0 R) => x0; rewrite -yx1 x0 mulr0. Qed. Fact inv_out : {in predC (predC1 0), inv =1 id}. Proof. (* Goal: @prop_in1 (Equality.sort (Zmodule.eqType (ComRing.zmodType R))) (@mem (Equality.sort (Zmodule.eqType (ComRing.zmodType R))) (simplPredType (Equality.sort (Zmodule.eqType (ComRing.zmodType R)))) (@predC (Equality.sort (Zmodule.eqType (ComRing.zmodType R))) (@pred_of_simpl (Equality.sort (Zmodule.eqType (ComRing.zmodType R))) (@predC1 (Zmodule.eqType (ComRing.zmodType R)) (zero (ComRing.zmodType R)))))) (fun x : ComRing.sort R => @eq (ComRing.sort R) (inv x) ((fun x0 : ComRing.sort R => x0) x)) (inPhantom (@eqfun (ComRing.sort R) (ComRing.sort R) inv (fun x : ComRing.sort R => x))) *) by move=> x /negbNE/eqP->. Qed. Definition UnitMixin := ComUnitRing.Mixin mulVf intro_unit inv_out. Definition UnitRingType := [comUnitRingType of UnitRingType R UnitMixin]. Definition IdomainType := IdomainType UnitRingType (@IdomainMixin UnitRingType (fun => id)). End Mixins. Section ClassDef. Record class_of (F : Type) : Type := Class { base : IntegralDomain.class_of F; mixin : mixin_of (UnitRing.Pack base) }. Local Coercion base : class_of >-> IntegralDomain.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (m0 : mixin_of (@UnitRing.Pack T b0)) := fun bT b & phant_id (IntegralDomain.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition comRingType := @ComRing.Pack cT xclass. Definition unitRingType := @UnitRing.Pack cT xclass. Definition comUnitRingType := @ComUnitRing.Pack cT xclass. Definition idomainType := @IntegralDomain.Pack cT xclass. Lemma unitfE x : (x \in unit) = (x != 0). Proof. (* Goal: @eq bool (@in_mem (Field.sort F) x (@mem (UnitRing.sort (Field.unitRingType F)) (predPredType (UnitRing.sort (Field.unitRingType F))) (@has_quality (S O) (UnitRing.sort (Field.unitRingType F)) (@unit (Field.unitRingType F))))) (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))) *) by apply/idP/idP=> [/(memPn _)-> | /fieldP]; rewrite ?unitr0. Qed. Lemma mulVf x : x != 0 -> x^-1 * x = 1. Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @eq (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (@mul (UnitRing.ringType (Field.unitRingType F)) (@inv (Field.unitRingType F) x) x) (one (UnitRing.ringType (Field.unitRingType F))) *) by rewrite -unitfE; apply: mulVr. Qed. Lemma divff x : x != 0 -> x / x = 1. Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @eq (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) x (@inv (Field.unitRingType F) x)) (one (Field.ringType F)) *) by rewrite -unitfE; apply: divrr. Qed. Definition mulfV := divff. Lemma mulKf x : x != 0 -> cancel ( *%R x) ( *%R x^-1). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @cancel (Ring.sort (Field.ringType F)) (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) x) (@mul (UnitRing.ringType (Field.unitRingType F)) (@inv (Field.unitRingType F) x)) *) by rewrite -unitfE; apply: mulKr. Qed. Lemma mulVKf x : x != 0 -> cancel ( *%R x^-1) ( *%R x). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @cancel (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (@mul (UnitRing.ringType (Field.unitRingType F)) (@inv (Field.unitRingType F) x)) (@mul (Field.ringType F) x) *) by rewrite -unitfE; apply: mulVKr. Qed. Lemma mulfK x : x != 0 -> cancel ( *%R^~ x) ( *%R^~ x^-1). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @cancel (Ring.sort (Field.ringType F)) (Ring.sort (Field.ringType F)) (fun x0 : Ring.sort (Field.ringType F) => @mul (Field.ringType F) x0 x) (fun x0 : Ring.sort (Field.ringType F) => @mul (Field.ringType F) x0 (@inv (Field.unitRingType F) x)) *) by rewrite -unitfE; apply: mulrK. Qed. Lemma mulfVK x : x != 0 -> cancel ( *%R^~ x^-1) ( *%R^~ x). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @cancel (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (fun x0 : Ring.sort (UnitRing.ringType (Field.unitRingType F)) => @mul (UnitRing.ringType (Field.unitRingType F)) x0 (@inv (Field.unitRingType F) x)) (fun x0 : Ring.sort (UnitRing.ringType (Field.unitRingType F)) => @mul (UnitRing.ringType (Field.unitRingType F)) x0 x) *) by rewrite -unitfE; apply: divrK. Qed. Definition divfK := mulfVK. Lemma invfM : {morph @inv F : x y / x * y}. Proof. (* Goal: @morphism_2 (UnitRing.sort (Field.unitRingType F)) (UnitRing.sort (Field.unitRingType F)) (@inv (Field.unitRingType F)) (fun x y : UnitRing.sort (Field.unitRingType F) => @mul (UnitRing.ringType (Field.unitRingType F)) x y) (fun x y : UnitRing.sort (Field.unitRingType F) => @mul (UnitRing.ringType (Field.unitRingType F)) x y) *) move=> x y; case: (eqVneq x 0) => [-> |nzx]; first by rewrite !(mul0r, invr0). (* Goal: @eq (UnitRing.sort (Field.unitRingType F)) (@inv (Field.unitRingType F) (@mul (UnitRing.ringType (Field.unitRingType F)) x y)) (@mul (UnitRing.ringType (Field.unitRingType F)) (@inv (Field.unitRingType F) x) (@inv (Field.unitRingType F) y)) *) case: (eqVneq y 0) => [-> |nzy]; first by rewrite !(mulr0, invr0). (* Goal: @eq (UnitRing.sort (Field.unitRingType F)) (@inv (Field.unitRingType F) (@mul (UnitRing.ringType (Field.unitRingType F)) x y)) (@mul (UnitRing.ringType (Field.unitRingType F)) (@inv (Field.unitRingType F) x) (@inv (Field.unitRingType F) y)) *) by rewrite mulrC invrM ?unitfE. Qed. Lemma invf_div x y : (x / y)^-1 = y / x. Proof. (* Goal: @eq (UnitRing.sort (Field.unitRingType F)) (@inv (Field.unitRingType F) (@mul (Field.ringType F) x (@inv (Field.unitRingType F) y))) (@mul (Field.ringType F) y (@inv (Field.unitRingType F) x)) *) by rewrite invfM invrK mulrC. Qed. Lemma divKf x : x != 0 -> involutive (fun y => x / y). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @involutive (Field.sort F) (fun y : Field.sort F => @mul (Field.ringType F) x (@inv (Field.unitRingType F) y)) *) by move=> nz_x y; rewrite invf_div mulrC divfK. Qed. Lemma expfB_cond m n x : (x == 0) + n <= m -> x ^+ (m - n) = x ^+ m / x ^+ n. Proof. (* Goal: forall _ : is_true (leq (addn (nat_of_bool (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))) n) m), @eq (Ring.sort (Field.ringType F)) (@exp (Field.ringType F) x (subn m n)) (@mul (Field.ringType F) (@exp (Field.ringType F) x m) (@inv (Field.unitRingType F) (@exp (Field.ringType F) x n))) *) move/subnK=> <-; rewrite addnA addnK !exprD. (* Goal: @eq (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) (@exp (Field.ringType F) x (subn m (addn (nat_of_bool (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))) n))) (@exp (Field.ringType F) x (nat_of_bool (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))))) (@mul (Field.ringType F) (@mul (Field.ringType F) (@mul (Field.ringType F) (@exp (Field.ringType F) x (subn m (addn (nat_of_bool (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))) n))) (@exp (Field.ringType F) x (nat_of_bool (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))))) (@exp (Field.ringType F) x n)) (@inv (Field.unitRingType F) (@exp (Field.ringType F) x n))) *) have [-> | nz_x] := altP eqP; first by rewrite !mulr0 !mul0r. (* Goal: @eq (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) (@exp (Field.ringType F) x (subn m (addn (nat_of_bool false) n))) (@exp (Field.ringType F) x (nat_of_bool false))) (@mul (Field.ringType F) (@mul (Field.ringType F) (@mul (Field.ringType F) (@exp (Field.ringType F) x (subn m (addn (nat_of_bool false) n))) (@exp (Field.ringType F) x (nat_of_bool false))) (@exp (Field.ringType F) x n)) (@inv (Field.unitRingType F) (@exp (Field.ringType F) x n))) *) by rewrite mulfK ?expf_neq0. Qed. Lemma expfB m n x : n < m -> x ^+ (m - n) = x ^+ m / x ^+ n. Proof. (* Goal: forall _ : is_true (leq (S n) m), @eq (Ring.sort (Field.ringType F)) (@exp (Field.ringType F) x (subn m n)) (@mul (Field.ringType F) (@exp (Field.ringType F) x m) (@inv (Field.unitRingType F) (@exp (Field.ringType F) x n))) *) by move=> lt_n_m; apply: expfB_cond; case: eqP => // _; apply: ltnW. Qed. Lemma prodfV I r (P : pred I) (E : I -> F) : \prod_(i <- r | P i) (E i)^-1 = (\prod_(i <- r | P i) E i)^-1. Proof. (* Goal: @eq (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (@BigOp.bigop (Ring.sort (UnitRing.ringType (Field.unitRingType F))) I (one (UnitRing.ringType (Field.unitRingType F))) r (fun i : I => @BigBody (Ring.sort (UnitRing.ringType (Field.unitRingType F))) I i (@mul (UnitRing.ringType (Field.unitRingType F))) (P i) (@inv (Field.unitRingType F) (E i)))) (@inv (Field.unitRingType F) (@BigOp.bigop (Ring.sort (Field.ringType F)) I (one (Field.ringType F)) r (fun i : I => @BigBody (Ring.sort (Field.ringType F)) I i (@mul (Field.ringType F)) (P i) (E i)))) *) by rewrite (big_morph _ invfM (invr1 F)). Qed. Lemma prodf_div I r (P : pred I) (E D : I -> F) : \prod_(i <- r | P i) (E i / D i) = \prod_(i <- r | P i) E i / \prod_(i <- r | P i) D i. Proof. (* Goal: @eq (Ring.sort (Field.ringType F)) (@BigOp.bigop (Ring.sort (Field.ringType F)) I (one (Field.ringType F)) r (fun i : I => @BigBody (Ring.sort (Field.ringType F)) I i (@mul (Field.ringType F)) (P i) (@mul (Field.ringType F) (E i) (@inv (Field.unitRingType F) (D i))))) (@mul (Field.ringType F) (@BigOp.bigop (Ring.sort (Field.ringType F)) I (one (Field.ringType F)) r (fun i : I => @BigBody (Ring.sort (Field.ringType F)) I i (@mul (Field.ringType F)) (P i) (E i))) (@inv (Field.unitRingType F) (@BigOp.bigop (Ring.sort (Field.ringType F)) I (one (Field.ringType F)) r (fun i : I => @BigBody (Ring.sort (Field.ringType F)) I i (@mul (Field.ringType F)) (P i) (D i))))) *) by rewrite big_split prodfV. Qed. Lemma telescope_prodf n m (f : nat -> F) : (forall k, n < k < m -> f k != 0) -> n < m -> \prod_(n <= k < m) (f k.+1 / f k) = f m / f n. Proof. (* Goal: forall (_ : forall (k : nat) (_ : is_true (andb (leq (S n) k) (leq (S k) m))), is_true (negb (@eq_op (Field.eqType F) (f k) (zero (Field.zmodType F))))) (_ : is_true (leq (S n) m)), @eq (Ring.sort (Field.ringType F)) (@BigOp.bigop (Ring.sort (Field.ringType F)) nat (one (Field.ringType F)) (index_iota n m) (fun k : nat => @BigBody (Ring.sort (Field.ringType F)) nat k (@mul (Field.ringType F)) true (@mul (Field.ringType F) (f (S k)) (@inv (Field.unitRingType F) (f k))))) (@mul (Field.ringType F) (f m) (@inv (Field.unitRingType F) (f n))) *) move=> nz_f ltnm; apply: invr_inj; rewrite prodf_div !invf_div -prodf_div. (* Goal: @eq (UnitRing.sort (Field.unitRingType F)) (@BigOp.bigop (Ring.sort (Field.ringType F)) nat (one (Field.ringType F)) (index_iota n m) (fun i : nat => @BigBody (Ring.sort (Field.ringType F)) nat i (@mul (Field.ringType F)) true (@mul (Field.ringType F) (f i) (@inv (Field.unitRingType F) (f (S i)))))) (@mul (Field.ringType F) (f n) (@inv (Field.unitRingType F) (f m))) *) by apply: telescope_prodr => // k /nz_f; rewrite unitfE. Qed. Lemma addf_div x1 y1 x2 y2 : y1 != 0 -> y2 != 0 -> x1 / y1 + x2 / y2 = (x1 * y2 + x2 * y1) / (y1 * y2). Proof. (* Goal: forall (_ : is_true (negb (@eq_op (Field.eqType F) y1 (zero (Field.zmodType F))))) (_ : is_true (negb (@eq_op (Field.eqType F) y2 (zero (Field.zmodType F))))), @eq (Zmodule.sort (Ring.zmodType (Field.ringType F))) (@add (Ring.zmodType (Field.ringType F)) (@mul (Field.ringType F) x1 (@inv (Field.unitRingType F) y1)) (@mul (Field.ringType F) x2 (@inv (Field.unitRingType F) y2))) (@mul (Field.ringType F) (@add (Ring.zmodType (Field.ringType F)) (@mul (Field.ringType F) x1 y2) (@mul (Field.ringType F) x2 y1)) (@inv (Field.unitRingType F) (@mul (Field.ringType F) y1 y2))) *) by move=> nzy1 nzy2; rewrite invfM mulrDl !mulrA mulrAC !mulfK. Qed. Lemma mulf_div x1 y1 x2 y2 : (x1 / y1) * (x2 / y2) = (x1 * x2) / (y1 * y2). Proof. (* Goal: @eq (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) (@mul (Field.ringType F) x1 (@inv (Field.unitRingType F) y1)) (@mul (Field.ringType F) x2 (@inv (Field.unitRingType F) y2))) (@mul (Field.ringType F) (@mul (Field.ringType F) x1 x2) (@inv (Field.unitRingType F) (@mul (Field.ringType F) y1 y2))) *) by rewrite mulrACA -invfM. Qed. Lemma char0_natf_div : [char F] =i pred0 -> forall m d, d %| m -> (m %/ d)%:R = m%:R / d%:R :> F. Proof. (* Goal: forall (_ : @eq_mem nat (@mem nat nat_pred_pred (@char (Field.ringType F) (Phant (Field.sort F)))) (@mem nat (simplPredType nat) (@pred0 nat))) (m d : nat) (_ : is_true (dvdn d m)), @eq (Field.sort F) (@natmul (Ring.zmodType (Field.ringType F)) (one (Field.ringType F)) (divn m d)) (@mul (UnitRing.ringType (Field.unitRingType F)) (@natmul (Ring.zmodType (UnitRing.ringType (Field.unitRingType F))) (one (UnitRing.ringType (Field.unitRingType F))) m) (@inv (Field.unitRingType F) (@natmul (Ring.zmodType (UnitRing.ringType (Field.unitRingType F))) (one (UnitRing.ringType (Field.unitRingType F))) d))) *) move/charf0P=> char0F m [|d] d_dv_m; first by rewrite divn0 invr0 mulr0. (* Goal: @eq (Field.sort F) (@natmul (Ring.zmodType (Field.ringType F)) (one (Field.ringType F)) (divn m (S d))) (@mul (UnitRing.ringType (Field.unitRingType F)) (@natmul (Ring.zmodType (UnitRing.ringType (Field.unitRingType F))) (one (UnitRing.ringType (Field.unitRingType F))) m) (@inv (Field.unitRingType F) (@natmul (Ring.zmodType (UnitRing.ringType (Field.unitRingType F))) (one (UnitRing.ringType (Field.unitRingType F))) (S d)))) *) by rewrite natr_div // unitfE char0F. Qed. Section FieldMorphismInj. Variables (R : ringType) (f : {rmorphism F -> R}). Lemma fmorph_eq0 x : (f x == 0) = (x == 0). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType (Ring.zmodType R)) (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Field.sort F, Ring.sort R)) f x) (zero (Ring.zmodType R))) (@eq_op (Field.eqType F) x (zero (Field.zmodType F))) *) have [-> | nz_x] := altP (x =P _); first by rewrite rmorph0 eqxx. (* Goal: @eq bool (@eq_op (Zmodule.eqType (Ring.zmodType R)) (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Field.sort F, Ring.sort R)) f x) (zero (Ring.zmodType R))) false *) apply/eqP; move/(congr1 ( *%R (f x^-1)))/eqP. (* Goal: forall _ : is_true (@eq_op (Ring.eqType R) (@mul R (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Field.sort F, Ring.sort R)) f (@inv (Field.unitRingType F) x)) (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Field.sort F, Ring.sort R)) f x)) (@mul R (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Field.sort F, Ring.sort R)) f (@inv (Field.unitRingType F) x)) (zero (Ring.zmodType R)))), Logic.False *) by rewrite -rmorphM mulVf // mulr0 rmorph1 ?oner_eq0. Qed. Lemma fmorph_inj : injective f. Proof. (* Goal: @injective (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType (Field.ringType F))) (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Field.sort F, Ring.sort R)) f) *) move=> x y eqfxy; apply/eqP; rewrite -subr_eq0 -fmorph_eq0 rmorphB //. (* Goal: is_true (@eq_op (Zmodule.eqType (Ring.zmodType R)) (@add (Ring.zmodType R) (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Ring.sort (Field.ringType F), Ring.sort R)) f x) (@opp (Ring.zmodType R) (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Ring.sort (Field.ringType F), Ring.sort R)) f y))) (zero (Ring.zmodType R))) *) by rewrite eqfxy subrr. Qed. Lemma fmorph_eq1 x : (f x == 1) = (x == 1). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType (Ring.zmodType R)) (@RMorphism.apply (Field.ringType F) R (Phant (forall _ : Field.sort F, Ring.sort R)) f x) (one R)) (@eq_op (Field.eqType F) x (one (Field.ringType F))) *) by rewrite -(inj_eq fmorph_inj) rmorph1. Qed. Lemma fmorph_char : [char R] =i [char F]. Proof. (* Goal: @eq_mem nat (@mem nat nat_pred_pred (@char R (Phant (Ring.sort R)))) (@mem nat nat_pred_pred (@char (Field.ringType F) (Phant (Field.sort F)))) *) by move=> p; rewrite !inE -fmorph_eq0 rmorph_nat. Qed. End FieldMorphismInj. Section FieldMorphismInv. Variables (R : unitRingType) (f : {rmorphism F -> R}). Lemma fmorph_unit x : (f x \in unit) = (x != 0). Proof. (* Goal: @eq bool (@in_mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@RMorphism.apply (Field.ringType F) (UnitRing.ringType R) (Phant (forall _ : Field.sort F, UnitRing.sort R)) f x) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))) *) have [-> |] := altP (x =P _); first by rewrite rmorph0 unitr0. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F)))), @eq bool (@in_mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@RMorphism.apply (Field.ringType F) (UnitRing.ringType R) (Phant (forall _ : Field.sort F, UnitRing.sort R)) f x) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (negb false) *) by rewrite -unitfE; apply: rmorph_unit. Qed. Lemma fmorphV : {morph f: x / x^-1}. Proof. (* Goal: @morphism_1 (Zmodule.sort (Ring.zmodType (Field.ringType F))) (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@RMorphism.apply (Field.ringType F) (UnitRing.ringType R) (Phant (forall _ : Field.sort F, UnitRing.sort R)) f) (fun x : Zmodule.sort (Ring.zmodType (Field.ringType F)) => @inv (Field.unitRingType F) x) (fun x : Zmodule.sort (Ring.zmodType (UnitRing.ringType R)) => @inv R x) *) move=> x; have [-> | nz_x] := eqVneq x 0; first by rewrite !(invr0, rmorph0). (* Goal: @eq (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@RMorphism.apply (Field.ringType F) (UnitRing.ringType R) (Phant (forall _ : Field.sort F, UnitRing.sort R)) f (@inv (Field.unitRingType F) x)) (@inv R (@RMorphism.apply (Field.ringType F) (UnitRing.ringType R) (Phant (forall _ : Field.sort F, UnitRing.sort R)) f x)) *) by rewrite rmorphV ?unitfE. Qed. Lemma fmorph_div : {morph f : x y / x / y}. Proof. (* Goal: @morphism_2 (Zmodule.sort (Ring.zmodType (Field.ringType F))) (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@RMorphism.apply (Field.ringType F) (UnitRing.ringType R) (Phant (forall _ : Field.sort F, UnitRing.sort R)) f) (fun x y : Zmodule.sort (Ring.zmodType (Field.ringType F)) => @mul (Field.ringType F) x (@inv (Field.unitRingType F) y)) (fun x y : Zmodule.sort (Ring.zmodType (UnitRing.ringType R)) => @mul (UnitRing.ringType R) x (@inv R y)) *) by move=> x y; rewrite rmorphM fmorphV. Qed. End FieldMorphismInv. Canonical regular_fieldType := [fieldType of F^o]. Section ModuleTheory. Variable V : lmodType F. Implicit Types (a : F) (v : V). Lemma scalerK a : a != 0 -> cancel ( *:%R a : V -> V) ( *:%R a^-1). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) a (zero (Field.zmodType F)))), @cancel (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@scale (Field.ringType F) V a : forall _ : @Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V, @Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@scale (UnitRing.ringType (Field.unitRingType F)) V (@inv (Field.unitRingType F) a)) *) by move=> nz_a v; rewrite scalerA mulVf // scale1r. Qed. Lemma scalerKV a : a != 0 -> cancel ( *:%R a^-1 : V -> V) ( *:%R a). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) a (zero (Field.zmodType F)))), @cancel (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@scale (UnitRing.ringType (Field.unitRingType F)) V (@inv (Field.unitRingType F) a) : forall _ : @Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V, @Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@scale (Field.ringType F) V a) *) by rewrite -invr_eq0 -{3}[a]invrK; apply: scalerK. Qed. Lemma scalerI a : a != 0 -> injective ( *:%R a : V -> V). Proof. (* Goal: forall _ : is_true (negb (@eq_op (Field.eqType F) a (zero (Field.zmodType F)))), @injective (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) (@scale (Field.ringType F) V a : forall _ : @Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V, @Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) *) by move=> nz_a; apply: can_inj (scalerK nz_a). Qed. Lemma scaler_eq0 a v : (a *: v == 0) = (a == 0) || (v == 0). Proof. (* Goal: @eq bool (@eq_op (Zmodule.eqType (@Zmodule.Pack (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.base (Field.ringType F) (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.class (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)))) (@scale (Field.ringType F) V a v) (zero (@Zmodule.Pack (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.base (Field.ringType F) (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.class (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V))))) (orb (@eq_op (Field.eqType F) a (zero (Field.zmodType F))) (@eq_op (@Lmodule.eqType (Field.ringType F) (Phant (Field.sort F)) V) v (zero (@Lmodule.zmodType (Field.ringType F) (Phant (Field.sort F)) V)))) *) have [-> | nz_a] := altP (a =P _); first by rewrite scale0r eqxx. (* Goal: @eq bool (@eq_op (Zmodule.eqType (@Zmodule.Pack (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.base (Field.ringType F) (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.class (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)))) (@scale (Field.ringType F) V a v) (zero (@Zmodule.Pack (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.base (Field.ringType F) (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.class (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V))))) (orb false (@eq_op (@Lmodule.eqType (Field.ringType F) (Phant (Field.sort F)) V) v (zero (@Lmodule.zmodType (Field.ringType F) (Phant (Field.sort F)) V)))) *) by rewrite (can2_eq (scalerK nz_a) (scalerKV nz_a)) scaler0. Qed. Lemma rpredZeq S (modS : submodPred S) (kS : keyed_pred modS) a v : (a *: v \in kS) = (a == 0) || (v \in kS). Proof. (* Goal: @eq bool (@in_mem (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.base (Field.ringType F) (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.class (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)))) (@scale (Field.ringType F) V a v) (@mem (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) S (@Pred.opp_key (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.zmod_opp (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.submod_zmod (Field.ringType F) V S modS))) kS))) (orb (@eq_op (Field.eqType F) a (zero (Field.zmodType F))) (@in_mem (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) v (@mem (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) S (@Pred.opp_key (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.zmod_opp (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.submod_zmod (Field.ringType F) V S modS))) kS)))) *) have [-> | nz_a] := altP eqP; first by rewrite scale0r rpred0. (* Goal: @eq bool (@in_mem (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.base (Field.ringType F) (@Lmodule.sort (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) (@Lmodule.class (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)))) (@scale (Field.ringType F) V a v) (@mem (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) S (@Pred.opp_key (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.zmod_opp (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.submod_zmod (Field.ringType F) V S modS))) kS))) (orb false (@in_mem (@Lmodule.sort (Field.ringType F) (Phant (Field.sort F)) V) v (@mem (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V)) S (@Pred.opp_key (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.zmod_opp (@Lmodule.zmodType (Field.ringType F) (Phant (Ring.sort (Field.ringType F))) V) S (@Pred.submod_zmod (Field.ringType F) V S modS))) kS)))) *) by apply/idP/idP; first rewrite -{2}(scalerK nz_a v); apply: rpredZ. Qed. End ModuleTheory. Lemma char_lalg (A : lalgType F) : [char A] =i [char F]. Proof. (* Goal: @eq_mem nat (@mem nat nat_pred_pred (@char (@Lalgebra.ringType (Field.ringType F) (Phant (Field.sort F)) A) (Phant (@Lalgebra.sort (Field.ringType F) (Phant (Field.sort F)) A)))) (@mem nat nat_pred_pred (@char (Field.ringType F) (Phant (Field.sort F)))) *) by move=> p; rewrite inE -scaler_nat scaler_eq0 oner_eq0 orbF. Qed. Section Predicates. Context (S : pred_class) (divS : @divrPred F S) (kS : keyed_pred divS). Lemma fpredMl x y : x \in kS -> x != 0 -> (x * y \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Field.sort F) x (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS)))) (_ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F))))), @eq bool (@in_mem (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) x y) (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) (@in_mem (Field.sort F) y (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) *) by rewrite -!unitfE; apply: rpredMl. Qed. Lemma fpredMr x y : x \in kS -> x != 0 -> (y * x \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Field.sort F) x (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS)))) (_ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F))))), @eq bool (@in_mem (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) y x) (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) (@in_mem (Field.sort F) y (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) *) by rewrite -!unitfE; apply: rpredMr. Qed. Lemma fpred_divl x y : x \in kS -> x != 0 -> (x / y \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Field.sort F) x (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS)))) (_ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F))))), @eq bool (@in_mem (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) x (@inv (Field.unitRingType F) y)) (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) (@in_mem (Field.sort F) y (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) *) by rewrite -!unitfE; apply: rpred_divl. Qed. Lemma fpred_divr x y : x \in kS -> x != 0 -> (y / x \in kS) = (y \in kS). Proof. (* Goal: forall (_ : is_true (@in_mem (Field.sort F) x (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS)))) (_ : is_true (negb (@eq_op (Field.eqType F) x (zero (Field.zmodType F))))), @eq bool (@in_mem (Ring.sort (Field.ringType F)) (@mul (Field.ringType F) y (@inv (Field.unitRingType F) x)) (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) (@in_mem (Field.sort F) y (@mem (Ring.sort (UnitRing.ringType (Field.unitRingType F))) (predPredType (Ring.sort (UnitRing.ringType (Field.unitRingType F)))) (@unkey_pred (Ring.sort (UnitRing.ringType (Field.unitRingType F))) S (@Pred.mul_key (UnitRing.ringType (Field.unitRingType F)) S (@Pred.div_mul (Field.unitRingType F) S divS)) kS))) *) by rewrite -!unitfE; apply: rpred_divr. Qed. End Predicates. End FieldTheory. Arguments fmorph_inj {F R} f [x1 x2]. Module DecidableField. Definition axiom (R : unitRingType) (s : seq R -> pred (formula R)) := forall e f, reflect (holds e f) (s e f). Record mixin_of (R : unitRingType) : Type := Mixin { sat : seq R -> pred (formula R); satP : axiom sat}. Section ClassDef. Record class_of (F : Type) : Type := Class {base : Field.class_of F; mixin : mixin_of (UnitRing.Pack base)}. Local Coercion base : class_of >-> Field.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (m0 : mixin_of (@UnitRing.Pack T b0)) := fun bT b & phant_id (Field.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition comRingType := @ComRing.Pack cT xclass. Definition unitRingType := @UnitRing.Pack cT xclass. Definition comUnitRingType := @ComUnitRing.Pack cT xclass. Definition idomainType := @IntegralDomain.Pack cT xclass. Definition fieldType := @Field.Pack cT xclass. End ClassDef. Module Exports. Coercion base : class_of >-> Field.class_of. Coercion mixin : class_of >-> mixin_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Coercion comRingType : type >-> ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> IntegralDomain.type. Canonical idomainType. Coercion fieldType : type >-> Field.type. Canonical fieldType. Notation decFieldType := type. Notation DecFieldType T m := (@pack T _ m _ _ id _ id). Notation DecFieldMixin := Mixin. Notation "[ 'decFieldType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'decFieldType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'decFieldType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'decFieldType' 'of' T ]") : form_scope. End Exports. End DecidableField. Import DecidableField.Exports. Section DecidableFieldTheory. Variable F : decFieldType. Definition sat := DecidableField.sat (DecidableField.class F). Lemma satP : DecidableField.axiom sat. Proof. (* Goal: @DecidableField.axiom (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))) sat *) exact: DecidableField.satP. Qed. Fact sol_subproof n f : reflect (exists s, (size s == n) && sat s f) (sat [::] (foldr Exists f (iota 0 n))). Definition sol n f := if sol_subproof n f is ReflectT sP then xchoose sP else nseq n 0. Lemma size_sol n f : size (sol n f) = n. Proof. (* Goal: @eq nat (@size (Choice.sort (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (sol n f)) n *) rewrite /sol; case: sol_subproof => [sP | _]; last exact: size_nseq. (* Goal: @eq nat (@size (Choice.sort (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) => andb (@eq_op nat_eqType (@size (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) s) n) (sat s f)) sP)) n *) by case/andP: (xchooseP sP) => /eqP. Qed. Lemma solP n f : reflect (exists2 s, size s = n & holds s f) (sat (sol n f) f). Lemma eq_sat f1 f2 : (forall e, holds e f1 <-> holds e f2) -> sat^~ f1 =1 sat^~ f2. Proof. (* Goal: forall _ : forall e : list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))), iff (@holds (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))) e f1) (@holds (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))) e f2), @eqfun bool (list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun x : list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) => sat x f1) (fun x : list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) => sat x f2) *) by move=> eqf12 e; apply/satP/satP; case: (eqf12 e). Qed. Lemma eq_sol f1 f2 : (forall e, holds e f1 <-> holds e f2) -> sol^~ f1 =1 sol^~ f2. Proof. (* Goal: forall _ : forall e : list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))), iff (@holds (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))) e f1) (@holds (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))) e f2), @eqfun (Choice.sort (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))))) (Equality.sort nat_eqType) (fun x : Equality.sort nat_eqType => sol x f1) (fun x : Equality.sort nat_eqType => sol x f2) *) rewrite /sol => /eq_sat eqf12 n. (* Goal: @eq (Choice.sort (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))))) match sol_subproof n f1 with | @Bool.ReflectT _ sP => @xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) => andb (@eq_op nat_eqType (@size (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) s) n) (sat s f1)) sP | @Bool.ReflectF _ n0 => @nseq (Zmodule.sort (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) n (zero (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) end match sol_subproof n f2 with | @Bool.ReflectT _ sP => @xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) => andb (@eq_op nat_eqType (@size (UnitRing.sort (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))) s) n) (sat s f2)) sP | @Bool.ReflectF _ n0 => @nseq (Zmodule.sort (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) n (zero (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) end *) do 2![case: sol_subproof] => //= [f1s f2s | ns1 [s f2s] | [s f1s] []]. (* Goal: @ex (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) *) (* Goal: @eq (list (DecidableField.sort F)) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1)) (@ex_intro (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) s f2s)) (@nseq (DecidableField.sort F) n (zero (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))))) *) (* Goal: @eq (list (DecidableField.sort F)) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1)) f2s) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f2)) f1s) *) - (* Goal: @ex (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) *) (* Goal: @eq (list (DecidableField.sort F)) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1)) (@ex_intro (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) s f2s)) (@nseq (DecidableField.sort F) n (zero (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))))) *) (* Goal: @eq (list (DecidableField.sort F)) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1)) f2s) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f2)) f1s) *) by apply: eq_xchoose => s; rewrite eqf12. (* Goal: @ex (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) *) (* Goal: @eq (list (DecidableField.sort F)) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1)) (@ex_intro (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) s f2s)) (@nseq (DecidableField.sort F) n (zero (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))))) *) - (* Goal: @ex (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) *) (* Goal: @eq (list (DecidableField.sort F)) (@xchoose (seq_choiceType (UnitRing.choiceType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F)))))))) (fun s : list (DecidableField.sort F) => andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1)) (@ex_intro (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) s f2s)) (@nseq (DecidableField.sort F) n (zero (UnitRing.zmodType (@UnitRing.Pack (DecidableField.sort F) (@ComUnitRing.base2 (DecidableField.sort F) (@IntegralDomain.base (DecidableField.sort F) (@Field.base (DecidableField.sort F) (@DecidableField.base (DecidableField.sort F) (DecidableField.class F))))))))) *) by case: ns1; exists s; rewrite -eqf12. (* Goal: @ex (list (DecidableField.sort F)) (fun s : list (DecidableField.sort F) => is_true (andb (@eq_op nat_eqType (@size (DecidableField.sort F) s) n) (sat s f1))) *) by exists s; rewrite eqf12. Qed. End DecidableFieldTheory. Arguments satP {F e f}. Arguments solP {F n f}. Section QE_Mixin. Variable F : Field.type. Implicit Type f : formula F. Variable proj : nat -> seq (term F) * seq (term F) -> formula F. Definition wf_QE_proj := forall i bc (bc_i := proj i bc), dnf_rterm bc -> qf_form bc_i && rformula bc_i. Definition valid_QE_proj := forall i bc (ex_i_bc := ('exists 'X_i, dnf_to_form [:: bc])%T) e, dnf_rterm bc -> reflect (holds e ex_i_bc) (qf_eval e (proj i bc)). Hypotheses (wf_proj : wf_QE_proj) (ok_proj : valid_QE_proj). Let elim_aux f n := foldr Or False (map (proj n) (qf_to_dnf f false)). Fixpoint quantifier_elim f := match f with | f1 /\ f2 => (quantifier_elim f1) /\ (quantifier_elim f2) | f1 \/ f2 => (quantifier_elim f1) \/ (quantifier_elim f2) | f1 ==> f2 => (~ quantifier_elim f1) \/ (quantifier_elim f2) | ~ f => ~ quantifier_elim f | ('exists 'X_n, f) => elim_aux (quantifier_elim f) n | ('forall 'X_n, f) => ~ elim_aux (~ quantifier_elim f) n | _ => f end%T. Lemma quantifier_elim_wf f : let qf := quantifier_elim f in rformula f -> qf_form qf && rformula qf. Proof. (* Goal: let qf := quantifier_elim f in forall _ : is_true (@rformula (Field.unitRingType F) f), is_true (andb (@qf_form (Field.unitRingType F) qf) (@rformula (Field.unitRingType F) qf)) *) suffices aux_wf f0 n : let qf := elim_aux f0 n in rformula f0 -> qf_form qf && rformula qf. (* Goal: let qf := elim_aux f0 n in forall _ : is_true (@rformula (Field.unitRingType F) f0), is_true (andb (@qf_form (Field.unitRingType F) qf) (@rformula (Field.unitRingType F) qf)) *) (* Goal: let qf := quantifier_elim f in forall _ : is_true (@rformula (Field.unitRingType F) f), is_true (andb (@qf_form (Field.unitRingType F) qf) (@rformula (Field.unitRingType F) qf)) *) - (* Goal: let qf := elim_aux f0 n in forall _ : is_true (@rformula (Field.unitRingType F) f0), is_true (andb (@qf_form (Field.unitRingType F) qf) (@rformula (Field.unitRingType F) qf)) *) (* Goal: let qf := quantifier_elim f in forall _ : is_true (@rformula (Field.unitRingType F) f), is_true (andb (@qf_form (Field.unitRingType F) qf) (@rformula (Field.unitRingType F) qf)) *) by elim: f => //=; do ?[ move=> f1 IH1 f2 IH2; case/andP=> rf1 rf2; case/andP:(IH1 rf1)=> -> ->; case/andP:(IH2 rf2)=> -> -> // | move=> n f1 IH rf1; case/andP: (IH rf1)=> qff rf; rewrite aux_wf ]. (* Goal: let qf := elim_aux f0 n in forall _ : is_true (@rformula (Field.unitRingType F) f0), is_true (andb (@qf_form (Field.unitRingType F) qf) (@rformula (Field.unitRingType F) qf)) *) rewrite /elim_aux => rf. (* Goal: is_true (andb (@qf_form (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false)))) (@rformula (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false))))) *) suffices or_wf fs : let ofs := foldr Or False fs in all (@qf_form F) fs && all (@rformula F) fs -> qf_form ofs && rformula ofs. (* Goal: let ofs := @foldr (formula (UnitRing.sort (Field.unitRingType F))) (formula (UnitRing.sort (Field.unitRingType F))) (@Or (UnitRing.sort (Field.unitRingType F))) (@Bool (UnitRing.sort (Field.unitRingType F)) false) fs in forall _ : is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) fs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) fs)), is_true (andb (@qf_form (Field.unitRingType F) ofs) (@rformula (Field.unitRingType F) ofs)) *) (* Goal: is_true (andb (@qf_form (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false)))) (@rformula (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false))))) *) - (* Goal: let ofs := @foldr (formula (UnitRing.sort (Field.unitRingType F))) (formula (UnitRing.sort (Field.unitRingType F))) (@Or (UnitRing.sort (Field.unitRingType F))) (@Bool (UnitRing.sort (Field.unitRingType F)) false) fs in forall _ : is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) fs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) fs)), is_true (andb (@qf_form (Field.unitRingType F) ofs) (@rformula (Field.unitRingType F) ofs)) *) (* Goal: is_true (andb (@qf_form (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false)))) (@rformula (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false))))) *) apply: or_wf. (* Goal: let ofs := @foldr (formula (UnitRing.sort (Field.unitRingType F))) (formula (UnitRing.sort (Field.unitRingType F))) (@Or (UnitRing.sort (Field.unitRingType F))) (@Bool (UnitRing.sort (Field.unitRingType F)) false) fs in forall _ : is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) fs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) fs)), is_true (andb (@qf_form (Field.unitRingType F) ofs) (@rformula (Field.unitRingType F) ofs)) *) (* Goal: is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false))) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false)))) *) suffices map_proj_wf bcs: let mbcs := map (proj n) bcs in all dnf_rterm bcs -> all (@qf_form _) mbcs && all (@rformula _) mbcs. (* Goal: let ofs := @foldr (formula (UnitRing.sort (Field.unitRingType F))) (formula (UnitRing.sort (Field.unitRingType F))) (@Or (UnitRing.sort (Field.unitRingType F))) (@Bool (UnitRing.sort (Field.unitRingType F)) false) fs in forall _ : is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) fs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) fs)), is_true (andb (@qf_form (Field.unitRingType F) ofs) (@rformula (Field.unitRingType F) ofs)) *) (* Goal: let mbcs := @map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) bcs in forall _ : is_true (@all (prod (list (term (UnitRing.sort (Field.unitRingType F)))) (list (term (UnitRing.sort (Field.unitRingType F))))) (@dnf_rterm (Field.unitRingType F)) bcs), is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) mbcs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) mbcs)) *) (* Goal: is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false))) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) (@qf_to_dnf (Field.unitRingType F) f0 false)))) *) by apply: map_proj_wf; apply: qf_to_dnf_rterm. (* Goal: let ofs := @foldr (formula (UnitRing.sort (Field.unitRingType F))) (formula (UnitRing.sort (Field.unitRingType F))) (@Or (UnitRing.sort (Field.unitRingType F))) (@Bool (UnitRing.sort (Field.unitRingType F)) false) fs in forall _ : is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) fs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) fs)), is_true (andb (@qf_form (Field.unitRingType F) ofs) (@rformula (Field.unitRingType F) ofs)) *) (* Goal: let mbcs := @map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) bcs in forall _ : is_true (@all (prod (list (term (UnitRing.sort (Field.unitRingType F)))) (list (term (UnitRing.sort (Field.unitRingType F))))) (@dnf_rterm (Field.unitRingType F)) bcs), is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) mbcs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) mbcs)) *) elim: bcs => [|bc bcs ihb] bcsr //= /andP[rbc rbcs]. (* Goal: let ofs := @foldr (formula (UnitRing.sort (Field.unitRingType F))) (formula (UnitRing.sort (Field.unitRingType F))) (@Or (UnitRing.sort (Field.unitRingType F))) (@Bool (UnitRing.sort (Field.unitRingType F)) false) fs in forall _ : is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) fs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) fs)), is_true (andb (@qf_form (Field.unitRingType F) ofs) (@rformula (Field.unitRingType F) ofs)) *) (* Goal: is_true (andb (andb (@qf_form (Field.unitRingType F) (proj n bc)) (@all (formula (Field.sort F)) (@qf_form (Field.unitRingType F)) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) bcs))) (andb (@rformula (Field.unitRingType F) (proj n bc)) (@all (formula (Field.sort F)) (@rformula (Field.unitRingType F)) (@map (prod (list (term (Field.sort F))) (list (term (Field.sort F)))) (formula (Field.sort F)) (proj n) bcs)))) *) by rewrite andbAC andbA wf_proj //= andbC ihb. (* Goal: let ofs := @foldr (formula (UnitRing.sort (Field.unitRingType F))) (formula (UnitRing.sort (Field.unitRingType F))) (@Or (UnitRing.sort (Field.unitRingType F))) (@Bool (UnitRing.sort (Field.unitRingType F)) false) fs in forall _ : is_true (andb (@all (formula (UnitRing.sort (Field.unitRingType F))) (@qf_form (Field.unitRingType F)) fs) (@all (formula (UnitRing.sort (Field.unitRingType F))) (@rformula (Field.unitRingType F)) fs)), is_true (andb (@qf_form (Field.unitRingType F) ofs) (@rformula (Field.unitRingType F) ofs)) *) elim: fs => //= g gs ihg; rewrite -andbA => /and4P[-> qgs -> rgs] /=. (* Goal: is_true (andb (@qf_form (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) gs)) (@rformula (Field.unitRingType F) (@foldr (formula (Field.sort F)) (formula (Field.sort F)) (@Or (Field.sort F)) (@Bool (Field.sort F) false) gs))) *) by apply: ihg; rewrite qgs rgs. Qed. Lemma quantifier_elim_rformP e f : rformula f -> reflect (holds e f) (qf_eval e (quantifier_elim f)). Definition proj_sat e f := qf_eval e (quantifier_elim (to_rform f)). Lemma proj_satP : DecidableField.axiom proj_sat. Proof. (* Goal: @DecidableField.axiom (Field.unitRingType F) proj_sat *) move=> e f; have fP := quantifier_elim_rformP e (to_rform_rformula f). (* Goal: Bool.reflect (@holds (Field.unitRingType F) e f) (proj_sat e f) *) by apply: (iffP fP); move/to_rformP. Qed. Definition QEdecFieldMixin := DecidableField.Mixin proj_satP. End QE_Mixin. Module ClosedField. Definition axiom (R : ringType) := forall n (P : nat -> R), n > 0 -> exists x : R, x ^+ n = \sum_(i < n) P i * (x ^+ i). Section ClassDef. Record class_of (F : Type) : Type := Class {base : DecidableField.class_of F; _ : axiom (Ring.Pack base)}. Local Coercion base : class_of >-> DecidableField.class_of. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variable (T : Type) (cT : type). Definition class := let: Pack _ c as cT' := cT return class_of cT' in c. Definition clone c of phant_id class c := @Pack T c. Let xT := let: Pack T _ := cT in T. Notation xclass := (class : class_of xT). Definition pack b0 (m0 : axiom (@Ring.Pack T b0)) := fun bT b & phant_id (DecidableField.class bT) b => fun m & phant_id m0 m => Pack (@Class T b m). Definition eqType := @Equality.Pack cT xclass. Definition choiceType := @Choice.Pack cT xclass. Definition zmodType := @Zmodule.Pack cT xclass. Definition ringType := @Ring.Pack cT xclass. Definition comRingType := @ComRing.Pack cT xclass. Definition unitRingType := @UnitRing.Pack cT xclass. Definition comUnitRingType := @ComUnitRing.Pack cT xclass. Definition idomainType := @IntegralDomain.Pack cT xclass. Definition fieldType := @Field.Pack cT xclass. Definition decFieldType := @DecidableField.Pack cT class. End ClassDef. Module Exports. Coercion base : class_of >-> DecidableField.class_of. Coercion sort : type >-> Sortclass. Bind Scope ring_scope with sort. Coercion eqType : type >-> Equality.type. Canonical eqType. Coercion choiceType : type >-> Choice.type. Canonical choiceType. Coercion zmodType : type >-> Zmodule.type. Canonical zmodType. Coercion ringType : type >-> Ring.type. Canonical ringType. Coercion comRingType : type >-> ComRing.type. Canonical comRingType. Coercion unitRingType : type >-> UnitRing.type. Canonical unitRingType. Coercion comUnitRingType : type >-> ComUnitRing.type. Canonical comUnitRingType. Coercion idomainType : type >-> IntegralDomain.type. Canonical idomainType. Coercion fieldType : type >-> Field.type. Canonical fieldType. Coercion decFieldType : type >-> DecidableField.type. Canonical decFieldType. Notation closedFieldType := type. Notation ClosedFieldType T m := (@pack T _ m _ _ id _ id). Notation "[ 'closedFieldType' 'of' T 'for' cT ]" := (@clone T cT _ idfun) (at level 0, format "[ 'closedFieldType' 'of' T 'for' cT ]") : form_scope. Notation "[ 'closedFieldType' 'of' T ]" := (@clone T _ _ id) (at level 0, format "[ 'closedFieldType' 'of' T ]") : form_scope. End Exports. End ClosedField. Import ClosedField.Exports. Section ClosedFieldTheory. Variable F : closedFieldType. Lemma solve_monicpoly : ClosedField.axiom F. Proof. (* Goal: ClosedField.axiom (ClosedField.ringType F) *) by case: F => ? []. Qed. Lemma imaginary_exists : {i : F | i ^+ 2 = -1}. Proof. (* Goal: @sig (ClosedField.sort F) (fun i : ClosedField.sort F => @eq (Ring.sort (ClosedField.ringType F)) (@exp (ClosedField.ringType F) i (S (S O))) (@opp (Ring.zmodType (ClosedField.ringType F)) (one (ClosedField.ringType F)))) *) have /sig_eqW[i Di2] := @solve_monicpoly 2 (nth 0 [:: -1]) isT. (* Goal: @sig (ClosedField.sort F) (fun i : ClosedField.sort F => @eq (Ring.sort (ClosedField.ringType F)) (@exp (ClosedField.ringType F) i (S (S O))) (@opp (Ring.zmodType (ClosedField.ringType F)) (one (ClosedField.ringType F)))) *) by exists i; rewrite Di2 !big_ord_recl big_ord0 mul0r mulr1 !addr0. Qed. End ClosedFieldTheory. Module SubType. Section Zmodule. Variables (V : zmodType) (S : predPredType V). Variables (subS : zmodPred S) (kS : keyed_pred subS). Variable U : subType (mem kS). Let inU v Sv : U := Sub v Sv. Let zeroU := inU (rpred0 kS). Let oppU (u : U) := inU (rpredNr (valP u)). Let addU (u1 u2 : U) := inU (rpredD (valP u1) (valP u2)). Fact addA : associative addU. Proof. (* Goal: @associative (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) addU *) by move=> u1 u2 u3; apply: val_inj; rewrite !SubK addrA. Qed. Fact addC : commutative addU. Proof. (* Goal: @commutative (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) addU *) by move=> u1 u2; apply: val_inj; rewrite !SubK addrC. Qed. Fact add0 : left_id zeroU addU. Proof. (* Goal: @left_id (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) zeroU addU *) by move=> u; apply: val_inj; rewrite !SubK add0r. Qed. Fact addN : left_inverse zeroU oppU addU. Proof. (* Goal: @left_inverse (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) (@sub_sort (Zmodule.sort V) (@pred_of_simpl (Zmodule.sort V) (@pred_of_mem_pred (Zmodule.sort V) (@mem (Zmodule.sort V) (predPredType (Zmodule.sort V)) (@unkey_pred (Zmodule.sort V) S (@Pred.opp_key V S (@Pred.zmod_opp V S subS)) kS)))) U) zeroU oppU addU *) by move=> u; apply: val_inj; rewrite !SubK addNr. Qed. Definition zmodMixin of phant U := ZmodMixin addA addC add0 addN. End Zmodule. Section Ring. Variables (R : ringType) (S : predPredType R). Variables (ringS : subringPred S) (kS : keyed_pred ringS). Definition cast_zmodType (V : zmodType) T (VeqT : V = T :> Type) := let cast mV := let: erefl in _ = T := VeqT return Zmodule.class_of T in mV in Zmodule.Pack (cast (Zmodule.class V)). Variable (T : subType (mem kS)) (V : zmodType) (VeqT: V = T :> Type). Let inT x Sx : T := Sub x Sx. Let oneT := inT (rpred1 kS). Let mulT (u1 u2 : T) := inT (rpredM (valP u1) (valP u2)). Let T' := cast_zmodType VeqT. Hypothesis valM : {morph (val : T' -> R) : x y / x - y}. Let val0 : val (0 : T') = 0. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@val (Zmodule.sort (Ring.zmodType R)) (@pred_of_simpl (Zmodule.sort (Ring.zmodType R)) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType R)) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S (@Pred.zmod_opp (Ring.zmodType R) S (@Pred.subring_zmod R S ringS))) kS)))) T (zero T' : Zmodule.sort T')) (zero (Ring.zmodType R)) *) by rewrite -(subrr (0 : T')) valM subrr. Qed. Let valD : {morph (val : T' -> R): x y / x + y}. Proof. (* Goal: @morphism_2 (Zmodule.sort T') (Ring.sort R) (@val (Zmodule.sort (Ring.zmodType R)) (@pred_of_simpl (Zmodule.sort (Ring.zmodType R)) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType R)) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S (@Pred.zmod_opp (Ring.zmodType R) S (@Pred.subring_zmod R S ringS))) kS)))) T : forall _ : Zmodule.sort T', Ring.sort R) (fun x y : Zmodule.sort T' => @add T' x y) (fun x y : Ring.sort R => @add (Ring.zmodType R) x y) *) by move=> u v; rewrite -{1}[v]opprK -[- v]sub0r !valM val0 sub0r opprK. Qed. Fact mulA : @associative T' mulT. Proof. (* Goal: @associative (Zmodule.sort T') mulT *) by move=> u1 u2 u3; apply: val_inj; rewrite !SubK mulrA. Qed. Fact mul1l : left_id oneT mulT. Proof. (* Goal: @left_id (@sub_sort (Zmodule.sort (Ring.zmodType R)) (@pred_of_simpl (Zmodule.sort (Ring.zmodType R)) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType R)) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S (@Pred.zmod_opp (Ring.zmodType R) S (@Pred.subring_zmod R S ringS))) kS)))) T) (@sub_sort (Zmodule.sort (Ring.zmodType R)) (@pred_of_simpl (Zmodule.sort (Ring.zmodType R)) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType R)) (@mem (Zmodule.sort (Ring.zmodType R)) (predPredType (Zmodule.sort (Ring.zmodType R))) (@unkey_pred (Zmodule.sort (Ring.zmodType R)) S (@Pred.opp_key (Ring.zmodType R) S (@Pred.zmod_opp (Ring.zmodType R) S (@Pred.subring_zmod R S ringS))) kS)))) T) oneT mulT *) by move=> u; apply: val_inj; rewrite !SubK mul1r. Qed. Fact mul1r : right_id oneT mulT. Fact mulDl : @left_distributive T' T' mulT +%R. Proof. (* Goal: @left_distributive (Zmodule.sort T') (Zmodule.sort T') mulT (@add T') *) by move=> u1 u2 u3; apply: val_inj; rewrite !(SubK, valD) mulrDl. Qed. Fact mulDr : @right_distributive T' T' mulT +%R. Proof. (* Goal: @right_distributive (Zmodule.sort T') (Zmodule.sort T') mulT (@add T') *) by move=> u1 u2 u3; apply: val_inj; rewrite !(SubK, valD) mulrDr. Qed. Fact nz1 : oneT != 0 :> T'. Proof. (* Goal: is_true (negb (@eq_op (Zmodule.eqType T') (oneT : Zmodule.sort T') (zero T' : Zmodule.sort T'))) *) by apply: contraNneq (oner_neq0 R) => eq10; rewrite -val0 -eq10 SubK. Qed. Definition ringMixin := RingMixin mulA mul1l mul1r mulDl mulDr nz1. End Ring. Section Lmodule. Variables (R : ringType) (V : lmodType R) (S : predPredType V). Variables (linS : submodPred S) (kS : keyed_pred linS). Variables (W : subType (mem kS)) (Z : zmodType) (ZeqW : Z = W :> Type). Let scaleW a (w : W) := (Sub _ : _ -> W) (rpredZ a (valP w)). Let W' := cast_zmodType ZeqW. Hypothesis valD : {morph (val : W' -> V) : x y / x + y}. Fact scaleA a b (w : W') : scaleW a (scaleW b w) = scaleW (a * b) w. Proof. (* Goal: @eq (@sub_sort (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@pred_of_simpl (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@pred_of_mem_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@mem (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.opp_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S (@Pred.zmod_opp (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S (@Pred.submod_zmod R V S linS))) kS)))) W) (scaleW a (scaleW b w)) (scaleW (@mul R a b) w) *) by apply: val_inj; rewrite !SubK scalerA. Qed. Fact scale1 : left_id 1 scaleW. Proof. (* Goal: @left_id (Ring.sort R) (@sub_sort (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@pred_of_simpl (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@pred_of_mem_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (@mem (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) (predPredType (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V))) (@unkey_pred (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) V)) S (@Pred.opp_key (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S (@Pred.zmod_opp (@Lmodule.zmodType R (Phant (Ring.sort R)) V) S (@Pred.submod_zmod R V S linS))) kS)))) W) (one R) scaleW *) by move=> w; apply: val_inj; rewrite !SubK scale1r. Qed. Fact scaleDr : @right_distributive R W' scaleW +%R. Proof. (* Goal: @right_distributive (Ring.sort R) (Zmodule.sort W') scaleW (@add W') *) by move=> a w w2; apply: val_inj; rewrite !(SubK, valD) scalerDr. Qed. Fact scaleDl w : {morph (scaleW^~ w : R -> W') : a b / a + b}. Proof. (* Goal: @morphism_2 (Ring.sort R) (Zmodule.sort W') ((fun x : Ring.sort R => scaleW x w) : forall _ : Ring.sort R, Zmodule.sort W') (fun a b : Ring.sort R => @add (Ring.zmodType R) a b) (fun a b : Zmodule.sort W' => @add W' a b) *) by move=> a b; apply: val_inj; rewrite !(SubK, valD) scalerDl. Qed. Definition lmodMixin := LmodMixin scaleA scale1 scaleDr scaleDl. End Lmodule. Lemma lalgMixin (R : ringType) (A : lalgType R) (B : lmodType R) (f : B -> A) : phant B -> injective f -> scalable f -> forall mulB, {morph f : x y / mulB x y >-> x * y} -> Lalgebra.axiom mulB. Proof. (* Goal: forall (_ : phant (@Lmodule.sort R (Phant (Ring.sort R)) B)) (_ : @injective (@Lalgebra.sort R (Phant (Ring.sort R)) A) (@Lmodule.sort R (Phant (Ring.sort R)) B) f) (_ : @Linear.mixin_of R B (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)) (@Lmodule.class R (Phant (Ring.sort R)) (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)))) (@scale R (@Lalgebra.lmodType R (Phant (Ring.sort R)) A)) f) (mulB : forall (_ : @Lmodule.sort R (Phant (Ring.sort R)) B) (_ : @Lmodule.sort R (Phant (Ring.sort R)) B), @Lmodule.sort R (Phant (Ring.sort R)) B) (_ : @morphism_2 (@Lmodule.sort R (Phant (Ring.sort R)) B) (@Lalgebra.sort R (Phant (Ring.sort R)) A) f (fun x y : @Lmodule.sort R (Phant (Ring.sort R)) B => mulB x y) (fun x y : @Lalgebra.sort R (Phant (Ring.sort R)) A => @mul (@Lalgebra.ringType R (Phant (Ring.sort R)) A) x y)), @Lalgebra.axiom R B mulB *) by move=> _ injf fZ mulB fM a x y; apply: injf; rewrite !(fZ, fM) scalerAl. Qed. Lemma comRingMixin (R : comRingType) (T : ringType) (f : T -> R) : phant T -> injective f -> {morph f : x y / x * y} -> commutative (@mul T). Proof. (* Goal: forall (_ : phant (Ring.sort T)) (_ : @injective (ComRing.sort R) (Ring.sort T) f) (_ : @morphism_2 (Ring.sort T) (ComRing.sort R) f (fun x y : Ring.sort T => @mul T x y) (fun x y : ComRing.sort R => @mul (ComRing.ringType R) x y)), @commutative (Ring.sort T) (Ring.sort T) (@mul T) *) by move=> _ inj_f fM x y; apply: inj_f; rewrite !fM mulrC. Qed. Lemma algMixin (R : comRingType) (A : algType R) (B : lalgType R) (f : B -> A) : phant B -> injective f -> {morph f : x y / x * y} -> scalable f -> @Algebra.axiom R B. Proof. (* Goal: forall (_ : phant (@Lalgebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) B)) (_ : @injective (@Algebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) A) (@Lalgebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) B) f) (_ : @morphism_2 (@Lalgebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) B) (@Algebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) A) f (fun x y : @Lalgebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) B => @mul (@Lalgebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) B) x y) (fun x y : @Algebra.sort (ComRing.ringType R) (Phant (ComRing.sort R)) A => @mul (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A) x y)) (_ : @Linear.mixin_of (ComRing.ringType R) (@Lalgebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) B) (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)))) (@scale (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A)) f), @Algebra.axiom (ComRing.ringType R) B *) by move=> _ inj_f fM fZ a x y; apply: inj_f; rewrite !(fM, fZ) scalerAr. Qed. Section UnitRing. Definition cast_ringType (Q : ringType) T (QeqT : Q = T :> Type) := let cast rQ := let: erefl in _ = T := QeqT return Ring.class_of T in rQ in Ring.Pack (cast (Ring.class Q)). Variables (R : unitRingType) (S : predPredType R). Variables (ringS : divringPred S) (kS : keyed_pred ringS). Variables (T : subType (mem kS)) (Q : ringType) (QeqT : Q = T :> Type). Let inT x Sx : T := Sub x Sx. Let invT (u : T) := inT (rpredVr (valP u)). Let unitT := [qualify a u : T | val u \is a unit]. Let T' := cast_ringType QeqT. Hypothesis val1 : val (1 : T') = 1. Hypothesis valM : {morph (val : T' -> R) : x y / x * y}. Fact mulVr : {in (unitT : predPredType T'), left_inverse (1 : T') invT (@mul T')}. Fact mulrV : {in unitT, right_inverse (1 : T') invT (@mul T')}. Fact unitP (u v : T') : v * u = 1 /\ u * v = 1 -> u \in unitT. Proof. (* Goal: forall _ : and (@eq (Ring.sort T') (@mul T' v u) (one T')) (@eq (Ring.sort T') (@mul T' u v) (one T')), is_true (@in_mem (Ring.sort T') u (@mem (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (predPredType (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T)) (@has_quality (Datatypes.S O) (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) unitT))) *) by case=> vu1 uv1; apply/unitrP; exists (val v); rewrite -!valM vu1 uv1. Qed. Fact unit_id : {in [predC unitT], invT =1 id}. Proof. (* Goal: @prop_in1 (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (@mem (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (simplPredType (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T)) (@predC (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (@pred_of_simpl (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (@pred_of_mem_pred (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (@mem (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (predPredType (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T)) (@has_quality (Datatypes.S O) (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) unitT)))))) (fun x : @sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T => @eq (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (invT x) ((fun x0 : @sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T => x0) x)) (inPhantom (@eqfun (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) (@sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T) invT (fun x : @sub_sort (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_simpl (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@pred_of_mem_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (@mem (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) (predPredType (Zmodule.sort (Ring.zmodType (UnitRing.ringType R)))) (@unkey_pred (Zmodule.sort (Ring.zmodType (UnitRing.ringType R))) S (@Pred.opp_key (Ring.zmodType (UnitRing.ringType R)) S (@Pred.zmod_opp (Ring.zmodType (UnitRing.ringType R)) S (@Pred.subring_zmod (UnitRing.ringType R) S (@Pred.divring_ring R S ringS)))) kS)))) T => x))) *) by move=> u /invr_out def_u1; apply: val_inj; rewrite SubK. Qed. Definition unitRingMixin := UnitRingMixin mulVr mulrV unitP unit_id. End UnitRing. Lemma idomainMixin (R : idomainType) (T : ringType) (f : T -> R) : phant T -> injective f -> f 0 = 0 -> {morph f : u v / u * v} -> @IntegralDomain.axiom T. Proof. (* Goal: forall (_ : phant (Ring.sort T)) (_ : @injective (IntegralDomain.sort R) (Ring.sort T) f) (_ : @eq (IntegralDomain.sort R) (f (zero (Ring.zmodType T))) (zero (IntegralDomain.zmodType R))) (_ : @morphism_2 (Ring.sort T) (IntegralDomain.sort R) f (fun u v : Ring.sort T => @mul T u v) (fun u v : IntegralDomain.sort R => @mul (IntegralDomain.ringType R) u v)), IntegralDomain.axiom T *) move=> _ injf f0 fM u v uv0. (* Goal: is_true (orb (@eq_op (Ring.eqType T) u (zero (Ring.zmodType T))) (@eq_op (Ring.eqType T) v (zero (Ring.zmodType T)))) *) by rewrite -!(inj_eq injf) !f0 -mulf_eq0 -fM uv0 f0. Qed. Lemma fieldMixin (F : fieldType) (K : unitRingType) (f : K -> F) : phant K -> injective f -> f 0 = 0 -> {mono f : u / u \in unit} -> @Field.mixin_of K. Proof. (* Goal: forall (_ : phant (UnitRing.sort K)) (_ : @injective (Field.sort F) (UnitRing.sort K) f) (_ : @eq (Field.sort F) (f (zero (UnitRing.zmodType K))) (zero (Field.zmodType F))) (_ : @monomorphism_1 (UnitRing.sort K) (Field.sort F) bool f (fun u : UnitRing.sort K => @in_mem (UnitRing.sort K) u (@mem (UnitRing.sort K) (predPredType (UnitRing.sort K)) (@has_quality (S O) (UnitRing.sort K) (@unit K)))) (fun u : Field.sort F => @in_mem (Field.sort F) u (@mem (UnitRing.sort (Field.unitRingType F)) (predPredType (UnitRing.sort (Field.unitRingType F))) (@has_quality (S O) (UnitRing.sort (Field.unitRingType F)) (@unit (Field.unitRingType F)))))), Field.mixin_of K *) by move=> _ injf f0 fU u; rewrite -fU unitfE -f0 inj_eq. Qed. Module Exports. Notation "[ 'zmodMixin' 'of' U 'by' <: ]" := (zmodMixin (Phant U)) (at level 0, format "[ 'zmodMixin' 'of' U 'by' <: ]") : form_scope. Notation "[ 'ringMixin' 'of' R 'by' <: ]" := (@ringMixin _ _ _ _ _ _ (@erefl Type R%type) (rrefl _)) (at level 0, format "[ 'ringMixin' 'of' R 'by' <: ]") : form_scope. Notation "[ 'lmodMixin' 'of' U 'by' <: ]" := (@lmodMixin _ _ _ _ _ _ _ (@erefl Type U%type) (rrefl _)) (at level 0, format "[ 'lmodMixin' 'of' U 'by' <: ]") : form_scope. Notation "[ 'lalgMixin' 'of' A 'by' <: ]" := ((lalgMixin (Phant A) val_inj (rrefl _)) *%R (rrefl _)) (at level 0, format "[ 'lalgMixin' 'of' A 'by' <: ]") : form_scope. Notation "[ 'comRingMixin' 'of' R 'by' <: ]" := (comRingMixin (Phant R) val_inj (rrefl _)) (at level 0, format "[ 'comRingMixin' 'of' R 'by' <: ]") : form_scope. Notation "[ 'algMixin' 'of' A 'by' <: ]" := (algMixin (Phant A) val_inj (rrefl _) (rrefl _)) (at level 0, format "[ 'algMixin' 'of' A 'by' <: ]") : form_scope. Notation "[ 'unitRingMixin' 'of' R 'by' <: ]" := (@unitRingMixin _ _ _ _ _ _ (@erefl Type R%type) (erefl _) (rrefl _)) (at level 0, format "[ 'unitRingMixin' 'of' R 'by' <: ]") : form_scope. Notation "[ 'idomainMixin' 'of' R 'by' <: ]" := (idomainMixin (Phant R) val_inj (erefl _) (rrefl _)) (at level 0, format "[ 'idomainMixin' 'of' R 'by' <: ]") : form_scope. Notation "[ 'fieldMixin' 'of' F 'by' <: ]" := (fieldMixin (Phant F) val_inj (erefl _) (frefl _)) (at level 0, format "[ 'fieldMixin' 'of' F 'by' <: ]") : form_scope. End Exports. End SubType. Module Theory. Definition addrA := addrA. Definition addrC := addrC. Proof. (* Goal: @commutative (Zmodule.sort V) (Zmodule.sort V) (@add V) *) by case V => T [? []]. Qed. Definition add0r := add0r. Definition addNr := addNr. Proof. (* Goal: @left_inverse (Zmodule.sort V) (Zmodule.sort V) (Zmodule.sort V) (zero V) (@opp V) (@add V) *) by case V => T [? []]. Qed. Definition addr0 := addr0. Definition addrN := addrN. Definition subrr := subrr. Definition addrCA := addrCA. Proof. (* Goal: @left_commutative (Zmodule.sort V) (Zmodule.sort V) (@add V) *) exact: mulmCA. Qed. Definition addrAC := addrAC. Definition addrACA := addrACA. Proof. (* Goal: @interchange (Zmodule.sort V) (@add V) (@add V) *) exact: mulmACA. Qed. Definition addKr := addKr. Definition addNKr := addNKr. Definition addrK := addrK. Definition addrNK := addrNK. Definition subrK := subrK. Definition subKr := subKr. Definition addrI := @addrI. Definition addIr := @addIr. Definition subrI := @subrI. Definition subIr := @subIr. Arguments addrI {V} y [x1 x2]. Arguments addIr {V} x [x1 x2]. Arguments subrI {V} y [x1 x2]. Arguments subIr {V} x [x1 x2]. Definition opprK := @opprK. Arguments opprK {V}. Definition oppr_inj := @oppr_inj. Arguments oppr_inj {V} [x1 x2]. Definition oppr0 := oppr0. Definition oppr_eq0 := oppr_eq0. Definition opprD := opprD. Definition opprB := opprB. Definition subr0 := subr0. Definition sub0r := sub0r. Proof. (* Goal: @eq (Zmodule.sort V) (@add V (zero V) (@opp V x)) (@opp V x) *) by rewrite add0r. Qed. Definition subr_eq := subr_eq. Definition addr0_eq := addr0_eq. Definition subr0_eq := subr0_eq. Proof. (* Goal: forall _ : @eq (Zmodule.sort V) (@add V x (@opp V y)) (zero V), @eq (Zmodule.sort V) x y *) by move/addr0_eq/oppr_inj. Qed. Definition subr_eq0 := subr_eq0. Definition addr_eq0 := addr_eq0. Definition eqr_opp := eqr_opp. Definition eqr_oppLR := eqr_oppLR. Definition sumrN := sumrN. Definition sumrB := sumrB. Definition sumrMnl := sumrMnl. Definition sumrMnr := sumrMnr. Definition sumr_const := sumr_const. Definition telescope_sumr := telescope_sumr. Definition mulr0n := mulr0n. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x O) (zero V) *) by []. Qed. Definition mulr1n := mulr1n. Definition mulr2n := mulr2n. Proof. (* Goal: @eq (Zmodule.sort V) (@natmul V x (S (S O))) (@add V x x) *) by []. Qed. Definition mulrS := mulrS. Definition mulrSr := mulrSr. Definition mulrb := mulrb. Definition mul0rn := mul0rn. Definition mulNrn := mulNrn. Definition mulrnDl := mulrnDl. Definition mulrnDr := mulrnDr. Definition mulrnBl := mulrnBl. Definition mulrnBr := mulrnBr. Definition mulrnA := mulrnA. Definition mulrnAC := mulrnAC. Definition mulrA := mulrA. Proof. (* Goal: @associative (Ring.sort R) (@mul R) *) by case R => T [? []]. Qed. Definition mul1r := mul1r. Definition mulr1 := mulr1. Proof. (* Goal: @right_id (Ring.sort R) (Ring.sort R) (one R) (@mul R) *) by case R => T [? []]. Qed. Definition mulrDl := mulrDl. Definition mulrDr := mulrDr. Definition oner_neq0 := oner_neq0. Definition oner_eq0 := oner_eq0. Proof. (* Goal: @eq bool (@eq_op (Ring.eqType R) (one R : Ring.sort R) (zero (Ring.zmodType R) : Ring.sort R)) false *) exact: negbTE oner_neq0. Qed. Definition mul0r := mul0r. Definition mulr0 := mulr0. Definition mulrN := mulrN. Definition mulNr := mulNr. Definition mulrNN := mulrNN. Definition mulN1r := mulN1r. Definition mulrN1 := mulrN1. Definition mulr_suml := mulr_suml. Definition mulr_sumr := mulr_sumr. Definition mulrBl := mulrBl. Definition mulrBr := mulrBr. Definition mulrnAl := mulrnAl. Definition mulrnAr := mulrnAr. Definition mulr_natl := mulr_natl. Definition mulr_natr := mulr_natr. Definition natrD := natrD. Definition natrB := natrB. Definition natr_sum := natr_sum. Definition natrM := natrM. Definition natrX := natrX. Definition expr0 := expr0. Proof. (* Goal: @eq (Ring.sort R) (@exp R x O) (one R) *) by []. Qed. Definition exprS := exprS. Definition expr1 := expr1. Definition expr2 := expr2. Proof. (* Goal: @eq (Ring.sort R) (@exp R x (S (S O))) (@mul R x x) *) by []. Qed. Definition expr0n := expr0n. Definition expr1n := expr1n. Definition exprD := exprD. Definition exprSr := exprSr. Definition commr_sym := commr_sym. Definition commr_refl := commr_refl. Proof. (* Goal: @comm R x x *) by []. Qed. Definition commr0 := commr0. Definition commr1 := commr1. Definition commrN := commrN. Definition commrN1 := commrN1. Definition commrD := commrD. Definition commrMn := commrMn. Definition commrM := commrM. Definition commr_nat := commr_nat. Definition commrX := commrX. Definition exprMn_comm := exprMn_comm. Definition commr_sign := commr_sign. Definition exprMn_n := exprMn_n. Definition exprM := exprM. Definition exprAC := exprAC. Definition expr_mod := expr_mod. Definition expr_dvd := expr_dvd. Definition signr_odd := signr_odd. Definition signr_eq0 := signr_eq0. Definition mulr_sign := mulr_sign. Definition signr_addb := signr_addb. Definition signrN := signrN. Definition signrE := signrE. Definition mulr_signM := mulr_signM. Definition exprNn := exprNn. Definition sqrrN := sqrrN. Definition sqrr_sign := sqrr_sign. Definition signrMK := signrMK. Definition mulrI_eq0 := mulrI_eq0. Definition lreg_neq0 := lreg_neq0. Definition mulrI0_lreg := mulrI0_lreg. Definition lregN := lregN. Definition lreg1 := lreg1. Definition lregM := lregM. Definition lregX := lregX. Definition lreg_sign := lreg_sign. Definition lregP {R x} := @lregP R x. Definition mulIr_eq0 := mulIr_eq0. Definition mulIr0_rreg := mulIr0_rreg. Definition rreg_neq0 := rreg_neq0. Definition rregN := rregN. Definition rreg1 := rreg1. Definition rregM := rregM. Definition revrX := revrX. Definition rregX := rregX. Definition rregP {R x} := @rregP R x. Definition exprDn_comm := exprDn_comm. Definition exprBn_comm := exprBn_comm. Definition subrXX_comm := subrXX_comm. Definition exprD1n := exprD1n. Definition subrX1 := subrX1. Definition sqrrD1 := sqrrD1. Definition sqrrB1 := sqrrB1. Definition subr_sqr_1 := subr_sqr_1. Definition charf0 := charf0. Proof. (* Goal: @eq (Ring.sort R) (@natmul (Ring.zmodType R) (one R) p) (zero (Ring.zmodType R)) *) by apply/eqP; case/andP: charFp. Qed. Definition charf_prime := charf_prime. Definition mulrn_char := mulrn_char. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@natmul (Ring.zmodType R) x p) (zero (Ring.zmodType R)) *) by rewrite -mulr_natl charf0 mul0r. Qed. Definition dvdn_charf := dvdn_charf. Definition charf_eq := charf_eq. Definition bin_lt_charf_0 := bin_lt_charf_0. Definition Frobenius_autE := Frobenius_autE. Proof. (* Goal: @eq (Ring.sort R) (@Frobenius_aut p charFp x) (@exp R x p) *) by []. Qed. Definition Frobenius_aut0 := Frobenius_aut0. Definition Frobenius_aut1 := Frobenius_aut1. Definition Frobenius_autD_comm := Frobenius_autD_comm. Definition Frobenius_autMn := Frobenius_autMn. Definition Frobenius_aut_nat := Frobenius_aut_nat. Definition Frobenius_autM_comm := Frobenius_autM_comm. Definition Frobenius_autX := Frobenius_autX. Definition Frobenius_autN := Frobenius_autN. Definition Frobenius_autB_comm := Frobenius_autB_comm. Definition exprNn_char := exprNn_char. Definition addrr_char2 := addrr_char2. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType R)) (@add (Ring.zmodType R) x x) (zero (Ring.zmodType R)) *) by rewrite -mulr2n mulrn_char. Qed. Definition oppr_char2 := oppr_char2. Definition addrK_char2 := addrK_char2. Definition addKr_char2 := addKr_char2. Definition prodr_const := prodr_const. Definition mulrC := mulrC. Definition mulrCA := mulrCA. Proof. (* Goal: @left_commutative (ComRing.sort R) (ComRing.sort R) (@mul (ComRing.ringType R)) *) exact: mulmCA. Qed. Definition mulrAC := mulrAC. Definition mulrACA := mulrACA. Proof. (* Goal: @interchange (ComRing.sort R) (@mul (ComRing.ringType R)) (@mul (ComRing.ringType R)) *) exact: mulmACA. Qed. Definition exprMn := exprMn. Definition prodrXl := prodrXl. Definition prodrXr := prodrXr. Definition prodrN := prodrN. Definition prodrMn := prodrMn. Definition natr_prod := natr_prod. Definition prodr_undup_exp_count := prodr_undup_exp_count. Definition exprDn := exprDn. Definition exprBn := exprBn. Definition subrXX := subrXX. Definition sqrrD := sqrrD. Definition sqrrB := sqrrB. Definition subr_sqr := subr_sqr. Definition subr_sqrDB := subr_sqrDB. Definition exprDn_char := exprDn_char. Definition mulrV := mulrV. Definition divrr := divrr. Definition mulVr := mulVr. Definition invr_out := invr_out. Definition unitrP {R x} := @unitrP R x. Definition mulKr := mulKr. Definition mulVKr := mulVKr. Definition mulrK := mulrK. Definition mulrVK := mulrVK. Definition divrK := divrK. Definition mulrI := mulrI. Definition mulIr := mulIr. Definition divrI := divrI. Definition divIr := divIr. Definition telescope_prodr := telescope_prodr. Definition commrV := commrV. Definition unitrE := unitrE. Definition invrK := @invrK. Arguments invrK {R}. Definition invr_inj := @invr_inj. Arguments invr_inj {R} [x1 x2]. Definition unitrV := unitrV. Definition unitr1 := unitr1. Definition invr1 := invr1. Definition divr1 := divr1. Proof. (* Goal: @eq (Ring.sort (UnitRing.ringType R)) (@mul (UnitRing.ringType R) x (@inv R (one (UnitRing.ringType R)))) x *) by rewrite invr1 mulr1. Qed. Definition div1r := div1r. Definition natr_div := natr_div. Definition unitr0 := unitr0. Definition invr0 := invr0. Definition unitrN1 := unitrN1. Definition unitrN := unitrN. Proof. (* Goal: @eq bool (@in_mem (Zmodule.sort (UnitRing.zmodType R)) (@opp (UnitRing.zmodType R) x) (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) (@in_mem (UnitRing.sort R) x (@mem (UnitRing.sort R) (predPredType (UnitRing.sort R)) (@has_quality (S O) (UnitRing.sort R) (@unit R)))) *) exact: rpredN. Qed. Definition invrN1 := invrN1. Definition invrN := invrN. Definition invr_sign := invr_sign. Definition unitrMl := unitrMl. Definition unitrMr := unitrMr. Definition invrM := invrM. Definition invr_eq0 := invr_eq0. Definition invr_eq1 := invr_eq1. Definition invr_neq0 := invr_neq0. Definition unitrM_comm := unitrM_comm. Definition unitrX := unitrX. Definition unitrX_pos := unitrX_pos. Definition exprVn := exprVn. Definition exprB := exprB. Definition invr_signM := invr_signM. Definition divr_signM := divr_signM. Definition rpred0D := rpred0D. Definition rpred0 := rpred0. Definition rpredD := rpredD. Definition rpredNr := rpredNr. Definition rpred_sum := rpred_sum. Definition rpredMn := rpredMn. Definition rpredN := rpredN. Definition rpredB := rpredB. Definition rpredMNn := rpredMNn. Definition rpredDr := rpredDr. Definition rpredDl := rpredDl. Definition rpredBr := rpredBr. Definition rpredBl := rpredBl. Definition rpredMsign := rpredMsign. Definition rpred1M := rpred1M. Definition rpred1 := rpred1. Definition rpredM := rpredM. Definition rpred_prod := rpred_prod. Definition rpredX := rpredX. Definition rpred_nat := rpred_nat. Definition rpredN1 := rpredN1. Definition rpred_sign := rpred_sign. Definition rpredZsign := rpredZsign. Definition rpredZnat := rpredZnat. Definition rpredZ := rpredZ. Definition rpredVr := rpredVr. Definition rpredV := rpredV. Definition rpred_div := rpred_div. Definition rpredXN := rpredXN. Definition rpredZeq := rpredZeq. Definition char_lalg := char_lalg. Definition rpredMr := rpredMr. Definition rpredMl := rpredMl. Definition rpred_divr := rpred_divr. Definition rpred_divl := rpred_divl. Definition eq_eval := eq_eval. Definition eval_tsubst := eval_tsubst. Definition eq_holds := eq_holds. Definition holds_fsubst := holds_fsubst. Definition unitrM := unitrM. Definition unitrPr {R x} := @unitrPr R x. Definition expr_div_n := expr_div_n. Definition mulr1_eq := mulr1_eq. Definition divr1_eq := divr1_eq. Proof. (* Goal: forall _ : @eq (Ring.sort (ComUnitRing.ringType R)) (@mul (ComUnitRing.ringType R) x (@inv (ComUnitRing.unitRingType R) y)) (one (ComUnitRing.ringType R)), @eq (ComUnitRing.sort R) x y *) by move/mulr1_eq/invr_inj. Qed. Definition divKr := divKr. Definition mulf_eq0 := mulf_eq0. Definition prodf_eq0 := prodf_eq0. Definition prodf_seq_eq0 := prodf_seq_eq0. Definition mulf_neq0 := mulf_neq0. Definition prodf_neq0 := prodf_neq0. Definition prodf_seq_neq0 := prodf_seq_neq0. Definition expf_eq0 := expf_eq0. Definition sqrf_eq0 := sqrf_eq0. Proof. (* Goal: @eq bool (@eq_op (Ring.eqType (IntegralDomain.ringType R)) (@exp (IntegralDomain.ringType R) x (S (S O))) (zero (Ring.zmodType (IntegralDomain.ringType R)))) (@eq_op (IntegralDomain.eqType R) x (zero (IntegralDomain.zmodType R))) *) exact: expf_eq0. Qed. Definition expf_neq0 := expf_neq0. Definition natf_neq0 := natf_neq0. Definition natf0_char := natf0_char. Definition charf'_nat := charf'_nat. Definition charf0P := charf0P. Definition eqf_sqr := eqf_sqr. Definition mulfI := mulfI. Definition mulIf := mulIf. Definition divfI := divfI. Definition divIf := divIf. Definition sqrf_eq1 := sqrf_eq1. Definition expfS_eq1 := expfS_eq1. Definition fieldP := fieldP. Proof. (* Goal: Field.mixin_of (Field.unitRingType F) *) by case: F => T []. Qed. Definition unitfE := unitfE. Definition mulVf := mulVf. Definition mulfV := mulfV. Definition divff := divff. Definition mulKf := mulKf. Definition mulVKf := mulVKf. Definition mulfK := mulfK. Definition mulfVK := mulfVK. Definition divfK := divfK. Definition divKf := divKf. Definition invfM := invfM. Definition invf_div := invf_div. Definition expfB_cond := expfB_cond. Definition expfB := expfB. Definition prodfV := prodfV. Definition prodf_div := prodf_div. Definition telescope_prodf := telescope_prodf. Definition addf_div := addf_div. Definition mulf_div := mulf_div. Definition char0_natf_div := char0_natf_div. Definition fpredMr := fpredMr. Definition fpredMl := fpredMl. Definition fpred_divr := fpred_divr. Definition fpred_divl := fpred_divl. Definition satP {F e f} := @satP F e f. Definition eq_sat := eq_sat. Definition solP {F n f} := @solP F n f. Definition eq_sol := eq_sol. Definition size_sol := size_sol. Definition solve_monicpoly := solve_monicpoly. Definition raddf0 := raddf0. Definition raddf_eq0 := raddf_eq0. Definition raddfN := raddfN. Definition raddfD := raddfD. Definition raddfB := raddfB. Proof. (* Goal: @morphism_2 (Zmodule.sort U) (Zmodule.sort V) (@Additive.apply U V (Phant (forall _ : Zmodule.sort U, Zmodule.sort V)) f) (fun x y : Zmodule.sort U => @add U x (@opp U y)) (fun x y : Zmodule.sort V => @add V x (@opp V y)) *) exact: Additive.class. Qed. Definition raddf_sum := raddf_sum. Definition raddfMn := raddfMn. Definition raddfMNn := raddfMNn. Definition raddfMnat := raddfMnat. Definition raddfMsign := raddfMsign. Definition can2_additive := can2_additive. Definition bij_additive := bij_additive. Definition rmorph0 := rmorph0. Definition rmorphN := rmorphN. Proof. (* Goal: @morphism_1 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x : Zmodule.sort (Ring.zmodType R) => @opp (Ring.zmodType R) x) (fun x : Zmodule.sort (Ring.zmodType S) => @opp (Ring.zmodType S) x) *) exact: raddfN. Qed. Definition rmorphD := rmorphD. Definition rmorphB := rmorphB. Proof. (* Goal: @morphism_2 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x y : Zmodule.sort (Ring.zmodType R) => @add (Ring.zmodType R) x (@opp (Ring.zmodType R) y)) (fun x y : Zmodule.sort (Ring.zmodType S) => @add (Ring.zmodType S) x (@opp (Ring.zmodType S) y)) *) exact: raddfB. Qed. Definition rmorph_sum := rmorph_sum. Definition rmorphMn := rmorphMn. Definition rmorphMNn := rmorphMNn. Proof. (* Goal: @morphism_1 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x : Zmodule.sort (Ring.zmodType R) => @opp (Ring.zmodType R) (@natmul (Ring.zmodType R) x n)) (fun x : Zmodule.sort (Ring.zmodType S) => @opp (Ring.zmodType S) (@natmul (Ring.zmodType S) x n)) *) exact: raddfMNn. Qed. Definition rmorphismP := rmorphismP. Definition rmorphismMP := rmorphismMP. Proof. (* Goal: @RMorphism.mixin_of R S (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) *) exact: rmorphismP. Qed. Definition rmorph1 := rmorph1. Definition rmorph_eq1 := rmorph_eq1. Definition rmorphM := rmorphM. Proof. (* Goal: @morphism_2 (Zmodule.sort (Ring.zmodType R)) (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f) (fun x y : Zmodule.sort (Ring.zmodType R) => @mul R x y) (fun x y : Zmodule.sort (Ring.zmodType S) => @mul S x y) *) by case: rmorphismMP. Qed. Definition rmorphMsign := rmorphMsign. Definition rmorph_nat := rmorph_nat. Definition rmorph_eq_nat := rmorph_eq_nat. Definition rmorph_prod := rmorph_prod. Definition rmorphX := rmorphX. Definition rmorphN1 := rmorphN1. Proof. (* Goal: @eq (Zmodule.sort (Ring.zmodType S)) (@RMorphism.apply R S (Phant (forall _ : Ring.sort R, Ring.sort S)) f (@opp (Ring.zmodType R) (one R))) (@opp (Ring.zmodType S) (one S)) *) by rewrite rmorphN rmorph1. Qed. Definition rmorph_sign := rmorph_sign. Definition rmorph_char := rmorph_char. Definition can2_rmorphism := can2_rmorphism. Definition bij_rmorphism := bij_rmorphism. Definition rmorph_comm := rmorph_comm. Definition rmorph_unit := rmorph_unit. Definition rmorphV := rmorphV. Definition rmorph_div := rmorph_div. Definition fmorph_eq0 := fmorph_eq0. Definition fmorph_inj := @fmorph_inj. Arguments fmorph_inj {F R} f [x1 x2]. Definition fmorph_eq1 := fmorph_eq1. Definition fmorph_char := fmorph_char. Definition fmorph_unit := fmorph_unit. Definition fmorphV := fmorphV. Definition fmorph_div := fmorph_div. Definition scalerA := scalerA. Definition scale1r := scale1r. Definition scalerDr := scalerDr. Definition scalerDl := scalerDl. Definition scaler0 := scaler0. Definition scale0r := scale0r. Definition scaleNr := scaleNr. Definition scaleN1r := scaleN1r. Definition scalerN := scalerN. Definition scalerBl := scalerBl. Definition scalerBr := scalerBr. Definition scaler_nat := scaler_nat. Definition scalerMnl := scalerMnl. Definition scalerMnr := scalerMnr. Definition scaler_suml := scaler_suml. Definition scaler_sumr := scaler_sumr. Definition scaler_eq0 := scaler_eq0. Definition scalerK := scalerK. Definition scalerKV := scalerKV. Definition scalerI := scalerI. Definition scalerAl := scalerAl. Definition mulr_algl := mulr_algl. Definition scaler_sign := scaler_sign. Definition signrZK := signrZK. Definition scalerCA := scalerCA. Definition scalerAr := scalerAr. Definition mulr_algr := mulr_algr. Definition exprZn := exprZn. Definition scaler_prodl := scaler_prodl. Definition scaler_prodr := scaler_prodr. Definition scaler_prod := scaler_prod. Definition scaler_injl := scaler_injl. Definition scaler_unit := scaler_unit. Definition invrZ := invrZ. Definition raddfZnat := raddfZnat. Definition raddfZsign := raddfZsign. Definition in_algE := in_algE. Proof. (* Goal: @eq (@Lalgebra.sort R (Phant (Ring.sort R)) A) (@in_alg_head R A (Phant (@Lalgebra.sort R (Phant (Ring.sort R)) A)) a) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A) a (one (@Lalgebra.ringType R (Phant (Ring.sort R)) A))) *) by []. Qed. Definition linear0 := linear0. Definition linearN := linearN. Proof. (* Goal: @morphism_1 (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (fun x : Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U) => @opp (@Lmodule.zmodType R (Phant (Ring.sort R)) U) x) (fun x : Zmodule.sort V => @opp V x) *) exact: raddfN. Qed. Definition linearD := linearD. Definition linearB := linearB. Proof. (* Goal: @morphism_2 (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (fun x y : Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U) => @add (@Lmodule.zmodType R (Phant (Ring.sort R)) U) x (@opp (@Lmodule.zmodType R (Phant (Ring.sort R)) U) y)) (fun x y : Zmodule.sort V => @add V x (@opp V y)) *) exact: raddfB. Qed. Definition linear_sum := linear_sum. Definition linearMn := linearMn. Definition linearMNn := linearMNn. Proof. (* Goal: @morphism_1 (Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U)) (Zmodule.sort V) (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) (fun x : Zmodule.sort (@Lmodule.zmodType R (Phant (Ring.sort R)) U) => @opp (@Lmodule.zmodType R (Phant (Ring.sort R)) U) (@natmul (@Lmodule.zmodType R (Phant (Ring.sort R)) U) x n)) (fun x : Zmodule.sort V => @opp V (@natmul V x n)) *) exact: raddfMNn. Qed. Definition linearP := linearP. Definition linearZ_LR := linearZ_LR. Proof. (* Goal: @Linear.mixin_of R U V s (@Linear.apply R U V s (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort V)) f) *) by case: f => ? []. Qed. Definition linearZ := linearZ. Definition linearPZ := linearPZ. Proof. (* Goal: @Linear.axiom R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (@Linear.apply R U (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V))) (@scale R V) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, @Lmodule.sort R (Phant (Ring.sort R)) V)) f) (@Scale.scale_law R V) (@Logic.eq_refl (forall (_ : Ring.sort R) (_ : Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))), Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) V) (@Lmodule.class R (Phant (Ring.sort R)) V)))) (@scale R V)) *) exact: linearP. Qed. Definition linearZZ := linearZZ. Definition scalarP := scalarP. Definition scalarZ := scalarZ. Proof. (* Goal: @Linear.mixin_of R U (Ring.zmodType R) (@mul R) (@Linear.apply R U (Ring.zmodType R) (@mul R) (Phant (forall _ : @Lmodule.sort R (Phant (Ring.sort R)) U, Zmodule.sort (Ring.zmodType R))) f) *) exact: linearZ_LR. Qed. Definition can2_linear := can2_linear. Definition bij_linear := bij_linear. Definition rmorph_alg := rmorph_alg. Definition lrmorphismP := lrmorphismP. Proof. (* Goal: @LRMorphism.class_of R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (@LRMorphism.apply R A (@Lalgebra.ringType R (Phant (Ring.sort R)) B) (@scale R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) B)) (Phant (forall _ : @Lalgebra.sort R (Phant (Ring.sort R)) A, @Lalgebra.sort R (Phant (Ring.sort R)) B)) f) *) exact: LRMorphism.class. Qed. Definition can2_lrmorphism := can2_lrmorphism. Definition bij_lrmorphism := bij_lrmorphism. Definition imaginary_exists := imaginary_exists. Notation null_fun V := (null_fun V) (only parsing). Notation in_alg A := (in_alg_loc A). End Theory. Notation in_alg A := (in_alg_loc A). End GRing. Export Zmodule.Exports Ring.Exports Lmodule.Exports Lalgebra.Exports. Export Additive.Exports RMorphism.Exports Linear.Exports LRMorphism.Exports. Export ComRing.Exports Algebra.Exports UnitRing.Exports UnitAlgebra.Exports. Export ComUnitRing.Exports IntegralDomain.Exports Field.Exports. Export DecidableField.Exports ClosedField.Exports. Export Pred.Exports SubType.Exports. Notation QEdecFieldMixin := QEdecFieldMixin. Notation "0" := (zero _) : ring_scope. Notation "-%R" := (@opp _) : ring_scope. Notation "- x" := (opp x) : ring_scope. Notation "+%R" := (@add _). Notation "x + y" := (add x y) : ring_scope. Notation "x - y" := (add x (- y)) : ring_scope. Notation "x *+ n" := (natmul x n) : ring_scope. Notation "x *- n" := (opp (x *+ n)) : ring_scope. Notation "s `_ i" := (seq.nth 0%R s%R i) : ring_scope. Notation support := 0.-support. Notation "1" := (one _) : ring_scope. Notation "- 1" := (opp 1) : ring_scope. Notation "n %:R" := (natmul 1 n) : ring_scope. Notation "[ 'char' R ]" := (char (Phant R)) : ring_scope. Notation Frobenius_aut chRp := (Frobenius_aut chRp). Notation "*%R" := (@mul _). Notation "x * y" := (mul x y) : ring_scope. Notation "x ^+ n" := (exp x n) : ring_scope. Notation "x ^-1" := (inv x) : ring_scope. Notation "x ^- n" := (inv (x ^+ n)) : ring_scope. Notation "x / y" := (mul x y^-1) : ring_scope. Notation "*:%R" := (@scale _ _). Notation "a *: m" := (scale a m) : ring_scope. Notation "k %:A" := (scale k 1) : ring_scope. Notation "\0" := (null_fun _) : ring_scope. Notation "f \+ g" := (add_fun_head tt f g) : ring_scope. Notation "f \- g" := (sub_fun_head tt f g) : ring_scope. Notation "a \*: f" := (scale_fun_head tt a f) : ring_scope. Notation "x \*o f" := (mull_fun_head tt x f) : ring_scope. Notation "x \o* f" := (mulr_fun_head tt x f) : ring_scope. Notation "\sum_ ( i <- r | P ) F" := (\big[+%R/0%R]_(i <- r | P%B) F%R) : ring_scope. Notation "\sum_ ( i <- r ) F" := (\big[+%R/0%R]_(i <- r) F%R) : ring_scope. Notation "\sum_ ( m <= i < n | P ) F" := (\big[+%R/0%R]_(m <= i < n | P%B) F%R) : ring_scope. Notation "\sum_ ( m <= i < n ) F" := (\big[+%R/0%R]_(m <= i < n) F%R) : ring_scope. Notation "\sum_ ( i | P ) F" := (\big[+%R/0%R]_(i | P%B) F%R) : ring_scope. Notation "\sum_ i F" := (\big[+%R/0%R]_i F%R) : ring_scope. Notation "\sum_ ( i : t | P ) F" := (\big[+%R/0%R]_(i : t | P%B) F%R) (only parsing) : ring_scope. Notation "\sum_ ( i : t ) F" := (\big[+%R/0%R]_(i : t) F%R) (only parsing) : ring_scope. Notation "\sum_ ( i < n | P ) F" := (\big[+%R/0%R]_(i < n | P%B) F%R) : ring_scope. Notation "\sum_ ( i < n ) F" := (\big[+%R/0%R]_(i < n) F%R) : ring_scope. Notation "\sum_ ( i 'in' A | P ) F" := (\big[+%R/0%R]_(i in A | P%B) F%R) : ring_scope. Notation "\sum_ ( i 'in' A ) F" := (\big[+%R/0%R]_(i in A) F%R) : ring_scope. Notation "\prod_ ( i <- r | P ) F" := (\big[*%R/1%R]_(i <- r | P%B) F%R) : ring_scope. Notation "\prod_ ( i <- r ) F" := (\big[*%R/1%R]_(i <- r) F%R) : ring_scope. Notation "\prod_ ( m <= i < n | P ) F" := (\big[*%R/1%R]_(m <= i < n | P%B) F%R) : ring_scope. Notation "\prod_ ( m <= i < n ) F" := (\big[*%R/1%R]_(m <= i < n) F%R) : ring_scope. Notation "\prod_ ( i | P ) F" := (\big[*%R/1%R]_(i | P%B) F%R) : ring_scope. Notation "\prod_ i F" := (\big[*%R/1%R]_i F%R) : ring_scope. Notation "\prod_ ( i : t | P ) F" := (\big[*%R/1%R]_(i : t | P%B) F%R) (only parsing) : ring_scope. Notation "\prod_ ( i : t ) F" := (\big[*%R/1%R]_(i : t) F%R) (only parsing) : ring_scope. Notation "\prod_ ( i < n | P ) F" := (\big[*%R/1%R]_(i < n | P%B) F%R) : ring_scope. Notation "\prod_ ( i < n ) F" := (\big[*%R/1%R]_(i < n) F%R) : ring_scope. Notation "\prod_ ( i 'in' A | P ) F" := (\big[*%R/1%R]_(i in A | P%B) F%R) : ring_scope. Notation "\prod_ ( i 'in' A ) F" := (\big[*%R/1%R]_(i in A) F%R) : ring_scope. Canonical add_monoid. Canonical add_comoid. Canonical mul_monoid. Canonical mul_comoid. Canonical muloid. Canonical addoid. Canonical locked_additive. Canonical locked_rmorphism. Canonical locked_linear. Canonical locked_lrmorphism. Canonical idfun_additive. Canonical idfun_rmorphism. Canonical idfun_linear. Canonical idfun_lrmorphism. Canonical comp_additive. Canonical comp_rmorphism. Canonical comp_linear. Canonical comp_lrmorphism. Canonical opp_additive. Canonical opp_linear. Canonical scale_additive. Canonical scale_linear. Canonical null_fun_additive. Canonical null_fun_linear. Canonical scale_fun_additive. Canonical scale_fun_linear. Canonical add_fun_additive. Canonical add_fun_linear. Canonical sub_fun_additive. Canonical sub_fun_linear. Canonical mull_fun_additive. Canonical mull_fun_linear. Canonical mulr_fun_additive. Canonical mulr_fun_linear. Canonical Frobenius_aut_additive. Canonical Frobenius_aut_rmorphism. Canonical in_alg_additive. Canonical in_alg_rmorphism. Notation "R ^c" := (converse R) (at level 2, format "R ^c") : type_scope. Canonical converse_eqType. Canonical converse_choiceType. Canonical converse_zmodType. Canonical converse_ringType. Canonical converse_unitRingType. Notation "R ^o" := (regular R) (at level 2, format "R ^o") : type_scope. Canonical regular_eqType. Canonical regular_choiceType. Canonical regular_zmodType. Canonical regular_ringType. Canonical regular_lmodType. Canonical regular_lalgType. Canonical regular_comRingType. Canonical regular_algType. Canonical regular_unitRingType. Canonical regular_comUnitRingType. Canonical regular_unitAlgType. Canonical regular_idomainType. Canonical regular_fieldType. Canonical unit_keyed. Canonical unit_opprPred. Canonical unit_mulrPred. Canonical unit_smulrPred. Canonical unit_divrPred. Canonical unit_sdivrPred. Bind Scope term_scope with term. Bind Scope term_scope with formula. Notation "''X_' i" := (Var _ i) : term_scope. Notation "n %:R" := (NatConst _ n) : term_scope. Notation "0" := 0%:R%T : term_scope. Notation "1" := 1%:R%T : term_scope. Notation "x %:T" := (Const x) : term_scope. Infix "+" := Add : term_scope. Notation "- t" := (Opp t) : term_scope. Notation "t - u" := (Add t (- u)) : term_scope. Infix "*" := Mul : term_scope. Infix "*+" := NatMul : term_scope. Notation "t ^-1" := (Inv t) : term_scope. Notation "t / u" := (Mul t u^-1) : term_scope. Infix "^+" := Exp : term_scope. Infix "==" := Equal : term_scope. Notation "x != y" := (GRing.Not (x == y)) : term_scope. Infix "/\" := And : term_scope. Infix "\/" := Or : term_scope. Infix "==>" := Implies : term_scope. Notation "~ f" := (Not f) : term_scope. Notation "''exists' ''X_' i , f" := (Exists i f) : term_scope. Notation "''forall' ''X_' i , f" := (Forall i f) : term_scope. Section FinFunZmod. Variable (aT : finType) (rT : zmodType). Implicit Types f g : {ffun aT -> rT}. Definition ffun_zero := [ffun a : aT => (0 : rT)]. Definition ffun_opp f := [ffun a => - f a]. Definition ffun_add f g := [ffun a => f a + g a]. Fact ffun_addA : associative ffun_add. Proof. (* Goal: @associative (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) ffun_add *) by move=> f1 f2 f3; apply/ffunP=> a; rewrite !ffunE addrA. Qed. Fact ffun_addC : commutative ffun_add. Proof. (* Goal: @commutative (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) ffun_add *) by move=> f1 f2; apply/ffunP=> a; rewrite !ffunE addrC. Qed. Fact ffun_add0 : left_id ffun_zero ffun_add. Proof. (* Goal: @left_id (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) ffun_zero ffun_add *) by move=> f; apply/ffunP=> a; rewrite !ffunE add0r. Qed. Fact ffun_addN : left_inverse ffun_zero ffun_opp ffun_add. Proof. (* Goal: @left_inverse (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) (@finfun_of aT (Zmodule.sort rT) (Phant (forall _ : Finite.sort aT, Zmodule.sort rT))) ffun_zero ffun_opp ffun_add *) by move=> f; apply/ffunP=> a; rewrite !ffunE addNr. Qed. Definition ffun_zmodMixin := Zmodule.Mixin ffun_addA ffun_addC ffun_add0 ffun_addN. Canonical ffun_zmodType := Eval hnf in ZmodType _ ffun_zmodMixin. Section Sum. Variables (I : Type) (r : seq I) (P : pred I) (F : I -> {ffun aT -> rT}). Lemma sum_ffunE x : (\sum_(i <- r | P i) F i) x = \sum_(i <- r | P i) F i x. Proof. (* Goal: @eq (Zmodule.sort rT) (@FunFinfun.fun_of_fin aT (Zmodule.sort rT) (@BigOp.bigop (Zmodule.sort ffun_zmodType) I (zero ffun_zmodType) r (fun i : I => @BigBody (Zmodule.sort ffun_zmodType) I i (@add ffun_zmodType) (P i) (F i))) x) (@BigOp.bigop (Zmodule.sort rT) I (zero rT) r (fun i : I => @BigBody (Zmodule.sort rT) I i (@add rT) (P i) (@FunFinfun.fun_of_fin aT (Zmodule.sort rT) (F i) x))) *) by elim/big_rec2: _ => // [|i _ y _ <-]; rewrite !ffunE. Qed. Lemma sum_ffun : \sum_(i <- r | P i) F i = [ffun x => \sum_(i <- r | P i) F i x]. Proof. (* Goal: @eq (Zmodule.sort ffun_zmodType) (@BigOp.bigop (Zmodule.sort ffun_zmodType) I (zero ffun_zmodType) r (fun i : I => @BigBody (Zmodule.sort ffun_zmodType) I i (@add ffun_zmodType) (P i) (F i))) (@FunFinfun.finfun aT (Zmodule.sort rT) (fun x : Finite.sort aT => @BigOp.bigop (Zmodule.sort rT) I (zero rT) r (fun i : I => @BigBody (Zmodule.sort rT) I i (@add rT) (P i) (@FunFinfun.fun_of_fin aT (Zmodule.sort rT) (F i) x)))) *) by apply/ffunP=> i; rewrite sum_ffunE ffunE. Qed. End Sum. Lemma ffunMnE f n x : (f *+ n) x = f x *+ n. Proof. (* Goal: @eq (Zmodule.sort rT) (@FunFinfun.fun_of_fin aT (Zmodule.sort rT) (@natmul ffun_zmodType f n) x) (@natmul rT (@FunFinfun.fun_of_fin aT (Zmodule.sort rT) f x) n) *) by rewrite -[n]card_ord -!sumr_const sum_ffunE. Qed. End FinFunZmod. Section FinFunRing. Variable (aT : finType) (R : ringType) (a : aT). Definition ffun_one : {ffun aT -> R} := [ffun => 1]. Definition ffun_mul (f g : {ffun aT -> R}) := [ffun x => f x * g x]. Fact ffun_mulA : associative ffun_mul. Proof. (* Goal: @associative (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) ffun_mul *) by move=> f1 f2 f3; apply/ffunP=> i; rewrite !ffunE mulrA. Qed. Fact ffun_mul_1l : left_id ffun_one ffun_mul. Proof. (* Goal: @left_id (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) ffun_one ffun_mul *) by move=> f; apply/ffunP=> i; rewrite !ffunE mul1r. Qed. Fact ffun_mul_1r : right_id ffun_one ffun_mul. Proof. (* Goal: @right_id (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) ffun_one ffun_mul *) by move=> f; apply/ffunP=> i; rewrite !ffunE mulr1. Qed. Fact ffun_mul_addl : left_distributive ffun_mul (@ffun_add _ _). Proof. (* Goal: @left_distributive (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) ffun_mul (@ffun_add aT (Ring.zmodType R)) *) by move=> f1 f2 f3; apply/ffunP=> i; rewrite !ffunE mulrDl. Qed. Fact ffun_mul_addr : right_distributive ffun_mul (@ffun_add _ _). Proof. (* Goal: @right_distributive (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) (@finfun_of aT (Ring.sort R) (Phant (forall _ : Finite.sort aT, Ring.sort R))) ffun_mul (@ffun_add aT (Ring.zmodType R)) *) by move=> f1 f2 f3; apply/ffunP=> i; rewrite !ffunE mulrDr. Qed. Fact ffun1_nonzero : ffun_one != 0. Proof. (* Goal: is_true (negb (@eq_op (finfun_of_eqType aT (Ring.eqType R)) ffun_one (zero (ffun_zmodType aT (Ring.zmodType R))))) *) by apply/eqP => /ffunP/(_ a)/eqP; rewrite !ffunE oner_eq0. Qed. Definition ffun_ringMixin := RingMixin ffun_mulA ffun_mul_1l ffun_mul_1r ffun_mul_addl ffun_mul_addr ffun1_nonzero. Definition ffun_ringType := Eval hnf in RingType {ffun aT -> R} ffun_ringMixin. End FinFunRing. Section FinFunComRing. Variable (aT : finType) (R : comRingType) (a : aT). Fact ffun_mulC : commutative (@ffun_mul aT R). Proof. (* Goal: @commutative (@finfun_of aT (Ring.sort (ComRing.ringType R)) (Phant (forall _ : Finite.sort aT, Ring.sort (ComRing.ringType R)))) (@finfun_of aT (Ring.sort (ComRing.ringType R)) (Phant (forall _ : Finite.sort aT, Ring.sort (ComRing.ringType R)))) (@ffun_mul aT (ComRing.ringType R)) *) by move=> f1 f2; apply/ffunP=> i; rewrite !ffunE mulrC. Qed. Definition ffun_comRingType := Eval hnf in ComRingType (ffun_ringType R a) ffun_mulC. End FinFunComRing. Section FinFunLmod. Variable (R : ringType) (aT : finType) (rT : lmodType R). Implicit Types f g : {ffun aT -> rT}. Definition ffun_scale k f := [ffun a => k *: f a]. Fact ffun_scaleA k1 k2 f : ffun_scale k1 (ffun_scale k2 f) = ffun_scale (k1 * k2) f. Proof. (* Goal: @eq (@finfun_of aT (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))) (Phant (forall _ : Finite.sort aT, Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))))) (ffun_scale k1 (ffun_scale k2 f)) (ffun_scale (@mul R k1 k2) f) *) by apply/ffunP=> a; rewrite !ffunE scalerA. Qed. Fact ffun_scale1 : left_id 1 ffun_scale. Proof. (* Goal: @left_id (Ring.sort R) (@finfun_of aT (@Lmodule.sort R (Phant (Ring.sort R)) rT) (Phant (forall _ : Finite.sort aT, @Lmodule.sort R (Phant (Ring.sort R)) rT))) (one R) ffun_scale *) by move=> f; apply/ffunP=> a; rewrite !ffunE scale1r. Qed. Fact ffun_scale_addr k : {morph (ffun_scale k) : x y / x + y}. Proof. (* Goal: @morphism_2 (@finfun_of aT (@Lmodule.sort R (Phant (Ring.sort R)) rT) (Phant (forall _ : Finite.sort aT, @Lmodule.sort R (Phant (Ring.sort R)) rT))) (@finfun_of aT (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))) (Phant (forall _ : Finite.sort aT, Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))))) (ffun_scale k) (fun x y : @finfun_of aT (@Lmodule.sort R (Phant (Ring.sort R)) rT) (Phant (forall _ : Finite.sort aT, @Lmodule.sort R (Phant (Ring.sort R)) rT)) => @add (ffun_zmodType aT (@Lmodule.zmodType R (Phant (Ring.sort R)) rT)) x y) (fun x y : @finfun_of aT (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))) (Phant (forall _ : Finite.sort aT, Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT))))) => @add (ffun_zmodType aT (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))) x y) *) by move=> f g; apply/ffunP=> a; rewrite !ffunE scalerDr. Qed. Fact ffun_scale_addl u : {morph (ffun_scale)^~ u : k1 k2 / k1 + k2}. Proof. (* Goal: @morphism_2 (Ring.sort R) (@finfun_of aT (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))) (Phant (forall _ : Finite.sort aT, Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))))) (fun x : Ring.sort R => ffun_scale x u) (fun k1 k2 : Ring.sort R => @add (Ring.zmodType R) k1 k2) (fun k1 k2 : @finfun_of aT (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))) (Phant (forall _ : Finite.sort aT, Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT))))) => @add (ffun_zmodType aT (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) rT) (@Lmodule.class R (Phant (Ring.sort R)) rT)))) k1 k2) *) by move=> k1 k2; apply/ffunP=> a; rewrite !ffunE scalerDl. Qed. Definition ffun_lmodMixin := LmodMixin ffun_scaleA ffun_scale1 ffun_scale_addr ffun_scale_addl. Canonical ffun_lmodType := Eval hnf in LmodType R {ffun aT -> rT} ffun_lmodMixin. End FinFunLmod. Section PairZmod. Variables M1 M2 : zmodType. Definition opp_pair (x : M1 * M2) := (- x.1, - x.2). Definition add_pair (x y : M1 * M2) := (x.1 + y.1, x.2 + y.2). Fact pair_addA : associative add_pair. Proof. (* Goal: @associative (prod (Zmodule.sort M1) (Zmodule.sort M2)) add_pair *) by move=> x y z; congr (_, _); apply: addrA. Qed. Fact pair_addC : commutative add_pair. Proof. (* Goal: @commutative (prod (Zmodule.sort M1) (Zmodule.sort M2)) (prod (Zmodule.sort M1) (Zmodule.sort M2)) add_pair *) by move=> x y; congr (_, _); apply: addrC. Qed. Fact pair_add0 : left_id (0, 0) add_pair. Proof. (* Goal: @left_id (prod (Zmodule.sort M1) (Zmodule.sort M2)) (prod (Zmodule.sort M1) (Zmodule.sort M2)) (@pair (Zmodule.sort M1) (Zmodule.sort M2) (zero M1) (zero M2)) add_pair *) by case=> x1 x2; congr (_, _); apply: add0r. Qed. Fact pair_addN : left_inverse (0, 0) opp_pair add_pair. Proof. (* Goal: @left_inverse (prod (Zmodule.sort M1) (Zmodule.sort M2)) (prod (Zmodule.sort M1) (Zmodule.sort M2)) (prod (Zmodule.sort M1) (Zmodule.sort M2)) (@pair (Zmodule.sort M1) (Zmodule.sort M2) (zero M1) (zero M2)) opp_pair add_pair *) by move=> x; congr (_, _); apply: addNr. Qed. Definition pair_zmodMixin := ZmodMixin pair_addA pair_addC pair_add0 pair_addN. Canonical pair_zmodType := Eval hnf in ZmodType (M1 * M2) pair_zmodMixin. End PairZmod. Section PairRing. Variables R1 R2 : ringType. Definition mul_pair (x y : R1 * R2) := (x.1 * y.1, x.2 * y.2). Fact pair_mulA : associative mul_pair. Proof. (* Goal: @associative (prod (Ring.sort R1) (Ring.sort R2)) mul_pair *) by move=> x y z; congr (_, _); apply: mulrA. Qed. Fact pair_mul1l : left_id (1, 1) mul_pair. Proof. (* Goal: @left_id (prod (Ring.sort R1) (Ring.sort R2)) (prod (Ring.sort R1) (Ring.sort R2)) (@pair (Ring.sort R1) (Ring.sort R2) (one R1) (one R2)) mul_pair *) by case=> x1 x2; congr (_, _); apply: mul1r. Qed. Fact pair_mul1r : right_id (1, 1) mul_pair. Proof. (* Goal: @right_id (prod (Ring.sort R1) (Ring.sort R2)) (prod (Ring.sort R1) (Ring.sort R2)) (@pair (Ring.sort R1) (Ring.sort R2) (one R1) (one R2)) mul_pair *) by case=> x1 x2; congr (_, _); apply: mulr1. Qed. Fact pair_mulDl : left_distributive mul_pair +%R. Proof. (* Goal: @left_distributive (prod (Ring.sort R1) (Ring.sort R2)) (prod (Ring.sort R1) (Ring.sort R2)) mul_pair (@add (pair_zmodType (Ring.zmodType R1) (Ring.zmodType R2))) *) by move=> x y z; congr (_, _); apply: mulrDl. Qed. Fact pair_mulDr : right_distributive mul_pair +%R. Proof. (* Goal: @right_distributive (prod (Ring.sort R1) (Ring.sort R2)) (prod (Ring.sort R1) (Ring.sort R2)) mul_pair (@add (pair_zmodType (Ring.zmodType R1) (Ring.zmodType R2))) *) by move=> x y z; congr (_, _); apply: mulrDr. Qed. Fact pair_one_neq0 : (1, 1) != 0 :> R1 * R2. Proof. (* Goal: is_true (negb (@eq_op (prod_eqType (Ring.eqType R1) (Ring.eqType R2)) (@pair (Ring.sort R1) (Ring.sort R2) (one R1) (one R2) : prod (Ring.sort R1) (Ring.sort R2)) (zero (pair_zmodType (Ring.zmodType R1) (Ring.zmodType R2)) : prod (Ring.sort R1) (Ring.sort R2)))) *) by rewrite xpair_eqE oner_eq0. Qed. Definition pair_ringMixin := RingMixin pair_mulA pair_mul1l pair_mul1r pair_mulDl pair_mulDr pair_one_neq0. Canonical pair_ringType := Eval hnf in RingType (R1 * R2) pair_ringMixin. End PairRing. Section PairComRing. Variables R1 R2 : comRingType. Fact pair_mulC : commutative (@mul_pair R1 R2). Proof. (* Goal: @commutative (prod (Ring.sort (ComRing.ringType R1)) (Ring.sort (ComRing.ringType R2))) (prod (Ring.sort (ComRing.ringType R1)) (Ring.sort (ComRing.ringType R2))) (@mul_pair (ComRing.ringType R1) (ComRing.ringType R2)) *) by move=> x y; congr (_, _); apply: mulrC. Qed. Canonical pair_comRingType := Eval hnf in ComRingType (R1 * R2) pair_mulC. End PairComRing. Section PairLmod. Variables (R : ringType) (V1 V2 : lmodType R). Definition scale_pair a (v : V1 * V2) : V1 * V2 := (a *: v.1, a *: v.2). Fact pair_scaleA a b u : scale_pair a (scale_pair b u) = scale_pair (a * b) u. Proof. (* Goal: @eq (prod (@Lmodule.sort R (Phant (Ring.sort R)) V1) (@Lmodule.sort R (Phant (Ring.sort R)) V2)) (scale_pair a (scale_pair b u)) (scale_pair (@mul R a b) u) *) by congr (_, _); apply: scalerA. Qed. Fact pair_scale1 u : scale_pair 1 u = u. Proof. (* Goal: @eq (prod (@Lmodule.sort R (Phant (Ring.sort R)) V1) (@Lmodule.sort R (Phant (Ring.sort R)) V2)) (scale_pair (one R) u) u *) by case: u => u1 u2; congr (_, _); apply: scale1r. Qed. Fact pair_scaleDr : right_distributive scale_pair +%R. Proof. (* Goal: @right_distributive (Ring.sort R) (prod (@Lmodule.sort R (Phant (Ring.sort R)) V1) (@Lmodule.sort R (Phant (Ring.sort R)) V2)) scale_pair (@add (pair_zmodType (@Lmodule.zmodType R (Phant (Ring.sort R)) V1) (@Lmodule.zmodType R (Phant (Ring.sort R)) V2))) *) by move=> a u v; congr (_, _); apply: scalerDr. Qed. Fact pair_scaleDl u : {morph scale_pair^~ u: a b / a + b}. Proof. (* Goal: @morphism_2 (Ring.sort R) (prod (@Lmodule.sort R (Phant (Ring.sort R)) V1) (@Lmodule.sort R (Phant (Ring.sort R)) V2)) (fun x : Ring.sort R => scale_pair x u) (fun a b : Ring.sort R => @add (Ring.zmodType R) a b) (fun a b : prod (@Lmodule.sort R (Phant (Ring.sort R)) V1) (@Lmodule.sort R (Phant (Ring.sort R)) V2) => @add (pair_zmodType (@Lmodule.zmodType R (Phant (Ring.sort R)) V1) (@Lmodule.zmodType R (Phant (Ring.sort R)) V2)) a b) *) by move=> a b; congr (_, _); apply: scalerDl. Qed. Definition pair_lmodMixin := LmodMixin pair_scaleA pair_scale1 pair_scaleDr pair_scaleDl. Canonical pair_lmodType := Eval hnf in LmodType R (V1 * V2) pair_lmodMixin. End PairLmod. Section PairLalg. Variables (R : ringType) (A1 A2 : lalgType R). Fact pair_scaleAl a (u v : A1 * A2) : a *: (u * v) = (a *: u) * v. Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort R (Phant (Ring.sort R)) (@pair_lmodType R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A1) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A2))) (@Lmodule.base R (@Lmodule.sort R (Phant (Ring.sort R)) (@pair_lmodType R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A1) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A2))) (@Lmodule.class R (Phant (Ring.sort R)) (@pair_lmodType R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A1) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A2)))))) (@scale R (@pair_lmodType R (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A1) (@Lalgebra.lmod_ringType R (Phant (Ring.sort R)) A2)) a (@mul (pair_ringType (@Lalgebra.ringType R (Phant (Ring.sort R)) A1) (@Lalgebra.ringType R (Phant (Ring.sort R)) A2)) u v)) (@mul (pair_ringType (@Lalgebra.ringType R (Phant (Ring.sort R)) A1) (@Lalgebra.ringType R (Phant (Ring.sort R)) A2)) (@scale R (@pair_lmodType R (@Lalgebra.lmodType R (Phant (Ring.sort R)) A1) (@Lalgebra.lmodType R (Phant (Ring.sort R)) A2)) a u) v) *) by congr (_, _); apply: scalerAl. Qed. Canonical pair_lalgType := Eval hnf in LalgType R (A1 * A2) pair_scaleAl. End PairLalg. Section PairAlg. Variables (R : comRingType) (A1 A2 : algType R). Fact pair_scaleAr a (u v : A1 * A2) : a *: (u * v) = u * (a *: v). Proof. (* Goal: @eq (Zmodule.sort (@Zmodule.Pack (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@pair_lalgType (ComRing.ringType R) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A1) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A2)))) (@Lmodule.base (ComRing.ringType R) (@Lmodule.sort (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@pair_lalgType (ComRing.ringType R) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A1) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A2)))) (@Lmodule.class (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@pair_lalgType (ComRing.ringType R) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A1) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A2))))))) (@scale (ComRing.ringType R) (@Lalgebra.lmod_ringType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) (@pair_lalgType (ComRing.ringType R) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A1) (@Algebra.lalgType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A2))) a (@mul (pair_ringType (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A1) (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A2)) u v)) (@mul (pair_ringType (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A1) (@Algebra.ringType (ComRing.ringType R) (Phant (ComRing.sort R)) A2)) u (@scale (ComRing.ringType R) (@pair_lmodType (ComRing.ringType R) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A1) (@Algebra.lmodType (ComRing.ringType R) (Phant (Ring.sort (ComRing.ringType R))) A2)) a v)) *) by congr (_, _); apply: scalerAr. Qed. Canonical pair_algType := Eval hnf in AlgType R (A1 * A2) pair_scaleAr. End PairAlg. Section PairUnitRing. Variables R1 R2 : unitRingType. Definition pair_unitr := [qualify a x : R1 * R2 | (x.1 \is a GRing.unit) && (x.2 \is a GRing.unit)]. Definition pair_invr x := if x \is a pair_unitr then (x.1^-1, x.2^-1) else x. Lemma pair_mulVl : {in pair_unitr, left_inverse 1 pair_invr *%R}. Proof. (* Goal: @prop_in1 (prod (UnitRing.sort R1) (UnitRing.sort R2)) (@mem (prod (UnitRing.sort R1) (UnitRing.sort R2)) (predPredType (prod (UnitRing.sort R1) (UnitRing.sort R2))) (@has_quality (S O) (prod (UnitRing.sort R1) (UnitRing.sort R2)) pair_unitr)) (fun x : prod (UnitRing.sort R1) (UnitRing.sort R2) => @eq (Ring.sort (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) (@mul (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2)) (pair_invr x) x) (one (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2)))) (inPhantom (@left_inverse (prod (UnitRing.sort R1) (UnitRing.sort R2)) (prod (UnitRing.sort R1) (UnitRing.sort R2)) (Ring.sort (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) (one (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) pair_invr (@mul (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))))) *) rewrite /pair_invr=> x; case: ifP => // /andP[Ux1 Ux2] _. (* Goal: @eq (Ring.sort (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) (@mul (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2)) (@pair (UnitRing.sort R1) (UnitRing.sort R2) (@inv R1 (@fst (UnitRing.sort R1) (UnitRing.sort R2) x)) (@inv R2 (@snd (UnitRing.sort R1) (UnitRing.sort R2) x))) x) (one (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) *) by congr (_, _); apply: mulVr. Qed. Lemma pair_mulVr : {in pair_unitr, right_inverse 1 pair_invr *%R}. Proof. (* Goal: @prop_in1 (prod (UnitRing.sort R1) (UnitRing.sort R2)) (@mem (prod (UnitRing.sort R1) (UnitRing.sort R2)) (predPredType (prod (UnitRing.sort R1) (UnitRing.sort R2))) (@has_quality (S O) (prod (UnitRing.sort R1) (UnitRing.sort R2)) pair_unitr)) (fun x : prod (UnitRing.sort R1) (UnitRing.sort R2) => @eq (Ring.sort (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) (@mul (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2)) x (pair_invr x)) (one (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2)))) (inPhantom (@right_inverse (prod (UnitRing.sort R1) (UnitRing.sort R2)) (prod (UnitRing.sort R1) (UnitRing.sort R2)) (Ring.sort (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) (one (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) pair_invr (@mul (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))))) *) rewrite /pair_invr=> x; case: ifP => // /andP[Ux1 Ux2] _. (* Goal: @eq (Ring.sort (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) (@mul (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2)) x (@pair (UnitRing.sort R1) (UnitRing.sort R2) (@inv R1 (@fst (UnitRing.sort R1) (UnitRing.sort R2) x)) (@inv R2 (@snd (UnitRing.sort R1) (UnitRing.sort R2) x)))) (one (pair_ringType (UnitRing.ringType R1) (UnitRing.ringType R2))) *) by congr (_, _); apply: mulrV. Qed. Lemma pair_unitP x y : y * x = 1 /\ x * y = 1 -> x \is a pair_unitr. Lemma pair_invr_out : {in [predC pair_unitr], pair_invr =1 id}. Proof. (* Goal: @prop_in1 (prod (UnitRing.sort R1) (UnitRing.sort R2)) (@mem (prod (UnitRing.sort R1) (UnitRing.sort R2)) (simplPredType (prod (UnitRing.sort R1) (UnitRing.sort R2))) (@predC (prod (UnitRing.sort R1) (UnitRing.sort R2)) (@pred_of_simpl (prod (UnitRing.sort R1) (UnitRing.sort R2)) (@pred_of_mem_pred (prod (UnitRing.sort R1) (UnitRing.sort R2)) (@mem (prod (UnitRing.sort R1) (UnitRing.sort R2)) (predPredType (prod (UnitRing.sort R1) (UnitRing.sort R2))) (@has_quality (S O) (prod (UnitRing.sort R1) (UnitRing.sort R2)) pair_unitr)))))) (fun x : prod (UnitRing.sort R1) (UnitRing.sort R2) => @eq (prod (UnitRing.sort R1) (UnitRing.sort R2)) (pair_invr x) ((fun x0 : prod (UnitRing.sort R1) (UnitRing.sort R2) => x0) x)) (inPhantom (@eqfun (prod (UnitRing.sort R1) (UnitRing.sort R2)) (prod (UnitRing.sort R1) (UnitRing.sort R2)) pair_invr (fun x : prod (UnitRing.sort R1) (UnitRing.sort R2) => x))) *) by rewrite /pair_invr => x /negPf/= ->. Qed. Definition pair_unitRingMixin := UnitRingMixin pair_mulVl pair_mulVr pair_unitP pair_invr_out. Canonical pair_unitRingType := Eval hnf in UnitRingType (R1 * R2) pair_unitRingMixin. End PairUnitRing. Canonical pair_comUnitRingType (R1 R2 : comUnitRingType) := Eval hnf in [comUnitRingType of R1 * R2]. Canonical pair_unitAlgType (R : comUnitRingType) (A1 A2 : unitAlgType R) := Eval hnf in [unitAlgType R of A1 * A2].
Require Import Ensf. Require Import Words. Definition lword (w : Word) : wordset := fun w1 : Word => w = w1 :>Word. Definition lconc (l1 l2 : wordset) : wordset := fun w : Word => exists w1 : Word, (exists w2 : Word, l1 w1 /\ l2 w2 /\ w = Append w1 w2 :>Word). Definition lunion (l1 l2 : wordset) : wordset := fun w : Word => l1 w \/ l2 w. Definition linter (l1 l2 : wordset) : wordset := fun w : Word => l1 w /\ l2 w. Fixpoint lpuiss (n : nat) : wordset -> wordset := fun l : wordset => match n return wordset with | O => lword nil | S p => lconc l (lpuiss p l) end. Definition lstar (l : wordset) : wordset := fun w : Word => exists n : nat, lpuiss n l w. Lemma induction_star : forall (P : Word -> Prop) (l : wordset), (forall (n : nat) (w : Word), lpuiss n l w -> P w) -> forall w : Word, lstar l w -> P w. Proof. (* Goal: forall (P : forall _ : Word, Prop) (l : wordset) (_ : forall (n : nat) (w : Word) (_ : lpuiss n l w), P w) (w : Word) (_ : lstar l w), P w *) unfold lstar in |- *. (* Goal: forall (P : forall _ : Word, Prop) (l : wordset) (_ : forall (n : nat) (w : Word) (_ : lpuiss n l w), P w) (w : Word) (_ : @ex nat (fun n : nat => lpuiss n l w)), P w *) intros. (* Goal: P w *) elim H0; clear H0. (* Goal: forall (x : nat) (_ : lpuiss x l w), P w *) intros x H0. (* Goal: P w *) apply (H x w); auto. Qed. Lemma lw_imp_lstarlw : forall (l : wordset) (w : Word), l w -> lstar l w. Proof. (* Goal: forall (l : wordset) (w : Word) (_ : l w), lstar l w *) intros. (* Goal: lstar l w *) unfold lstar in |- *. (* Goal: @ex nat (fun n : nat => lpuiss n l w) *) exists 1. (* Goal: lpuiss (S O) l w *) change (lconc l (lpuiss 0 l) w) in |- *. (* Goal: lconc l (lpuiss O l) w *) unfold lconc in |- *. (* Goal: @ex Word (fun w1 : Word => @ex Word (fun w2 : Word => and (l w1) (and (lpuiss O l w2) (@eq Word w (Append w1 w2))))) *) exists w. (* Goal: @ex Word (fun w2 : Word => and (l w) (and (lpuiss O l w2) (@eq Word w (Append w w2)))) *) exists nil. (* Goal: and (l w) (and (lpuiss O l nil) (@eq Word w (Append w nil))) *) split; [ assumption | split ]. (* Goal: @eq Word w (Append w nil) *) (* Goal: lpuiss O l nil *) unfold lpuiss in |- *. (* Goal: @eq Word w (Append w nil) *) (* Goal: lword nil nil *) unfold lword in |- *; auto. (* Goal: @eq Word w (Append w nil) *) symmetry in |- *. (* Goal: @eq Word (Append w nil) w *) apply Append_w_nil. Qed. Inductive isrationnal : wordset -> Prop := | israt_lword : forall w : Word, inmonoid alph w -> isrationnal (lword w) | israt_lunion : forall l1 l2 : wordset, isrationnal l1 -> isrationnal l2 -> isrationnal (lunion l1 l2) | israt_conc : forall l1 l2 : wordset, isrationnal l1 -> isrationnal l2 -> isrationnal (lconc l1 l2) | israt_lstar : forall l : wordset, isrationnal l -> isrationnal (lstar l).
Global Set Asymmetric Patterns. Require Export Peano_dec. Inductive nat_tree : Set := | NIL : nat_tree | bin : nat -> nat_tree -> nat_tree -> nat_tree. Inductive binp : nat_tree -> Prop := binp_intro : forall (n : nat) (t1 t2 : nat_tree), binp (bin n t1 t2). Hint Resolve binp_intro: searchtrees. Lemma NIL_not_bin : ~ binp NIL. Proof. (* Goal: not (binp NIL) *) unfold not in |- *; intros H. (* Goal: False *) inversion_clear H. Qed. Hint Resolve NIL_not_bin: searchtrees. Lemma diff_nil_bin : forall (n : nat) (t1 t2 : nat_tree), bin n t1 t2 <> NIL. Proof. (* Goal: forall (n : nat) (t1 t2 : nat_tree), not (@eq nat_tree (bin n t1 t2) NIL) *) intros; discriminate. Qed. Hint Resolve diff_nil_bin: searchtrees. Inductive occ : nat_tree -> nat -> Prop := | occ_root : forall (n : nat) (t1 t2 : nat_tree), occ (bin n t1 t2) n | occ_l : forall (n p : nat) (t1 t2 : nat_tree), occ t1 p -> occ (bin n t1 t2) p | occ_r : forall (n p : nat) (t1 t2 : nat_tree), occ t2 p -> occ (bin n t1 t2) p. Hint Resolve occ_root occ_l occ_r: searchtrees. Definition member (n : nat) (t : nat_tree) := occ t n. Derive Inversion_clear OCC_INV with (forall (n p : nat) (t1 t2 : nat_tree), occ (bin n t1 t2) p). Lemma occ_inv : forall (n p : nat) (t1 t2 : nat_tree), occ (bin n t1 t2) p -> n = p \/ occ t1 p \/ occ t2 p. Proof. (* Goal: forall (n p : nat) (t1 t2 : nat_tree) (_ : occ (bin n t1 t2) p), or (@eq nat n p) (or (occ t1 p) (occ t2 p)) *) intros. (* Goal: or (@eq nat n p) (or (occ t1 p) (occ t2 p)) *) inversion H using OCC_INV; auto with searchtrees. Qed. Hint Resolve occ_inv: searchtrees. Lemma not_occ_nil : forall p : nat, ~ occ NIL p. Proof. (* Goal: forall p : nat, not (occ NIL p) *) unfold not in |- *; intros p H. (* Goal: False *) inversion_clear H. Qed. Hint Resolve not_occ_nil: searchtrees.
Require Export GeoCoq.Elements.OriginalProofs.lemma_angledistinct. Require Export GeoCoq.Elements.OriginalProofs.lemma_layoff. Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglesNC. Require Export GeoCoq.Elements.OriginalProofs.lemma_equalangleshelper. Require Export GeoCoq.Elements.OriginalProofs.proposition_04. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_equalanglestransitive : forall A B C D E F P Q R, CongA A B C D E F -> CongA D E F P Q R -> CongA A B C P Q R. Proof. (* Goal: forall (A B C D E F P Q R : @Point Ax0) (_ : @CongA Ax0 A B C D E F) (_ : @CongA Ax0 D E F P Q R), @CongA Ax0 A B C P Q R *) intros. (* Goal: @CongA Ax0 A B C P Q R *) assert (neq A B) by (forward_using lemma_angledistinct). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq D E) by (forward_using lemma_angledistinct). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq E D) by (conclude lemma_inequalitysymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq E F) by (forward_using lemma_angledistinct). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq B C) by (forward_using lemma_angledistinct). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq P Q) by (forward_using lemma_angledistinct). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq Q P) by (conclude lemma_inequalitysymmetric). (* Goal: @CongA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists U, (Out E D U /\ Cong E U B A)) by (conclude lemma_layoff);destruct Tf as [U];spliter. (* Goal: @CongA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists V, (Out E F V /\ Cong E V B C)) by (conclude lemma_layoff);destruct Tf as [V];spliter. (* Goal: @CongA Ax0 A B C P Q R *) assert (neq E U) by (conclude lemma_raystrict). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq E V) by (conclude lemma_raystrict). (* Goal: @CongA Ax0 A B C P Q R *) assert (CongA P Q R D E F) by (conclude lemma_equalanglessymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert (neq Q R) by (forward_using lemma_angledistinct). (* Goal: @CongA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists u, (Out Q P u /\ Cong Q u E U)) by (conclude lemma_layoff);destruct Tf as [u];spliter. (* Goal: @CongA Ax0 A B C P Q R *) let Tf:=fresh in assert (Tf:exists v, (Out Q R v /\ Cong Q v E V)) by (conclude lemma_layoff);destruct Tf as [v];spliter. (* Goal: @CongA Ax0 A B C P Q R *) assert (nCol A B C) by (conclude_def CongA ). (* Goal: @CongA Ax0 A B C P Q R *) assert (CongA A B C U E V) by (conclude lemma_equalangleshelper). (* Goal: @CongA Ax0 A B C P Q R *) assert (Cong B A E U) by (conclude lemma_congruencesymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert (Cong B C E V) by (conclude lemma_congruencesymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert ((Cong A C U V /\ CongA B A C E U V /\ CongA B C A E V U)) by (conclude proposition_04). (* Goal: @CongA Ax0 A B C P Q R *) assert (Cong E U Q u) by (conclude lemma_congruencesymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert (Cong E V Q v) by (conclude lemma_congruencesymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert (CongA D E F u Q v) by (conclude lemma_equalangleshelper). (* Goal: @CongA Ax0 A B C P Q R *) assert (CongA u Q v D E F) by (conclude lemma_equalanglessymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert (CongA u Q v U E V) by (conclude lemma_equalangleshelper). (* Goal: @CongA Ax0 A B C P Q R *) assert (CongA U E V u Q v) by (conclude lemma_equalanglessymmetric). (* Goal: @CongA Ax0 A B C P Q R *) assert ((Cong U V u v /\ CongA E U V Q u v /\ CongA E V U Q v u)) by (conclude proposition_04). (* Goal: @CongA Ax0 A B C P Q R *) assert (Cong A C u v) by (conclude lemma_congruencetransitive). (* Goal: @CongA Ax0 A B C P Q R *) assert (Cong B A Q u) by (conclude lemma_congruencetransitive). (* Goal: @CongA Ax0 A B C P Q R *) assert (Cong B C Q v) by (conclude lemma_congruencetransitive). (* Goal: @CongA Ax0 A B C P Q R *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @CongA Ax0 A B C P Q R *) assert (eq C C) by (conclude cn_equalityreflexive). (* Goal: @CongA Ax0 A B C P Q R *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: @CongA Ax0 A B C P Q R *) assert (Out B C C) by (conclude lemma_ray4). (* Goal: @CongA Ax0 A B C P Q R *) assert (CongA A B C P Q R) by (conclude_def CongA ). (* Goal: @CongA Ax0 A B C P Q R *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.proposition_24. Require Export GeoCoq.Elements.OriginalProofs.lemma_angletrichotomy2. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma proposition_25 : forall A B C D E F, Triangle A B C -> Triangle D E F -> Cong A B D E -> Cong A C D F -> Lt E F B C -> LtA E D F B A C. Proof. (* Goal: forall (A B C D E F : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @Triangle Ax0 D E F) (_ : @Cong Ax0 A B D E) (_ : @Cong Ax0 A C D F) (_ : @Lt Ax0 E F B C), @LtA Ax0 E D F B A C *) intros. (* Goal: @LtA Ax0 E D F B A C *) assert (Cong D E A B) by (conclude lemma_congruencesymmetric). (* Goal: @LtA Ax0 E D F B A C *) assert (Cong D F A C) by (conclude lemma_congruencesymmetric). (* Goal: @LtA Ax0 E D F B A C *) assert (~ LtA B A C E D F). (* Goal: @LtA Ax0 E D F B A C *) (* Goal: not (@LtA Ax0 B A C E D F) *) { (* Goal: not (@LtA Ax0 B A C E D F) *) intro. (* Goal: False *) assert (Lt B C E F) by (conclude proposition_24). (* Goal: False *) assert (~ Lt E F B C) by (conclude lemma_trichotomy2). (* Goal: False *) contradict. (* BG Goal: @LtA Ax0 E D F B A C *) } (* Goal: @LtA Ax0 E D F B A C *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: @LtA Ax0 E D F B A C *) assert (~ Col B A C). (* Goal: @LtA Ax0 E D F B A C *) (* Goal: not (@Col Ax0 B A C) *) { (* Goal: not (@Col Ax0 B A C) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @LtA Ax0 E D F B A C *) } (* Goal: @LtA Ax0 E D F B A C *) assert (nCol D E F) by (conclude_def Triangle ). (* Goal: @LtA Ax0 E D F B A C *) assert (~ Col E D F). (* Goal: @LtA Ax0 E D F B A C *) (* Goal: not (@Col Ax0 E D F) *) { (* Goal: not (@Col Ax0 E D F) *) intro. (* Goal: False *) assert (Col D E F) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: @LtA Ax0 E D F B A C *) } (* Goal: @LtA Ax0 E D F B A C *) assert (~ CongA E D F B A C). (* Goal: @LtA Ax0 E D F B A C *) (* Goal: not (@CongA Ax0 E D F B A C) *) { (* Goal: not (@CongA Ax0 E D F B A C) *) intro. (* Goal: False *) assert (CongA B A C E D F) by (conclude lemma_equalanglessymmetric). (* Goal: False *) assert (Cong B C E F) by (conclude proposition_04). (* Goal: False *) assert (Cong E F B C) by (conclude lemma_congruencesymmetric). (* Goal: False *) assert (Lt B C B C) by (conclude lemma_lessthancongruence2). (* Goal: False *) assert (~ Lt B C B C) by (conclude lemma_trichotomy2). (* Goal: False *) contradict. (* BG Goal: @LtA Ax0 E D F B A C *) } (* Goal: @LtA Ax0 E D F B A C *) assert (LtA E D F B A C) by (conclude lemma_angletrichotomy2). (* Goal: @LtA Ax0 E D F B A C *) close. Qed. End Euclid.
Require Import Ensf. Require Import Words. Require Import fonctions. Require Import Relations. Require Import gram. Inductive Deriveg (X R : Ensf) : Word -> Word -> Prop := | Deriveg1 : forall (u v : Word) (A : Elt), dans (couple A (word u)) R -> Deriveg X R (cons A v) (Append u v) | Deriveg2 : forall (u v : Word) (x : Elt), dans x X -> Deriveg X R u v -> Deriveg X R (cons x u) (cons x v). Hint Resolve Deriveg1. Hint Resolve Deriveg2. Definition Derivegstar (X R : Ensf) := Rstar Word (Deriveg X R). Lemma Deriveg_Derive : forall (X R : Ensf) (u v : Word), Deriveg X R u v -> Derive R u v. Proof. (* Goal: forall (X R : Ensf) (u v : Word) (_ : Deriveg X R u v), Derive R u v *) intros X R u v Der_g. (* Goal: Derive R u v *) elim Der_g. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : Derive R u v), Derive R (cons x u) (cons x v) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) R), Derive R (cons A v) (Append u v) *) intros. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : Derive R u v), Derive R (cons x u) (cons x v) *) (* Goal: Derive R (cons A v0) (Append u0 v0) *) apply Derive1; auto. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : Derive R u v), Derive R (cons x u) (cons x v) *) intros. (* Goal: Derive R (cons x u0) (cons x v0) *) apply Derive2; auto. Qed. Lemma Derivegstar_Derivestar : forall (X R : Ensf) (u v : Word), Derivegstar X R u v -> Derivestar R u v. Proof. (* Goal: forall (X R : Ensf) (u v : Word) (_ : Derivegstar X R u v), Derivestar R u v *) unfold Derivegstar, Rstar, Derivestar in |- *. (* Goal: forall (X R : Ensf) (u v : Word) (_ : forall (P : forall (_ : Word) (_ : Word), Prop) (_ : forall u0 : Word, P u0 u0) (_ : forall (u0 v0 w : Word) (_ : Deriveg X R u0 v0) (_ : P v0 w), P u0 w), P u v), Rstar Word (Derive R) u v *) intros X R x y Derivegstar_x_y. (* Goal: Rstar Word (Derive R) x y *) pattern x, y in |- *. (* Goal: (fun w w0 : Word => Rstar Word (Derive R) w w0) x y *) apply Derivegstar_x_y. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : Rstar Word (Derive R) v w), Rstar Word (Derive R) u w *) (* Goal: forall u : Word, Rstar Word (Derive R) u u *) intro. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : Rstar Word (Derive R) v w), Rstar Word (Derive R) u w *) (* Goal: Rstar Word (Derive R) u u *) apply Rstar_reflexive. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : Rstar Word (Derive R) v w), Rstar Word (Derive R) u w *) intros u v w Der Der_star. (* Goal: Rstar Word (Derive R) u w *) apply Rstar_R with v. (* Goal: Rstar Word (Derive R) v w *) (* Goal: Derive R u v *) apply Deriveg_Derive with X; assumption. (* Goal: Rstar Word (Derive R) v w *) assumption. Qed. Axiom Derivestar_Derivegstar : forall (X R : Ensf) (u v : Word), Derivestar R u v -> Derivegstar X R u v. Hint Resolve Derivestar_Derivegstar.
Require Import Ensf. Require Import Words. Require Import more_words. Require Import need. Require Import Relations. Require Import gram. Require Import gram_g. Require Import PushdownAutomata. Section APD. Variable X V R : Ensf. Variable S' : Elt. Hypothesis Gram : isGram X V R S'. Lemma Regles_X_V_R : Regles X V R. Proof. (* Goal: Regles X V R *) apply isGram4 with S'. (* Goal: isGram X V R S' *) exact Gram. Qed. Let P := union X V. Let f_R_d (a : Elt) := couple (word (cons (first a) nil)) (couple (eps X) (second a)). Let f_X_d (x : Elt) := couple (word (cons x nil)) (couple x (word nil)). Let d := union (map f_R_d R) (map f_X_d X). Let wd := cons S' nil. Let wa := nil. Lemma Trans : Transition X P d. Proof. (* Goal: Transition X P d *) red in |- *. (* Goal: forall (x : Elt) (_ : dans x d), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) intros x dans_x_d. (* Goal: @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) elimtype (dans x (map f_R_d R) \/ dans x (map f_X_d X)). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: forall _ : dans x (map f_R_d R), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) intros dans_x. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) elimtype (exists y : Elt, dans y R /\ x = f_R_d y). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: forall (x0 : Elt) (_ : and (dans x0 R) (@eq Elt x (f_R_d x0))), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) intros y temp; elim temp; clear temp. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: forall (_ : dans y R) (_ : @eq Elt x (f_R_d y)), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) unfold f_R_d in |- *. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: forall (_ : dans y R) (_ : @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (second y)))), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) intros dans_y_R eg_x_f_y. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) exists (cons (first y) nil). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: inmonoid P (cons (first y) nil) *) apply inmonoid_cons. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: dans (first y) P *) (* Goal: inmonoid P nil *) trivial. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: dans (first y) P *) elim (Regles_X_V_R y dans_y_R). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: forall (x : Elt) (_ : dans x V) (_ : @ex2 Word (fun B : Word => @eq Elt y (couple x (word B))) (fun B : Word => inmonoid (union X V) B)), dans (first y) P *) intros f_y dans_f_y_V temp; elim temp; clear temp. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: forall (x : Word) (_ : @eq Elt y (couple f_y (word x))) (_ : inmonoid (union X V) x), dans (first y) P *) intros u eg_y inmono_u. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: dans (first y) P *) rewrite eg_y. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: dans (first (couple f_y (word u))) P *) unfold first in |- *. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: dans f_y P *) unfold P in |- *. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) (* Goal: dans f_y (union X V) *) auto. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple y0 (word w2))))) *) exists (eps X). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word w2)))) *) (* Goal: dans (eps X) (add (eps X) X) *) auto. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word w2)))) *) exists (word_inv (second y)). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) (* Goal: inmonoid P (word_inv (second y)) *) elim (Regles_X_V_R y dans_y_R). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) (* Goal: forall (x : Elt) (_ : dans x V) (_ : @ex2 Word (fun B : Word => @eq Elt y (couple x (word B))) (fun B : Word => inmonoid (union X V) B)), inmonoid P (word_inv (second y)) *) intros f_y dans_f_y_V temp; elim temp; clear temp. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) (* Goal: forall (x : Word) (_ : @eq Elt y (couple f_y (word x))) (_ : inmonoid (union X V) x), inmonoid P (word_inv (second y)) *) intros u eg_y inmono_u. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) (* Goal: inmonoid P (word_inv (second y)) *) rewrite eg_y. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) (* Goal: inmonoid P (word_inv (second (couple f_y (word u)))) *) unfold second in |- *. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) (* Goal: inmonoid P (word_inv (word u)) *) unfold word_inv in |- *. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) (* Goal: inmonoid P u *) assumption. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) elim (Regles_X_V_R y dans_y_R). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: forall (x0 : Elt) (_ : dans x0 V) (_ : @ex2 Word (fun B : Word => @eq Elt y (couple x0 (word B))) (fun B : Word => inmonoid (union X V) B)), @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) intros f_y dans_f_y_V temp; elim temp; clear temp. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: forall (x0 : Word) (_ : @eq Elt y (couple f_y (word x0))) (_ : inmonoid (union X V) x0), @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) intros u eg_y inmono_u. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (word (word_inv (second y))))) *) replace (word (word_inv (second y))) with (second y). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt (second y) (word (word_inv (second y))) *) (* Goal: @eq Elt x (couple (word (cons (first y) nil)) (couple (eps X) (second y))) *) assumption. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt (second y) (word (word_inv (second y))) *) replace (second y) with (word u). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt (word u) (second y) *) (* Goal: @eq Elt (word u) (word (word_inv (word u))) *) apply refl_equal. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt (word u) (second y) *) rewrite eg_y. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) (* Goal: @eq Elt (word u) (second (couple f_y (word u))) *) apply refl_equal. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: @ex Elt (fun y : Elt => and (dans y R) (@eq Elt x (f_R_d y))) *) apply dans_map. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) (* Goal: dans x (map f_R_d R) *) assumption. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: forall _ : dans x (map f_X_d X), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) intros dans_x. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) elimtype (exists y : Elt, dans y X /\ x = f_X_d y). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: forall (x0 : Elt) (_ : and (dans x0 X) (@eq Elt x (f_X_d x0))), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) intros y temp; elim temp; clear temp. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: forall (_ : dans y X) (_ : @eq Elt x (f_X_d y)), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) unfold f_X_d in |- *. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: forall (_ : dans y X) (_ : @eq Elt x (couple (word (cons y nil)) (couple y (word nil)))), @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) intros dans_y_X eg_x_f_y. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Word (fun w1 : Word => inmonoid P w1) (fun w1 : Word => @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word w1) (couple y (word w2)))))) *) exists (cons y nil). (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons y nil)) (couple y0 (word w2))))) *) (* Goal: inmonoid P (cons y nil) *) apply inmonoid_cons. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons y nil)) (couple y0 (word w2))))) *) (* Goal: dans y P *) (* Goal: inmonoid P nil *) trivial. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons y nil)) (couple y0 (word w2))))) *) (* Goal: dans y P *) unfold P in |- *. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons y nil)) (couple y0 (word w2))))) *) (* Goal: dans y (union X V) *) auto. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Elt (fun y : Elt => dans y (add (eps X) X)) (fun y0 : Elt => @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons y nil)) (couple y0 (word w2))))) *) exists y. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons y nil)) (couple y (word w2)))) *) (* Goal: dans y (add (eps X) X) *) auto. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @ex2 Word (fun w2 : Word => inmonoid P w2) (fun w2 : Word => @eq Elt x (couple (word (cons y nil)) (couple y (word w2)))) *) exists nil. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @eq Elt x (couple (word (cons y nil)) (couple y (word nil))) *) (* Goal: inmonoid P nil *) trivial. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) (* Goal: @eq Elt x (couple (word (cons y nil)) (couple y (word nil))) *) assumption. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: @ex Elt (fun y : Elt => and (dans y X) (@eq Elt x (f_X_d y))) *) apply dans_map. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) (* Goal: dans x (map f_X_d X) *) assumption. (* Goal: or (dans x (map f_R_d R)) (dans x (map f_X_d X)) *) auto. Qed. Lemma X_P_wd_wa_d : P_automata X P wd wa d. Proof. (* Goal: P_automata X P wd wa d *) red in |- *. (* Goal: and (inmonoid P wd) (and (inmonoid P wa) (Transition X P d)) *) split. (* Goal: and (inmonoid P wa) (Transition X P d) *) (* Goal: inmonoid P wd *) unfold wd in |- *. (* Goal: and (inmonoid P wa) (Transition X P d) *) (* Goal: inmonoid P (cons S' nil) *) apply inmonoid_cons. (* Goal: and (inmonoid P wa) (Transition X P d) *) (* Goal: dans S' P *) (* Goal: inmonoid P nil *) trivial. (* Goal: and (inmonoid P wa) (Transition X P d) *) (* Goal: dans S' P *) unfold P in |- *. (* Goal: and (inmonoid P wa) (Transition X P d) *) (* Goal: dans S' (union X V) *) apply union_d. (* Goal: and (inmonoid P wa) (Transition X P d) *) (* Goal: dans S' V *) apply isGram3 with X R. (* Goal: and (inmonoid P wa) (Transition X P d) *) (* Goal: isGram X V R S' *) exact Gram. (* Goal: and (inmonoid P wa) (Transition X P d) *) split. (* Goal: Transition X P d *) (* Goal: inmonoid P wa *) apply inmonoid_nil. (* Goal: Transition X P d *) exact Trans. Qed. Lemma cut_spec : forall u : Word, {a : Word & {b : Word | inmonoid X a /\ Append a b = u /\ (b = nil \/ ex2 (fun x : Elt => ~ dans x X) (fun x : Elt => exists w : Word, b = cons x w))}}. Proof. (* Goal: forall u : Word, @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) u) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) intro u. (* Goal: @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) u) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) pattern u in |- *. (* Goal: (fun w : Word => @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0))))))))) u *) apply Word_rec. (* Goal: forall (e : Elt) (w : Word) (_ : @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0))))))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons e w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0)))))))) *) (* Goal: @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) nil) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) exists nil. (* Goal: forall (e : Elt) (w : Word) (_ : @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0))))))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons e w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0)))))))) *) (* Goal: @sig Word (fun b : Word => and (inmonoid X nil) (and (@eq Word (Append nil b) nil) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))))) *) exists nil. (* Goal: forall (e : Elt) (w : Word) (_ : @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0))))))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons e w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0)))))))) *) (* Goal: and (inmonoid X nil) (and (@eq Word (Append nil nil) nil) (or (@eq Word nil nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word nil (cons x w)))))) *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0))))))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons e w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w0 : Word => @eq Word b (cons x w0)))))))) *) intros x w Hyp. (* Goal: @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) elim Hyp. (* Goal: forall (x0 : Word) (_ : @sig Word (fun b : Word => and (inmonoid X x0) (and (@eq Word (Append x0 b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) intros a' spec; elim spec. (* Goal: forall (x0 : Word) (_ : and (inmonoid X a') (and (@eq Word (Append a' x0) w) (or (@eq Word x0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word x0 (cons x w))))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) intros b' temp; elim temp; clear temp. (* Goal: forall (_ : inmonoid X a') (_ : and (@eq Word (Append a' b') w) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) intros inmonoid_a' temp; elim temp; clear temp. (* Goal: forall (_ : @eq Word (Append a' b') w) (_ : or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))), @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) intros spec_App spec_or. (* Goal: @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) elimtype ({dans x X} + {~ dans x X}). (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: forall _ : dans x X, @sigT Word (fun a0 : Word => @sig Word (fun b : Word => and (inmonoid X a0) (and (@eq Word (Append a0 b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) intro dans_x_X. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) exists (cons x a'). (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: @sig Word (fun b : Word => and (inmonoid X (cons x a')) (and (@eq Word (Append (cons x a') b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))))) *) exists b'. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: and (inmonoid X (cons x a')) (and (@eq Word (Append (cons x a') b') (cons x w)) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))))) *) split. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: and (@eq Word (Append (cons x a') b') (cons x w)) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))) *) (* Goal: inmonoid X (cons x a') *) apply inmonoid_cons; assumption. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: and (@eq Word (Append (cons x a') b') (cons x w)) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))) *) split. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))) *) (* Goal: @eq Word (Append (cons x a') b') (cons x w) *) unfold Append in |- *. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))) *) (* Goal: @eq Word (cons x ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) a' b')) (cons x w) *) simpl in |- *. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))) *) (* Goal: @eq Word (cons x ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) a' b')) (cons x w) *) auto. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) (* Goal: or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))) *) elim spec_or; intro; assumption. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: forall _ : not (dans x X), @sigT Word (fun a : Word => @sig Word (fun b0 : Word => and (inmonoid X a) (and (@eq Word (Append a b0) (cons x w)) (or (@eq Word b0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b0 (cons x w)))))))) *) intro N_dans_x_X. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: @sigT Word (fun a : Word => @sig Word (fun b : Word => and (inmonoid X a) (and (@eq Word (Append a b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) *) exists nil. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: @sig Word (fun b : Word => and (inmonoid X nil) (and (@eq Word (Append nil b) (cons x w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))))) *) exists (cons x w). (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: and (inmonoid X nil) (and (@eq Word (Append nil (cons x w)) (cons x w)) (or (@eq Word (cons x w) nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x0 : Elt => @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x0 w0)))))) *) split. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: and (@eq Word (Append nil (cons x w)) (cons x w)) (or (@eq Word (cons x w) nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x0 : Elt => @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x0 w0))))) *) (* Goal: inmonoid X nil *) auto. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: and (@eq Word (Append nil (cons x w)) (cons x w)) (or (@eq Word (cons x w) nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x0 : Elt => @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x0 w0))))) *) split. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: or (@eq Word (cons x w) nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x0 : Elt => @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x0 w0)))) *) (* Goal: @eq Word (Append nil (cons x w)) (cons x w) *) auto. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: or (@eq Word (cons x w) nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x0 : Elt => @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x0 w0)))) *) apply or_intror. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: @ex2 Elt (fun x : Elt => not (dans x X)) (fun x0 : Elt => @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x0 w0))) *) exists x. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x w0)) *) (* Goal: not (dans x X) *) assumption. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: @ex Word (fun w0 : Word => @eq Word (cons x w) (cons x w0)) *) exists w. (* Goal: sumbool (dans x X) (not (dans x X)) *) (* Goal: @eq Word (cons x w) (cons x w) *) apply refl_equal. (* Goal: sumbool (dans x X) (not (dans x X)) *) exact (Dans_spec x X). Qed. Definition cut (u : Word) := let (a, s) := cut_spec u in (a, let (b, s2) := s in b). Definition cut1 (u : Word) := fst (cut u). Definition cut2 (u : Word) := snd (cut u). Lemma cut_unicite : forall u a b a' b' : Word, inmonoid X a /\ Append a b = u /\ (b = nil \/ ex2 (fun x : Elt => ~ dans x X) (fun x : Elt => exists w : Word, b = cons x w)) -> inmonoid X a' /\ Append a' b' = u /\ (b' = nil \/ ex2 (fun x : Elt => ~ dans x X) (fun x : Elt => exists w : Word, b' = cons x w)) -> a = a'. Proof. (* Goal: forall (u a b a' b' : Word) (_ : and (inmonoid X a) (and (@eq Word (Append a b) u) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))))) (_ : and (inmonoid X a') (and (@eq Word (Append a' b') u) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))))), @eq Word a a' *) intros u a b a' b' temp1 temp2; elim temp1; elim temp2; clear temp1; clear temp2. (* Goal: forall (_ : inmonoid X a') (_ : and (@eq Word (Append a' b') u) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))))) (_ : inmonoid X a) (_ : and (@eq Word (Append a b) u) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))), @eq Word a a' *) intros inmon temp inmon' temp'; elim temp; elim temp'; clear temp; clear temp'. (* Goal: forall (_ : @eq Word (Append a b) u) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))) (_ : @eq Word (Append a' b') u) (_ : or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))), @eq Word a a' *) intros App spec_or App' spec_or'. (* Goal: @eq Word a a' *) elimtype (exists w : Word, a = Append a' w /\ b' = Append w b \/ a' = Append a w /\ b = Append w b'). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall (x : Word) (_ : or (and (@eq Word a (Append a' x)) (@eq Word b' (Append x b))) (and (@eq Word a' (Append a x)) (@eq Word b (Append x b')))), @eq Word a a' *) intros x temp; elim temp; clear temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: forall _ : and (@eq Word a (Append a' x)) (@eq Word b' (Append x b)), @eq Word a a' *) pattern a' at 2 in |- *. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: (fun w : Word => forall _ : and (@eq Word a (Append a' x)) (@eq Word b' (Append x b)), @eq Word a w) a' *) replace a' with (Append a' nil). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: forall _ : and (@eq Word a (Append a' x)) (@eq Word b' (Append x b)), @eq Word a (Append a' nil) *) generalize x; clear x; simple induction x. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : and (@eq Word a (Append a' w)) (@eq Word b' (Append w b)), @eq Word a (Append a' nil)) (_ : and (@eq Word a (Append a' (cons e w))) (@eq Word b' (Append (cons e w) b))), @eq Word a (Append a' nil) *) (* Goal: forall _ : and (@eq Word a (Append a' nil)) (@eq Word b' (Append nil b)), @eq Word a (Append a' nil) *) intro temp; elim temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : and (@eq Word a (Append a' w)) (@eq Word b' (Append w b)), @eq Word a (Append a' nil)) (_ : and (@eq Word a (Append a' (cons e w))) (@eq Word b' (Append (cons e w) b))), @eq Word a (Append a' nil) *) (* Goal: forall (_ : @eq Word a (Append a' nil)) (_ : @eq Word b' (Append nil b)), @eq Word a (Append a' nil) *) auto. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : and (@eq Word a (Append a' w)) (@eq Word b' (Append w b)), @eq Word a (Append a' nil)) (_ : and (@eq Word a (Append a' (cons e w))) (@eq Word b' (Append (cons e w) b))), @eq Word a (Append a' nil) *) intros x0 w Hyp temp; elim temp; clear temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: forall (_ : @eq Word a (Append a' (cons x0 w))) (_ : @eq Word b' (Append (cons x0 w) b)), @eq Word a (Append a' nil) *) intros a_eg b'_eg. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: @eq Word a (Append a' nil) *) absurd (dans x0 X). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: not (dans x0 X) *) elim spec_or'. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans x0 X) *) (* Goal: forall _ : @eq Word b' nil, not (dans x0 X) *) rewrite b'_eg. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans x0 X) *) (* Goal: forall _ : @eq Word (Append (cons x0 w) b) nil, not (dans x0 X) *) intro cons_nil. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans x0 X) *) (* Goal: not (dans x0 X) *) absurd (cons x0 (Append w b) = nil). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans x0 X) *) (* Goal: @eq Word (cons x0 (Append w b)) nil *) (* Goal: not (@eq Word (cons x0 (Append w b)) nil) *) discriminate. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans x0 X) *) (* Goal: @eq Word (cons x0 (Append w b)) nil *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans x0 X) *) intro temp; elim temp; clear temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall (x : Elt) (_ : not (dans x X)) (_ : @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans x0 X) *) intros x1 N_dans_x1 temp; elim temp; clear temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: forall (x : Word) (_ : @eq Word b' (cons x1 x)), not (dans x0 X) *) intros w' b'_eg_2. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: not (dans x0 X) *) replace x0 with x1. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: @eq Elt x1 x0 *) (* Goal: not (dans x1 X) *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: @eq Elt x1 x0 *) apply cons_cons_inv1 with w' (Append w b). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: @eq Word (cons x1 w') (cons x0 (Append w b)) *) rewrite <- b'_eg_2. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) (* Goal: @eq Word b' (cons x0 (Append w b)) *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: dans x0 X *) apply inmonoid_cons_inv2 with w. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: inmonoid X (cons x0 w) *) apply inmonoid_Append_inv2 with a'. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: inmonoid X (Append a' (cons x0 w)) *) rewrite <- a_eg. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) (* Goal: inmonoid X a *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) (* Goal: @eq Word (Append a' nil) a' *) apply Append_w_nil. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word a a' *) pattern a at 2 in |- *. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: (fun w : Word => forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word w a') a *) replace a with (Append a nil). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: forall _ : and (@eq Word a' (Append a x)) (@eq Word b (Append x b')), @eq Word (Append a nil) a' *) generalize x; clear x; simple induction x. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : and (@eq Word a' (Append a w)) (@eq Word b (Append w b')), @eq Word (Append a nil) a') (_ : and (@eq Word a' (Append a (cons e w))) (@eq Word b (Append (cons e w) b'))), @eq Word (Append a nil) a' *) (* Goal: forall _ : and (@eq Word a' (Append a nil)) (@eq Word b (Append nil b')), @eq Word (Append a nil) a' *) intro temp; elim temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : and (@eq Word a' (Append a w)) (@eq Word b (Append w b')), @eq Word (Append a nil) a') (_ : and (@eq Word a' (Append a (cons e w))) (@eq Word b (Append (cons e w) b'))), @eq Word (Append a nil) a' *) (* Goal: forall (_ : @eq Word a' (Append a nil)) (_ : @eq Word b (Append nil b')), @eq Word (Append a nil) a' *) auto. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : and (@eq Word a' (Append a w)) (@eq Word b (Append w b')), @eq Word (Append a nil) a') (_ : and (@eq Word a' (Append a (cons e w))) (@eq Word b (Append (cons e w) b'))), @eq Word (Append a nil) a' *) intros x0 w Hyp temp; elim temp; clear temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: forall (_ : @eq Word a' (Append a (cons x0 w))) (_ : @eq Word b (Append (cons x0 w) b')), @eq Word (Append a nil) a' *) intros a'_eg b_eg. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: @eq Word (Append a nil) a' *) absurd (dans x0 X). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: not (dans x0 X) *) elim spec_or. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))), not (dans x0 X) *) (* Goal: forall _ : @eq Word b nil, not (dans x0 X) *) rewrite b_eg. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))), not (dans x0 X) *) (* Goal: forall _ : @eq Word (Append (cons x0 w) b') nil, not (dans x0 X) *) intro cons_nil. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))), not (dans x0 X) *) (* Goal: not (dans x0 X) *) absurd (cons x0 (Append w b') = nil). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))), not (dans x0 X) *) (* Goal: @eq Word (cons x0 (Append w b')) nil *) (* Goal: not (@eq Word (cons x0 (Append w b')) nil) *) discriminate. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))), not (dans x0 X) *) (* Goal: @eq Word (cons x0 (Append w b')) nil *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))), not (dans x0 X) *) intro temp; elim temp; clear temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall (x : Elt) (_ : not (dans x X)) (_ : @ex Word (fun w : Word => @eq Word b (cons x w))), not (dans x0 X) *) intros x1 N_dans_x1 temp; elim temp; clear temp. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: forall (x : Word) (_ : @eq Word b (cons x1 x)), not (dans x0 X) *) intros w' b_eg_2. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: not (dans x0 X) *) replace x0 with x1. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: @eq Elt x1 x0 *) (* Goal: not (dans x1 X) *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: @eq Elt x1 x0 *) apply cons_cons_inv1 with w' (Append w b'). (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: @eq Word (cons x1 w') (cons x0 (Append w b')) *) rewrite <- b_eg_2. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) (* Goal: @eq Word b (cons x0 (Append w b')) *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: dans x0 X *) apply inmonoid_cons_inv2 with w. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: inmonoid X (cons x0 w) *) apply inmonoid_Append_inv2 with a. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: inmonoid X (Append a (cons x0 w)) *) rewrite <- a'_eg. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) (* Goal: inmonoid X a' *) assumption. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) (* Goal: @eq Word (Append a nil) a *) apply Append_w_nil. (* Goal: @ex Word (fun w : Word => or (and (@eq Word a (Append a' w)) (@eq Word b' (Append w b))) (and (@eq Word a' (Append a w)) (@eq Word b (Append w b')))) *) apply Append_Append. (* Goal: @eq Word (Append a b) (Append a' b') *) rewrite App'; assumption. Qed. Lemma inmonoid_cut1 : forall w : Word, inmonoid X (cut1 w). Proof. (* Goal: forall w : Word, inmonoid X (cut1 w) *) intro w. (* Goal: inmonoid X (cut1 w) *) unfold cut1, cut in |- *. (* Goal: inmonoid X (@fst Word Word (let (a, s) := cut_spec w in @pair Word Word a (let (b, _) := s in b))) *) elim (cut_spec w). (* Goal: forall (x : Word) (p : @sig Word (fun b : Word => and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word b (cons x0 w)))))))), inmonoid X (@fst Word Word (@pair Word Word x (let (b, _) := p in b))) *) intros a temp; elim temp; clear temp. (* Goal: forall (x : Word) (_ : and (inmonoid X a) (and (@eq Word (Append a x) w) (or (@eq Word x nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word x (cons x0 w))))))), inmonoid X (@fst Word Word (@pair Word Word a x)) *) intros b temp; elim temp; clear temp. (* Goal: forall (_ : inmonoid X a) (_ : and (@eq Word (Append a b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))), inmonoid X (@fst Word Word (@pair Word Word a b)) *) simpl in |- *; auto. Qed. Lemma cut_Append : forall w : Word, w = Append (cut1 w) (cut2 w). Proof. (* Goal: forall w : Word, @eq Word w (Append (cut1 w) (cut2 w)) *) intro w. (* Goal: @eq Word w (Append (cut1 w) (cut2 w)) *) unfold cut1, cut2, cut in |- *. (* Goal: @eq Word w (Append (@fst Word Word (let (a, s) := cut_spec w in @pair Word Word a (let (b, _) := s in b))) (@snd Word Word (let (a, s) := cut_spec w in @pair Word Word a (let (b, _) := s in b)))) *) elim (cut_spec w). (* Goal: forall (x : Word) (p : @sig Word (fun b : Word => and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word b (cons x0 w)))))))), @eq Word w (Append (@fst Word Word (@pair Word Word x (let (b, _) := p in b))) (@snd Word Word (@pair Word Word x (let (b, _) := p in b)))) *) intros a temp; elim temp; clear temp. (* Goal: forall (x : Word) (_ : and (inmonoid X a) (and (@eq Word (Append a x) w) (or (@eq Word x nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word x (cons x0 w))))))), @eq Word w (Append (@fst Word Word (@pair Word Word a x)) (@snd Word Word (@pair Word Word a x))) *) intros b temp; elim temp; clear temp. (* Goal: forall (_ : inmonoid X a) (_ : and (@eq Word (Append a b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))), @eq Word w (Append (@fst Word Word (@pair Word Word a b)) (@snd Word Word (@pair Word Word a b))) *) intros inm temp; elim temp. (* Goal: forall (_ : @eq Word (Append a b) w) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word w (Append (@fst Word Word (@pair Word Word a b)) (@snd Word Word (@pair Word Word a b))) *) simpl in |- *; auto. Qed. Lemma cut1_cons : forall (a : Elt) (w : Word), dans a X -> cut1 (cons a w) = cons a (cut1 w). Proof. (* Goal: forall (a : Elt) (w : Word) (_ : dans a X), @eq Word (cut1 (cons a w)) (cons a (cut1 w)) *) intros a w dans_a_X. (* Goal: @eq Word (cut1 (cons a w)) (cons a (cut1 w)) *) unfold cut1, cut in |- *. (* Goal: @eq Word (@fst Word Word (let (a0, s) := cut_spec (cons a w) in @pair Word Word a0 (let (b, _) := s in b))) (cons a (@fst Word Word (let (a, s) := cut_spec w in @pair Word Word a (let (b, _) := s in b)))) *) elim (cut_spec w). (* Goal: forall (x : Word) (p : @sig Word (fun b : Word => and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word b (cons x0 w)))))))), @eq Word (@fst Word Word (let (a0, s) := cut_spec (cons a w) in @pair Word Word a0 (let (b, _) := s in b))) (cons a (@fst Word Word (@pair Word Word x (let (b, _) := p in b)))) *) intros x temp; elim temp; clear temp. (* Goal: forall (x0 : Word) (_ : and (inmonoid X x) (and (@eq Word (Append x x0) w) (or (@eq Word x0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word x0 (cons x w))))))), @eq Word (@fst Word Word (let (a0, s) := cut_spec (cons a w) in @pair Word Word a0 (let (b, _) := s in b))) (cons a (@fst Word Word (@pair Word Word x x0))) *) intros b temp; elim temp; clear temp. (* Goal: forall (_ : inmonoid X x) (_ : and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))), @eq Word (@fst Word Word (let (a0, s) := cut_spec (cons a w) in @pair Word Word a0 (let (b, _) := s in b))) (cons a (@fst Word Word (@pair Word Word x b))) *) intros inmon_X_x temp; elim temp; clear temp. (* Goal: forall (_ : @eq Word (Append x b) w) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word (@fst Word Word (let (a0, s) := cut_spec (cons a w) in @pair Word Word a0 (let (b, _) := s in b))) (cons a (@fst Word Word (@pair Word Word x b))) *) elim (cut_spec (cons a w)). (* Goal: forall (x0 : Word) (p : @sig Word (fun b : Word => and (inmonoid X x0) (and (@eq Word (Append x0 b) (cons a w)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))))) (_ : @eq Word (Append x b) w) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word (@fst Word Word (@pair Word Word x0 (let (b, _) := p in b))) (cons a (@fst Word Word (@pair Word Word x b))) *) intros x' temp; elim temp; clear temp. (* Goal: forall (x0 : Word) (_ : and (inmonoid X x') (and (@eq Word (Append x' x0) (cons a w)) (or (@eq Word x0 nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word x0 (cons x w))))))) (_ : @eq Word (Append x b) w) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word (@fst Word Word (@pair Word Word x' x0)) (cons a (@fst Word Word (@pair Word Word x b))) *) intros b' temp; elim temp; clear temp. (* Goal: forall (_ : inmonoid X x') (_ : and (@eq Word (Append x' b') (cons a w)) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))))) (_ : @eq Word (Append x b) w) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word (@fst Word Word (@pair Word Word x' b')) (cons a (@fst Word Word (@pair Word Word x b))) *) intros inmon_X_x' temp; elim temp; clear temp. (* Goal: forall (_ : @eq Word (Append x' b') (cons a w)) (_ : or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))) (_ : @eq Word (Append x b) w) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word (@fst Word Word (@pair Word Word x' b')) (cons a (@fst Word Word (@pair Word Word x b))) *) intros App_eg' spec' App_eg spec. (* Goal: @eq Word (@fst Word Word (@pair Word Word x' b')) (cons a (@fst Word Word (@pair Word Word x b))) *) simpl in |- *. (* Goal: @eq Word x' (cons a x) *) cut (inmonoid X x'). (* Goal: inmonoid X x' *) (* Goal: forall _ : inmonoid X x', @eq Word x' (cons a x) *) cut (Append x' b' = cons a w). (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (_ : @eq Word (Append x' b') (cons a w)) (_ : inmonoid X x'), @eq Word x' (cons a x) *) clear inmon_X_x' App_eg'. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (_ : @eq Word (Append x' b') (cons a w)) (_ : inmonoid X x'), @eq Word x' (cons a x) *) generalize x'; clear x'; simple induction x'. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: forall (_ : @eq Word (Append nil b') (cons a w)) (_ : inmonoid X nil), @eq Word nil (cons a x) *) intro App_nil_b'_eg_cons_a_w. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: forall _ : inmonoid X nil, @eq Word nil (cons a x) *) absurd (dans a X). (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: not (dans a X) *) elim spec'. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) (* Goal: forall _ : @eq Word b' nil, not (dans a X) *) intro b'_nil. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) (* Goal: not (dans a X) *) absurd (cons a w = nil). (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) (* Goal: @eq Word (cons a w) nil *) (* Goal: not (@eq Word (cons a w) nil) *) discriminate. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) (* Goal: @eq Word (cons a w) nil *) rewrite <- b'_nil. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) (* Goal: @eq Word (cons a w) b' *) rewrite <- App_nil_b'_eg_cons_a_w. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) (* Goal: @eq Word (Append nil b') b' *) trivial. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall _ : @ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) intro temp; elim temp; clear temp. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall (x : Elt) (_ : not (dans x X)) (_ : @ex Word (fun w : Word => @eq Word b' (cons x w))), not (dans a X) *) intros x0 N_dans_x0_X temp; elim temp; clear temp. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: forall (x : Word) (_ : @eq Word b' (cons x0 x)), not (dans a X) *) intros w1 eg_b'_cons. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: not (dans a X) *) replace a with x0. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: @eq Elt x0 a *) (* Goal: not (dans x0 X) *) assumption. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: @eq Elt x0 a *) apply cons_cons_inv1 with w1 w. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: @eq Word (cons x0 w1) (cons a w) *) rewrite <- eg_b'_cons. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) (* Goal: @eq Word b' (cons a w) *) assumption. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) (* Goal: dans a X *) assumption. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: forall (e : Elt) (w0 : Word) (_ : forall (_ : @eq Word (Append w0 b') (cons a w)) (_ : inmonoid X w0), @eq Word w0 (cons a x)) (_ : @eq Word (Append (cons e w0) b') (cons a w)) (_ : inmonoid X (cons e w0)), @eq Word (cons e w0) (cons a x) *) intros x0 w0 Hyp App_eg_cons inmon_cons. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: @eq Word (cons x0 w0) (cons a x) *) apply cons_cons. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: @eq Word w0 x *) (* Goal: @eq Elt x0 a *) apply cons_cons_inv1 with (Append w0 b') w. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: @eq Word w0 x *) (* Goal: @eq Word (cons x0 (Append w0 b')) (cons a w) *) assumption. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: @eq Word w0 x *) apply cut_unicite with w b' b. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))) *) (* Goal: and (inmonoid X w0) (and (@eq Word (Append w0 b') w) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))))) *) split. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))) *) (* Goal: and (@eq Word (Append w0 b') w) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))) *) (* Goal: inmonoid X w0 *) apply inmonoid_cons_inv with x0; assumption. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))) *) (* Goal: and (@eq Word (Append w0 b') w) (or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w))))) *) split. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))) *) (* Goal: or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))) *) (* Goal: @eq Word (Append w0 b') w *) apply cons_cons_inv2 with x0 a. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))) *) (* Goal: or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))) *) (* Goal: @eq Word (cons x0 (Append w0 b')) (cons a w) *) assumption. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))) *) (* Goal: or (@eq Word b' nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b' (cons x w)))) *) assumption. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) (* Goal: and (inmonoid X x) (and (@eq Word (Append x b) w) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))) *) split; auto. (* Goal: inmonoid X x' *) (* Goal: @eq Word (Append x' b') (cons a w) *) assumption. (* Goal: inmonoid X x' *) assumption. Qed. Lemma cut1_Append : forall u v : Word, inmonoid X u -> cut1 (Append u v) = Append u (cut1 v). Proof. (* Goal: forall (u v : Word) (_ : inmonoid X u), @eq Word (cut1 (Append u v)) (Append u (cut1 v)) *) intros u v. (* Goal: forall _ : inmonoid X u, @eq Word (cut1 (Append u v)) (Append u (cut1 v)) *) generalize u; clear u; simple induction u. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid X w, @eq Word (cut1 (Append w v)) (Append w (cut1 v))) (_ : inmonoid X (cons e w)), @eq Word (cut1 (Append (cons e w) v)) (Append (cons e w) (cut1 v)) *) (* Goal: forall _ : inmonoid X nil, @eq Word (cut1 (Append nil v)) (Append nil (cut1 v)) *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid X w, @eq Word (cut1 (Append w v)) (Append w (cut1 v))) (_ : inmonoid X (cons e w)), @eq Word (cut1 (Append (cons e w) v)) (Append (cons e w) (cut1 v)) *) intros x w Hyp inmon_x_w. (* Goal: @eq Word (cut1 (Append (cons x w) v)) (Append (cons x w) (cut1 v)) *) replace (cut1 (Append (cons x w) v)) with (cons x (cut1 (Append w v))). (* Goal: @eq Word (cons x (cut1 (Append w v))) (cut1 (Append (cons x w) v)) *) (* Goal: @eq Word (cons x (cut1 (Append w v))) (Append (cons x w) (cut1 v)) *) replace (Append (cons x w) (cut1 v)) with (cons x (Append w (cut1 v))). (* Goal: @eq Word (cons x (cut1 (Append w v))) (cut1 (Append (cons x w) v)) *) (* Goal: @eq Word (cons x (Append w (cut1 v))) (Append (cons x w) (cut1 v)) *) (* Goal: @eq Word (cons x (cut1 (Append w v))) (cons x (Append w (cut1 v))) *) apply cons_cons. (* Goal: @eq Word (cons x (cut1 (Append w v))) (cut1 (Append (cons x w) v)) *) (* Goal: @eq Word (cons x (Append w (cut1 v))) (Append (cons x w) (cut1 v)) *) (* Goal: @eq Word (cut1 (Append w v)) (Append w (cut1 v)) *) (* Goal: @eq Elt x x *) trivial. (* Goal: @eq Word (cons x (cut1 (Append w v))) (cut1 (Append (cons x w) v)) *) (* Goal: @eq Word (cons x (Append w (cut1 v))) (Append (cons x w) (cut1 v)) *) (* Goal: @eq Word (cut1 (Append w v)) (Append w (cut1 v)) *) apply Hyp. (* Goal: @eq Word (cons x (cut1 (Append w v))) (cut1 (Append (cons x w) v)) *) (* Goal: @eq Word (cons x (Append w (cut1 v))) (Append (cons x w) (cut1 v)) *) (* Goal: inmonoid X w *) apply inmonoid_cons_inv with x; assumption. (* Goal: @eq Word (cons x (cut1 (Append w v))) (cut1 (Append (cons x w) v)) *) (* Goal: @eq Word (cons x (Append w (cut1 v))) (Append (cons x w) (cut1 v)) *) trivial. (* Goal: @eq Word (cons x (cut1 (Append w v))) (cut1 (Append (cons x w) v)) *) apply sym_equal. (* Goal: @eq Word (cut1 (Append (cons x w) v)) (cons x (cut1 (Append w v))) *) unfold Append in |- *. (* Goal: @eq Word (cut1 (cons x ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) w v))) (cons x (cut1 ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) w v))) *) simpl in |- *. (* Goal: @eq Word (cut1 (cons x ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) w v))) (cons x (cut1 ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) w v))) *) apply cut1_cons. (* Goal: dans x X *) apply inmonoid_cons_inv2 with w. (* Goal: inmonoid X (cons x w) *) trivial. Qed. Axiom cut2_cons : forall (A : Elt) (v : Word), dans A X -> cut2 (cons A v) = cut2 v. Lemma cut2_cons_N : forall (A : Elt) (v : Word), ~ dans A X -> cut2 (cons A v) = cons A v. Proof. (* Goal: forall (A : Elt) (v : Word) (_ : not (dans A X)), @eq Word (cut2 (cons A v)) (cons A v) *) intros A v N_dans_A_X. (* Goal: @eq Word (cut2 (cons A v)) (cons A v) *) unfold cut2, cut in |- *. (* Goal: @eq Word (@snd Word Word (let (a, s) := cut_spec (cons A v) in @pair Word Word a (let (b, _) := s in b))) (cons A v) *) elim (cut_spec (cons A v)). (* Goal: forall (x : Word) (p : @sig Word (fun b : Word => and (inmonoid X x) (and (@eq Word (Append x b) (cons A v)) (or (@eq Word b nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word b (cons x0 w)))))))), @eq Word (@snd Word Word (@pair Word Word x (let (b, _) := p in b))) (cons A v) *) intros a temp; elim temp; clear temp. (* Goal: forall (x : Word) (_ : and (inmonoid X a) (and (@eq Word (Append a x) (cons A v)) (or (@eq Word x nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word x (cons x0 w))))))), @eq Word (@snd Word Word (@pair Word Word a x)) (cons A v) *) intros b temp; elim temp; clear temp. (* Goal: forall (_ : inmonoid X a) (_ : and (@eq Word (Append a b) (cons A v)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))), @eq Word (@snd Word Word (@pair Word Word a b)) (cons A v) *) intros inmon_a temp; elim temp; clear temp. (* Goal: forall (_ : @eq Word (Append a b) (cons A v)) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word (@snd Word Word (@pair Word Word a b)) (cons A v) *) intros App_eg spec_or. (* Goal: @eq Word (@snd Word Word (@pair Word Word a b)) (cons A v) *) cut (inmonoid X a). (* Goal: inmonoid X a *) (* Goal: forall _ : inmonoid X a, @eq Word (@snd Word Word (@pair Word Word a b)) (cons A v) *) cut (Append a b = cons A v). (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (_ : @eq Word (Append a b) (cons A v)) (_ : inmonoid X a), @eq Word (@snd Word Word (@pair Word Word a b)) (cons A v) *) clear App_eg inmon_a. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (_ : @eq Word (Append a b) (cons A v)) (_ : inmonoid X a), @eq Word (@snd Word Word (@pair Word Word a b)) (cons A v) *) generalize a; clear a; simple induction a. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (e : Elt) (w : Word) (_ : forall (_ : @eq Word (Append w b) (cons A v)) (_ : inmonoid X w), @eq Word (@snd Word Word (@pair Word Word w b)) (cons A v)) (_ : @eq Word (Append (cons e w) b) (cons A v)) (_ : inmonoid X (cons e w)), @eq Word (@snd Word Word (@pair Word Word (cons e w) b)) (cons A v) *) (* Goal: forall (_ : @eq Word (Append nil b) (cons A v)) (_ : inmonoid X nil), @eq Word (@snd Word Word (@pair Word Word nil b)) (cons A v) *) auto. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (e : Elt) (w : Word) (_ : forall (_ : @eq Word (Append w b) (cons A v)) (_ : inmonoid X w), @eq Word (@snd Word Word (@pair Word Word w b)) (cons A v)) (_ : @eq Word (Append (cons e w) b) (cons A v)) (_ : inmonoid X (cons e w)), @eq Word (@snd Word Word (@pair Word Word (cons e w) b)) (cons A v) *) intros x w Hyp App_eg_x_w inmon. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Word (@snd Word Word (@pair Word Word (cons x w) b)) (cons A v) *) absurd (dans A X). (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: not (dans A X) *) assumption. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) replace A with x. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Elt x A *) (* Goal: dans x X *) apply inmonoid_cons_inv2 with w. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Elt x A *) (* Goal: inmonoid X (cons x w) *) assumption. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Elt x A *) apply cons_cons_inv1 with (Append w b) v. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Word (cons x (Append w b)) (cons A v) *) assumption. (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) assumption. (* Goal: inmonoid X a *) assumption. Qed. Lemma Deriveg_imp_Deriveg_cut : forall x y : Word, Deriveg X R x y -> ex2 (fun w : Word => Append (cut1 x) w = y) (fun w : Word => Deriveg X R (cut2 x) w). Proof. (* Goal: forall (x y : Word) (_ : Deriveg X R x y), @ex2 Word (fun w : Word => @eq Word (Append (cut1 x) w) y) (fun w : Word => Deriveg X R (cut2 x) w) *) intros x y Der. (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cut1 x) w) y) (fun w : Word => Deriveg X R (cut2 x) w) *) elim Der. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) R), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons A v)) w) (Append u v)) (fun w : Word => Deriveg X R (cut2 (cons A v)) w) *) intros. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons A v)) w) (Append u v)) (fun w : Word => Deriveg X R (cut2 (cons A v)) w) *) replace (cut1 (cons A v)) with nil. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append nil w) (Append u v)) (fun w : Word => Deriveg X R (cut2 (cons A v)) w) *) exists (Append u v). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: Deriveg X R (cut2 (cons A v)) (Append u v) *) (* Goal: @eq Word (Append nil (Append u v)) (Append u v) *) trivial. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: Deriveg X R (cut2 (cons A v)) (Append u v) *) replace (cut2 (cons A v)) with (cons A v). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: @eq Word (cons A v) (cut2 (cons A v)) *) (* Goal: Deriveg X R (cons A v) (Append u v) *) apply Deriveg1. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: @eq Word (cons A v) (cut2 (cons A v)) *) (* Goal: dans (couple A (word u)) R *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: @eq Word (cons A v) (cut2 (cons A v)) *) apply sym_equal. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: @eq Word (cut2 (cons A v)) (cons A v) *) apply cut2_cons_N. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: not (dans A X) *) apply inter_dans with V. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: dans A V *) (* Goal: inter V X empty *) apply sym_inter. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: dans A V *) (* Goal: inter X V empty *) apply isGram2 with R S'. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: dans A V *) (* Goal: isGram X V R S' *) exact Gram. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: dans A V *) apply Regles_inv1 with X R (word u). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: dans (couple A (word u)) R *) (* Goal: Regles X V R *) apply isGram4 with S'. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: dans (couple A (word u)) R *) (* Goal: isGram X V R S' *) exact Gram. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) (* Goal: dans (couple A (word u)) R *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (cut1 (cons A v)) *) unfold cut1, cut in |- *. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (@fst Word Word (let (a, s) := cut_spec (cons A v) in @pair Word Word a (let (b, _) := s in b))) *) elim (cut_spec (cons A v)). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: forall (x : Word) (p : @sig Word (fun b : Word => and (inmonoid X x) (and (@eq Word (Append x b) (cons A v)) (or (@eq Word b nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word b (cons x0 w)))))))), @eq Word nil (@fst Word Word (@pair Word Word x (let (b, _) := p in b))) *) intros a p. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (@fst Word Word (@pair Word Word a (let (b, _) := p in b))) *) elim p. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: forall (x : Word) (_ : and (inmonoid X a) (and (@eq Word (Append a x) (cons A v)) (or (@eq Word x nil) (@ex2 Elt (fun x0 : Elt => not (dans x0 X)) (fun x0 : Elt => @ex Word (fun w : Word => @eq Word x (cons x0 w))))))), @eq Word nil (@fst Word Word (@pair Word Word a x)) *) intros b temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: forall (_ : inmonoid X a) (_ : and (@eq Word (Append a b) (cons A v)) (or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w)))))), @eq Word nil (@fst Word Word (@pair Word Word a b)) *) intros inmon_a temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: forall (_ : @eq Word (Append a b) (cons A v)) (_ : or (@eq Word b nil) (@ex2 Elt (fun x : Elt => not (dans x X)) (fun x : Elt => @ex Word (fun w : Word => @eq Word b (cons x w))))), @eq Word nil (@fst Word Word (@pair Word Word a b)) *) intros App_eg spec_or. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: @eq Word nil (@fst Word Word (@pair Word Word a b)) *) cut (inmonoid X a). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: forall _ : inmonoid X a, @eq Word nil (@fst Word Word (@pair Word Word a b)) *) cut (Append a b = cons A v). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (_ : @eq Word (Append a b) (cons A v)) (_ : inmonoid X a), @eq Word nil (@fst Word Word (@pair Word Word a b)) *) clear App_eg inmon_a p. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (_ : @eq Word (Append a b) (cons A v)) (_ : inmonoid X a), @eq Word nil (@fst Word Word (@pair Word Word a b)) *) generalize a; clear a; simple induction a. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (e : Elt) (w : Word) (_ : forall (_ : @eq Word (Append w b) (cons A v)) (_ : inmonoid X w), @eq Word nil (@fst Word Word (@pair Word Word w b))) (_ : @eq Word (Append (cons e w) b) (cons A v)) (_ : inmonoid X (cons e w)), @eq Word nil (@fst Word Word (@pair Word Word (cons e w) b)) *) (* Goal: forall (_ : @eq Word (Append nil b) (cons A v)) (_ : inmonoid X nil), @eq Word nil (@fst Word Word (@pair Word Word nil b)) *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: forall (e : Elt) (w : Word) (_ : forall (_ : @eq Word (Append w b) (cons A v)) (_ : inmonoid X w), @eq Word nil (@fst Word Word (@pair Word Word w b))) (_ : @eq Word (Append (cons e w) b) (cons A v)) (_ : inmonoid X (cons e w)), @eq Word nil (@fst Word Word (@pair Word Word (cons e w) b)) *) intros x0 w Hyp App inmon. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Word nil (@fst Word Word (@pair Word Word (cons x0 w) b)) *) absurd (dans A X). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: not (dans A X) *) intros. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: not (dans A X) *) apply inter_dans with V. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: dans A V *) (* Goal: inter V X empty *) apply sym_inter. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: dans A V *) (* Goal: inter X V empty *) apply isGram2 with R S'. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: dans A V *) (* Goal: isGram X V R S' *) exact Gram. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: dans A V *) apply Regles_inv1 with X R (word u). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: dans (couple A (word u)) R *) (* Goal: Regles X V R *) apply isGram4 with S'. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: dans (couple A (word u)) R *) (* Goal: isGram X V R S' *) exact Gram. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) (* Goal: dans (couple A (word u)) R *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: dans A X *) apply inmonoid_cons_inv2 with w. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: inmonoid X (cons A w) *) replace A with x0. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Elt x0 A *) (* Goal: inmonoid X (cons x0 w) *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Elt x0 A *) apply cons_cons_inv1 with (Append w b) v. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) (* Goal: @eq Word (cons x0 (Append w b)) (cons A v) *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) (* Goal: @eq Word (Append a b) (cons A v) *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) (* Goal: inmonoid X a *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : @ex2 Word (fun w : Word => @eq Word (Append (cut1 u) w) v) (fun w : Word => Deriveg X R (cut2 u) w)), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x u)) w) (cons x v)) (fun w : Word => Deriveg X R (cut2 (cons x u)) w) *) intros u v x0 dans_x0_X Deriveg_X_R_u_v temp. (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x0 u)) w) (cons x0 v)) (fun w : Word => Deriveg X R (cut2 (cons x0 u)) w) *) elim temp; clear temp. (* Goal: forall (x : Word) (_ : @eq Word (Append (cut1 u) x) v) (_ : Deriveg X R (cut2 u) x), @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x0 u)) w) (cons x0 v)) (fun w : Word => Deriveg X R (cut2 (cons x0 u)) w) *) intros w eg_App_cut Der_g_cut2. (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cut1 (cons x0 u)) w) (cons x0 v)) (fun w : Word => Deriveg X R (cut2 (cons x0 u)) w) *) exists w. (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) (* Goal: @eq Word (Append (cut1 (cons x0 u)) w) (cons x0 v) *) replace (cut1 (cons x0 u)) with (cons x0 (cut1 u)). (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) (* Goal: @eq Word (cons x0 (cut1 u)) (cut1 (cons x0 u)) *) (* Goal: @eq Word (Append (cons x0 (cut1 u)) w) (cons x0 v) *) unfold Append in |- *. (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) (* Goal: @eq Word (cons x0 (cut1 u)) (cut1 (cons x0 u)) *) (* Goal: @eq Word (cons x0 ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) (cut1 u) w)) (cons x0 v) *) simpl in |- *. (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) (* Goal: @eq Word (cons x0 (cut1 u)) (cut1 (cons x0 u)) *) (* Goal: @eq Word (cons x0 ((fix Append (w1 w2 : Word) {struct w1} : Word := match w1 with | nil => w2 | cons a w3 => cons a (Append w3 w2) end) (cut1 u) w)) (cons x0 v) *) apply cons_cons; trivial. (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) (* Goal: @eq Word (cons x0 (cut1 u)) (cut1 (cons x0 u)) *) apply sym_equal. (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) (* Goal: @eq Word (cut1 (cons x0 u)) (cons x0 (cut1 u)) *) apply cut1_cons. (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) (* Goal: dans x0 X *) assumption. (* Goal: Deriveg X R (cut2 (cons x0 u)) w *) replace (cut2 (cons x0 u)) with (cut2 u). (* Goal: @eq Word (cut2 u) (cut2 (cons x0 u)) *) (* Goal: Deriveg X R (cut2 u) w *) assumption. (* Goal: @eq Word (cut2 u) (cut2 (cons x0 u)) *) apply sym_equal. (* Goal: @eq Word (cut2 (cons x0 u)) (cut2 u) *) apply cut2_cons. (* Goal: dans x0 X *) assumption. Qed. Lemma Deriveg_imp_Deriveg_App : forall x y : Word, Deriveg X R x y -> forall u v : Word, Append u v = x -> inmonoid X u -> ex2 (fun w : Word => Append u w = y) (fun w : Word => Deriveg X R v w). Proof. (* Goal: forall (x y : Word) (_ : Deriveg X R x y) (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Deriveg X R v w) *) intros x y Derg. (* Goal: forall (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Deriveg X R v w) *) elim Derg. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) R) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons A v)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (Append u v)) (fun w : Word => Deriveg X R v0 w) *) intros u0 v0 A dans_A_u0_R u v eg_App. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: forall _ : inmonoid X u, @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) elimtype (u = nil \/ (exists w : Word, (exists x : Elt, u = cons x w))). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: forall (_ : @eq Word u nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) intros u_eg. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: forall _ : inmonoid X u, @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) exists (Append u0 v0). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R v (Append u0 v0) *) (* Goal: @eq Word (Append u (Append u0 v0)) (Append u0 v0) *) rewrite u_eg. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R v (Append u0 v0) *) (* Goal: @eq Word (Append nil (Append u0 v0)) (Append u0 v0) *) trivial. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R v (Append u0 v0) *) replace v with (cons A v0). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: @eq Word (cons A v0) v *) (* Goal: Deriveg X R (cons A v0) (Append u0 v0) *) apply Deriveg1; assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: @eq Word (cons A v0) v *) replace v with (Append u v). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: @eq Word (Append u v) v *) (* Goal: @eq Word (cons A v0) (Append u v) *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: @eq Word (Append u v) v *) rewrite u_eg. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: @eq Word (Append nil v) v *) trivial. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) intro temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (x : Word) (_ : @ex Elt (fun x0 : Elt => @eq Word u (cons x0 x))) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) intros w temp; elim temp; clear temp. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (x : Elt) (_ : @eq Word u (cons x w)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) intros x0 u_eg inmon_u. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append u w) (Append u0 v0)) (fun w : Word => Deriveg X R v w) *) absurd (dans x0 V). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: dans x0 V *) (* Goal: not (dans x0 V) *) apply inter_dans with X. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: dans x0 V *) (* Goal: dans x0 X *) (* Goal: inter X V empty *) apply isGram2 with R S'. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: dans x0 V *) (* Goal: dans x0 X *) (* Goal: isGram X V R S' *) exact Gram. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: dans x0 V *) (* Goal: dans x0 X *) apply inmonoid_cons_inv2 with w. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: dans x0 V *) (* Goal: inmonoid X (cons x0 w) *) rewrite <- u_eg. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: dans x0 V *) (* Goal: inmonoid X u *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: dans x0 V *) replace x0 with A. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Elt A x0 *) (* Goal: dans A V *) apply Regles_inv1 with X R (word u0). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Elt A x0 *) (* Goal: dans (couple A (word u0)) R *) (* Goal: Regles X V R *) exact Regles_X_V_R. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Elt A x0 *) (* Goal: dans (couple A (word u0)) R *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Elt A x0 *) apply cons_cons_inv1 with v0 (Append w v). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Word (cons A v0) (cons x0 (Append w v)) *) change (cons A v0 = Append (cons x0 w) v) in |- *. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Word (cons A v0) (Append (cons x0 w) v) *) rewrite <- u_eg. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Word (cons A v0) (Append u v) *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) clear eg_App. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) generalize u; clear u; simple induction u. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) (* Goal: or (@eq Word nil nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word nil (cons x w)))) *) auto. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) intros x0 w hyp. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: or (@eq Word (cons x0 w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons x0 w) (cons x w0)))) *) apply or_intror. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: @ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons x0 w) (cons x w0))) *) exists w. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: @ex Elt (fun x : Elt => @eq Word (cons x0 w) (cons x w)) *) exists x0. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) (* Goal: @eq Word (cons x0 w) (cons x0 w) *) trivial. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) v) (fun w : Word => Deriveg X R v0 w)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) (cons x u)) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) (cons x v)) (fun w : Word => Deriveg X R v0 w) *) intros u0 v0 x0 dans_x0_X Derg_u_v Hyp u v. (* Goal: forall (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) elimtype (u = nil \/ (exists w : Word, (exists x : Elt, u = cons x w))). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: forall (_ : @eq Word u nil) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) intro eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: forall (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) rewrite eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: forall (_ : @eq Word (Append nil v) (cons x0 u0)) (_ : inmonoid X nil), @ex2 Word (fun w : Word => @eq Word (Append nil w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) intros App_eg inmon_nil. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append nil w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) exists (cons x0 v0). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R v (cons x0 v0) *) (* Goal: @eq Word (Append nil (cons x0 v0)) (cons x0 v0) *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R v (cons x0 v0) *) replace v with (cons x0 u0). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R (cons x0 u0) (cons x0 v0) *) apply Deriveg2. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R u0 v0 *) (* Goal: dans x0 X *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) (* Goal: Deriveg X R u0 v0 *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) intro temp; elim temp; clear temp. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (x : Word) (_ : @ex Elt (fun x0 : Elt => @eq Word u (cons x0 x))) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) intros w temp; elim temp; clear temp. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (x : Elt) (_ : @eq Word u (cons x w)) (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) intros x1 u_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @eq Word (Append u v) (cons x0 u0)) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) rewrite u_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @eq Word (Append (cons x1 w) v) (cons x0 u0)) (_ : inmonoid X (cons x1 w)), @ex2 Word (fun w0 : Word => @eq Word (Append (cons x1 w) w0) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) intros App_cons_eg inmonoid_X_cons_x1_w. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w0 : Word => @eq Word (Append (cons x1 w) w0) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) elimtype (ex2 (fun w1 : Word => Append w w1 = v0) (fun w1 : Word => Deriveg X R v w1)). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: forall (x : Word) (_ : @eq Word (Append w x) v0) (_ : Deriveg X R v x), @ex2 Word (fun w0 : Word => @eq Word (Append (cons x1 w) w0) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) intros w0 App_eg Der_v_w0. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: @ex2 Word (fun w0 : Word => @eq Word (Append (cons x1 w) w0) (cons x0 v0)) (fun w : Word => Deriveg X R v w) *) exists w0. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: Deriveg X R v w0 *) (* Goal: @eq Word (Append (cons x1 w) w0) (cons x0 v0) *) change (cons x1 (Append w w0) = cons x0 v0) in |- *. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: Deriveg X R v w0 *) (* Goal: @eq Word (cons x1 (Append w w0)) (cons x0 v0) *) apply cons_cons. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: Deriveg X R v w0 *) (* Goal: @eq Word (Append w w0) v0 *) (* Goal: @eq Elt x1 x0 *) apply cons_cons_inv1 with (Append w v) u0. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: Deriveg X R v w0 *) (* Goal: @eq Word (Append w w0) v0 *) (* Goal: @eq Word (cons x1 (Append w v)) (cons x0 u0) *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: Deriveg X R v w0 *) (* Goal: @eq Word (Append w w0) v0 *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) (* Goal: Deriveg X R v w0 *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append w w1) v0) (fun w1 : Word => Deriveg X R v w1) *) apply Hyp. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: inmonoid X w *) (* Goal: @eq Word (Append w v) u0 *) apply cons_cons_inv2 with x1 x0. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: inmonoid X w *) (* Goal: @eq Word (cons x1 (Append w v)) (cons x0 u0) *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: inmonoid X w *) apply inmonoid_cons_inv with x1. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: inmonoid X (cons x1 w) *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) generalize u; clear u; simple induction u. (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) (* Goal: or (@eq Word nil nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word nil (cons x w)))) *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) intros x2 w hyp. (* Goal: or (@eq Word (cons x2 w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons x2 w) (cons x w0)))) *) apply or_intror. (* Goal: @ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons x2 w) (cons x w0))) *) exists w. (* Goal: @ex Elt (fun x : Elt => @eq Word (cons x2 w) (cons x w)) *) exists x2. (* Goal: @eq Word (cons x2 w) (cons x2 w) *) trivial. Qed. Lemma Derivegstar_imp_Der_inmon : forall x y : Word, Derivegstar X R x y -> forall u v : Word, Append u v = x -> inmonoid X u -> ex2 (fun w : Word => Append u w = y) (fun w : Word => Derivegstar X R v w). Proof. (* Goal: forall (x y : Word) (_ : Derivegstar X R x y) (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Derivegstar X R v w) *) unfold Derivegstar in |- *. (* Goal: forall (x y : Word) (_ : Rstar Word (Deriveg X R) x y) (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Word (Deriveg X R) v w) *) intros x y Der_star. (* Goal: forall (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Word (Deriveg X R) v w) *) unfold Rstar in Der_star. (* Goal: forall (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Word (Deriveg X R) v w) *) pattern x, y in |- *. (* Goal: (fun w w0 : Word => forall (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w1 : Word => @eq Word (Append u w1) w0) (fun w1 : Word => Rstar Word (Deriveg X R) v w1)) x y *) apply Der_star. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) v) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0) *) (* Goal: forall (u u0 v : Word) (_ : @eq Word (Append u0 v) u) (_ : inmonoid X u0), @ex2 Word (fun w : Word => @eq Word (Append u0 w) u) (fun w : Word => Rstar Word (Deriveg X R) v w) *) intros; exists v. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) v) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0) *) (* Goal: Rstar Word (Deriveg X R) v v *) (* Goal: @eq Word (Append u0 v) u *) assumption. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) v) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0) *) (* Goal: Rstar Word (Deriveg X R) v v *) apply Rstar_reflexive. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : forall (u0 v0 : Word) (_ : @eq Word (Append u0 v0) v) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0)) (u0 v0 : Word) (_ : @eq Word (Append u0 v0) u) (_ : inmonoid X u0), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w0 : Word => Rstar Word (Deriveg X R) v0 w0) *) intros u v w Der_u_v Hyp u0 v0 App_eg inmon_u0. (* Goal: @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w : Word => Rstar Word (Deriveg X R) v0 w) *) elimtype (ex2 (fun w1 : Word => Append u0 w1 = v) (fun w1 : Word => Deriveg X R v0 w1)). (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: forall (x : Word) (_ : @eq Word (Append u0 x) v) (_ : Deriveg X R v0 x), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w : Word => Rstar Word (Deriveg X R) v0 w) *) intros w0 App_eg_u0_w0 Deriveg_v0_x0. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w : Word => Rstar Word (Deriveg X R) v0 w) *) elimtype (ex2 (fun w1 : Word => Append u0 w1 = w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1)). (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1) *) (* Goal: forall (x : Word) (_ : @eq Word (Append u0 x) w) (_ : Rstar Word (Deriveg X R) w0 x), @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w : Word => Rstar Word (Deriveg X R) v0 w) *) intros w1 App_eg_u0_w1_w Rstar_Der. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1) *) (* Goal: @ex2 Word (fun w0 : Word => @eq Word (Append u0 w0) w) (fun w : Word => Rstar Word (Deriveg X R) v0 w) *) exists w1. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1) *) (* Goal: Rstar Word (Deriveg X R) v0 w1 *) (* Goal: @eq Word (Append u0 w1) w *) assumption. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1) *) (* Goal: Rstar Word (Deriveg X R) v0 w1 *) apply Rstar_R with w0. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1) *) (* Goal: Rstar Word (Deriveg X R) w0 w1 *) (* Goal: Deriveg X R v0 w0 *) assumption. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1) *) (* Goal: Rstar Word (Deriveg X R) w0 w1 *) assumption. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) w) (fun w1 : Word => Rstar Word (Deriveg X R) w0 w1) *) apply Hyp; assumption. (* Goal: @ex2 Word (fun w1 : Word => @eq Word (Append u0 w1) v) (fun w1 : Word => Deriveg X R v0 w1) *) apply Deriveg_imp_Deriveg_App with u; assumption. Qed. Inductive Derive_P_A_2 : Conf -> Conf -> Prop := | Derive_X : forall (w u : Word) (x : Elt), dans x X -> Derive_P_A_2 (cons x w, cons x u) (w, u) | Derive_V : forall (v w u : Word) (x : Elt), dans (couple x (word u)) R -> Derive_P_A_2 (cons x w, v) (Append u w, v). Definition Derive_P_A_2_nind (x y : Conf) := ex2 (fun a : Elt => dans a X) (fun a : Elt => fst x = cons a (fst y) /\ snd x = cons a (snd y)) \/ (exists a : Elt, ex2 (fun w : Word => cons a w = fst x) (fun w : Word => ex2 (fun u : Word => dans (couple a (word u)) R) (fun u : Word => Append u w = fst y))). Lemma Derive_P_A_2_inv : forall x y : Conf, Derive_P_A_2 x y -> Derive_P_A_2_nind x y. Proof. (* Goal: forall (x y : Conf) (_ : Derive_P_A_2 x y), Derive_P_A_2_nind x y *) intros x y Der. (* Goal: Derive_P_A_2_nind x y *) unfold Derive_P_A_2_nind in |- *. (* Goal: or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word x) (cons a (@fst Word Word y))) (@eq Word (@snd Word Word x) (cons a (@snd Word Word y))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w : Word => @eq Word (cons a w) (@fst Word Word x)) (fun w : Word => @ex2 Word (fun u : Word => dans (couple a (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word y))))) *) elim Der. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x w) v)) (cons a (@fst Word Word (@pair Word Word (Append u w) v)))) (@eq Word (@snd Word Word (@pair Word Word (cons x w) v)) (cons a (@snd Word Word (@pair Word Word (Append u w) v)))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x w) v))) (fun w0 : Word => @ex2 Word (fun u0 : Word => dans (couple a (word u0)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word (Append u w) v)))))) *) (* Goal: forall (w u : Word) (x : Elt) (_ : dans x X), or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x w) (cons x u))) (cons a (@fst Word Word (@pair Word Word w u)))) (@eq Word (@snd Word Word (@pair Word Word (cons x w) (cons x u))) (cons a (@snd Word Word (@pair Word Word w u)))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x w) (cons x u)))) (fun w0 : Word => @ex2 Word (fun u0 : Word => dans (couple a (word u0)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word w u)))))) *) intros w u x0 dans_x0_X. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x w) v)) (cons a (@fst Word Word (@pair Word Word (Append u w) v)))) (@eq Word (@snd Word Word (@pair Word Word (cons x w) v)) (cons a (@snd Word Word (@pair Word Word (Append u w) v)))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x w) v))) (fun w0 : Word => @ex2 Word (fun u0 : Word => dans (couple a (word u0)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word (Append u w) v)))))) *) (* Goal: or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x0 w) (cons x0 u))) (cons a (@fst Word Word (@pair Word Word w u)))) (@eq Word (@snd Word Word (@pair Word Word (cons x0 w) (cons x0 u))) (cons a (@snd Word Word (@pair Word Word w u)))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x0 w) (cons x0 u)))) (fun w0 : Word => @ex2 Word (fun u : Word => dans (couple a (word u)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word w u)))))) *) apply or_introl. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x w) v)) (cons a (@fst Word Word (@pair Word Word (Append u w) v)))) (@eq Word (@snd Word Word (@pair Word Word (cons x w) v)) (cons a (@snd Word Word (@pair Word Word (Append u w) v)))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x w) v))) (fun w0 : Word => @ex2 Word (fun u0 : Word => dans (couple a (word u0)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word (Append u w) v)))))) *) (* Goal: @ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x0 w) (cons x0 u))) (cons a (@fst Word Word (@pair Word Word w u)))) (@eq Word (@snd Word Word (@pair Word Word (cons x0 w) (cons x0 u))) (cons a (@snd Word Word (@pair Word Word w u))))) *) exists x0; auto. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x w) v)) (cons a (@fst Word Word (@pair Word Word (Append u w) v)))) (@eq Word (@snd Word Word (@pair Word Word (cons x w) v)) (cons a (@snd Word Word (@pair Word Word (Append u w) v)))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x w) v))) (fun w0 : Word => @ex2 Word (fun u0 : Word => dans (couple a (word u0)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word (Append u w) v)))))) *) intros v w u x0 dans_couple_Der. (* Goal: or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x0 w) v)) (cons a (@fst Word Word (@pair Word Word (Append u w) v)))) (@eq Word (@snd Word Word (@pair Word Word (cons x0 w) v)) (cons a (@snd Word Word (@pair Word Word (Append u w) v)))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x0 w) v))) (fun w0 : Word => @ex2 Word (fun u : Word => dans (couple a (word u)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word (Append u w) v)))))) *) apply or_intror. (* Goal: @ex Elt (fun a : Elt => @ex2 Word (fun w0 : Word => @eq Word (cons a w0) (@fst Word Word (@pair Word Word (cons x0 w) v))) (fun w0 : Word => @ex2 Word (fun u : Word => dans (couple a (word u)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word (Append u w) v))))) *) exists x0. (* Goal: @ex2 Word (fun w0 : Word => @eq Word (cons x0 w0) (@fst Word Word (@pair Word Word (cons x0 w) v))) (fun w0 : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u0 : Word => @eq Word (Append u0 w0) (@fst Word Word (@pair Word Word (Append u w) v)))) *) exists w. (* Goal: @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u0 : Word => @eq Word (Append u0 w) (@fst Word Word (@pair Word Word (Append u w) v))) *) (* Goal: @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x0 w) v)) *) auto. (* Goal: @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u0 : Word => @eq Word (Append u0 w) (@fst Word Word (@pair Word Word (Append u w) v))) *) exists u; auto. Qed. Definition Derivestar_P_A_2 := Rstar Conf Derive_P_A_2. Lemma Der_cons_inv : forall (x : Elt) (u v : Word), dans x X -> Derivestar_P_A_2 (cons x u, v) (nil, nil) -> ex2 (fun v2 : Word => v = cons x v2) (fun v2 : Word => Derivestar_P_A_2 (u, v2) (nil, nil)). Proof. (* Goal: forall (x : Elt) (u v : Word) (_ : dans x X) (_ : Derivestar_P_A_2 (@pair Word Word (cons x u) v) (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intros x u v dans_x_X Der_star. (* Goal: @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) elimtype ((cons x u, v) = (nil, nil) \/ ex2 (fun z : Conf => Derive_P_A_2 (cons x u, v) z) (fun z : Conf => Rstar (Word * Word) Derive_P_A_2 z (nil, nil))). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: forall _ : @ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: forall _ : @eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intro eg. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: forall _ : @ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) absurd (cons x u = nil). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: forall _ : @ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (cons x u) nil *) (* Goal: not (@eq Word (cons x u) nil) *) discriminate. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: forall _ : @ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (cons x u) nil *) change (fst (cons x u, v) = fst (nil, nil)) in |- *. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: forall _ : @ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (@fst Word Word (@pair Word Word (cons x u) v)) (@fst Word Word (@pair Word Word nil nil)) *) apply (f_equal (fst (A:=Word) (B:=Word))). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: forall _ : @ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil) *) assumption. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: forall _ : @ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intro temp; elim temp; clear temp; intros z Der Der_star_2. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) cut (Derive_P_A_2_nind (cons x u, v) z). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall _ : Derive_P_A_2_nind (@pair Word Word (cons x u) v) z, @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) unfold Derive_P_A_2_nind in |- *. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall _ : or (@ex2 Elt (fun a : Elt => dans a X) (fun a : Elt => and (@eq Word (@fst Word Word (@pair Word Word (cons x u) v)) (cons a (@fst Word Word z))) (@eq Word (@snd Word Word (@pair Word Word (cons x u) v)) (cons a (@snd Word Word z))))) (@ex Elt (fun a : Elt => @ex2 Word (fun w : Word => @eq Word (cons a w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple a (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z))))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intro temp; elim temp; clear temp; intro temp; elim temp; clear temp. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: forall (x0 : Elt) (_ : dans x0 X) (_ : and (@eq Word (@fst Word Word (@pair Word Word (cons x u) v)) (cons x0 (@fst Word Word z))) (@eq Word (@snd Word Word (@pair Word Word (cons x u) v)) (cons x0 (@snd Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) simpl in |- *. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: forall (x0 : Elt) (_ : dans x0 X) (_ : and (@eq Word (cons x u) (cons x0 (@fst Word Word z))) (@eq Word v (cons x0 (@snd Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intros x0 dans_x0_X temp; elim temp; clear temp. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: forall (_ : @eq Word (cons x u) (cons x0 (@fst Word Word z))) (_ : @eq Word v (cons x0 (@snd Word Word z))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intros eg_cons_x_x0 eg_v_cons. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) exists (snd z). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: Derivestar_P_A_2 (@pair Word Word u (@snd Word Word z)) (@pair Word Word nil nil) *) (* Goal: @eq Word v (cons x (@snd Word Word z)) *) replace x with x0. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: Derivestar_P_A_2 (@pair Word Word u (@snd Word Word z)) (@pair Word Word nil nil) *) (* Goal: @eq Elt x0 x *) (* Goal: @eq Word v (cons x0 (@snd Word Word z)) *) trivial. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: Derivestar_P_A_2 (@pair Word Word u (@snd Word Word z)) (@pair Word Word nil nil) *) (* Goal: @eq Elt x0 x *) apply cons_cons_inv1 with (fst z) u. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: Derivestar_P_A_2 (@pair Word Word u (@snd Word Word z)) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x0 (@fst Word Word z)) (cons x u) *) auto. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: Derivestar_P_A_2 (@pair Word Word u (@snd Word Word z)) (@pair Word Word nil nil) *) unfold Derivestar_P_A_2 in |- *. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word u (@snd Word Word z)) (@pair Word Word nil nil) *) replace u with (fst z). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (@fst Word Word z) u *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word (@fst Word Word z) (@snd Word Word z)) (@pair Word Word nil nil) *) cut (Rstar (Word * Word) Derive_P_A_2 z (nil, nil)). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (@fst Word Word z) u *) (* Goal: Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil) *) (* Goal: forall _ : Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil), Rstar Conf Derive_P_A_2 (@pair Word Word (@fst Word Word z) (@snd Word Word z)) (@pair Word Word nil nil) *) elim z. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (@fst Word Word z) u *) (* Goal: Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil) *) (* Goal: forall (a b : Word) (_ : Rstar (prod Word Word) Derive_P_A_2 (@pair Word Word a b) (@pair Word Word nil nil)), Rstar Conf Derive_P_A_2 (@pair Word Word (@fst Word Word (@pair Word Word a b)) (@snd Word Word (@pair Word Word a b))) (@pair Word Word nil nil) *) auto. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (@fst Word Word z) u *) (* Goal: Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil) *) assumption. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (@fst Word Word z) u *) apply cons_cons_inv2 with x0 x. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) (* Goal: @eq Word (cons x0 (@fst Word Word z)) (cons x u) *) auto. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (@fst Word Word (@pair Word Word (cons x u) v))) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) simpl in |- *. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x0 : Elt) (_ : @ex2 Word (fun w : Word => @eq Word (cons x0 w) (cons x u)) (fun w : Word => @ex2 Word (fun u : Word => dans (couple x0 (word u)) R) (fun u : Word => @eq Word (Append u w) (@fst Word Word z)))), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intros x0 temp; elim temp; clear temp; intros w eg temp; elim temp; clear temp. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall (x1 : Word) (_ : dans (couple x0 (word x1)) R) (_ : @eq Word (Append x1 w) (@fst Word Word z)), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) intros u0 dans_couple. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: forall _ : @eq Word (Append u0 w) (@fst Word Word z), @ex2 Word (fun v2 : Word => @eq Word v (cons x v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word u v2) (@pair Word Word nil nil)) *) absurd (dans x0 V). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans x0 V *) (* Goal: not (dans x0 V) *) apply inter_dans with X. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans x0 V *) (* Goal: dans x0 X *) (* Goal: inter X V empty *) exact (isGram2 X V R S' Gram). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans x0 V *) (* Goal: dans x0 X *) replace x0 with x. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans x0 V *) (* Goal: @eq Elt x x0 *) (* Goal: dans x X *) trivial. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans x0 V *) (* Goal: @eq Elt x x0 *) apply cons_cons_inv1 with u w. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans x0 V *) (* Goal: @eq Word (cons x u) (cons x0 w) *) auto. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans x0 V *) apply Regles_inv1 with X R (word u0). (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans (couple x0 (word u0)) R *) (* Goal: Regles X V R *) exact Regles_X_V_R. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) (* Goal: dans (couple x0 (word u0)) R *) assumption. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2_nind (@pair Word Word (cons x u) v) z *) apply Derive_P_A_2_inv. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) (* Goal: Derive_P_A_2 (@pair Word Word (cons x u) v) z *) assumption. (* Goal: or (@eq (prod Word Word) (@pair Word Word (cons x u) v) (@pair Word Word nil nil)) (@ex2 Conf (fun z : Conf => Derive_P_A_2 (@pair Word Word (cons x u) v) z) (fun z : Conf => Rstar (prod Word Word) Derive_P_A_2 z (@pair Word Word nil nil))) *) apply Rstar_inv. (* Goal: Rstar (prod Word Word) Derive_P_A_2 (@pair Word Word (cons x u) v) (@pair Word Word nil nil) *) assumption. Qed. Lemma Derive_P_A_2_imp_Der_P_A_2_App : forall x y : Word, Derivestar_P_A_2 (x, y) (nil, nil) -> forall u v : Word, Append u v = x -> inmonoid X u -> ex2 (fun w : Word => Append u w = y) (fun w : Word => Derivestar_P_A_2 (v, w) (nil, nil)). Proof. (* Goal: forall (x y : Word) (_ : Derivestar_P_A_2 (@pair Word Word x y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) unfold Derivestar_P_A_2 in |- *. (* Goal: forall (x y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word x y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) x) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) simple induction x. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word nil y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros y Der_P_A_2 u v. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: forall (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) elimtype (u = nil \/ (exists w : Word, (exists x : Elt, u = cons x w))). (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: forall (_ : @eq Word u nil) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros u_eg. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: forall (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) rewrite u_eg. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: forall (_ : @eq Word (Append nil v) nil) (_ : inmonoid X nil), @ex2 Word (fun w : Word => @eq Word (Append nil w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros App_eg inmon_nil. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append nil w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) exists y; auto. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v y) (@pair Word Word nil nil) *) replace v with nil; trivial. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intro temp; elim temp; clear temp; intros w temp; elim temp; clear temp. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (x : Elt) (_ : @eq Word u (cons x w)) (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros x0 eg_u. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @eq Word (Append u v) nil) (_ : inmonoid X u), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) rewrite eg_u. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (_ : @eq Word (Append (cons x0 w) v) nil) (_ : inmonoid X (cons x0 w)), @ex2 Word (fun w0 : Word => @eq Word (Append (cons x0 w) w0) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros cons_eg_nil. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : inmonoid X (cons x0 w), @ex2 Word (fun w0 : Word => @eq Word (Append (cons x0 w) w0) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) absurd (cons x0 (Append w v) = nil). (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Word (cons x0 (Append w v)) nil *) (* Goal: not (@eq Word (cons x0 (Append w v)) nil) *) discriminate. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @eq Word (cons x0 (Append w v)) nil *) trivial. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) generalize u; clear u; simple induction u. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) (* Goal: or (@eq Word nil nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word nil (cons x w)))) *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) intros x1 w1 Hyp; apply or_intror; exists w1; exists x1; trivial. (* Goal: forall (e : Elt) (w : Word) (_ : forall (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word w y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) w) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil))) (y : Word) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) y) (@pair Word Word nil nil)) (u v : Word) (_ : @eq Word (Append u v) (cons e w)) (_ : inmonoid X u), @ex2 Word (fun w0 : Word => @eq Word (Append u w0) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w0) (@pair Word Word nil nil)) *) intros x0 w Hyp y Der_star_cons u v App_eg inmon_X. (* Goal: @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) elimtype (u = nil \/ (exists w : Word, (exists x : Elt, u = cons x w))). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: forall _ : @eq Word u nil, @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros u_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) rewrite u_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append nil w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) replace v with (cons x0 w). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @eq Word (cons x0 w) v *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append nil w) y) (fun w0 : Word => Rstar Conf Derive_P_A_2 (@pair Word Word (cons x0 w) w0) (@pair Word Word nil nil)) *) exists y; trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @eq Word (cons x0 w) v *) replace v with (Append u v). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @eq Word (Append u v) v *) (* Goal: @eq Word (cons x0 w) (Append u v) *) auto. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @eq Word (Append u v) v *) rewrite u_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @eq Word (Append nil v) v *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall _ : @ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w))), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intro temp; elim temp; clear temp; intros w1 temp; elim temp; clear temp. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: forall (x : Elt) (_ : @eq Word u (cons x w1)), @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros x1 eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append u w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) rewrite eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cons x1 w1) w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) elimtype (ex2 (fun v2 : Word => y = cons x0 v2) (fun v2 : Word => Derivestar_P_A_2 (w, v2) (nil, nil))). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: forall (x : Word) (_ : @eq Word y (cons x0 x)) (_ : Derivestar_P_A_2 (@pair Word Word w x) (@pair Word Word nil nil)), @ex2 Word (fun w : Word => @eq Word (Append (cons x1 w1) w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros v2 y_eg Der_w_v2. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cons x1 w1) w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) elimtype (ex2 (fun w : Word => Append w1 w = v2) (fun w : Word => Rstar Conf Derive_P_A_2 (v, w) (nil, nil))). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: forall (x : Word) (_ : @eq Word (Append w1 x) v2) (_ : Rstar Conf Derive_P_A_2 (@pair Word Word v x) (@pair Word Word nil nil)), @ex2 Word (fun w : Word => @eq Word (Append (cons x1 w1) w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) intros we App_w1_we_eg_v2 Rstar_Der. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cons x1 w1) w) y) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) exists we. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (Append (cons x1 w1) we) y *) rewrite y_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (Append (cons x1 w1) we) (cons x0 v2) *) replace (Append (cons x1 w1) we) with (cons x1 (Append w1 we)). (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (Append (cons x1 w1) we) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (cons x0 v2) *) apply cons_cons. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (Append (cons x1 w1) we) *) (* Goal: @eq Word (Append w1 we) v2 *) (* Goal: @eq Elt x1 x0 *) apply cons_cons_inv1 with (Append w1 v) w. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (Append (cons x1 w1) we) *) (* Goal: @eq Word (Append w1 we) v2 *) (* Goal: @eq Word (cons x1 (Append w1 v)) (cons x0 w) *) rewrite <- App_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (Append (cons x1 w1) we) *) (* Goal: @eq Word (Append w1 we) v2 *) (* Goal: @eq Word (cons x1 (Append w1 v)) (Append u v) *) rewrite eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (Append (cons x1 w1) we) *) (* Goal: @eq Word (Append w1 we) v2 *) (* Goal: @eq Word (cons x1 (Append w1 v)) (Append (cons x1 w1) v) *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (Append (cons x1 w1) we) *) (* Goal: @eq Word (Append w1 we) v2 *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 we)) (Append (cons x1 w1) we) *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word v we) (@pair Word Word nil nil) *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (Append w1 w) v2) (fun w : Word => Rstar Conf Derive_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) *) apply Hyp. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X w1 *) (* Goal: @eq Word (Append w1 v) w *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil) *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X w1 *) (* Goal: @eq Word (Append w1 v) w *) apply cons_cons_inv2 with x1 x0. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X w1 *) (* Goal: @eq Word (cons x1 (Append w1 v)) (cons x0 w) *) rewrite <- App_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X w1 *) (* Goal: @eq Word (cons x1 (Append w1 v)) (Append u v) *) rewrite eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X w1 *) (* Goal: @eq Word (cons x1 (Append w1 v)) (Append (cons x1 w1) v) *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X w1 *) apply inmonoid_cons_inv with x1. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X (cons x1 w1) *) rewrite <- eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X u *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: @ex2 Word (fun v2 : Word => @eq Word y (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word w v2) (@pair Word Word nil nil)) *) apply Der_cons_inv. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: dans x0 X *) replace x0 with x1. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: @eq Elt x1 x0 *) (* Goal: dans x1 X *) apply inmonoid_cons_inv2 with w1. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: @eq Elt x1 x0 *) (* Goal: inmonoid X (cons x1 w1) *) rewrite <- eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: @eq Elt x1 x0 *) (* Goal: inmonoid X u *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: @eq Elt x1 x0 *) apply cons_cons_inv1 with (Append w1 v) w. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 v)) (cons x0 w) *) rewrite <- App_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 v)) (Append u v) *) rewrite eg_u. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) (* Goal: @eq Word (cons x1 (Append w1 v)) (Append (cons x1 w1) v) *) trivial. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 w) y) (@pair Word Word nil nil) *) assumption. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) clear inmon_X App_eg. (* Goal: or (@eq Word u nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word u (cons x w)))) *) generalize u; clear u; simple induction u. (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) (* Goal: or (@eq Word nil nil) (@ex Word (fun w : Word => @ex Elt (fun x : Elt => @eq Word nil (cons x w)))) *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : or (@eq Word w nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word w (cons x w0))))), or (@eq Word (cons e w) nil) (@ex Word (fun w0 : Word => @ex Elt (fun x : Elt => @eq Word (cons e w) (cons x w0)))) *) intros x1 w1 tmp; apply or_intror; exists w1; exists x1; trivial. Qed. Lemma Derive_P_A_2_imp_Der_P_A_2_cons : forall (u : Elt) (x y : Word), Derivestar_P_A_2 (cons u x, y) (nil, nil) -> dans u X -> ex2 (fun w : Word => cons u w = y) (fun w : Word => Derivestar_P_A_2 (x, w) (nil, nil)). Proof. (* Goal: forall (u : Elt) (x y : Word) (_ : Derivestar_P_A_2 (@pair Word Word (cons u x) y) (@pair Word Word nil nil)) (_ : dans u X), @ex2 Word (fun w : Word => @eq Word (cons u w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word x w) (@pair Word Word nil nil)) *) intros. (* Goal: @ex2 Word (fun w : Word => @eq Word (cons u w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word x w) (@pair Word Word nil nil)) *) elimtype (ex2 (fun w : Word => Append (cons u nil) w = y) (fun w : Word => Derivestar_P_A_2 (x, w) (nil, nil))). (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cons u nil) w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word x w) (@pair Word Word nil nil)) *) (* Goal: forall (x0 : Word) (_ : @eq Word (Append (cons u nil) x0) y) (_ : Derivestar_P_A_2 (@pair Word Word x x0) (@pair Word Word nil nil)), @ex2 Word (fun w : Word => @eq Word (cons u w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word x w) (@pair Word Word nil nil)) *) intros w eg_App Der. (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cons u nil) w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word x w) (@pair Word Word nil nil)) *) (* Goal: @ex2 Word (fun w : Word => @eq Word (cons u w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word x w) (@pair Word Word nil nil)) *) exists w; trivial. (* Goal: @ex2 Word (fun w : Word => @eq Word (Append (cons u nil) w) y) (fun w : Word => Derivestar_P_A_2 (@pair Word Word x w) (@pair Word Word nil nil)) *) apply Derive_P_A_2_imp_Der_P_A_2_App with (cons u x); auto. Qed. Lemma Derivestar_P_A_2_x : forall x : Word, inmonoid X x -> Derivestar_P_A_2 (x, x) (nil, nil). Proof. (* Goal: forall (x : Word) (_ : inmonoid X x), Derivestar_P_A_2 (@pair Word Word x x) (@pair Word Word nil nil) *) unfold Derivestar_P_A_2 in |- *. (* Goal: forall (x : Word) (_ : inmonoid X x), Rstar Conf Derive_P_A_2 (@pair Word Word x x) (@pair Word Word nil nil) *) simple induction x. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid X w, Rstar Conf Derive_P_A_2 (@pair Word Word w w) (@pair Word Word nil nil)) (_ : inmonoid X (cons e w)), Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) (cons e w)) (@pair Word Word nil nil) *) (* Goal: forall _ : inmonoid X nil, Rstar Conf Derive_P_A_2 (@pair Word Word nil nil) (@pair Word Word nil nil) *) intro. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid X w, Rstar Conf Derive_P_A_2 (@pair Word Word w w) (@pair Word Word nil nil)) (_ : inmonoid X (cons e w)), Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) (cons e w)) (@pair Word Word nil nil) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word nil nil) (@pair Word Word nil nil) *) apply Rstar_reflexive. (* Goal: forall (e : Elt) (w : Word) (_ : forall _ : inmonoid X w, Rstar Conf Derive_P_A_2 (@pair Word Word w w) (@pair Word Word nil nil)) (_ : inmonoid X (cons e w)), Rstar Conf Derive_P_A_2 (@pair Word Word (cons e w) (cons e w)) (@pair Word Word nil nil) *) intros x0 w Hyp inmon. (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word (cons x0 w) (cons x0 w)) (@pair Word Word nil nil) *) apply Rstar_R with (w, w). (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word w w) (@pair Word Word nil nil) *) (* Goal: Derive_P_A_2 (@pair Word Word (cons x0 w) (cons x0 w)) (@pair Word Word w w) *) apply Derive_X. (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word w w) (@pair Word Word nil nil) *) (* Goal: dans x0 X *) apply inmonoid_cons_inv2 with w; assumption. (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word w w) (@pair Word Word nil nil) *) apply Hyp. (* Goal: inmonoid X w *) apply inmonoid_cons_inv with x0; assumption. Qed. Hint Resolve Derivestar_P_A_2_x. Lemma Derivegstar_imp_Derivestar_P_A_2 : forall x y : Word, Derivegstar X R x y -> inmonoid X y -> Derivestar_P_A_2 (x, y) (nil, nil). Proof. (* Goal: forall (x y : Word) (_ : Derivegstar X R x y) (_ : inmonoid X y), Derivestar_P_A_2 (@pair Word Word x y) (@pair Word Word nil nil) *) unfold Derivegstar, Rstar in |- *. (* Goal: forall (x y : Word) (_ : forall (P : forall (_ : Word) (_ : Word), Prop) (_ : forall u : Word, P u u) (_ : forall (u v w : Word) (_ : Deriveg X R u v) (_ : P v w), P u w), P x y) (_ : inmonoid X y), Derivestar_P_A_2 (@pair Word Word x y) (@pair Word Word nil nil) *) intros x y Der_star. (* Goal: forall _ : inmonoid X y, Derivestar_P_A_2 (@pair Word Word x y) (@pair Word Word nil nil) *) pattern x, y in |- *. (* Goal: (fun w w0 : Word => forall _ : inmonoid X w0, Derivestar_P_A_2 (@pair Word Word w w0) (@pair Word Word nil nil)) x y *) apply Der_star. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil) *) (* Goal: forall (u : Word) (_ : inmonoid X u), Derivestar_P_A_2 (@pair Word Word u u) (@pair Word Word nil nil) *) auto. (* Goal: forall (u v w : Word) (_ : Deriveg X R u v) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil) *) intros u v w Derg_u_v. (* Goal: forall (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil) *) generalize w. (* Goal: forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil) *) elim Derg_u_v. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil)) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (cons x v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons x u) w) (@pair Word Word nil nil) *) (* Goal: forall (u v : Word) (A : Elt) (_ : dans (couple A (word u)) R) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (Append u v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons A v) w) (@pair Word Word nil nil) *) intros u0 v0 A dans_couple w0 Hyp inmon_w0. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil)) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (cons x v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons x u) w) (@pair Word Word nil nil) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons A v0) w0) (@pair Word Word nil nil) *) unfold Derivestar_P_A_2 in |- *. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil)) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (cons x v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons x u) w) (@pair Word Word nil nil) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word (cons A v0) w0) (@pair Word Word nil nil) *) apply Rstar_R with (Append u0 v0, w0). (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil)) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (cons x v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons x u) w) (@pair Word Word nil nil) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word (Append u0 v0) w0) (@pair Word Word nil nil) *) (* Goal: Derive_P_A_2 (@pair Word Word (cons A v0) w0) (@pair Word Word (Append u0 v0) w0) *) apply Derive_V. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil)) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (cons x v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons x u) w) (@pair Word Word nil nil) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word (Append u0 v0) w0) (@pair Word Word nil nil) *) (* Goal: dans (couple A (word u0)) R *) assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil)) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (cons x v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons x u) w) (@pair Word Word nil nil) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word (Append u0 v0) w0) (@pair Word Word nil nil) *) apply Hyp; assumption. (* Goal: forall (u v : Word) (x : Elt) (_ : dans x X) (_ : Deriveg X R u v) (_ : forall (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word v w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word u w) (@pair Word Word nil nil)) (w : Word) (_ : forall _ : inmonoid X w, Derivestar_P_A_2 (@pair Word Word (cons x v) w) (@pair Word Word nil nil)) (_ : inmonoid X w), Derivestar_P_A_2 (@pair Word Word (cons x u) w) (@pair Word Word nil nil) *) intros u0 v0 x0 dans_x0_v0 Der_u0_v0 Hyp1 w0 Hyp2 inmon_w0. (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 u0) w0) (@pair Word Word nil nil) *) elimtype (ex2 (fun v2 : Word => w0 = cons x0 v2) (fun v2 : Word => Derivestar_P_A_2 (v0, v2) (nil, nil))). (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: forall (x : Word) (_ : @eq Word w0 (cons x0 x)) (_ : Derivestar_P_A_2 (@pair Word Word v0 x) (@pair Word Word nil nil)), Derivestar_P_A_2 (@pair Word Word (cons x0 u0) w0) (@pair Word Word nil nil) *) intros x1 w0_eg_cons Derivestar_v0_x1. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 u0) w0) (@pair Word Word nil nil) *) rewrite w0_eg_cons. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 u0) (cons x0 x1)) (@pair Word Word nil nil) *) unfold Derivestar_P_A_2 in |- *. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word (cons x0 u0) (cons x0 x1)) (@pair Word Word nil nil) *) apply Rstar_R with (u0, x1). (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word u0 x1) (@pair Word Word nil nil) *) (* Goal: Derive_P_A_2 (@pair Word Word (cons x0 u0) (cons x0 x1)) (@pair Word Word u0 x1) *) apply Derive_X. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word u0 x1) (@pair Word Word nil nil) *) (* Goal: dans x0 X *) assumption. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: Rstar Conf Derive_P_A_2 (@pair Word Word u0 x1) (@pair Word Word nil nil) *) apply Hyp1. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X x1 *) (* Goal: forall _ : inmonoid X x1, Derivestar_P_A_2 (@pair Word Word v0 x1) (@pair Word Word nil nil) *) auto. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X x1 *) apply inmonoid_cons_inv with x0. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X (cons x0 x1) *) rewrite <- w0_eg_cons. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) (* Goal: inmonoid X w0 *) assumption. (* Goal: @ex2 Word (fun v2 : Word => @eq Word w0 (cons x0 v2)) (fun v2 : Word => Derivestar_P_A_2 (@pair Word Word v0 v2) (@pair Word Word nil nil)) *) apply Der_cons_inv. (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 v0) w0) (@pair Word Word nil nil) *) (* Goal: dans x0 X *) assumption. (* Goal: Derivestar_P_A_2 (@pair Word Word (cons x0 v0) w0) (@pair Word Word nil nil) *) exact (Hyp2 inmon_w0). Qed. Hint Resolve Derivegstar_imp_Derivestar_P_A_2. Lemma Derive_P_A_2_imp_Derive_P_A : forall x y : Word * Word, Derive_P_A_2 x y -> Derive_P_A X d x y. Proof. (* Goal: forall (x y : prod Word Word) (_ : Derive_P_A_2 x y), Derive_P_A X d x y *) intros x y Der. (* Goal: Derive_P_A X d x y *) elim Der. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: forall (w u : Word) (x : Elt) (_ : dans x X), Derive_P_A X d (@pair Word Word (cons x w) (cons x u)) (@pair Word Word w u) *) intros w u x0 dans_x0_X. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: Derive_P_A X d (@pair Word Word (cons x0 w) (cons x0 u)) (@pair Word Word w u) *) replace (cons x0 w) with (Append (cons x0 nil) w). (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: Derive_P_A X d (@pair Word Word (Append (cons x0 nil) w) (cons x0 u)) (@pair Word Word w u) *) pattern w at 2 in |- *. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: (fun w0 : Word => Derive_P_A X d (@pair Word Word (Append (cons x0 nil) w) (cons x0 u)) (@pair Word Word w0 u)) w *) replace w with (Append nil w). (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) (* Goal: Derive_P_A X d (@pair Word Word (Append (cons x0 nil) w) (cons x0 u)) (@pair Word Word (Append nil w) u) *) apply Derive_cons. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) (* Goal: dans (couple (word (cons x0 nil)) (couple x0 (word nil))) d *) (* Goal: dans x0 X *) assumption. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) (* Goal: dans (couple (word (cons x0 nil)) (couple x0 (word nil))) d *) unfold d in |- *. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) (* Goal: dans (couple (word (cons x0 nil)) (couple x0 (word nil))) (union (map f_R_d R) (map f_X_d X)) *) apply union_d. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) (* Goal: dans (couple (word (cons x0 nil)) (couple x0 (word nil))) (map f_X_d X) *) change (dans (f_X_d x0) (map f_X_d X)) in |- *. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) (* Goal: dans (f_X_d x0) (map f_X_d X) *) apply dans_map_inv. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) (* Goal: dans x0 X *) assumption. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Word (Append nil w) w *) trivial. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) trivial. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), Derive_P_A X d (@pair Word Word (cons x w) v) (@pair Word Word (Append u w) v) *) intros v w u x0 dans_couple. (* Goal: Derive_P_A X d (@pair Word Word (cons x0 w) v) (@pair Word Word (Append u w) v) *) replace (cons x0 w) with (Append (cons x0 nil) w). (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: Derive_P_A X d (@pair Word Word (Append (cons x0 nil) w) v) (@pair Word Word (Append u w) v) *) apply Derive_eps. (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: dans (couple (word (cons x0 nil)) (couple (eps X) (word u))) d *) unfold d in |- *. (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: dans (couple (word (cons x0 nil)) (couple (eps X) (word u))) (union (map f_R_d R) (map f_X_d X)) *) apply union_g. (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: dans (couple (word (cons x0 nil)) (couple (eps X) (word u))) (map f_R_d R) *) replace (couple (word (cons x0 nil)) (couple (eps X) (word u))) with (f_R_d (couple x0 (word u))). (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Elt (f_R_d (couple x0 (word u))) (couple (word (cons x0 nil)) (couple (eps X) (word u))) *) (* Goal: dans (f_R_d (couple x0 (word u))) (map f_R_d R) *) apply dans_map_inv. (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Elt (f_R_d (couple x0 (word u))) (couple (word (cons x0 nil)) (couple (eps X) (word u))) *) (* Goal: dans (couple x0 (word u)) R *) assumption. (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Elt (f_R_d (couple x0 (word u))) (couple (word (cons x0 nil)) (couple (eps X) (word u))) *) unfold f_R_d in |- *. (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) (* Goal: @eq Elt (couple (word (cons (first (couple x0 (word u))) nil)) (couple (eps X) (second (couple x0 (word u))))) (couple (word (cons x0 nil)) (couple (eps X) (word u))) *) trivial. (* Goal: @eq Word (Append (cons x0 nil) w) (cons x0 w) *) trivial. Qed. Hint Resolve Derive_P_A_2_imp_Derive_P_A. Lemma Derivestar_P_A_2_imp_Derivestar_P_A : forall x y : Word * Word, Derivestar_P_A_2 x y -> Derivestar_P_A X d x y. Proof. (* Goal: forall (x y : prod Word Word) (_ : Derivestar_P_A_2 x y), Derivestar_P_A X d x y *) unfold Derivestar_P_A_2, Rstar, Derivestar_P_A in |- *. (* Goal: forall (x y : prod Word Word) (_ : forall (P : forall (_ : Conf) (_ : Conf), Prop) (_ : forall u : Conf, P u u) (_ : forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : P v w), P u w), P x y), Rstar Conf (Derive_P_A X d) x y *) intros x y Rstar_Der. (* Goal: Rstar Conf (Derive_P_A X d) x y *) pattern x, y in |- *. (* Goal: (fun p p0 : prod Word Word => Rstar Conf (Derive_P_A X d) p p0) x y *) apply Rstar_Der. (* Goal: forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : Rstar Conf (Derive_P_A X d) v w), Rstar Conf (Derive_P_A X d) u w *) (* Goal: forall u : Conf, Rstar Conf (Derive_P_A X d) u u *) intros. (* Goal: forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : Rstar Conf (Derive_P_A X d) v w), Rstar Conf (Derive_P_A X d) u w *) (* Goal: Rstar Conf (Derive_P_A X d) u u *) apply Rstar_reflexive. (* Goal: forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : Rstar Conf (Derive_P_A X d) v w), Rstar Conf (Derive_P_A X d) u w *) intros u v w Hyp1 Hyp2. (* Goal: Rstar Conf (Derive_P_A X d) u w *) apply Rstar_R with v; auto. Qed. Hint Resolve Derivestar_P_A_2_imp_Derivestar_P_A. Lemma Derive_P_A_imp_Derive_P_A_2 : forall x y : Word * Word, Derive_P_A X d x y -> Derive_P_A_2 x y. Proof. (* Goal: forall (x y : prod Word Word) (_ : Derive_P_A X d x y), Derive_P_A_2 x y *) unfold d in |- *. (* Goal: forall (x y : prod Word Word) (_ : Derive_P_A X (union (map f_R_d R) (map f_X_d X)) x y), Derive_P_A_2 x y *) intros x y Der. (* Goal: Derive_P_A_2 x y *) elim Der. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: forall (w w1 w2 u : Word) (x : Elt) (_ : dans x X) (_ : dans (couple (word w1) (couple x (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x u)) (@pair Word Word (Append w2 w) u) *) intros w w1 w2 u x0 dans_x0_X dans_couple_d. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) elimtype (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R) \/ dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) intros dans_couple. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) absurd (dans (eps X) X). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: dans (eps X) X *) (* Goal: not (dans (eps X) X) *) apply not_dans_X_eps. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: dans (eps X) X *) replace (eps X) with x0. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @eq Elt x0 (eps X) *) (* Goal: dans x0 X *) assumption. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @eq Elt x0 (eps X) *) elimtype (exists r : Elt, dans r R /\ couple (word w1) (couple x0 (word w2)) = f_R_d r). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r))) *) (* Goal: forall (x : Elt) (_ : and (dans x R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d x))), @eq Elt x0 (eps X) *) intros r temp; elim temp; clear temp; intros dans_r_R. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r))) *) (* Goal: forall _ : @eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r), @eq Elt x0 (eps X) *) unfold f_R_d in |- *. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r))) *) (* Goal: forall _ : @eq Elt (couple (word w1) (couple x0 (word w2))) (couple (word (cons (first r) nil)) (couple (eps X) (second r))), @eq Elt x0 (eps X) *) intro eg. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r))) *) (* Goal: @eq Elt x0 (eps X) *) apply couple_couple_inv1 with (word w2) (second r). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r))) *) (* Goal: @eq Elt (couple x0 (word w2)) (couple (eps X) (second r)) *) apply couple_couple_inv2 with (word w1) (word (cons (first r) nil)). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r))) *) (* Goal: @eq Elt (couple (word w1) (couple x0 (word w2))) (couple (word (cons (first r) nil)) (couple (eps X) (second r))) *) assumption. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_R_d r))) *) apply dans_map. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) (* Goal: dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R) *) assumption. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) intros dans_couple. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) elimtype (exists r : Elt, dans r X /\ couple (word w1) (couple x0 (word w2)) = f_X_d r). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: forall (x : Elt) (_ : and (dans x X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d x))), Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) intros r temp; elim temp; clear temp; intros dans_r_X eg. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) replace w1 with (cons x0 nil). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: Derive_P_A_2 (@pair Word Word (Append (cons x0 nil) w) (cons x0 u)) (@pair Word Word (Append w2 w) u) *) replace w2 with nil. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) (* Goal: Derive_P_A_2 (@pair Word Word (Append (cons x0 nil) w) (cons x0 u)) (@pair Word Word (Append nil w) u) *) simpl in |- *. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) (* Goal: Derive_P_A_2 (@pair Word Word (cons x0 w) (cons x0 u)) (@pair Word Word w u) *) replace (Append nil w) with w. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) (* Goal: @eq Word w (Append nil w) *) (* Goal: Derive_P_A_2 (@pair Word Word (cons x0 w) (cons x0 u)) (@pair Word Word w u) *) replace (Append (cons x0 nil) w) with (cons x0 w). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) (* Goal: @eq Word w (Append nil w) *) (* Goal: @eq Word (cons x0 w) (Append (cons x0 nil) w) *) (* Goal: Derive_P_A_2 (@pair Word Word (cons x0 w) (cons x0 u)) (@pair Word Word w u) *) apply Derive_X. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) (* Goal: @eq Word w (Append nil w) *) (* Goal: @eq Word (cons x0 w) (Append (cons x0 nil) w) *) (* Goal: dans x0 X *) assumption. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) (* Goal: @eq Word w (Append nil w) *) (* Goal: @eq Word (cons x0 w) (Append (cons x0 nil) w) *) trivial. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) (* Goal: @eq Word w (Append nil w) *) trivial. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Word nil w2 *) apply word_word_inv. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Elt (word nil) (word w2) *) apply couple_couple_inv2 with r x0. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Elt (couple r (word nil)) (couple x0 (word w2)) *) apply couple_couple_inv2 with (word (cons r nil)) (word w1). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) (* Goal: @eq Elt (couple (word (cons r nil)) (couple r (word nil))) (couple (word w1) (couple x0 (word w2))) *) auto. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Word (cons x0 nil) w1 *) replace x0 with r. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Elt r x0 *) (* Goal: @eq Word (cons r nil) w1 *) apply word_word_inv. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Elt r x0 *) (* Goal: @eq Elt (word (cons r nil)) (word w1) *) apply couple_couple_inv1 with (couple r (word nil)) (couple x0 (word w2)). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Elt r x0 *) (* Goal: @eq Elt (couple (word (cons r nil)) (couple r (word nil))) (couple (word w1) (couple x0 (word w2))) *) auto. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Elt r x0 *) apply couple_couple_inv1 with (word nil) (word w2). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Elt (couple r (word nil)) (couple x0 (word w2)) *) apply couple_couple_inv2 with (word (cons r nil)) (word w1). (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) (* Goal: @eq Elt (couple (word (cons r nil)) (couple r (word nil))) (couple (word w1) (couple x0 (word w2))) *) auto. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple x0 (word w2))) (f_X_d r))) *) apply dans_map. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) (* Goal: dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X) *) assumption. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: or (dans (couple (word w1) (couple x0 (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple x0 (word w2))) (map f_X_d X)) *) auto. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) unfold d in |- *. (* Goal: forall (w w1 w2 u : Word) (_ : dans (couple (word w1) (couple (eps X) (word w2))) (union (map f_R_d R) (map f_X_d X))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) intros w w1 w2 u dans_couple_d. (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) elimtype (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R) \/ dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) intros dans_couple. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) elimtype (exists r : Elt, dans r R /\ couple (word w1) (couple (eps X) (word w2)) = f_R_d r). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: forall (x : Elt) (_ : and (dans x R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d x))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) intros r temp; elim temp; clear temp; intros dans_r_R eg. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) replace w1 with (cons (first r) nil). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: Derive_P_A_2 (@pair Word Word (Append (cons (first r) nil) w) u) (@pair Word Word (Append w2 w) u) *) replace (Append (cons (first r) nil) w) with (cons (first r) w). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: Derive_P_A_2 (@pair Word Word (cons (first r) w) u) (@pair Word Word (Append w2 w) u) *) apply Derive_V. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: dans (couple (first r) (word w2)) R *) replace (word w2) with (second r). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: dans (couple (first r) (second r)) R *) elimtype (ex2 (fun A : Elt => dans A V) (fun A : Elt => ex2 (fun B : Word => r = couple A (word B)) (fun B : Word => inmonoid (union X V) B))). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: forall (x : Elt) (_ : dans x V) (_ : @ex2 Word (fun B : Word => @eq Elt r (couple x (word B))) (fun B : Word => inmonoid (union X V) B)), dans (couple (first r) (second r)) R *) intros A dans_A_V temp; elim temp; clear temp; intros B eg_r inmon_B. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: dans (couple (first r) (second r)) R *) rewrite eg_r. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: dans (couple (first (couple A (word B))) (second (couple A (word B)))) R *) replace (first (couple A (word B))) with A. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: @eq Elt A (first (couple A (word B))) *) (* Goal: dans (couple A (second (couple A (word B)))) R *) replace (second (couple A (word B))) with (word B). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: @eq Elt A (first (couple A (word B))) *) (* Goal: @eq Elt (word B) (second (couple A (word B))) *) (* Goal: dans (couple A (word B)) R *) rewrite <- eg_r. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: @eq Elt A (first (couple A (word B))) *) (* Goal: @eq Elt (word B) (second (couple A (word B))) *) (* Goal: dans r R *) assumption. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: @eq Elt A (first (couple A (word B))) *) (* Goal: @eq Elt (word B) (second (couple A (word B))) *) trivial. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) (* Goal: @eq Elt A (first (couple A (word B))) *) trivial. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: @ex2 Elt (fun A : Elt => dans A V) (fun A : Elt => @ex2 Word (fun B : Word => @eq Elt r (couple A (word B))) (fun B : Word => inmonoid (union X V) B)) *) apply Regles_X_V_R. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) (* Goal: dans r R *) assumption. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (second r) (word w2) *) apply couple_couple_inv2 with (eps X) (eps X). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (couple (eps X) (second r)) (couple (eps X) (word w2)) *) apply couple_couple_inv2 with (word (cons (first r) nil)) (word w1). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) (* Goal: @eq Elt (couple (word (cons (first r) nil)) (couple (eps X) (second r))) (couple (word w1) (couple (eps X) (word w2))) *) auto. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) (* Goal: @eq Word (cons (first r) w) (Append (cons (first r) nil) w) *) trivial. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Word (cons (first r) nil) w1 *) apply word_word_inv. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Elt (word (cons (first r) nil)) (word w1) *) apply couple_couple_inv1 with (couple (eps X) (second r)) (couple (eps X) (word w2)). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) (* Goal: @eq Elt (couple (word (cons (first r) nil)) (couple (eps X) (second r))) (couple (word w1) (couple (eps X) (word w2))) *) auto. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: @ex Elt (fun r : Elt => and (dans r R) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_R_d r))) *) apply dans_map. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) (* Goal: dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R) *) assumption. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: forall _ : dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) intro dans_couple. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) elimtype (exists r : Elt, dans r X /\ couple (word w1) (couple (eps X) (word w2)) = f_X_d r). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: forall (x : Elt) (_ : and (dans x X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d x))), Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) intros r temp; elim temp; clear temp; intros dans_r_X eg. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: Derive_P_A_2 (@pair Word Word (Append w1 w) u) (@pair Word Word (Append w2 w) u) *) absurd (dans (eps X) X). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: dans (eps X) X *) (* Goal: not (dans (eps X) X) *) apply not_dans_X_eps. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: dans (eps X) X *) replace (eps X) with r. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: @eq Elt r (eps X) *) (* Goal: dans r X *) assumption. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: @eq Elt r (eps X) *) apply couple_couple_inv1 with (word nil) (word w2). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: @eq Elt (couple r (word nil)) (couple (eps X) (word w2)) *) apply couple_couple_inv2 with (word (cons r nil)) (word w1). (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) (* Goal: @eq Elt (couple (word (cons r nil)) (couple r (word nil))) (couple (word w1) (couple (eps X) (word w2))) *) auto. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: @ex Elt (fun r : Elt => and (dans r X) (@eq Elt (couple (word w1) (couple (eps X) (word w2))) (f_X_d r))) *) apply dans_map. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) (* Goal: dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X) *) assumption. (* Goal: or (dans (couple (word w1) (couple (eps X) (word w2))) (map f_R_d R)) (dans (couple (word w1) (couple (eps X) (word w2))) (map f_X_d X)) *) auto. Qed. Hint Resolve Derive_P_A_imp_Derive_P_A_2. Lemma Derivestar_P_A_imp_Derivestar_P_A_2 : forall x y : Word * Word, Derivestar_P_A X d x y -> Derivestar_P_A_2 x y. Proof. (* Goal: forall (x y : prod Word Word) (_ : Derivestar_P_A X d x y), Derivestar_P_A_2 x y *) unfold Derivestar_P_A, Rstar, Derivestar_P_A_2 in |- *. (* Goal: forall (x y : prod Word Word) (_ : forall (P : forall (_ : Conf) (_ : Conf), Prop) (_ : forall u : Conf, P u u) (_ : forall (u v w : Conf) (_ : Derive_P_A X d u v) (_ : P v w), P u w), P x y), Rstar Conf Derive_P_A_2 x y *) intros x y Der_star. (* Goal: Rstar Conf Derive_P_A_2 x y *) pattern x, y in |- *. (* Goal: (fun p p0 : prod Word Word => Rstar Conf Derive_P_A_2 p p0) x y *) apply Der_star. (* Goal: forall (u v w : Conf) (_ : Derive_P_A X d u v) (_ : Rstar Conf Derive_P_A_2 v w), Rstar Conf Derive_P_A_2 u w *) (* Goal: forall u : Conf, Rstar Conf Derive_P_A_2 u u *) intros. (* Goal: forall (u v w : Conf) (_ : Derive_P_A X d u v) (_ : Rstar Conf Derive_P_A_2 v w), Rstar Conf Derive_P_A_2 u w *) (* Goal: Rstar Conf Derive_P_A_2 u u *) apply Rstar_reflexive. (* Goal: forall (u v w : Conf) (_ : Derive_P_A X d u v) (_ : Rstar Conf Derive_P_A_2 v w), Rstar Conf Derive_P_A_2 u w *) intros u v w Deri_u_v Rstar_v_w. (* Goal: Rstar Conf Derive_P_A_2 u w *) apply Rstar_R with v; auto. Qed. Hint Resolve Derivestar_P_A_imp_Derivestar_P_A_2. Theorem Derivestar_imp_Derivestar_P_A : forall x y : Word, Derivestar R x y -> inmonoid X y -> Derivestar_P_A X d (x, y) (nil, nil). Proof. (* Goal: forall (x y : Word) (_ : Derivestar R x y) (_ : inmonoid X y), Derivestar_P_A X d (@pair Word Word x y) (@pair Word Word nil nil) *) auto. Qed. Inductive Derive_P_A_3 : Word * Conf -> Word * Conf -> Prop := | Derive3_X : forall (w u s : Word) (x : Elt), dans x X -> Derive_P_A_3 (s, (cons x w, cons x u)) (Append s (cons x nil), (w, u)) | Derive3_V : forall (v w u s : Word) (x : Elt), dans (couple x (word u)) R -> Derive_P_A_3 (s, (cons x w, v)) (s, (Append u w, v)). Definition Derivestar_P_A_3 := Rstar (Word * Conf) Derive_P_A_3. Lemma Conserve_App_s_u : forall s1 s2 u1 u2 v1 v2 : Word, Derive_P_A_3 (s1, (u1, v1)) (s2, (u2, v2)) -> Append s1 v1 = Append s2 v2. Proof. (* Goal: forall (s1 s2 u1 u2 v1 v2 : Word) (_ : Derive_P_A_3 (@pair Word (prod Word Word) s1 (@pair Word Word u1 v1)) (@pair Word (prod Word Word) s2 (@pair Word Word u2 v2))), @eq Word (Append s1 v1) (Append s2 v2) *) intros s1 s2 u1 u2 v1 v2 Derive_P_A_3_s1_v1_s2_v2. (* Goal: @eq Word (Append s1 v1) (Append s2 v2) *) change ((fun a b : Word * Conf => Append (fst a) (snd (snd a)) = Append (fst b) (snd (snd b))) (s1, (u1, v1)) (s2, (u2, v2))) in |- *. (* Goal: (fun a b : prod Word Conf => @eq Word (Append (@fst Word Conf a) (@snd Word Word (@snd Word Conf a))) (Append (@fst Word Conf b) (@snd Word Word (@snd Word Conf b)))) (@pair Word (prod Word Word) s1 (@pair Word Word u1 v1)) (@pair Word (prod Word Word) s2 (@pair Word Word u2 v2)) *) elim Derive_P_A_3_s1_v1_s2_v2; simpl in |- *. (* Goal: forall (v _ : Word) (u s : Word) (x : Elt) (_ : dans (couple x (word u)) R), @eq Word (Append s v) (Append s v) *) (* Goal: forall (_ : Word) (u s : Word) (x : Elt) (_ : dans x X), @eq Word (Append s (cons x u)) (Append (Append s (cons x nil)) u) *) intros w u s x dans_x_X. (* Goal: forall (v _ : Word) (u s : Word) (x : Elt) (_ : dans (couple x (word u)) R), @eq Word (Append s v) (Append s v) *) (* Goal: @eq Word (Append s (cons x u)) (Append (Append s (cons x nil)) u) *) replace (cons x u) with (Append (cons x nil) u); trivial. (* Goal: forall (v _ : Word) (u s : Word) (x : Elt) (_ : dans (couple x (word u)) R), @eq Word (Append s v) (Append s v) *) auto. Qed. Lemma Derisvestar_P_A_3_conserve : forall s1 s2 u1 u2 v1 v2 : Word, Derivestar_P_A_3 (s1, (u1, v1)) (s2, (u2, v2)) -> Append s1 v1 = Append s2 v2. Proof. (* Goal: forall (s1 s2 u1 u2 v1 v2 : Word) (_ : Derivestar_P_A_3 (@pair Word (prod Word Word) s1 (@pair Word Word u1 v1)) (@pair Word (prod Word Word) s2 (@pair Word Word u2 v2))), @eq Word (Append s1 v1) (Append s2 v2) *) unfold Derivestar_P_A_3, Rstar in |- *. (* Goal: forall (s1 s2 u1 u2 v1 v2 : Word) (_ : forall (P : forall (_ : prod Word Conf) (_ : prod Word Conf), Prop) (_ : forall u : prod Word Conf, P u u) (_ : forall (u v w : prod Word Conf) (_ : Derive_P_A_3 u v) (_ : P v w), P u w), P (@pair Word (prod Word Word) s1 (@pair Word Word u1 v1)) (@pair Word (prod Word Word) s2 (@pair Word Word u2 v2))), @eq Word (Append s1 v1) (Append s2 v2) *) intros s1 s2 u1 u2 v1 v2 Derivestar_P_A_3_s1_v1_s2_v2. (* Goal: @eq Word (Append s1 v1) (Append s2 v2) *) change ((fun a b : Word * Conf => Append (fst a) (snd (snd a)) = Append (fst b) (snd (snd b))) (s1, (u1, v1)) (s2, (u2, v2))) in |- *. (* Goal: (fun a b : prod Word Conf => @eq Word (Append (@fst Word Conf a) (@snd Word Word (@snd Word Conf a))) (Append (@fst Word Conf b) (@snd Word Word (@snd Word Conf b)))) (@pair Word (prod Word Word) s1 (@pair Word Word u1 v1)) (@pair Word (prod Word Word) s2 (@pair Word Word u2 v2)) *) apply Derivestar_P_A_3_s1_v1_s2_v2. (* Goal: forall (u v w : prod Word Conf) (_ : Derive_P_A_3 u v) (_ : @eq Word (Append (@fst Word Conf v) (@snd Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf u) (@snd Word Word (@snd Word Conf u))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) (* Goal: forall u : prod Word Conf, @eq Word (Append (@fst Word Conf u) (@snd Word Word (@snd Word Conf u))) (Append (@fst Word Conf u) (@snd Word Word (@snd Word Conf u))) *) trivial. (* Goal: forall (u v w : prod Word Conf) (_ : Derive_P_A_3 u v) (_ : @eq Word (Append (@fst Word Conf v) (@snd Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf u) (@snd Word Word (@snd Word Conf u))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) intros u v w. (* Goal: forall (_ : Derive_P_A_3 u v) (_ : @eq Word (Append (@fst Word Conf v) (@snd Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf u) (@snd Word Word (@snd Word Conf u))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) elim u. (* Goal: forall (a : Word) (b : Conf) (_ : Derive_P_A_3 (@pair Word Conf a b) v) (_ : @eq Word (Append (@fst Word Conf v) (@snd Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf a b)) (@snd Word Word (@snd Word Conf (@pair Word Conf a b)))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) intros uu1 uuc. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf uu1 uuc) v) (_ : @eq Word (Append (@fst Word Conf v) (@snd Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf uu1 uuc)) (@snd Word Word (@snd Word Conf (@pair Word Conf uu1 uuc)))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) elim uuc. (* Goal: forall (a b : Word) (_ : Derive_P_A_3 (@pair Word Conf uu1 (@pair Word Word a b)) v) (_ : @eq Word (Append (@fst Word Conf v) (@snd Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf uu1 (@pair Word Word a b))) (@snd Word Word (@snd Word Conf (@pair Word Conf uu1 (@pair Word Word a b))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) intros uu2 uu3. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf uu1 (@pair Word Word uu2 uu3)) v) (_ : @eq Word (Append (@fst Word Conf v) (@snd Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))) (@snd Word Word (@snd Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) elim v. (* Goal: forall (a : Word) (b : Conf) (_ : Derive_P_A_3 (@pair Word Conf uu1 (@pair Word Word uu2 uu3)) (@pair Word Conf a b)) (_ : @eq Word (Append (@fst Word Conf (@pair Word Conf a b)) (@snd Word Word (@snd Word Conf (@pair Word Conf a b)))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))) (@snd Word Word (@snd Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) intros vv1 vvc. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf uu1 (@pair Word Word uu2 uu3)) (@pair Word Conf vv1 vvc)) (_ : @eq Word (Append (@fst Word Conf (@pair Word Conf vv1 vvc)) (@snd Word Word (@snd Word Conf (@pair Word Conf vv1 vvc)))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))) (@snd Word Word (@snd Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) elim vvc. (* Goal: forall (a b : Word) (_ : Derive_P_A_3 (@pair Word Conf uu1 (@pair Word Word uu2 uu3)) (@pair Word Conf vv1 (@pair Word Word a b))) (_ : @eq Word (Append (@fst Word Conf (@pair Word Conf vv1 (@pair Word Word a b))) (@snd Word Word (@snd Word Conf (@pair Word Conf vv1 (@pair Word Word a b))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))) (@snd Word Word (@snd Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) intros vv2 vv3. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf uu1 (@pair Word Word uu2 uu3)) (@pair Word Conf vv1 (@pair Word Word vv2 vv3))) (_ : @eq Word (Append (@fst Word Conf (@pair Word Conf vv1 (@pair Word Word vv2 vv3))) (@snd Word Word (@snd Word Conf (@pair Word Conf vv1 (@pair Word Word vv2 vv3))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append (@fst Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))) (@snd Word Word (@snd Word Conf (@pair Word Conf uu1 (@pair Word Word uu2 uu3))))) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) simpl in |- *. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf uu1 (@pair Word Word uu2 uu3)) (@pair Word Conf vv1 (@pair Word Word vv2 vv3))) (_ : @eq Word (Append vv1 vv3) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w)))), @eq Word (Append uu1 uu3) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) intros Der eg1. (* Goal: @eq Word (Append uu1 uu3) (Append (@fst Word Conf w) (@snd Word Word (@snd Word Conf w))) *) rewrite <- eg1. (* Goal: @eq Word (Append uu1 uu3) (Append vv1 vv3) *) apply Conserve_App_s_u with uu2 vv2. (* Goal: Derive_P_A_3 (@pair Word (prod Word Word) uu1 (@pair Word Word uu2 uu3)) (@pair Word (prod Word Word) vv1 (@pair Word Word vv2 vv3)) *) assumption. Qed. Lemma Derive_P_A_2_imp_Derive_P_A_3 : forall (s : Word) (x y : Conf), Derive_P_A_2 x y -> exists s2 : Word, Derive_P_A_3 (s, x) (s2, y). Proof. (* Goal: forall (s : Word) (x y : Conf) (_ : Derive_P_A_2 x y), @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s x) (@pair Word Conf s2 y)) *) intros s x y Derive_P_A_2_x_y. (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s x) (@pair Word Conf s2 y)) *) elim Derive_P_A_2_x_y. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x w) v)) (@pair Word Conf s2 (@pair Word Word (Append u w) v))) *) (* Goal: forall (w u : Word) (x : Elt) (_ : dans x X), @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x w) (cons x u))) (@pair Word Conf s2 (@pair Word Word w u))) *) intros w u x0 dans_x0_X. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x w) v)) (@pair Word Conf s2 (@pair Word Word (Append u w) v))) *) (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x0 w) (cons x0 u))) (@pair Word Conf s2 (@pair Word Word w u))) *) exists (Append s (cons x0 nil)). (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x w) v)) (@pair Word Conf s2 (@pair Word Word (Append u w) v))) *) (* Goal: Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x0 w) (cons x0 u))) (@pair Word Conf (Append s (cons x0 nil)) (@pair Word Word w u)) *) apply Derive3_X; assumption. (* Goal: forall (v w u : Word) (x : Elt) (_ : dans (couple x (word u)) R), @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x w) v)) (@pair Word Conf s2 (@pair Word Word (Append u w) v))) *) intros v w u x0 dans_couple. (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x0 w) v)) (@pair Word Conf s2 (@pair Word Word (Append u w) v))) *) intros; exists s. (* Goal: Derive_P_A_3 (@pair Word Conf s (@pair Word Word (cons x0 w) v)) (@pair Word Conf s (@pair Word Word (Append u w) v)) *) apply Derive3_V; assumption. Qed. Lemma Derivestar_P_A_2_imp_Derivestar_P_A_3 : forall x y : Conf, Derivestar_P_A_2 x y -> forall s : Word, exists s2 : Word, Derivestar_P_A_3 (s, x) (s2, y). Proof. (* Goal: forall (x y : Conf) (_ : Derivestar_P_A_2 x y) (s : Word), @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word Conf s x) (@pair Word Conf s2 y)) *) unfold Derivestar_P_A_2, Rstar, Derivestar_P_A_3 in |- *. (* Goal: forall (x y : Conf) (_ : forall (P : forall (_ : Conf) (_ : Conf), Prop) (_ : forall u : Conf, P u u) (_ : forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : P v w), P u w), P x y) (s : Word), @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s x) (@pair Word Conf s2 y)) *) intros x y Der_star. (* Goal: forall s : Word, @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s x) (@pair Word Conf s2 y)) *) pattern x, y in |- *. (* Goal: (fun c c0 : Conf => forall s : Word, @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s c) (@pair Word Conf s2 c0))) x y *) apply Der_star. (* Goal: forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : forall s : Word, @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s v) (@pair Word Conf s2 w))) (s : Word), @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) (* Goal: forall (u : Conf) (s : Word), @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 u)) *) intros; exists s. (* Goal: forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : forall s : Word, @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s v) (@pair Word Conf s2 w))) (s : Word), @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) (* Goal: Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s u) *) apply Rstar_reflexive. (* Goal: forall (u v w : Conf) (_ : Derive_P_A_2 u v) (_ : forall s : Word, @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s v) (@pair Word Conf s2 w))) (s : Word), @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) intros u v w Der_u_v Ex_v_w s. (* Goal: @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) elimtype (exists s2 : Word, Derive_P_A_3 (s, u) (s2, v)). (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 v)) *) (* Goal: forall (x : Word) (_ : Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf x v)), @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) intros s1 Der_3_s_u_s1_v. (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 v)) *) (* Goal: @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) elim (Ex_v_w s1). (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 v)) *) (* Goal: forall (x : Word) (_ : Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s1 v) (@pair Word Conf x w)), @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) intros s2 Rstar_s1_v_s2_w. (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 v)) *) (* Goal: @ex Word (fun s2 : Word => Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w)) *) exists s2. (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 v)) *) (* Goal: Rstar (prod Word Conf) Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 w) *) apply Rstar_R with (s1, v); trivial. (* Goal: @ex Word (fun s2 : Word => Derive_P_A_3 (@pair Word Conf s u) (@pair Word Conf s2 v)) *) apply Derive_P_A_2_imp_Derive_P_A_3; assumption. Qed. Lemma Deriveg_imp_Deriveg_App_2 : forall x y a : Word, inmonoid X a -> Deriveg X R x y -> Deriveg X R (Append a x) (Append a y). Proof. (* Goal: forall (x y a : Word) (_ : inmonoid X a) (_ : Deriveg X R x y), Deriveg X R (Append a x) (Append a y) *) intros x y. (* Goal: forall (a : Word) (_ : inmonoid X a) (_ : Deriveg X R x y), Deriveg X R (Append a x) (Append a y) *) simple induction a. (* Goal: forall (e : Elt) (w : Word) (_ : forall (_ : inmonoid X w) (_ : Deriveg X R x y), Deriveg X R (Append w x) (Append w y)) (_ : inmonoid X (cons e w)) (_ : Deriveg X R x y), Deriveg X R (Append (cons e w) x) (Append (cons e w) y) *) (* Goal: forall (_ : inmonoid X nil) (_ : Deriveg X R x y), Deriveg X R (Append nil x) (Append nil y) *) auto. (* Goal: forall (e : Elt) (w : Word) (_ : forall (_ : inmonoid X w) (_ : Deriveg X R x y), Deriveg X R (Append w x) (Append w y)) (_ : inmonoid X (cons e w)) (_ : Deriveg X R x y), Deriveg X R (Append (cons e w) x) (Append (cons e w) y) *) intros x0 w Hyp inmonoid_X_cons_x0_w Der_x_y. (* Goal: Deriveg X R (Append (cons x0 w) x) (Append (cons x0 w) y) *) change (Deriveg X R (cons x0 (Append w x)) (cons x0 (Append w y))) in |- *. (* Goal: Deriveg X R (cons x0 (Append w x)) (cons x0 (Append w y)) *) apply Deriveg2. (* Goal: Deriveg X R (Append w x) (Append w y) *) (* Goal: dans x0 X *) apply inmonoid_cons_inv2 with w; assumption. (* Goal: Deriveg X R (Append w x) (Append w y) *) apply Hyp. (* Goal: Deriveg X R x y *) (* Goal: inmonoid X w *) apply inmonoid_cons_inv with x0; assumption. (* Goal: Deriveg X R x y *) assumption. Qed. Lemma Derive_P_A_3_imp_Derivegstar : forall x y x' y' s s' : Word, Derive_P_A_3 (s, (x, y)) (s', (x', y')) -> inmonoid X s -> Derivegstar X R (Append s x) (Append s' x'). Proof. (* Goal: forall (x y x' y' s s' : Word) (_ : Derive_P_A_3 (@pair Word (prod Word Word) s (@pair Word Word x y)) (@pair Word (prod Word Word) s' (@pair Word Word x' y'))) (_ : inmonoid X s), Derivegstar X R (Append s x) (Append s' x') *) intros x y x' y' s s' Der. (* Goal: forall _ : inmonoid X s, Derivegstar X R (Append s x) (Append s' x') *) change ((fun a a' : Word * Conf => inmonoid X (fst a) -> Derivegstar X R (Append (fst a) (fst (snd a))) (Append (fst a') (fst (snd a')))) (s, (x, y)) (s', (x', y'))) in |- *. (* Goal: (fun a a' : prod Word Conf => forall _ : inmonoid X (@fst Word Conf a), Derivegstar X R (Append (@fst Word Conf a) (@fst Word Word (@snd Word Conf a))) (Append (@fst Word Conf a') (@fst Word Word (@snd Word Conf a')))) (@pair Word (prod Word Word) s (@pair Word Word x y)) (@pair Word (prod Word Word) s' (@pair Word Word x' y')) *) unfold Derivegstar in |- *. (* Goal: forall _ : inmonoid X (@fst Word Conf (@pair Word (prod Word Word) s (@pair Word Word x y))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word (prod Word Word) s (@pair Word Word x y))) (@fst Word Word (@snd Word Conf (@pair Word (prod Word Word) s (@pair Word Word x y))))) (Append (@fst Word Conf (@pair Word (prod Word Word) s' (@pair Word Word x' y'))) (@fst Word Word (@snd Word Conf (@pair Word (prod Word Word) s' (@pair Word Word x' y'))))) *) elim Der; simpl in |- *. (* Goal: forall (_ : Word) (w u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), Rstar Word (Deriveg X R) (Append s (cons x w)) (Append s (Append u w)) *) (* Goal: forall (w _ : Word) (s : Word) (x : Elt) (_ : dans x X) (_ : inmonoid X s), Rstar Word (Deriveg X R) (Append s (cons x w)) (Append (Append s (cons x nil)) w) *) intros w u s0 x0 dans_x0_X inmon_s. (* Goal: forall (_ : Word) (w u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), Rstar Word (Deriveg X R) (Append s (cons x w)) (Append s (Append u w)) *) (* Goal: Rstar Word (Deriveg X R) (Append s0 (cons x0 w)) (Append (Append s0 (cons x0 nil)) w) *) replace (Append (Append s0 (cons x0 nil)) w) with (Append s0 (Append (cons x0 nil) w)). (* Goal: forall (_ : Word) (w u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), Rstar Word (Deriveg X R) (Append s (cons x w)) (Append s (Append u w)) *) (* Goal: @eq Word (Append s0 (Append (cons x0 nil) w)) (Append (Append s0 (cons x0 nil)) w) *) (* Goal: Rstar Word (Deriveg X R) (Append s0 (cons x0 w)) (Append s0 (Append (cons x0 nil) w)) *) apply Rstar_reflexive. (* Goal: forall (_ : Word) (w u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), Rstar Word (Deriveg X R) (Append s (cons x w)) (Append s (Append u w)) *) (* Goal: @eq Word (Append s0 (Append (cons x0 nil) w)) (Append (Append s0 (cons x0 nil)) w) *) auto. (* Goal: forall (_ : Word) (w u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), Rstar Word (Deriveg X R) (Append s (cons x w)) (Append s (Append u w)) *) intros v w u s0 x0 dans_couple_x0_u_R inmon_s. (* Goal: Rstar Word (Deriveg X R) (Append s0 (cons x0 w)) (Append s0 (Append u w)) *) apply Rstar_R with (Append s0 (Append u w)). (* Goal: Rstar Word (Deriveg X R) (Append s0 (Append u w)) (Append s0 (Append u w)) *) (* Goal: Deriveg X R (Append s0 (cons x0 w)) (Append s0 (Append u w)) *) apply Deriveg_imp_Deriveg_App_2. (* Goal: Rstar Word (Deriveg X R) (Append s0 (Append u w)) (Append s0 (Append u w)) *) (* Goal: Deriveg X R (cons x0 w) (Append u w) *) (* Goal: inmonoid X s0 *) assumption. (* Goal: Rstar Word (Deriveg X R) (Append s0 (Append u w)) (Append s0 (Append u w)) *) (* Goal: Deriveg X R (cons x0 w) (Append u w) *) apply Deriveg1. (* Goal: Rstar Word (Deriveg X R) (Append s0 (Append u w)) (Append s0 (Append u w)) *) (* Goal: dans (couple x0 (word u)) R *) assumption. (* Goal: Rstar Word (Deriveg X R) (Append s0 (Append u w)) (Append s0 (Append u w)) *) apply Rstar_reflexive. Qed. Lemma Derive_P_A_3_conserve_inmonoid_s : forall x y x' y' s s' : Word, Derive_P_A_3 (s, (x, y)) (s', (x', y')) -> inmonoid X s -> inmonoid X s'. Proof. (* Goal: forall (x y x' y' s s' : Word) (_ : Derive_P_A_3 (@pair Word (prod Word Word) s (@pair Word Word x y)) (@pair Word (prod Word Word) s' (@pair Word Word x' y'))) (_ : inmonoid X s), inmonoid X s' *) intros x y x' y' s s' Der. (* Goal: forall _ : inmonoid X s, inmonoid X s' *) change ((fun a a' : Word * Conf => inmonoid X (fst a) -> inmonoid X (fst a')) (s, (x, y)) (s', (x', y'))) in |- *. (* Goal: (fun a a' : prod Word Conf => forall _ : inmonoid X (@fst Word Conf a), inmonoid X (@fst Word Conf a')) (@pair Word (prod Word Word) s (@pair Word Word x y)) (@pair Word (prod Word Word) s' (@pair Word Word x' y')) *) elim Der; simpl in |- *. (* Goal: forall (_ : Word) (_ : Word) (u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), inmonoid X s *) (* Goal: forall (_ : Word) (_ : Word) (s : Word) (x : Elt) (_ : dans x X) (_ : inmonoid X s), inmonoid X (Append s (cons x nil)) *) intros. (* Goal: forall (_ : Word) (_ : Word) (u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), inmonoid X s *) (* Goal: inmonoid X (Append s0 (cons x0 nil)) *) apply inmonoid_Append; auto. (* Goal: forall (_ : Word) (_ : Word) (u s : Word) (x : Elt) (_ : dans (couple x (word u)) R) (_ : inmonoid X s), inmonoid X s *) auto. Qed. Lemma Derivestar_P_A_3_imp_Derivegstar : forall x y x' y' s s' : Word, Derivestar_P_A_3 (s, (x, y)) (s', (x', y')) -> inmonoid X s -> Derivegstar X R (Append s x) (Append s' x'). Proof. (* Goal: forall (x y x' y' s s' : Word) (_ : Derivestar_P_A_3 (@pair Word (prod Word Word) s (@pair Word Word x y)) (@pair Word (prod Word Word) s' (@pair Word Word x' y'))) (_ : inmonoid X s), Derivegstar X R (Append s x) (Append s' x') *) unfold Derivestar_P_A_3, Rstar in |- *. (* Goal: forall (x y x' y' s s' : Word) (_ : forall (P : forall (_ : prod Word Conf) (_ : prod Word Conf), Prop) (_ : forall u : prod Word Conf, P u u) (_ : forall (u v w : prod Word Conf) (_ : Derive_P_A_3 u v) (_ : P v w), P u w), P (@pair Word (prod Word Word) s (@pair Word Word x y)) (@pair Word (prod Word Word) s' (@pair Word Word x' y'))) (_ : inmonoid X s), Derivegstar X R (Append s x) (Append s' x') *) intros x y x' y' s s' Der_star. (* Goal: forall _ : inmonoid X s, Derivegstar X R (Append s x) (Append s' x') *) change ((fun a a' : Word * Conf => inmonoid X (fst a) -> Derivegstar X R (Append (fst a) (fst (snd a))) (Append (fst a') (fst (snd a')))) (s, (x, y)) (s', (x', y'))) in |- *. (* Goal: (fun a a' : prod Word Conf => forall _ : inmonoid X (@fst Word Conf a), Derivegstar X R (Append (@fst Word Conf a) (@fst Word Word (@snd Word Conf a))) (Append (@fst Word Conf a') (@fst Word Word (@snd Word Conf a')))) (@pair Word (prod Word Word) s (@pair Word Word x y)) (@pair Word (prod Word Word) s' (@pair Word Word x' y')) *) apply Der_star; unfold Derivegstar in |- *. (* Goal: forall (u v w : prod Word Conf) (_ : Derive_P_A_3 u v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf u)), Rstar Word (Deriveg X R) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) (* Goal: forall (u : prod Word Conf) (_ : inmonoid X (@fst Word Conf u)), Rstar Word (Deriveg X R) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) *) intros. (* Goal: forall (u v w : prod Word Conf) (_ : Derive_P_A_3 u v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf u)), Rstar Word (Deriveg X R) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) (* Goal: Rstar Word (Deriveg X R) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) *) apply Rstar_reflexive. (* Goal: forall (u v w : prod Word Conf) (_ : Derive_P_A_3 u v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf u)), Rstar Word (Deriveg X R) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) intros u v w. (* Goal: forall (_ : Derive_P_A_3 u v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf u)), Rstar Word (Deriveg X R) (Append (@fst Word Conf u) (@fst Word Word (@snd Word Conf u))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) elim u. (* Goal: forall (a : Word) (b : Conf) (_ : Derive_P_A_3 (@pair Word Conf a b) v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf a b))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf a b)) (@fst Word Word (@snd Word Conf (@pair Word Conf a b)))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) intros u1 uc. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf u1 uc) v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf u1 uc))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf u1 uc)) (@fst Word Word (@snd Word Conf (@pair Word Conf u1 uc)))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) elim uc. (* Goal: forall (a b : Word) (_ : Derive_P_A_3 (@pair Word Conf u1 (@pair Word Word a b)) v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf u1 (@pair Word Word a b)))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf u1 (@pair Word Word a b))) (@fst Word Word (@snd Word Conf (@pair Word Conf u1 (@pair Word Word a b))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) intros u2 u3. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf u1 (@pair Word Word u2 u3)) v) (_ : forall _ : inmonoid X (@fst Word Conf v), Rstar Word (Deriveg X R) (Append (@fst Word Conf v) (@fst Word Word (@snd Word Conf v))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3)))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))) (@fst Word Word (@snd Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) elim v. (* Goal: forall (a : Word) (b : Conf) (_ : Derive_P_A_3 (@pair Word Conf u1 (@pair Word Word u2 u3)) (@pair Word Conf a b)) (_ : forall _ : inmonoid X (@fst Word Conf (@pair Word Conf a b)), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf a b)) (@fst Word Word (@snd Word Conf (@pair Word Conf a b)))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3)))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))) (@fst Word Word (@snd Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) intros v1 vc. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf u1 (@pair Word Word u2 u3)) (@pair Word Conf v1 vc)) (_ : forall _ : inmonoid X (@fst Word Conf (@pair Word Conf v1 vc)), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf v1 vc)) (@fst Word Word (@snd Word Conf (@pair Word Conf v1 vc)))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3)))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))) (@fst Word Word (@snd Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) elim vc. (* Goal: forall (a b : Word) (_ : Derive_P_A_3 (@pair Word Conf u1 (@pair Word Word u2 u3)) (@pair Word Conf v1 (@pair Word Word a b))) (_ : forall _ : inmonoid X (@fst Word Conf (@pair Word Conf v1 (@pair Word Word a b))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf v1 (@pair Word Word a b))) (@fst Word Word (@snd Word Conf (@pair Word Conf v1 (@pair Word Word a b))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3)))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))) (@fst Word Word (@snd Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) intros v2 v3. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf u1 (@pair Word Word u2 u3)) (@pair Word Conf v1 (@pair Word Word v2 v3))) (_ : forall _ : inmonoid X (@fst Word Conf (@pair Word Conf v1 (@pair Word Word v2 v3))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf v1 (@pair Word Word v2 v3))) (@fst Word Word (@snd Word Conf (@pair Word Conf v1 (@pair Word Word v2 v3))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3)))), Rstar Word (Deriveg X R) (Append (@fst Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))) (@fst Word Word (@snd Word Conf (@pair Word Conf u1 (@pair Word Word u2 u3))))) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) simpl in |- *. (* Goal: forall (_ : Derive_P_A_3 (@pair Word Conf u1 (@pair Word Word u2 u3)) (@pair Word Conf v1 (@pair Word Word v2 v3))) (_ : forall _ : inmonoid X v1, Rstar Word (Deriveg X R) (Append v1 v2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w)))) (_ : inmonoid X u1), Rstar Word (Deriveg X R) (Append u1 u2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) intros Der_3_u_v Hyp inmon_u1. (* Goal: Rstar Word (Deriveg X R) (Append u1 u2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) apply Rstar_transitive with (Append v1 v2). (* Goal: Rstar Word (Deriveg X R) (Append v1 v2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) (* Goal: Rstar Word (Deriveg X R) (Append u1 u2) (Append v1 v2) *) change (Derivegstar X R (Append u1 u2) (Append v1 v2)) in |- *. (* Goal: Rstar Word (Deriveg X R) (Append v1 v2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) (* Goal: Derivegstar X R (Append u1 u2) (Append v1 v2) *) apply Derive_P_A_3_imp_Derivegstar with u3 v3. (* Goal: Rstar Word (Deriveg X R) (Append v1 v2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) (* Goal: inmonoid X u1 *) (* Goal: Derive_P_A_3 (@pair Word (prod Word Word) u1 (@pair Word Word u2 u3)) (@pair Word (prod Word Word) v1 (@pair Word Word v2 v3)) *) assumption. (* Goal: Rstar Word (Deriveg X R) (Append v1 v2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) (* Goal: inmonoid X u1 *) assumption. (* Goal: Rstar Word (Deriveg X R) (Append v1 v2) (Append (@fst Word Conf w) (@fst Word Word (@snd Word Conf w))) *) apply Hyp. (* Goal: inmonoid X v1 *) apply Derive_P_A_3_conserve_inmonoid_s with u2 u3 v2 v3 u1. (* Goal: inmonoid X u1 *) (* Goal: Derive_P_A_3 (@pair Word (prod Word Word) u1 (@pair Word Word u2 u3)) (@pair Word (prod Word Word) v1 (@pair Word Word v2 v3)) *) assumption. (* Goal: inmonoid X u1 *) assumption. Qed. Theorem Derivestar_P_A_imp_Derivestar : forall x y : Word, Derivestar_P_A X d (x, y) (nil, nil) -> Derivestar R x y. Proof. (* Goal: forall (x y : Word) (_ : Derivestar_P_A X d (@pair Word Word x y) (@pair Word Word nil nil)), Derivestar R x y *) intros x y Derivestar_P_A_x_y_nil_nil. (* Goal: Derivestar R x y *) elimtype (exists s2 : Word, Derivestar_P_A_3 (nil, (x, y)) (s2, (nil, nil))). (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: forall (x0 : Word) (_ : Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) x0 (@pair Word Word nil nil))), Derivestar R x y *) intros s2 Derivestar_P_A_3_x_y. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: Derivestar R x y *) apply Derivegstar_Derivestar with X. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: Derivegstar X R x y *) replace x with (Append nil x). (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: Derivegstar X R (Append nil x) y *) replace y with (Append s2 nil). (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append s2 nil) y *) (* Goal: Derivegstar X R (Append nil x) (Append s2 nil) *) apply Derivestar_P_A_3_imp_Derivegstar with y nil. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append s2 nil) y *) (* Goal: inmonoid X nil *) (* Goal: Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil)) *) assumption. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append s2 nil) y *) (* Goal: inmonoid X nil *) trivial. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append s2 nil) y *) replace y with (Append nil y). (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append nil y) y *) (* Goal: @eq Word (Append s2 nil) (Append nil y) *) apply sym_equal. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append nil y) y *) (* Goal: @eq Word (Append nil y) (Append s2 nil) *) apply Derisvestar_P_A_3_conserve with x nil. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append nil y) y *) (* Goal: Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil)) *) assumption. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) (* Goal: @eq Word (Append nil y) y *) trivial. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) (* Goal: @eq Word (Append nil x) x *) trivial. (* Goal: @ex Word (fun s2 : Word => Derivestar_P_A_3 (@pair Word (prod Word Word) nil (@pair Word Word x y)) (@pair Word (prod Word Word) s2 (@pair Word Word nil nil))) *) apply Derivestar_P_A_2_imp_Derivestar_P_A_3. (* Goal: Derivestar_P_A_2 (@pair Word Word x y) (@pair Word Word nil nil) *) auto. Qed. Hint Resolve Derivestar_P_A_imp_Derivestar. Theorem equiv_APD_Gram : l_egal (LA X wd wa d) (LG X V R S'). Proof. (* Goal: l_egal (LA X wd wa d) (LG X V R S') *) red in |- *. (* Goal: and (l_inclus (LA X wd wa d) (LG X V R S')) (l_inclus (LG X V R S') (LA X wd wa d)) *) unfold l_inclus, LA, LG in |- *. (* Goal: and (forall (w : Word) (_ : and (Derivestar_P_A X d (@pair Word Word wd w) (@pair Word Word wa nil)) (inmonoid X w)), and (Derivestar R (cons S' nil) w) (inmonoid X w)) (forall (w : Word) (_ : and (Derivestar R (cons S' nil) w) (inmonoid X w)), and (Derivestar_P_A X d (@pair Word Word wd w) (@pair Word Word wa nil)) (inmonoid X w)) *) split. (* Goal: forall (w : Word) (_ : and (Derivestar R (cons S' nil) w) (inmonoid X w)), and (Derivestar_P_A X d (@pair Word Word wd w) (@pair Word Word wa nil)) (inmonoid X w) *) (* Goal: forall (w : Word) (_ : and (Derivestar_P_A X d (@pair Word Word wd w) (@pair Word Word wa nil)) (inmonoid X w)), and (Derivestar R (cons S' nil) w) (inmonoid X w) *) intros w temp; elim temp; intros Der inmon. (* Goal: forall (w : Word) (_ : and (Derivestar R (cons S' nil) w) (inmonoid X w)), and (Derivestar_P_A X d (@pair Word Word wd w) (@pair Word Word wa nil)) (inmonoid X w) *) (* Goal: and (Derivestar R (cons S' nil) w) (inmonoid X w) *) auto. (* Goal: forall (w : Word) (_ : and (Derivestar R (cons S' nil) w) (inmonoid X w)), and (Derivestar_P_A X d (@pair Word Word wd w) (@pair Word Word wa nil)) (inmonoid X w) *) intros w temp; elim temp; intros Der inmon. (* Goal: and (Derivestar_P_A X d (@pair Word Word wd w) (@pair Word Word wa nil)) (inmonoid X w) *) auto. Qed. End APD.
Require Export GeoCoq.Tarski_dev.Ch13_4_cos. Require Export GeoCoq.Tarski_dev.Annexes.project. Section Pappus_Pascal. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma l13_10_aux1 : forall O A B P Q la lb lp lq, Col O A B -> Col O P Q -> Perp O P P A -> Perp O Q Q B -> Q_Cong la -> Q_Cong lb -> Q_Cong lp -> Q_Cong lq -> la O A -> lb O B -> lp O P -> lq O Q -> exists a, Q_CongA_Acute a /\ Lcos lp la a /\ Lcos lq lb a. Proof. (* Goal: forall (O A B P Q : @Tpoint Tn) (la lb lp lq : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (_ : @Col Tn O A B) (_ : @Col Tn O P Q) (_ : @Perp Tn O P P A) (_ : @Perp Tn O Q Q B) (_ : @Q_Cong Tn la) (_ : @Q_Cong Tn lb) (_ : @Q_Cong Tn lp) (_ : @Q_Cong Tn lq) (_ : la O A) (_ : lb O B) (_ : lp O P) (_ : lq O Q), @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) intros. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) assert(Acute A O P). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: @Acute Tn A O P *) apply (perp_acute _ _ P);finish. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) assert(P <> O). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: not (@eq (@Tpoint Tn) P O) *) intro. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) subst P. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) apply perp_not_eq_1 in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) tauto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) assert(A <> O). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) subst A. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) apply perp_not_col in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) apply H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: @Col Tn O P P *) Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) assert(Q <> O). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: not (@eq (@Tpoint Tn) Q O) *) intro. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) subst Q. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) apply perp_not_eq_1 in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) tauto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) assert(B <> O). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: not (@eq (@Tpoint Tn) B O) *) intro. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) subst B. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) apply perp_not_col in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: False *) apply H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: @Col Tn O Q Q *) Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) assert(HH:= anga_exists A O P H13 H12 H11). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) ex_and HH a. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) assert(a B O Q). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) assert(~ Par O P A P). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: not (@Par Tn O P A P) *) intro. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) unfold Par in H18. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) induction H18. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) (* Goal: False *) unfold Par_strict in H18. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) (* Goal: False *) spliter. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) (* Goal: False *) apply H21. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X O P) (@Col Tn X A P)) *) exists P. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) (* Goal: and (@Col Tn P O P) (@Col Tn P A P) *) split; Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) spliter. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) apply perp_comm in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) apply perp_not_col in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: False *) apply H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Col Tn P O A *) Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) assert(A <> P). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: not (@eq (@Tpoint Tn) A P) *) apply perp_not_eq_2 in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: not (@eq (@Tpoint Tn) A P) *) auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) assert(Proj O O O P A P). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Proj Tn O O O P A P *) unfold Proj. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: and (not (@eq (@Tpoint Tn) O P)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@Par Tn O P A P)) (and (@Col Tn O P O) (or (@Par Tn O O A P) (@eq (@Tpoint Tn) O O))))) *) repeat split; Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) assert(Proj A P O P A P). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Proj Tn A P O P A P *) unfold Proj. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: and (not (@eq (@Tpoint Tn) O P)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@Par Tn O P A P)) (and (@Col Tn O P P) (or (@Par Tn A P A P) (@eq (@Tpoint Tn) A P))))) *) repeat split; Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: or (@Par Tn A P A P) (@eq (@Tpoint Tn) A P) *) left. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Par Tn A P A P *) apply par_reflexivity. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: not (@eq (@Tpoint Tn) A P) *) auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) assert(Proj B Q O P A P). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Proj Tn B Q O P A P *) unfold Proj. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: and (not (@eq (@Tpoint Tn) O P)) (and (not (@eq (@Tpoint Tn) A P)) (and (not (@Par Tn O P A P)) (and (@Col Tn O P Q) (or (@Par Tn B Q A P) (@eq (@Tpoint Tn) B Q))))) *) repeat split; Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: or (@Par Tn B Q A P) (@eq (@Tpoint Tn) B Q) *) left. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Par Tn B Q A P *) apply (l12_9 _ _ _ _ O P); Cop. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Perp Tn A P O P *) (* Goal: @Perp Tn B Q O P *) apply perp_sym. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Perp Tn A P O P *) (* Goal: @Perp Tn O P B Q *) eapply (perp_col _ Q); Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Perp Tn A P O P *) (* Goal: @Perp Tn O Q B Q *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Perp Tn A P O P *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) induction H. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) assert(Bet O P Q). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Bet Tn O P Q *) apply(per23_preserves_bet O A B P Q); auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O Q B *) (* Goal: @Per Tn O P A *) apply perp_in_per. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O Q B *) (* Goal: @Perp_at Tn P O P P A *) apply perp_comm in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O Q B *) (* Goal: @Perp_at Tn P O P P A *) apply perp_perp_in in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O Q B *) (* Goal: @Perp_at Tn P O P P A *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O Q B *) apply perp_in_per. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Perp_at Tn Q O Q Q B *) apply perp_comm in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Perp_at Tn Q O Q Q B *) apply perp_perp_in in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Perp_at Tn Q O Q Q B *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) assert(CongA A O P B O Q). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @CongA Tn A O P B O Q *) eapply (out_conga B _ Q B _ Q). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: @Out Tn O B A *) (* Goal: @CongA Tn B O Q B O Q *) apply conga_refl; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: @Out Tn O B A *) unfold Out. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: and (not (@eq (@Tpoint Tn) B O)) (and (not (@eq (@Tpoint Tn) A O)) (or (@Bet Tn O B A) (@Bet Tn O A B))) *) repeat split; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) unfold Out. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: and (not (@eq (@Tpoint Tn) Q O)) (and (not (@eq (@Tpoint Tn) P O)) (or (@Bet Tn O Q P) (@Bet Tn O P Q))) *) repeat split; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) apply out_trivial; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) apply out_trivial; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) apply (anga_conga_anga _ A O P); auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) induction H. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) assert(Bet P Q O). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Bet Tn P Q O *) apply between_symmetry. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Bet Tn O Q P *) apply(per23_preserves_bet O B A Q P); Between. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Per Tn O Q B *) (* Goal: @Col Tn O Q P *) Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Per Tn O Q B *) apply perp_in_per. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Perp_at Tn Q O Q Q B *) apply perp_comm in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Perp_at Tn Q O Q Q B *) apply perp_perp_in in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Perp_at Tn Q O Q Q B *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) apply perp_comm in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) apply perp_perp_in in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) assert(CongA A O P B O Q). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @CongA Tn A O P B O Q *) eapply (out_conga B _ Q B _ Q). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: @Out Tn O B A *) (* Goal: @CongA Tn B O Q B O Q *) apply conga_refl; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: @Out Tn O B A *) unfold Out. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: and (not (@eq (@Tpoint Tn) B O)) (and (not (@eq (@Tpoint Tn) A O)) (or (@Bet Tn O B A) (@Bet Tn O A B))) *) repeat split; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: or (@Bet Tn O B A) (@Bet Tn O A B) *) left. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) (* Goal: @Bet Tn O B A *) Between. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Out Tn O Q P *) unfold Out. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: and (not (@eq (@Tpoint Tn) Q O)) (and (not (@eq (@Tpoint Tn) P O)) (or (@Bet Tn O Q P) (@Bet Tn O P Q))) *) repeat split; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: or (@Bet Tn O Q P) (@Bet Tn O P Q) *) left. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) (* Goal: @Bet Tn O Q P *) Between. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) (* Goal: @Out Tn O B B *) apply out_trivial; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) (* Goal: @Out Tn O Q Q *) apply out_trivial; auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: a B O Q *) apply (anga_conga_anga _ A O P); auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) assert(Bet Q O P). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Bet Tn Q O P *) apply(per13_preserves_bet B O A Q P); auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Per Tn O Q B *) (* Goal: @Col Tn Q O P *) Col. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Per Tn O Q B *) apply perp_in_per. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Perp_at Tn Q O Q Q B *) apply perp_comm in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Perp_at Tn Q O Q Q B *) apply perp_perp_in in H2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) (* Goal: @Perp_at Tn Q O Q Q B *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) apply perp_comm in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) apply perp_perp_in in H1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @Per Tn O P A *) Perp. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) assert(CongA A O P B O Q). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) (* Goal: @CongA Tn A O P B O Q *) eapply (l11_14 ); Between. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) (* Goal: a B O Q *) apply (anga_conga_anga _ A O P); auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a))) *) exists a. (* Goal: and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lp la a) (@Lcos Tn lq lb a)) *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lp A B) (and (la A C) (a B A C)))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B O) (and (lp O B) (and (la O C) (a B O C))))) *) exists P. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C P O) (and (lp O P) (and (la O C) (a P O C)))) *) exists A. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) (* Goal: and (@Per Tn A P O) (and (lp O P) (and (la O A) (a P O A))) *) repeat split; auto. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) (* Goal: a P O A *) (* Goal: @Per Tn A P O *) apply perp_in_per. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) (* Goal: a P O A *) (* Goal: @Perp_at Tn P A P P O *) Perp. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) (* Goal: a P O A *) apply anga_sym; auto. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (lq A B) (and (lb A C) (a B A C)))))) *) exists O. (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B O) (and (lq O B) (and (lb O C) (a B O C))))) *) exists Q. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C Q O) (and (lq O Q) (and (lb O C) (a Q O C)))) *) exists B. (* Goal: and (@Per Tn B Q O) (and (lq O Q) (and (lb O B) (a Q O B))) *) repeat split; auto. (* Goal: a Q O B *) (* Goal: @Per Tn B Q O *) apply perp_in_per. (* Goal: a Q O B *) (* Goal: @Perp_at Tn Q B Q Q O *) Perp. (* Goal: a Q O B *) apply anga_sym; auto. Qed. Lemma l13_10_aux2 : forall O A B la lla lb llb, Col O A B -> Q_Cong la -> Q_Cong lla -> Q_Cong lb -> Q_Cong llb -> la O A -> lla O A -> lb O B -> llb O B -> A <> O -> B <> O -> exists a, Q_CongA_Acute a /\ Lcos lla la a /\ Lcos llb lb a. Proof. (* Goal: forall (O A B : @Tpoint Tn) (la lla lb llb : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (_ : @Col Tn O A B) (_ : @Q_Cong Tn la) (_ : @Q_Cong Tn lla) (_ : @Q_Cong Tn lb) (_ : @Q_Cong Tn llb) (_ : la O A) (_ : lla O A) (_ : lb O B) (_ : llb O B) (_ : not (@eq (@Tpoint Tn) A O)) (_ : not (@eq (@Tpoint Tn) B O)), @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lla la a) (@Lcos Tn llb lb a))) *) intros. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lla la a) (@Lcos Tn llb lb a))) *) assert(HH:=anga_exists A O A H8 H8 (acute_trivial A O H8)). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lla la a) (@Lcos Tn llb lb a))) *) ex_and HH a. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lla la a) (@Lcos Tn llb lb a))) *) exists a. (* Goal: and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lla la a) (@Lcos Tn llb lb a)) *) split; auto. (* Goal: and (@Lcos Tn lla la a) (@Lcos Tn llb lb a) *) assert(Q_CongA_Null_Acute a). (* Goal: and (@Lcos Tn lla la a) (@Lcos Tn llb lb a) *) (* Goal: @Q_CongA_Null_Acute Tn a *) assert(Out O A A /\ Q_CongA_Null_Acute a). (* Goal: and (@Lcos Tn lla la a) (@Lcos Tn llb lb a) *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: and (@Out Tn O A A) (@Q_CongA_Null_Acute Tn a) *) apply(anga_col_null a A O A); auto. (* Goal: and (@Lcos Tn lla la a) (@Lcos Tn llb lb a) *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: @Col Tn A O A *) Col. (* Goal: and (@Lcos Tn lla la a) (@Lcos Tn llb lb a) *) (* Goal: @Q_CongA_Null_Acute Tn a *) tauto. (* Goal: and (@Lcos Tn lla la a) (@Lcos Tn llb lb a) *) split. (* Goal: @Lcos Tn llb lb a *) (* Goal: @Lcos Tn lla la a *) assert(EqL la lla). (* Goal: @Lcos Tn llb lb a *) (* Goal: @Lcos Tn lla la a *) (* Goal: @EqL Tn la lla *) apply ex_eql. (* Goal: @Lcos Tn llb lb a *) (* Goal: @Lcos Tn lla la a *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => and (@Len Tn A B la) (@Len Tn A B lla))) *) exists O. (* Goal: @Lcos Tn llb lb a *) (* Goal: @Lcos Tn lla la a *) (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => and (@Len Tn O B la) (@Len Tn O B lla)) *) exists A. (* Goal: @Lcos Tn llb lb a *) (* Goal: @Lcos Tn lla la a *) (* Goal: and (@Len Tn O A la) (@Len Tn O A lla) *) repeat split; auto. (* Goal: @Lcos Tn llb lb a *) (* Goal: @Lcos Tn lla la a *) rewrite <- H13. (* Goal: @Lcos Tn llb lb a *) (* Goal: @Lcos Tn la la a *) apply null_lcos; auto. (* Goal: @Lcos Tn llb lb a *) (* Goal: not (@Q_Cong_Null Tn la) *) intro. (* Goal: @Lcos Tn llb lb a *) (* Goal: False *) unfold Q_Cong_Null in H14. (* Goal: @Lcos Tn llb lb a *) (* Goal: False *) spliter. (* Goal: @Lcos Tn llb lb a *) (* Goal: False *) ex_and H15 X. (* Goal: @Lcos Tn llb lb a *) (* Goal: False *) assert(HH:= lg_cong la O A X X H0 H4 H16). (* Goal: @Lcos Tn llb lb a *) (* Goal: False *) treat_equalities. (* Goal: @Lcos Tn llb lb a *) (* Goal: False *) tauto. (* Goal: @Lcos Tn llb lb a *) assert(HH:=anga_exists B O B H9 H9 (acute_trivial B O H9)). (* Goal: @Lcos Tn llb lb a *) ex_and HH b. (* Goal: @Lcos Tn llb lb a *) assert(EqA a b). (* Goal: @Lcos Tn llb lb a *) (* Goal: @EqA Tn a b *) assert(HH:=null_anga A O B O a b). (* Goal: @Lcos Tn llb lb a *) (* Goal: @EqA Tn a b *) apply HH; split; auto. (* Goal: @Lcos Tn llb lb a *) assert(EqL lb llb). (* Goal: @Lcos Tn llb lb a *) (* Goal: @EqL Tn lb llb *) apply ex_eql. (* Goal: @Lcos Tn llb lb a *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => and (@Len Tn A B lb) (@Len Tn A B llb))) *) exists O. (* Goal: @Lcos Tn llb lb a *) (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => and (@Len Tn O B lb) (@Len Tn O B llb)) *) exists B. (* Goal: @Lcos Tn llb lb a *) (* Goal: and (@Len Tn O B lb) (@Len Tn O B llb) *) repeat split; auto. (* Goal: @Lcos Tn llb lb a *) rewrite <- H16. (* Goal: @Lcos Tn lb lb a *) apply null_lcos; auto. (* Goal: not (@Q_Cong_Null Tn lb) *) intro. (* Goal: False *) unfold Q_Cong_Null in H17. (* Goal: False *) spliter. (* Goal: False *) ex_and H18 X. (* Goal: False *) assert(HH:= lg_cong lb O B X X H2 H6 H19). (* Goal: False *) treat_equalities. (* Goal: False *) tauto. Qed. Lemma l13_6_bis : forall lp l1 l2 a, Lcos lp l1 a -> Lcos lp l2 a -> EqL l1 l2. Proof. (* Goal: forall (lp l1 l2 : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (_ : @Lcos Tn lp l1 a) (_ : @Lcos Tn lp l2 a), @EqL Tn l1 l2 *) intros. (* Goal: @EqL Tn l1 l2 *) induction(is_null_anga_dec a). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @EqL Tn l1 l2 *) apply lcos_lg_anga in H. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @EqL Tn l1 l2 *) apply lcos_lg_anga in H0. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @EqL Tn l1 l2 *) spliter. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @EqL Tn l1 l2 *) assert(HH:= null_lcos_eql lp l1 a H H1). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @EqL Tn l1 l2 *) assert(HP:= null_lcos_eql lp l2 a H0 H1). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @EqL Tn l1 l2 *) transitivity lp; auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @EqL Tn lp l2 *) symmetry; auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) apply lcos_lg_anga in H. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) apply lcos_lg_anga in H0. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) spliter. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert (HH:= H). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(HH0:= H0). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) unfold Lcos in HH. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) unfold Lcos in HH0. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) spliter. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) ex_and H11 A. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) ex_and H16 B. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) ex_and H11 C. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) ex_and H15 A'. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) ex_and H19 B'. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) ex_and H15 C'. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(HH:=not_null_not_col a B A C H4 H1 H18). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(HP:=not_null_not_col a B' A' C' H4 H1 H21). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(B <> C). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: not (@eq (@Tpoint Tn) B C) *) intro. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: False *) subst C. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: False *) apply HH. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @Col Tn B A B *) Col. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(B' <> C'). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: not (@eq (@Tpoint Tn) B' C') *) intro. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: False *) subst C'. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: False *) apply HP. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @Col Tn B' A' B' *) Col. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(HQ:= anga_distincts a B A C H4 H18). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(HR:= anga_distincts a B' A' C' H4 H21). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) spliter. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(Cong A B A' B'). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @Cong Tn A B A' B' *) apply (lg_cong lp); auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(CongA B A C B' A' C'). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @CongA Tn B A C B' A' C' *) apply (anga_conga a); auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(CongA C B A C' B' A'). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @CongA Tn C B A C' B' A' *) apply l11_16; auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) assert(Cong A C A' C' /\ Cong B C B' C' /\ CongA A C B A' C' B'). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: and (@Cong Tn A C A' C') (and (@Cong Tn B C B' C') (@CongA Tn A C B A' C' B')) *) apply(l11_50_1 A B C A' B' C'); auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @CongA Tn A B C A' B' C' *) (* Goal: not (@Col Tn A B C) *) intro. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @CongA Tn A B C A' B' C' *) (* Goal: False *) apply HH. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @CongA Tn A B C A' B' C' *) (* Goal: @Col Tn B A C *) Col. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @CongA Tn A B C A' B' C' *) apply conga_comm. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) (* Goal: @CongA Tn C B A C' B' A' *) auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) spliter. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @EqL Tn l1 l2 *) apply (all_eql A' C'). (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @Len Tn A' C' l2 *) (* Goal: @Len Tn A' C' l1 *) split; auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: @Len Tn A' C' l2 *) split; auto. (* Goal: @Q_CongA_Acute Tn a *) (* Goal: l2 A' C' *) eapply (lg_cong_lg _ A C); auto. (* Goal: @Q_CongA_Acute Tn a *) unfold Lcos in *;intuition. Qed. Lemma lcos3_lcos2 : forall l1 l2 a b c d n, Eq_Lcos3 l1 a b n l2 c d n -> Eq_Lcos2 l1 a b l2 c d. Proof. (* Goal: forall (l1 l2 : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (a b c d n : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (_ : @Eq_Lcos3 Tn l1 a b n l2 c d n), @Eq_Lcos2 Tn l1 a b l2 c d *) intros. (* Goal: @Eq_Lcos2 Tn l1 a b l2 c d *) unfold Eq_Lcos3 in H. (* Goal: @Eq_Lcos2 Tn l1 a b l2 c d *) ex_and H lp. (* Goal: @Eq_Lcos2 Tn l1 a b l2 c d *) unfold Eq_Lcos2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp l1 a b) (@Lcos2 Tn lp l2 c d)) *) apply lcos3_lcos_2_1 in H. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp l1 a b) (@Lcos2 Tn lp l2 c d)) *) apply lcos3_lcos_2_1 in H0. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp l1 a b) (@Lcos2 Tn lp l2 c d)) *) ex_and H ll1. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp l1 a b) (@Lcos2 Tn lp l2 c d)) *) ex_and H0 ll2. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp l1 a b) (@Lcos2 Tn lp l2 c d)) *) assert (EqL ll1 ll2). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp l1 a b) (@Lcos2 Tn lp l2 c d)) *) (* Goal: @EqL Tn ll1 ll2 *) eapply(l13_6_bis lp _ _ n); auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp l1 a b) (@Lcos2 Tn lp l2 c d)) *) exists ll1. (* Goal: and (@Lcos2 Tn ll1 l1 a b) (@Lcos2 Tn ll1 l2 c d) *) split; auto. (* Goal: @Lcos2 Tn ll1 l2 c d *) apply lcos2_lg_anga in H. (* Goal: @Lcos2 Tn ll1 l2 c d *) apply lcos2_lg_anga in H0. (* Goal: @Lcos2 Tn ll1 l2 c d *) spliter. (* Goal: @Lcos2 Tn ll1 l2 c d *) apply(lcos2_eql_lcos2 l2 l2 ll2 ll1 c d); auto. (* Goal: @EqL Tn ll2 ll1 *) (* Goal: @EqL Tn l2 l2 *) reflexivity. (* Goal: @EqL Tn ll2 ll1 *) symmetry; auto. Qed. Lemma lcos2_lcos : forall l1 l2 a b c, Eq_Lcos2 l1 a c l2 b c -> Eq_Lcos l1 a l2 b. Proof. (* Goal: forall (l1 l2 : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (a b c : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (_ : @Eq_Lcos2 Tn l1 a c l2 b c), @Eq_Lcos Tn l1 a l2 b *) intros. (* Goal: @Eq_Lcos Tn l1 a l2 b *) unfold Eq_Lcos2 in H. (* Goal: @Eq_Lcos Tn l1 a l2 b *) ex_and H lp. (* Goal: @Eq_Lcos Tn l1 a l2 b *) unfold Lcos2 in H. (* Goal: @Eq_Lcos Tn l1 a l2 b *) unfold Lcos2 in H0. (* Goal: @Eq_Lcos Tn l1 a l2 b *) ex_and H lx. (* Goal: @Eq_Lcos Tn l1 a l2 b *) ex_and H0 ly. (* Goal: @Eq_Lcos Tn l1 a l2 b *) unfold Eq_Lcos. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp l1 a) (@Lcos Tn lp l2 b)) *) assert(EqL lx ly). (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp l1 a) (@Lcos Tn lp l2 b)) *) (* Goal: @EqL Tn lx ly *) eapply(l13_6_bis lp _ _ c); auto. (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp l1 a) (@Lcos Tn lp l2 b)) *) exists lx. (* Goal: and (@Lcos Tn lx l1 a) (@Lcos Tn lx l2 b) *) split; auto. (* Goal: @Lcos Tn lx l2 b *) apply lcos_lg_anga in H. (* Goal: @Lcos Tn lx l2 b *) apply lcos_lg_anga in H0. (* Goal: @Lcos Tn lx l2 b *) spliter. (* Goal: @Lcos Tn lx l2 b *) rewrite H3;auto. Qed. Lemma lcos_per_anga : forall O A P la lp a, Lcos lp la a -> la O A -> lp O P -> Per A P O -> a A O P. Proof. (* Goal: forall (O A P : @Tpoint Tn) (la lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (_ : @Lcos Tn lp la a) (_ : la O A) (_ : lp O P) (_ : @Per Tn A P O), a A O P *) intros. (* Goal: a A O P *) assert(HH:= H). (* Goal: a A O P *) unfold Lcos in HH. (* Goal: a A O P *) spliter. (* Goal: a A O P *) ex_and H6 O'. (* Goal: a A O P *) ex_and H7 P'. (* Goal: a A O P *) ex_and H6 A'. (* Goal: a A O P *) assert(Cong O A O' A'). (* Goal: a A O P *) (* Goal: @Cong Tn O A O' A' *) apply (lg_cong la); auto. (* Goal: a A O P *) assert(Cong O P O' P'). (* Goal: a A O P *) (* Goal: @Cong Tn O P O' P' *) apply (lg_cong lp); auto. (* Goal: a A O P *) assert(HH:= lcos_lg_not_null lp la a H). (* Goal: a A O P *) spliter. (* Goal: a A O P *) induction(eq_dec_points A P). (* Goal: a A O P *) (* Goal: a A O P *) subst A. (* Goal: a A O P *) (* Goal: a P O P *) assert(Cong O' A' O' P'). (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @Cong Tn O' A' O' P' *) apply (cong_transitivity _ _ O P); Cong. (* Goal: a A O P *) (* Goal: a P O P *) assert(A' = P'). (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) induction(col_dec A' P' O'). (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: @eq (@Tpoint Tn) A' P' *) assert(A' = P' \/ O' = P'). (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: or (@eq (@Tpoint Tn) A' P') (@eq (@Tpoint Tn) O' P') *) apply l8_9; auto. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: @eq (@Tpoint Tn) A' P' *) induction H16. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: @eq (@Tpoint Tn) A' P' *) auto. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: @eq (@Tpoint Tn) A' P' *) subst P'. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: @eq (@Tpoint Tn) A' O' *) eapply (cong_identity _ O' O'); Cong. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) assert(Lt P' A' A' O' /\ Lt P' O' A' O'). (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) (* Goal: and (@Lt Tn P' A' A' O') (@Lt Tn P' O' A' O') *) assert_diffs; apply(l11_46 A' P' O'); auto. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) spliter. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) unfold Lt in H17. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) spliter. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @eq (@Tpoint Tn) A' P' *) apply False_ind. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: False *) apply H18. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @Cong Tn P' O' A' O' *) Cong. (* Goal: a A O P *) (* Goal: a P O P *) subst A'. (* Goal: a A O P *) (* Goal: a P O P *) assert(Q_CongA_Null_Acute a). (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) apply(out_null_anga a P' O' P'); auto. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @Out Tn O' P' P' *) apply out_trivial. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: not (@eq (@Tpoint Tn) P' O') *) intro. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: False *) subst P'. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: False *) apply H12. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @Q_Cong_Null Tn lp *) unfold Q_Cong_Null. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: and (@Q_Cong Tn lp) (@ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A)) *) split. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A) *) (* Goal: @Q_Cong Tn lp *) auto. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A) *) exists O'. (* Goal: a A O P *) (* Goal: a P O P *) (* Goal: lp O' O' *) auto. (* Goal: a A O P *) (* Goal: a P O P *) apply(is_null_all a P O). (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: not (@eq (@Tpoint Tn) P O) *) intro. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: False *) subst P. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: False *) apply H12. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: @Q_Cong_Null Tn lp *) unfold Q_Cong_Null. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: and (@Q_Cong Tn lp) (@ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A)) *) split. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A) *) (* Goal: @Q_Cong Tn lp *) auto. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A) *) exists O. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) (* Goal: lp O O *) auto. (* Goal: a A O P *) (* Goal: @Q_CongA_Null_Acute Tn a *) auto. (* Goal: a A O P *) assert(O <> P). (* Goal: a A O P *) (* Goal: not (@eq (@Tpoint Tn) O P) *) intro. (* Goal: a A O P *) (* Goal: False *) subst P. (* Goal: a A O P *) (* Goal: False *) apply H12. (* Goal: a A O P *) (* Goal: @Q_Cong_Null Tn lp *) split. (* Goal: a A O P *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A) *) (* Goal: @Q_Cong Tn lp *) auto. (* Goal: a A O P *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A) *) exists O. (* Goal: a A O P *) (* Goal: lp O O *) auto. (* Goal: a A O P *) induction(col_dec A P O). (* Goal: a A O P *) (* Goal: a A O P *) assert (HH:=anga_distincts a P' O' A' H5 H9). (* Goal: a A O P *) (* Goal: a A O P *) spliter. (* Goal: a A O P *) (* Goal: a A O P *) assert(A' <> P'). (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) intro. (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: False *) subst A'. (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: False *) assert(A = P \/ O = P). (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: False *) (* Goal: or (@eq (@Tpoint Tn) A P) (@eq (@Tpoint Tn) O P) *) apply l8_9; auto. (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: False *) induction H19. (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: False *) (* Goal: False *) auto. (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: False *) contradiction. (* Goal: a A O P *) (* Goal: a A O P *) assert(~ Col A P O). (* Goal: a A O P *) (* Goal: a A O P *) (* Goal: not (@Col Tn A P O) *) apply(per_not_col A P O); auto. (* Goal: a A O P *) (* Goal: a A O P *) contradiction. (* Goal: a A O P *) assert (HH:=anga_distincts a P' O' A' H5 H9). (* Goal: a A O P *) spliter. (* Goal: a A O P *) assert(A' <> P'). (* Goal: a A O P *) (* Goal: not (@eq (@Tpoint Tn) A' P') *) intro. (* Goal: a A O P *) (* Goal: False *) subst A'. (* Goal: a A O P *) (* Goal: False *) assert(Cong O P O A). (* Goal: a A O P *) (* Goal: False *) (* Goal: @Cong Tn O P O A *) apply (cong_transitivity _ _ O' P'); Cong. (* Goal: a A O P *) (* Goal: False *) assert(Lt P A A O /\ Lt P O A O). (* Goal: a A O P *) (* Goal: False *) (* Goal: and (@Lt Tn P A A O) (@Lt Tn P O A O) *) assert_diffs; apply(l11_46 A P O); auto. (* Goal: a A O P *) (* Goal: False *) spliter. (* Goal: a A O P *) (* Goal: False *) unfold Lt in H21. (* Goal: a A O P *) (* Goal: False *) spliter. (* Goal: a A O P *) (* Goal: False *) apply H22. (* Goal: a A O P *) (* Goal: @Cong Tn P O A O *) Cong. (* Goal: a A O P *) assert(CongA A P O A' P' O'). (* Goal: a A O P *) (* Goal: @CongA Tn A P O A' P' O' *) apply l11_16; auto. (* Goal: a A O P *) assert(Cong P A P' A' /\ CongA P A O P' A' O' /\ CongA P O A P' O' A'). (* Goal: a A O P *) (* Goal: and (@Cong Tn P A P' A') (and (@CongA Tn P A O P' A' O') (@CongA Tn P O A P' O' A')) *) assert(Lt P A A O /\ Lt P O A O). (* Goal: a A O P *) (* Goal: and (@Cong Tn P A P' A') (and (@CongA Tn P A O P' A' O') (@CongA Tn P O A P' O' A')) *) (* Goal: and (@Lt Tn P A A O) (@Lt Tn P O A O) *) assert_diffs; apply(l11_46 A P O); auto. (* Goal: a A O P *) (* Goal: and (@Cong Tn P A P' A') (and (@CongA Tn P A O P' A' O') (@CongA Tn P O A P' O' A')) *) spliter. (* Goal: a A O P *) (* Goal: and (@Cong Tn P A P' A') (and (@CongA Tn P A O P' A' O') (@CongA Tn P O A P' O' A')) *) unfold Lt in H22. (* Goal: a A O P *) (* Goal: and (@Cong Tn P A P' A') (and (@CongA Tn P A O P' A' O') (@CongA Tn P O A P' O' A')) *) spliter. (* Goal: a A O P *) (* Goal: and (@Cong Tn P A P' A') (and (@CongA Tn P A O P' A' O') (@CongA Tn P O A P' O' A')) *) apply(l11_52 A P O A' P' O' ); Cong. (* Goal: a A O P *) spliter. (* Goal: a A O P *) apply conga_comm in H23. (* Goal: a A O P *) apply (anga_conga_anga a A' O' P'); auto. (* Goal: @CongA Tn A' O' P' A O P *) (* Goal: a A' O' P' *) apply (anga_sym a); auto. (* Goal: @CongA Tn A' O' P' A O P *) apply conga_sym. (* Goal: @CongA Tn A O P A' O' P' *) auto. Qed. Lemma lcos_lcos_cop__col : forall la lb lp a b O A B P, Lcos lp la a -> Lcos lp lb b -> la O A -> lb O B -> lp O P -> a A O P -> b B O P -> Coplanar O A B P -> Col A B P. Proof. (* Goal: forall (la lb lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (a b : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (O A B P : @Tpoint Tn) (_ : @Lcos Tn lp la a) (_ : @Lcos Tn lp lb b) (_ : la O A) (_ : lb O B) (_ : lp O P) (_ : a A O P) (_ : b B O P) (_ : @Coplanar Tn O A B P), @Col Tn A B P *) intros. (* Goal: @Col Tn A B P *) apply lcos_lg_anga in H. (* Goal: @Col Tn A B P *) apply lcos_lg_anga in H0. (* Goal: @Col Tn A B P *) spliter. (* Goal: @Col Tn A B P *) assert(Per O P A). (* Goal: @Col Tn A B P *) (* Goal: @Per Tn O P A *) apply (lcos_per O P A lp la a); auto. (* Goal: @Col Tn A B P *) (* Goal: a P O A *) apply anga_sym; auto. (* Goal: @Col Tn A B P *) assert(Per O P B). (* Goal: @Col Tn A B P *) (* Goal: @Per Tn O P B *) apply (lcos_per O P B lp lb b); auto. (* Goal: @Col Tn A B P *) (* Goal: b P O B *) apply anga_sym; auto. (* Goal: @Col Tn A B P *) apply cop_per2__col with O; Perp. (* Goal: not (@eq (@Tpoint Tn) O P) *) intro. (* Goal: False *) subst P. (* Goal: False *) assert(HH:=lcos_lg_not_null lp la a H). (* Goal: False *) spliter. (* Goal: False *) apply H15. (* Goal: @Q_Cong_Null Tn lp *) unfold Q_Cong_Null. (* Goal: and (@Q_Cong Tn lp) (@ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A)) *) split; auto. (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => lp A A) *) exists O. (* Goal: lp O O *) auto. Qed. Lemma per13_preserves_bet_inv : forall A B C A' C', Bet A' B C' -> B <> A' -> B <> C' -> Col A B C -> Per B A' A -> Per B C' C -> Bet A B C. Proof. (* Goal: forall (A B C A' C' : @Tpoint Tn) (_ : @Bet Tn A' B C') (_ : not (@eq (@Tpoint Tn) B A')) (_ : not (@eq (@Tpoint Tn) B C')) (_ : @Col Tn A B C) (_ : @Per Tn B A' A) (_ : @Per Tn B C' C), @Bet Tn A B C *) intros. (* Goal: @Bet Tn A B C *) assert(Col A' B C'). (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn A' B C' *) apply bet_col in H. (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn A' B C' *) Col. (* Goal: @Bet Tn A B C *) induction(eq_dec_points A A'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst A'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Col B C' C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn B C' C *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HH:=l8_9 B C' C H4 H6 ). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction HH. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) contradiction. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assumption. (* Goal: @Bet Tn A B C *) assert(C <> C'). (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) C C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: False *) assert(Col B A' A). (* Goal: @Bet Tn A B C *) (* Goal: False *) (* Goal: @Col Tn B A' A *) ColR. (* Goal: @Bet Tn A B C *) (* Goal: False *) assert(HH:=l8_9 B A' A H3 H7). (* Goal: @Bet Tn A B C *) (* Goal: False *) induction HH; contradiction. (* Goal: @Bet Tn A B C *) assert(Perp B A' A' A). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' A' A *) apply per_perp_in in H3; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' A' A *) apply perp_in_comm in H3. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' A' A *) apply perp_in_perp_bis in H3. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' A' A *) induction H3. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' A' A *) (* Goal: @Perp Tn B A' A' A *) Perp. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' A' A *) apply perp_distinct in H3. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' A' A *) tauto. (* Goal: @Bet Tn A B C *) assert(Perp B C' C' C). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B C' C' C *) apply per_perp_in in H4; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B C' C' C *) apply perp_in_comm in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B C' C' C *) apply perp_in_perp_bis in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B C' C' C *) induction H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B C' C' C *) (* Goal: @Perp Tn B C' C' C *) Perp. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B C' C' C *) apply perp_distinct in H4. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B C' C' C *) tauto. (* Goal: @Bet Tn A B C *) assert(Par A A' C C'). (* Goal: @Bet Tn A B C *) (* Goal: @Par Tn A A' C C' *) apply(l12_9 A A' C C' B A'); Perp; Cop. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn C C' B A' *) apply perp_sym. (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn B A' C C' *) apply(perp_col _ C'); Perp. (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn B C' A' *) ColR. (* Goal: @Bet Tn A B C *) induction H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HH:=par_strict_symmetry A A' C C' H10). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply l12_6 in H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply l12_6 in HH. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(~Col A' A B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A' A B) *) apply per_not_col in H3; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn A' A B) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H3. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn B A' A *) Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(~Col C' C B). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn C' C B) *) apply per_not_col in H4; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: not (@Col Tn C' C B) *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H4. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Col Tn B C' C *) Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(OS A' A B C'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn A' A B C' *) apply out_one_side. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn A' B C' *) (* Goal: or (not (@Col Tn A' A B)) (not (@Col Tn A' A C')) *) left; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn A' B C' *) repeat split. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: not (@eq (@Tpoint Tn) B A') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: False *) subst A'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: False *) apply H11. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) (* Goal: @Col Tn B A B *) Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: not (@eq (@Tpoint Tn) C' A') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) apply one_side_symmetry in H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) unfold OS in H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) ex_and H10 X. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) unfold TS in H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) spliter. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: False *) apply H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) (* Goal: @Col Tn A' A A' *) Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn A' B C') (@Bet Tn A' C' B) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A' B C' *) assumption. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(OS C' C B A'). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn C' C B A' *) apply out_one_side. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C' B A' *) (* Goal: or (not (@Col Tn C' C B)) (not (@Col Tn C' C A')) *) left; auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C' B A' *) repeat split. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: not (@eq (@Tpoint Tn) B C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: False *) apply H12. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) (* Goal: @Col Tn B C B *) Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) apply one_side_symmetry in H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) unfold OS in H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) ex_and H10 X. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) unfold TS in H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) spliter. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: False *) apply H10. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) (* Goal: @Col Tn A' A A' *) Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: or (@Bet Tn C' B A') (@Bet Tn C' A' B) *) left. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn C' B A' *) Between. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(OS A' A B C). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn A' A B C *) apply(one_side_transitivity _ _ _ C'); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn A' A C' C *) apply invert_one_side. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn A A' C' C *) apply one_side_symmetry. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn A A' C C' *) assumption. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(OS C C' B A). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn C C' B A *) apply(one_side_transitivity _ _ _ A'); auto. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn C C' A' A *) (* Goal: @OS Tn C C' B A' *) apply invert_one_side. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn C C' A' A *) (* Goal: @OS Tn C' C B A' *) assumption. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn C C' A' A *) apply one_side_symmetry. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @OS Tn C C' A A' *) assumption. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply invert_one_side in H15. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(HP:= col_one_side_out A A' B C H2 H15). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) assert(Out C B A). (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Out Tn C B A *) apply(col_one_side_out C C' B A); Col. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) unfold Out in *. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) spliter. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction H19. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) Between. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) induction H22. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) Between. (* Goal: @Bet Tn A B C *) (* Goal: @Bet Tn A B C *) apply False_ind. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply H18. (* Goal: @Bet Tn A B C *) (* Goal: @eq (@Tpoint Tn) A C *) apply (between_equality _ _ B); Between. (* Goal: @Bet Tn A B C *) spliter. (* Goal: @Bet Tn A B C *) assert(Perp A' C' A A'). (* Goal: @Bet Tn A B C *) (* Goal: @Perp Tn A' C' A A' *) apply (perp_col _ B); Perp. (* Goal: @Bet Tn A B C *) (* Goal: not (@eq (@Tpoint Tn) A' C') *) intro. (* Goal: @Bet Tn A B C *) (* Goal: False *) subst C'. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply between_identity in H. (* Goal: @Bet Tn A B C *) (* Goal: False *) subst A'. (* Goal: @Bet Tn A B C *) (* Goal: False *) apply perp_distinct in H9. (* Goal: @Bet Tn A B C *) (* Goal: False *) tauto. (* Goal: @Bet Tn A B C *) apply perp_not_col in H14. (* Goal: @Bet Tn A B C *) apply False_ind. (* Goal: False *) apply H14. (* Goal: @Col Tn A' C' A *) ColR. Qed. Lemma l13_10_aux3 : forall A B C A' B' C' O, ~ Col O A A' -> B <> O -> C <> O -> Col O A B -> Col O B C -> B' <> O -> C' <> O -> Col O A' B' -> Col O B' C' -> Perp2 B C' C B' O -> Perp2 C A' A C' O -> Bet A O B -> Bet A' O B'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn O A A')) (_ : not (@eq (@Tpoint Tn) B O)) (_ : not (@eq (@Tpoint Tn) C O)) (_ : @Col Tn O A B) (_ : @Col Tn O B C) (_ : not (@eq (@Tpoint Tn) B' O)) (_ : not (@eq (@Tpoint Tn) C' O)) (_ : @Col Tn O A' B') (_ : @Col Tn O B' C') (_ : @Perp2 Tn B C' C B' O) (_ : @Perp2 Tn C A' A C' O) (_ : @Bet Tn A O B), @Bet Tn A' O B' *) intros. (* Goal: @Bet Tn A' O B' *) assert(A <> O). (* Goal: @Bet Tn A' O B' *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: False *) subst A. (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O O A' *) Col. (* Goal: @Bet Tn A' O B' *) assert(A' <> O). (* Goal: @Bet Tn A' O B' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: False *) subst A'. (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A O *) Col. (* Goal: @Bet Tn A' O B' *) assert(Col O A C). (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A C *) apply (col_transitivity_1 _ B); Col. (* Goal: @Bet Tn A' O B' *) assert(Col O A' C'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A' C' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Bet Tn A' O B' *) assert(Bet C A O \/ Bet A C O \/ Bet O C B \/ Bet O B C). (* Goal: @Bet Tn A' O B' *) (* Goal: or (@Bet Tn C A O) (or (@Bet Tn A C O) (or (@Bet Tn O C B) (@Bet Tn O B C))) *) apply(fourth_point A O B C); auto. (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn A O C *) ColR. (* Goal: @Bet Tn A' O B' *) induction H15. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet O C' A'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn O C' A' *) apply(perp2_preserves_bet23 O A C C' A'); Between. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: not (@Col Tn O A C') *) (* Goal: @Col Tn O C' A' *) Col. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: not (@Col Tn O A C') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn A C' C A' O *) apply perp2_sym. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn C A' A C' O *) auto. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet B' O C'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn B' O C' *) apply(perp2_preserves_bet13 O B C B' C'); eBetween. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O B B') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) eBetween. (* Goal: @Bet Tn A' O B' *) induction H15. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet C O B). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn C O B *) eBetween. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet O A' C'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn O A' C' *) apply(perp2_preserves_bet23 O C A A' C'); Between. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O C A') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet B' O C'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn B' O C' *) apply(perp2_preserves_bet13 O B C B' C'); Between. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O B B') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) eBetween. (* Goal: @Bet Tn A' O B' *) induction H15. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet A O C). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A O C *) eBetween. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet O B' C'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn O B' C' *) apply(perp2_preserves_bet23 O C B B' C'); Between. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: not (@Col Tn O C B') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn C B' B C' O *) apply perp2_sym. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Perp2 Tn B C' C B' O *) auto. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) assert(Bet C' O A'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn C' O A' *) apply(perp2_preserves_bet13 O C A C' A'); Col. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O C C') *) (* Goal: @Bet Tn C O A *) Between. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O C C') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A' O B' *) eBetween. (* Goal: @Bet Tn A' O B' *) assert(Bet A O C). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn A O C *) eBetween. (* Goal: @Bet Tn A' O B' *) assert(Bet O C' B'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn O C' B' *) apply(perp2_preserves_bet23 O B C C' B'); Col. (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O B C') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) assert(Bet C' O A'). (* Goal: @Bet Tn A' O B' *) (* Goal: @Bet Tn C' O A' *) apply(perp2_preserves_bet13 O C A C' A'); Col. (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O C C') *) (* Goal: @Bet Tn C O A *) Between. (* Goal: @Bet Tn A' O B' *) (* Goal: not (@Col Tn O C C') *) intro. (* Goal: @Bet Tn A' O B' *) (* Goal: False *) apply H. (* Goal: @Bet Tn A' O B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Bet Tn A' O B' *) eBetween. Qed. Lemma l13_10_aux4 : forall A B C A' B' C' O, ~ Col O A A' -> B <> O -> C <> O -> Col O A B -> Col O B C -> B' <> O -> C' <> O -> Col O A' B' -> Col O B' C' -> Perp2 B C' C B' O -> Perp2 C A' A C' O -> Bet O A B -> Out O A' B'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn O A A')) (_ : not (@eq (@Tpoint Tn) B O)) (_ : not (@eq (@Tpoint Tn) C O)) (_ : @Col Tn O A B) (_ : @Col Tn O B C) (_ : not (@eq (@Tpoint Tn) B' O)) (_ : not (@eq (@Tpoint Tn) C' O)) (_ : @Col Tn O A' B') (_ : @Col Tn O B' C') (_ : @Perp2 Tn B C' C B' O) (_ : @Perp2 Tn C A' A C' O) (_ : @Bet Tn O A B), @Out Tn O A' B' *) intros. (* Goal: @Out Tn O A' B' *) assert(A <> O). (* Goal: @Out Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: False *) subst A. (* Goal: @Out Tn O A' B' *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O O A' *) Col. (* Goal: @Out Tn O A' B' *) assert(A' <> O). (* Goal: @Out Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: False *) subst A'. (* Goal: @Out Tn O A' B' *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O A O *) Col. (* Goal: @Out Tn O A' B' *) assert(Col O A C). (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O A C *) ColR. (* Goal: @Out Tn O A' B' *) induction(eq_dec_points A B). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) subst B. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert (HH : Par C A' C B'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) assert(~ Col A C' O). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) (* Goal: not (@Col Tn A C' O) *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) assert(HH:= perp2_pseudo_trans C A' A C' C B' O H9 H8 H14). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) ex_and HH X. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) ex_and H15 Y. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Par Tn C A' C B' *) apply (l12_9 _ _ _ _ X Y); Perp. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' C *) (* Goal: @Coplanar Tn X Y C B' *) (* Goal: @Coplanar Tn X Y C C *) Cop. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' C *) (* Goal: @Coplanar Tn X Y C B' *) Cop. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) (* Goal: @Coplanar Tn X Y A' C *) Cop. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Coplanar Tn X Y A' B' *) exists O. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: or (and (@Col Tn X Y O) (@Col Tn A' B' O)) (or (and (@Col Tn X A' O) (@Col Tn Y B' O)) (and (@Col Tn X B' O) (@Col Tn Y A' O))) *) left. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: and (@Col Tn X Y O) (@Col Tn A' B' O) *) split; Col. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(A' = B'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) assert(Col A' B' C). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) (* Goal: @Col Tn A' B' C *) induction HH. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) (* Goal: @Col Tn A' B' C *) (* Goal: @Col Tn A' B' C *) apply False_ind. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) (* Goal: @Col Tn A' B' C *) (* Goal: False *) apply H14. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) (* Goal: @Col Tn A' B' C *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Col Tn X C A') (@Col Tn X C B')) *) exists C. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) (* Goal: @Col Tn A' B' C *) (* Goal: and (@Col Tn C C A') (@Col Tn C C B') *) split; Col. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) (* Goal: @Col Tn A' B' C *) spliter. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) (* Goal: @Col Tn A' B' C *) Col. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @eq (@Tpoint Tn) A' B' *) apply (l6_21 O C' C B'); Col. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) (* Goal: not (@eq (@Tpoint Tn) C B') *) (* Goal: not (@Col Tn O C' C) *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) (* Goal: not (@eq (@Tpoint Tn) C B') *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) (* Goal: not (@eq (@Tpoint Tn) C B') *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) (* Goal: not (@eq (@Tpoint Tn) C B') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) (* Goal: False *) subst B'. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) (* Goal: False *) apply par_distinct in HH. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) (* Goal: False *) tauto. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O C' A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) subst B'. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' A' *) apply out_trivial. (* Goal: @Out Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) auto. (* Goal: @Out Tn O A' B' *) assert(Bet C O A \/ Bet O C A \/ Bet A C B \/ Bet A B C). (* Goal: @Out Tn O A' B' *) (* Goal: or (@Bet Tn C O A) (or (@Bet Tn O C A) (or (@Bet Tn A C B) (@Bet Tn A B C))) *) apply(fourth_point O A B C); auto. (* Goal: @Out Tn O A' B' *) induction H15. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet B' O C'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn B' O C' *) assert(Bet C O B). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn B' O C' *) (* Goal: @Bet Tn C O B *) eBetween. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn B' O C' *) apply(perp2_preserves_bet13 O B C B' C'); Between. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: not (@Col Tn O B B') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet A' O C'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn A' O C' *) apply(perp2_preserves_bet13 O A C A' C');Between. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) apply perp2_sym. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C A' A C' O *) assumption. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) repeat split; auto. (* Goal: @Out Tn O A' B' *) (* Goal: or (@Bet Tn O A' B') (@Bet Tn O B' A') *) apply(l5_2 C' O A' B'); Between. (* Goal: @Out Tn O A' B' *) induction H15. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet O C B). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O C B *) eBetween. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet O B' C'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O B' C' *) apply(perp2_preserves_bet23 O C B B' C'); Col. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: not (@Col Tn O C B') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) apply perp2_sym. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn B C' C B' O *) auto. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet O A' C'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O A' C' *) apply(perp2_preserves_bet23 O C A A' C'); Between. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: not (@Col Tn O C A') *) (* Goal: @Col Tn O A' C' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: not (@Col Tn O C A') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) repeat split; auto. (* Goal: @Out Tn O A' B' *) (* Goal: or (@Bet Tn O A' B') (@Bet Tn O B' A') *) apply(l5_3 O A' B' C'); auto. (* Goal: @Out Tn O A' B' *) induction H15. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet O A C). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O A C *) eBetween. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet O C' A'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O C' A' *) apply(perp2_preserves_bet23 O A C C' A'); auto. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: not (@Col Tn O A C') *) (* Goal: @Col Tn O C' A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: not (@Col Tn O A C') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) apply perp2_sym. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C A' A C' O *) auto. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet O C B). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O C B *) eBetween. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) assert(Bet O B' C'). (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O B' C' *) apply(perp2_preserves_bet23 O C B B' C'); auto. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: not (@Col Tn O C B') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C B' B C' O *) apply perp2_sym. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn B C' C B' O *) auto. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) repeat split; auto. (* Goal: @Out Tn O A' B' *) (* Goal: or (@Bet Tn O A' B') (@Bet Tn O B' A') *) right. (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O B' A' *) eBetween. (* Goal: @Out Tn O A' B' *) assert(Bet O A C). (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O A C *) eBetween. (* Goal: @Out Tn O A' B' *) assert( Bet O B C). (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O B C *) eBetween. (* Goal: @Out Tn O A' B' *) assert(Bet O C' B'). (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O C' B' *) apply(perp2_preserves_bet23 O B C C' B'); Col. (* Goal: @Out Tn O A' B' *) (* Goal: not (@Col Tn O B C') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) assert(Bet O C' A'). (* Goal: @Out Tn O A' B' *) (* Goal: @Bet Tn O C' A' *) apply(perp2_preserves_bet23 O A C C' A'); auto. (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: not (@Col Tn O A C') *) (* Goal: @Col Tn O C' A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: not (@Col Tn O A C') *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn A C' C A' O *) apply perp2_sym. (* Goal: @Out Tn O A' B' *) (* Goal: @Perp2 Tn C A' A C' O *) auto. (* Goal: @Out Tn O A' B' *) repeat split; auto. (* Goal: or (@Bet Tn O A' B') (@Bet Tn O B' A') *) apply (l5_1 _ C'); auto. Qed. Lemma l13_10_aux5 : forall A B C A' B' C' O, ~ Col O A A' -> B <> O -> C <> O -> Col O A B -> Col O B C -> B' <> O -> C' <> O -> Col O A' B' -> Col O B' C'-> Perp2 B C' C B' O -> Perp2 C A' A C' O -> Out O A B -> Out O A' B'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn O A A')) (_ : not (@eq (@Tpoint Tn) B O)) (_ : not (@eq (@Tpoint Tn) C O)) (_ : @Col Tn O A B) (_ : @Col Tn O B C) (_ : not (@eq (@Tpoint Tn) B' O)) (_ : not (@eq (@Tpoint Tn) C' O)) (_ : @Col Tn O A' B') (_ : @Col Tn O B' C') (_ : @Perp2 Tn B C' C B' O) (_ : @Perp2 Tn C A' A C' O) (_ : @Out Tn O A B), @Out Tn O A' B' *) intros. (* Goal: @Out Tn O A' B' *) assert(A' <> O). (* Goal: @Out Tn O A' B' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: @Out Tn O A' B' *) (* Goal: False *) subst A'. (* Goal: @Out Tn O A' B' *) (* Goal: False *) apply H. (* Goal: @Out Tn O A' B' *) (* Goal: @Col Tn O A O *) Col. (* Goal: @Out Tn O A' B' *) induction H10. (* Goal: @Out Tn O A' B' *) spliter. (* Goal: @Out Tn O A' B' *) induction H13. (* Goal: @Out Tn O A' B' *) (* Goal: @Out Tn O A' B' *) eapply (l13_10_aux4 A B C _ _ C'); auto. (* Goal: @Out Tn O A' B' *) apply l6_6. (* Goal: @Out Tn O B' A' *) apply(l13_10_aux4 B A C B' A' C'); try assumption. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O B' A' *) (* Goal: @Col Tn O A C *) (* Goal: @Col Tn O B A *) (* Goal: not (@Col Tn O B B') *) intro. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O B' A' *) (* Goal: @Col Tn O A C *) (* Goal: @Col Tn O B A *) (* Goal: False *) apply H. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O B' A' *) (* Goal: @Col Tn O A C *) (* Goal: @Col Tn O B A *) (* Goal: @Col Tn O A A' *) ColR. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O B' A' *) (* Goal: @Col Tn O A C *) (* Goal: @Col Tn O B A *) Col. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O B' A' *) (* Goal: @Col Tn O A C *) ColR. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) (* Goal: @Col Tn O B' A' *) Col. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A' C' *) ColR. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) apply perp2_sym. (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn C A' A C' O *) assumption. (* Goal: @Perp2 Tn C B' B C' O *) apply perp2_sym. (* Goal: @Perp2 Tn B C' C B' O *) auto. Qed. Lemma cop_per2__perp : forall A B X Y, A <> B -> X <> Y -> (B <> X \/ B <> Y) -> Coplanar A B X Y -> Per A B X -> Per A B Y -> Perp A B X Y. Proof. (* Goal: forall (A B X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) X Y)) (_ : or (not (@eq (@Tpoint Tn) B X)) (not (@eq (@Tpoint Tn) B Y))) (_ : @Coplanar Tn A B X Y) (_ : @Per Tn A B X) (_ : @Per Tn A B Y), @Perp Tn A B X Y *) intros. (* Goal: @Perp Tn A B X Y *) induction H1. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) assert(HH:=H3). (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) apply per_perp_in in H3; auto. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) apply perp_in_perp_bis in H3. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) induction H3. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) apply perp_not_eq_1 in H3. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) tauto. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) apply perp_sym. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn X Y A B *) apply (perp_col _ B); auto. (* Goal: @Perp Tn A B X Y *) (* Goal: @Col Tn X B Y *) (* Goal: @Perp Tn X B A B *) Perp. (* Goal: @Perp Tn A B X Y *) (* Goal: @Col Tn X B Y *) apply col_permutation_5. (* Goal: @Perp Tn A B X Y *) (* Goal: @Col Tn X Y B *) apply cop_per2__col with A; Perp; Cop. (* Goal: @Perp Tn A B X Y *) assert(HH:=H4). (* Goal: @Perp Tn A B X Y *) apply per_perp_in in H4; auto. (* Goal: @Perp Tn A B X Y *) apply perp_in_perp_bis in H4. (* Goal: @Perp Tn A B X Y *) induction H4. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) apply perp_not_eq_1 in H4. (* Goal: @Perp Tn A B X Y *) (* Goal: @Perp Tn A B X Y *) tauto. (* Goal: @Perp Tn A B X Y *) apply perp_sym. (* Goal: @Perp Tn X Y A B *) apply perp_left_comm. (* Goal: @Perp Tn Y X A B *) apply (perp_col _ B); auto. (* Goal: @Col Tn Y B X *) (* Goal: @Perp Tn Y B A B *) Perp. (* Goal: @Col Tn Y B X *) apply col_permutation_5. (* Goal: @Col Tn Y X B *) eapply cop_per2__col with A; Perp; Cop. Qed. Lemma l13_10 : forall A B C A' B' C' O, ~ Col O A A' -> B <> O -> C <> O -> Col O A B -> Col O B C -> B' <> O -> C' <> O -> Col O A' B' -> Col O B' C' -> Perp2 B C' C B' O -> Perp2 C A' A C' O -> Perp2 A B' B A' O. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn O A A')) (_ : not (@eq (@Tpoint Tn) B O)) (_ : not (@eq (@Tpoint Tn) C O)) (_ : @Col Tn O A B) (_ : @Col Tn O B C) (_ : not (@eq (@Tpoint Tn) B' O)) (_ : not (@eq (@Tpoint Tn) C' O)) (_ : @Col Tn O A' B') (_ : @Col Tn O B' C') (_ : @Perp2 Tn B C' C B' O) (_ : @Perp2 Tn C A' A C' O), @Perp2 Tn A B' B A' O *) intros. (* Goal: @Perp2 Tn A B' B A' O *) assert(HH8:= H8). (* Goal: @Perp2 Tn A B' B A' O *) assert(HH9:= H9). (* Goal: @Perp2 Tn A B' B A' O *) assert(Col O A C). (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: @Col Tn O A C *) apply (col_transitivity_1 _ B); Col. (* Goal: @Perp2 Tn A B' B A' O *) assert(Col O A' C'). (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: @Col Tn O A' C' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Perp2 Tn A B' B A' O *) assert(A <> O). (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: False *) subst A. (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: False *) apply H. (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: @Col Tn O O A' *) Col. (* Goal: @Perp2 Tn A B' B A' O *) assert(~ Col A B' O). (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: not (@Col Tn A B' O) *) intro. (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: False *) apply H. (* Goal: @Perp2 Tn A B' B A' O *) (* Goal: @Col Tn O A A' *) apply (col_transitivity_1 _ B'); Col. (* Goal: @Perp2 Tn A B' B A' O *) apply perp2_perp_in in HH8. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: @Perp2 Tn A B' B A' O *) ex_and HH8 L. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: @Perp2 Tn A B' B A' O *) ex_and H14 L'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: @Perp2 Tn A B' B A' O *) apply perp2_perp_in in HH9. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp2 Tn A B' B A' O *) ex_and HH9 M. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp2 Tn A B' B A' O *) ex_and H19 M'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp2 Tn A B' B A' O *) assert(HH:=l8_18_existence A B' O H13). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp2 Tn A B' B A' O *) ex_and HH N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp2 Tn A B' B A' O *) unfold Perp2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn O X Y) (and (@Perp Tn X Y A B') (@Perp Tn X Y B A')))) *) exists O. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn O O Y) (and (@Perp Tn O Y A B') (@Perp Tn O Y B A'))) *) exists N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: and (@Col Tn O O N) (and (@Perp Tn O N A B') (@Perp Tn O N B A')) *) repeat split. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N A B' *) (* Goal: @Col Tn O O N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N A B' *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O A). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH la. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O B). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH lb. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O C). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH lc. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O A'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH la'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O B'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH lb'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O C'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH lc'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O L). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH ll. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O L'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH ll'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O M). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH lm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O M'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH lm'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(HH:=lg_exists O N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and HH ln. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(O <> L). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L) *) apply perp_in_perp_bis in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L) *) induction H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L) *) (* Goal: not (@eq (@Tpoint Tn) O L) *) apply perp_not_eq_1 in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L) *) (* Goal: not (@eq (@Tpoint Tn) O L) *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L) *) apply perp_not_eq_1 in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(O <> L'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L') *) apply perp_in_perp_bis in H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L') *) induction H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L') *) (* Goal: not (@eq (@Tpoint Tn) O L') *) apply perp_not_eq_1 in H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L') *) (* Goal: not (@eq (@Tpoint Tn) O L') *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L') *) apply perp_not_eq_1 in H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O L') *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(~ Col O B B'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Col Tn O B B') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O A A' *) assert(Col O A B'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O A A' *) (* Goal: @Col Tn O A B' *) eapply (col_transitivity_1 _ B); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O A A' *) eapply (col_transitivity_1 _ B'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(~ Col O C C'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Col Tn O C C') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O A A' *) assert(Col O A C'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O A A' *) (* Goal: @Col Tn O A C' *) eapply (col_transitivity_1 _ C); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O A A' *) eapply (col_transitivity_1 _ C'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists a, Q_CongA_Acute a /\ Lcos ll lb a /\ Lcos ll' lc a). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) induction(eq_dec_points B L). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) subst L. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) assert(C = L'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @eq (@Tpoint Tn) C L' *) eapply (l6_21 O B B' L'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: not (@eq (@Tpoint Tn) B' L') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: False *) subst L'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: False *) contradiction. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) subst L'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) apply (l13_10_aux2 O B C); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lb a) (@Lcos Tn ll' lc a))) *) apply (l13_10_aux1 O B C L L'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn O L L B *) apply perp_in_perp_bis in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn O L L B *) induction H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn O L L B *) (* Goal: @Perp Tn O L L B *) apply perp_not_eq_1 in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn O L L B *) (* Goal: @Perp Tn O L L B *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn O L L B *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn L B O L *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn B L L O *) eapply (perp_col _ C');auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn B C' L O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) apply perp_in_perp_bis in H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) induction H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn O L' L' C *) apply perp_not_eq_1 in H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) (* Goal: @Perp Tn O L' L' C *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' C *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn L' C O L' *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C L' L' O *) eapply (perp_col _ B'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: not (@eq (@Tpoint Tn) C L') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: False *) subst L'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: False *) assert(Col O B L). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: False *) (* Goal: @Col Tn O B L *) eapply (col_transitivity_1 _ C); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: False *) apply H52. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: @eq (@Tpoint Tn) B L *) apply(l6_21 O C C' B B L); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: not (@eq (@Tpoint Tn) C' B) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: False *) subst C'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: False *) unfold Perp_at in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) (* Goal: False *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C B' L' O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H52 l'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists a, Q_CongA_Acute a /\ Lcos ll lc' a /\ Lcos ll' lb' a). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) induction(eq_dec_points C' L). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) subst L. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) assert(B' = L'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @eq (@Tpoint Tn) B' L' *) eapply (l6_21 O C' C L'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: not (@eq (@Tpoint Tn) C L') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: False *) subst L'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: False *) apply H51. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @Col Tn O C C' *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) subst L'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) eapply (l13_10_aux2 O C' B'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn ll lc' a) (@Lcos Tn ll' lb' a))) *) apply (l13_10_aux1 O C' B' L L'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn O L L C' *) apply perp_in_perp_bis in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn O L L C' *) induction H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn O L L C' *) (* Goal: @Perp Tn O L L C' *) apply perp_not_eq_1 in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn O L L C' *) (* Goal: @Perp Tn O L L C' *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn O L L C' *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn L C' O L *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn C' L L O *) eapply (perp_col _ B); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn C' B L O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) apply perp_in_perp_bis in H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) induction H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn O L' L' B' *) apply perp_not_eq_1 in H18. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) (* Goal: @Perp Tn O L' L' B' *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O L' L' B' *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn L' B' O L' *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' L' L' O *) eapply (perp_col _ C);Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: not (@eq (@Tpoint Tn) B' L') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: False *) subst L'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: False *) assert(Col O C' L). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: False *) (* Goal: @Col Tn O C' L *) eapply (col_transitivity_1 _ B'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: False *) apply H55. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: @eq (@Tpoint Tn) C' L *) apply(l6_21 O B' B C' C' L); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: not (@eq (@Tpoint Tn) B C') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: False *) subst C'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: False *) unfold Perp_at in H17. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) (* Goal: False *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' C L' O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H55 l. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists a, Q_CongA_Acute a /\ Lcos lm lc a /\ Lcos lm' la a). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) induction (eq_dec_points C M). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) subst M. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) assert(A = M'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @eq (@Tpoint Tn) A M' *) eapply (l6_21 O C C' M'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: not (@eq (@Tpoint Tn) C' M') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: False *) subst M'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: False *) contradiction. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) subst M'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) apply (l13_10_aux2 O C A); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm lc a) (@Lcos Tn lm' la a))) *) apply (l13_10_aux1 O C A M M'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn O M M C *) apply perp_in_perp_bis in H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn O M M C *) induction H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn O M M C *) (* Goal: @Perp Tn O M M C *) apply perp_not_eq_1 in H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn O M M C *) (* Goal: @Perp Tn O M M C *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn O M M C *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn M C O M *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn C M M O *) eapply (perp_col _ A');auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn C A' M O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) apply perp_in_perp_bis in H23. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) induction H23. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn O M' M' A *) apply perp_not_eq_1 in H23. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) (* Goal: @Perp Tn O M' M' A *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' A *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn M' A O M' *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A M' M' O *) eapply (perp_col _ C'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: not (@eq (@Tpoint Tn) A M') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: False *) subst M'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: False *) assert(Col O C M). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: False *) (* Goal: @Col Tn O C M *) eapply (col_transitivity_1 _ A); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: False *) apply H58. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: @eq (@Tpoint Tn) C M *) apply(l6_21 O A A' C C M); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: not (@eq (@Tpoint Tn) A' C) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: False *) unfold Perp_at in H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) (* Goal: False *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A C' M' O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H58 m'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists a, Q_CongA_Acute a /\ Lcos lm la' a /\ Lcos lm' lc' a). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) induction(eq_dec_points A' M). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) subst M. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) assert(C' = M'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @eq (@Tpoint Tn) C' M' *) eapply (l6_21 O A' A M'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: not (@eq (@Tpoint Tn) A M') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: False *) subst M'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @Col Tn O A A' *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) subst M'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) eapply (l13_10_aux2 O A' C'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) (* Goal: @Col Tn O A O *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (and (@Lcos Tn lm la' a) (@Lcos Tn lm' lc' a))) *) apply (l13_10_aux1 O A' C' M M'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn O M M A' *) apply perp_in_perp_bis in H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn O M M A' *) induction H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn O M M A' *) (* Goal: @Perp Tn O M M A' *) apply perp_not_eq_1 in H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn O M M A' *) (* Goal: @Perp Tn O M M A' *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn O M M A' *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn M A' O M *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn A' M M O *) eapply (perp_col _ C);Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn A' C M O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) apply perp_in_perp_bis in H23. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) induction H23. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn O M' M' C' *) apply perp_not_eq_1 in H23. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) (* Goal: @Perp Tn O M' M' C' *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O M' M' C' *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn M' C' O M' *) apply perp_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' M' M' O *) eapply (perp_col _ A);Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: not (@eq (@Tpoint Tn) C' M') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: False *) subst M'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: False *) assert(Col O A' M). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: False *) (* Goal: @Col Tn O A' M *) eapply (col_transitivity_1 _ C'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: False *) apply H61. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: @eq (@Tpoint Tn) A' M *) apply(l6_21 O C' C A' A' M); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: not (@eq (@Tpoint Tn) C A') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: False *) unfold Perp_at in H22. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) (* Goal: False *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn C' A M' O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H61 m. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists a, Q_CongA_Acute a /\ Lcos ln la a). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) assert(exists a, Q_CongA_Acute a /\ a A O N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (a A O N)) *) apply(anga_exists A O N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: False *) subst A. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: @Col Tn O O A' *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) apply perp_not_eq_2 in H25. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) induction(eq_dec_points A N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: @Acute Tn A O N *) subst N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: @Acute Tn A O A *) apply acute_trivial. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: not (@eq (@Tpoint Tn) A O) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: False *) subst A. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) (* Goal: @Col Tn O O A' *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Acute Tn A O N *) eapply (perp_acute _ _ N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Perp_at Tn N O N A N *) (* Goal: @Col Tn A N N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Perp_at Tn N O N A N *) apply perp_in_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Perp_at Tn N N O A N *) apply perp_perp_in. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Perp Tn N O A N *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Perp Tn A N N O *) apply (perp_col _ B'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Col Tn A B' N *) (* Goal: @Perp Tn A B' N O *) (* Goal: not (@eq (@Tpoint Tn) A N) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Col Tn A B' N *) (* Goal: @Perp Tn A B' N O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) (* Goal: @Col Tn A B' N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) ex_and H64 n'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln la a)) *) exists n'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Q_CongA_Acute Tn n') (@Lcos Tn ln la n') *) split. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos Tn ln la n' *) (* Goal: @Q_CongA_Acute Tn n' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos Tn ln la n' *) unfold Lcos. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Q_Cong Tn ln) (and (@Q_Cong Tn la) (and (@Q_CongA_Acute Tn n') (@ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (ln A B) (and (la A C) (n' B A C))))))))) *) repeat split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (ln A B) (and (la A C) (n' B A C)))))) *) exists O. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B O) (and (ln O B) (and (la O C) (n' B O C))))) *) exists N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C N O) (and (ln O N) (and (la O C) (n' N O C)))) *) exists A. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Per Tn A N O) (and (ln O N) (and (la O A) (n' N O A))) *) repeat split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Per Tn A N O *) induction(eq_dec_points A N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Per Tn A N O *) (* Goal: @Per Tn A N O *) subst N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Per Tn A N O *) (* Goal: @Per Tn A A O *) apply l8_2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Per Tn A N O *) (* Goal: @Per Tn O A A *) apply l8_5. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Per Tn A N O *) apply perp_in_per. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Perp_at Tn N A N N O *) apply perp_in_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Perp_at Tn N N A O N *) apply perp_perp_in. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Perp Tn N A O N *) apply perp_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Perp Tn A N O N *) apply (perp_col _ B'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Col Tn A B' N *) (* Goal: @Perp Tn A B' O N *) (* Goal: not (@eq (@Tpoint Tn) A N) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Col Tn A B' N *) (* Goal: @Perp Tn A B' O N *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) (* Goal: @Col Tn A B' N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N O A *) apply anga_sym; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H64 n'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists a, Q_CongA_Acute a /\ Lcos ln lb' a). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) assert(exists a, Q_CongA_Acute a /\ a B' O N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (a B' O N)) *) apply(anga_exists B' O N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: False *) subst B'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: False *) apply H50. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) (* Goal: @Col Tn O B O *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) apply perp_not_eq_2 in H25. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: not (@eq (@Tpoint Tn) N O) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) induction(eq_dec_points B' N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: @Acute Tn B' O N *) subst N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: @Acute Tn B' O B' *) apply acute_trivial. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) (* Goal: not (@eq (@Tpoint Tn) B' O) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Acute Tn B' O N *) eapply (perp_acute _ _ N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Perp_at Tn N O N B' N *) (* Goal: @Col Tn B' N N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Perp_at Tn N O N B' N *) apply perp_in_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Perp_at Tn N N O B' N *) apply perp_perp_in. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Perp Tn N O B' N *) apply perp_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Perp Tn B' N N O *) apply (perp_col _ A). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Col Tn B' A N *) (* Goal: @Perp Tn B' A N O *) (* Goal: not (@eq (@Tpoint Tn) B' N) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Col Tn B' A N *) (* Goal: @Perp Tn B' A N O *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) (* Goal: @Col Tn B' A N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) ex_and H66 n. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun a : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Q_CongA_Acute Tn a) (@Lcos Tn ln lb' a)) *) exists n. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Q_CongA_Acute Tn n) (@Lcos Tn ln lb' n) *) split. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos Tn ln lb' n *) (* Goal: @Q_CongA_Acute Tn n *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos Tn ln lb' n *) unfold Lcos. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Q_Cong Tn ln) (and (@Q_Cong Tn lb') (and (@Q_CongA_Acute Tn n) (@ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (ln A B) (and (lb' A C) (n B A C))))))))) *) repeat split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B A) (and (ln A B) (and (lb' A C) (n B A C)))))) *) exists O. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun B : @Tpoint Tn => @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C B O) (and (ln O B) (and (lb' O C) (n B O C))))) *) exists N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Per Tn C N O) (and (ln O N) (and (lb' O C) (n N O C)))) *) exists B'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Per Tn B' N O) (and (ln O N) (and (lb' O B') (n N O B'))) *) repeat split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Per Tn B' N O *) induction(eq_dec_points B' N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Per Tn B' N O *) (* Goal: @Per Tn B' N O *) subst N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Per Tn B' N O *) (* Goal: @Per Tn B' B' O *) apply l8_2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Per Tn B' N O *) (* Goal: @Per Tn O B' B' *) apply l8_5. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Per Tn B' N O *) apply perp_in_per. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Perp_at Tn N B' N N O *) apply perp_in_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Perp_at Tn N N B' O N *) apply perp_perp_in. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Perp Tn N B' O N *) apply perp_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Perp Tn B' N O N *) apply (perp_col _ A). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Col Tn B' A N *) (* Goal: @Perp Tn B' A O N *) (* Goal: not (@eq (@Tpoint Tn) B' N) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Col Tn B' A N *) (* Goal: @Perp Tn B' A O N *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) (* Goal: @Col Tn B' A N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N O B' *) apply anga_sym; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H66 n. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos lc l' lb' l). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn lc l' lb' l *) unfold Eq_Lcos. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp lc l') (@Lcos Tn lp lb' l)) *) exists ll'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos Tn ll' lc l') (@Lcos Tn ll' lb' l) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos lb l' lc' l). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn lb l' lc' l *) unfold Eq_Lcos. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp lb l') (@Lcos Tn lp lc' l)) *) exists ll. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos Tn ll lb l') (@Lcos Tn ll lc' l) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos lc m' la' m). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn lc m' la' m *) unfold Eq_Lcos. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp lc m') (@Lcos Tn lp la' m)) *) exists lm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos Tn lm lc m') (@Lcos Tn lm la' m) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos la m' lc' m). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn la m' lc' m *) unfold Eq_Lcos. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp la m') (@Lcos Tn lp lc' m)) *) exists lm'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos Tn lm' la m') (@Lcos Tn lm' lc' m) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos la n' lb' n). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn la n' lb' n *) unfold Eq_Lcos. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn lp la n') (@Lcos Tn lp lb' n)) *) exists ln. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos Tn ln la n') (@Lcos Tn ln lb' n) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists lp, Lcos lp lb n'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => @Lcos Tn lp lb n') *) apply(lcos_exists lb n'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn lb) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) unfold Q_Cong_Null in H73. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) spliter. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) ex_and H74 X. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) apply H0. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @eq (@Tpoint Tn) B O *) eapply (cong_identity _ _ X). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Cong Tn B O X X *) apply (lg_cong lb); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: lb B O *) apply (lg_sym lb); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H73 bn'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists lp, Lcos lp ll n'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => @Lcos Tn lp ll n') *) apply(lcos_exists ll n'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn ll) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) unfold Q_Cong_Null in H73. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) spliter. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) ex_and H75 X. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) apply H48. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @eq (@Tpoint Tn) O L *) apply (cong_identity _ _ X). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Cong Tn O L X X *) apply (lg_cong ll); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H73 bl'n'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(exists lp, Lcos lp bn' l'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => @Lcos Tn lp bn' l') *) apply(lcos_exists bn' l'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn bn') *) (* Goal: @Q_Cong Tn bn' *) apply lcos_lg_anga in H74. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn bn') *) (* Goal: @Q_Cong Tn bn' *) spliter. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn bn') *) (* Goal: @Q_Cong Tn bn' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn bn') *) assert(HH:= lcos_lg_not_null bn' lb n' H74 ). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn bn') *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H73 bn'l'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Lcos2 bl'n' lb l' n'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos2 Tn bl'n' lb l' n' *) unfold Lcos2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun la : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn la lb l') (@Lcos Tn bl'n' la n')) *) exists ll. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos Tn ll lb l') (@Lcos Tn bl'n' ll n') *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Lcos2 bn'l' lb n' l'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos2 Tn bn'l' lb n' l' *) unfold Lcos2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun la : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos Tn la lb n') (@Lcos Tn bn'l' la l')) *) exists bn'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos Tn bn' lb n') (@Lcos Tn bn'l' bn' l') *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(EqL bl'n' bn'l'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @EqL Tn bl'n' bn'l' *) apply lcos2_comm in H77. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @EqL Tn bl'n' bn'l' *) apply (lcos2_uniqueness lb _ _ l' n'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) apply lcos_lg_anga in H75. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) apply lcos_lg_anga in H76. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) spliter. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos2 lb l' n' lb n' l'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos2 Tn lb l' n' lb n' l' *) unfold Eq_Lcos2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp lb l' n') (@Lcos2 Tn lp lb n' l')) *) exists bl'n'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos2 Tn bl'n' lb l' n') (@Lcos2 Tn bl'n' lb n' l') *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos2 Tn bl'n' lb n' l' *) eapply (lcos2_eql_lcos2 lb _ bn'l'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @EqL Tn bn'l' bl'n' *) (* Goal: @EqL Tn lb lb *) (* Goal: @Lcos2 Tn bn'l' lb n' l' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @EqL Tn bn'l' bl'n' *) (* Goal: @EqL Tn lb lb *) reflexivity. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @EqL Tn bn'l' bl'n' *) symmetry; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos2 lb l' n' lc' l n'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos2 Tn lb l' n' lc' l n' *) apply lcos_eq_lcos2_eq; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m lc' l n' m). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc' l n' m *) apply lcos2_eq_lcos3_eq; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m lc' m l n'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc' m l n' *) unfold Eq_Lcos3 in H87. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc' m l n' *) ex_and H87 lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc' m l n' *) unfold Eq_Lcos3. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp lc' m l n')) *) exists lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp lc' m l n') *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lc' m l n' *) apply lcos3_permut1. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lc' m n' l *) apply lcos3_permut2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lc' l n' m *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 la m' l n' lc' m l n'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn la m' l n' lc' m l n' *) apply lcos_eq_lcos3_eq; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m la m' l n'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la m' l n' *) apply (lcos3_eq_trans _ _ _ _ lc' m l n'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lc' m l n' la m' l n' *) apply lcos3_eq_sym; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m la n' m' l). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la n' m' l *) unfold Eq_Lcos3 in H90. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la n' m' l *) ex_and H90 lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la n' m' l *) unfold Eq_Lcos3. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp la n' m' l)) *) exists lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp la n' m' l) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp la n' m' l *) apply lcos3_permut1. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp la n' l m' *) apply lcos3_permut2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp la m' l n' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 la n' m' l lb' n m' l). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn la n' m' l lb' n m' l *) apply lcos_eq_lcos3_eq; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m lb' n m' l). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lb' n m' l *) apply (lcos3_eq_trans _ _ _ _ la n' m' l); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m lb' l n m'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lb' l n m' *) unfold Eq_Lcos3 in H93. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lb' l n m' *) ex_and H93 lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lb' l n m' *) unfold Eq_Lcos3. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp lb' l n m')) *) exists lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp lb' l n m') *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lb' l n m' *) apply lcos3_permut1. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lb' l m' n *) apply lcos3_permut2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lb' n m' l *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb' l n m' lc l' n m'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb' l n m' lc l' n m' *) apply lcos_eq_lcos3_eq; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn lb' l lc l' *) apply lcos_eq_sym; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m lc l' n m'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc l' n m' *) apply (lcos3_eq_trans _ _ _ _ lb' l n m'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m lc m' l' n). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc m' l' n *) unfold Eq_Lcos3 in H96. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc m' l' n *) ex_and H96 lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m lc m' l' n *) unfold Eq_Lcos3. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp lc m' l' n)) *) exists lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp lc m' l' n) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lc m' l' n *) apply lcos3_permut1. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lc m' n l' *) apply lcos3_permut2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp lc l' n m' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 la' m l' n lc m' l' n). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn la' m l' n lc m' l' n *) apply lcos_eq_lcos3_eq; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn la' m lc m' *) apply lcos_eq_sym; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m la' m l' n). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la' m l' n *) apply (lcos3_eq_trans _ _ _ _ lc m' l' n); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lc m' l' n la' m l' n *) apply lcos3_eq_sym; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos3 lb l' n' m la' n l' m). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la' n l' m *) unfold Eq_Lcos3 in H99. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la' n l' m *) ex_and H99 lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos3 Tn lb l' n' m la' n l' m *) unfold Eq_Lcos3. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp la' n l' m)) *) exists lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos3 Tn lp lb l' n' m) (@Lcos3 Tn lp la' n l' m) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp la' n l' m *) apply lcos3_permut2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos3 Tn lp la' m l' n *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos2 lb l' n' la' n l'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos2 Tn lb l' n' la' n l' *) apply (lcos3_lcos2 _ _ _ _ _ _ m); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos2 lb n' l' la' n l'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos2 Tn lb n' l' la' n l' *) unfold Eq_Lcos2 in H101. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos2 Tn lb n' l' la' n l' *) ex_and H101 lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos2 Tn lb n' l' la' n l' *) unfold Eq_Lcos2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop) (fun lp : forall (_ : @Tpoint Tn) (_ : @Tpoint Tn), Prop => and (@Lcos2 Tn lp lb n' l') (@Lcos2 Tn lp la' n l')) *) exists lp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Lcos2 Tn lp lb n' l') (@Lcos2 Tn lp la' n l') *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos2 Tn lp lb n' l' *) apply lcos2_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Lcos2 Tn lp lb l' n' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Eq_Lcos lb n' la' n). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn lb n' la' n *) apply (lcos2_lcos) in H102. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Eq_Lcos Tn lb n' la' n *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) clear H85 H86 H87 H88 H89 H90 H91 H92 H93 H94 H95 H96 H97 H98 H99 H100 H101 H102. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) unfold Eq_Lcos in H103. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) ex_and H103 ln'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(O <> N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O N) *) apply perp_not_eq_2 in H25; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) apply lcos_lg_anga in H85. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) spliter. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(n' A O N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' A O N *) apply(lcos_per_anga _ _ _ la ln); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn A N O *) induction(eq_dec_points A N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn A N O *) (* Goal: @Per Tn A N O *) subst N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn A N O *) (* Goal: @Per Tn A A O *) apply l8_2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn A N O *) (* Goal: @Per Tn O A A *) apply l8_5. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn A N O *) apply perp_in_per. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp_at Tn N A N N O *) apply perp_in_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp_at Tn N N A O N *) apply perp_perp_in. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn N A O N *) apply perp_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn A N O N *) apply (perp_col _ B'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(n B' O N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: n B' O N *) apply(lcos_per_anga _ _ _ lb' ln); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn B' N O *) induction(eq_dec_points B' N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn B' N O *) (* Goal: @Per Tn B' N O *) subst N. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn B' N O *) (* Goal: @Per Tn B' B' O *) apply l8_2. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn B' N O *) (* Goal: @Per Tn O B' B' *) apply l8_5. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn B' N O *) apply perp_in_per. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp_at Tn N B' N N O *) apply perp_in_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp_at Tn N N B' O N *) apply perp_perp_in. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn N B' O N *) apply perp_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' N O N *) apply (perp_col _ A); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn B' A O N *) Perp. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) assert(Bet A O B \/ Out O A B \/ ~ Col A O B). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: or (@Bet Tn A O B) (or (@Out Tn O A B) (not (@Col Tn A O B))) *) apply(or_bet_out A O B); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) induction H93. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(HH:=ex_point_lg_bet ln' N O H89). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) ex_and HH N'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(O <> N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) O N') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) subst N'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) assert(HH:=lcos_lg_not_null ln' lb n' H85). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) spliter. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) apply H96. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Q_Cong_Null Tn ln' *) unfold Q_Cong_Null. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Q_Cong Tn ln') (@ex (@Tpoint Tn) (fun A : @Tpoint Tn => ln' A A)) *) split; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun A : @Tpoint Tn => ln' A A) *) exists O. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: ln' O O *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(A' <> B). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@eq (@Tpoint Tn) A' B) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: False *) contradiction. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(Per O N' B). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn O N' B *) apply(lcos_per O N' B ln' lb n'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) assert(CongA N O A B O N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @CongA Tn N O A B O N' *) apply(l11_13 N' O A A O N' N B ); Between. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @CongA Tn N' O A A O N' *) apply conga_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @CongA Tn A O N' A O N' *) apply conga_refl; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) apply (anga_conga_anga n' A O N); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn A O N N' O B *) apply conga_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn N O A B O N' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(Per O N' A'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn O N' A' *) apply(lcos_per O N' A' ln' la' n); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) assert(CongA N O B' A' O N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @CongA Tn N O B' A' O N' *) apply(l11_13 N' O B' B' O N' N A' ); Between. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Bet Tn B' O A' *) (* Goal: @CongA Tn N' O B' B' O N' *) apply conga_left_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Bet Tn B' O A' *) (* Goal: @CongA Tn B' O N' B' O N' *) apply conga_refl; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Bet Tn B' O A' *) apply between_symmetry. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) (* Goal: @Bet Tn A' O B' *) apply(l13_10_aux3 A B C A' B' C' O); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Col Tn O A O *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) eapply (anga_conga_anga n B' O N); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn B' O N N' O A' *) apply conga_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn N O B' A' O N' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) apply (perp_col _ N'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N' B A' *) apply cop_per2__perp; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) induction(eq_dec_points N' B). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) right. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) N' A') *) subst N'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) B A') *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) left. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: not (@eq (@Tpoint Tn) N' B) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn O N' B A' *) apply coplanar_perm_16. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn B A' O N' *) apply col_cop__cop with N; Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn B A' O N *) apply coplanar_perm_5. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn B N O A' *) apply col_cop__cop with B'; Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Coplanar Tn B N O B' *) exists A. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: or (and (@Col Tn B N A) (@Col Tn O B' A)) (or (and (@Col Tn B O A) (@Col Tn N B' A)) (and (@Col Tn B B' A) (@Col Tn N O A))) *) right. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: or (and (@Col Tn B O A) (@Col Tn N B' A)) (and (@Col Tn B B' A) (@Col Tn N O A)) *) left. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: and (@Col Tn B O A) (@Col Tn N B' A) *) split; Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) induction H93. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(exists N' : Tpoint, ln' O N' /\ Out O N' N). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @ex (@Tpoint Tn) (fun N' : @Tpoint Tn => and (ln' O N') (@Out Tn O N' N)) *) apply(ex_point_lg_out ln' O N H87 H89). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn ln') *) assert(HH:=lcos_lg_not_null ln' la' n H86). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn ln') *) spliter. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: not (@Q_Cong_Null Tn ln') *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) ex_and H94 N'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(Per O N' B). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn O N' B *) apply(lcos_per O N' B ln' lb n'); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) assert(CongA A O N B O N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @CongA Tn A O N B O N' *) apply(out_conga A O N A O N A N B N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O A B *) (* Goal: @Out Tn O N N *) (* Goal: @Out Tn O A A *) (* Goal: @CongA Tn A O N A O N *) apply conga_refl ; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O A B *) (* Goal: @Out Tn O N N *) (* Goal: @Out Tn O A A *) apply out_trivial; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O A B *) (* Goal: @Out Tn O N N *) apply out_trivial; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O A B *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @Out Tn O N N' *) apply l6_6. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) (* Goal: @Out Tn O N' N *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n' N' O B *) apply (anga_conga_anga n' A O N); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn A O N N' O B *) apply conga_right_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn A O N B O N' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) assert(Per O N' A'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Per Tn O N' A' *) apply(lcos_per O N' A' ln' la' n); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) assert(CongA B' O N A' O N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @CongA Tn B' O N A' O N' *) apply(out_conga B' O N B' O N B' N A' N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B' A' *) (* Goal: @Out Tn O N N *) (* Goal: @Out Tn O B' B' *) (* Goal: @CongA Tn B' O N B' O N *) apply conga_refl; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B' A' *) (* Goal: @Out Tn O N N *) (* Goal: @Out Tn O B' B' *) apply out_trivial; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B' A' *) (* Goal: @Out Tn O N N *) apply out_trivial; auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B' A' *) eapply (l13_10_aux5 B A C B' A' C'); Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: not (@eq (@Tpoint Tn) A' O) *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: False *) apply H. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) (* Goal: @Col Tn O A O *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn A C' C A' O *) apply perp2_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn C B' B C' O *) (* Goal: @Perp2 Tn C A' A C' O *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn C B' B C' O *) apply perp2_sym. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) (* Goal: @Perp2 Tn B C' C B' O *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O B A *) apply l6_6. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) (* Goal: @Out Tn O A B *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N N' *) apply l6_6. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) (* Goal: @Out Tn O N' N *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: n N' O A' *) apply (anga_conga_anga n B' O N); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn B' O N N' O A' *) apply conga_right_comm. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) (* Goal: @CongA Tn B' O N A' O N' *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Perp Tn O N B A' *) apply(perp_col _ N'). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Perp Tn O N' B A' *) (* Goal: not (@eq (@Tpoint Tn) O N) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Perp Tn O N' B A' *) apply (cop_per2__perp); auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) B A') *) (* Goal: not (@eq (@Tpoint Tn) O N') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) B A') *) (* Goal: False *) subst N'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) B A') *) (* Goal: False *) unfold Out in H95. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) B A') *) (* Goal: False *) tauto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) B A') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: False *) contradiction. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) induction(eq_dec_points N' B). (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) subst N'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: or (not (@eq (@Tpoint Tn) B B)) (not (@eq (@Tpoint Tn) B A')) *) right. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: not (@eq (@Tpoint Tn) B A') *) intro. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: False *) subst A'. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) (* Goal: False *) contradiction. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: or (not (@eq (@Tpoint Tn) N' B)) (not (@eq (@Tpoint Tn) N' A')) *) left. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) (* Goal: not (@eq (@Tpoint Tn) N' B) *) auto. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn O N' B A' *) apply coplanar_perm_16. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn B A' O N' *) apply col_cop__cop with N; Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn B A' O N *) apply coplanar_perm_5. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn B N O A' *) apply col_cop__cop with B'; Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: @Coplanar Tn B N O B' *) exists A. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: or (and (@Col Tn B N A) (@Col Tn O B' A)) (or (and (@Col Tn B O A) (@Col Tn N B' A)) (and (@Col Tn B B' A) (@Col Tn N O A))) *) right. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: or (and (@Col Tn B O A) (@Col Tn N B' A)) (and (@Col Tn B B' A) (@Col Tn N O A)) *) left. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) (* Goal: and (@Col Tn B O A) (@Col Tn N B' A) *) split; Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) apply out_col in H95. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) (* Goal: @Col Tn O N' N *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Perp Tn O N B A' *) apply False_ind. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: False *) apply H93. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) (* Goal: @Col Tn A O B *) Col. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) (* Goal: and (not (@Col Tn O C A')) (not (@Col Tn O A C')) *) split; intro; apply H; ColR. (* Goal: and (not (@Col Tn O B C')) (not (@Col Tn O C B')) *) split; intro; apply H; ColR. Qed. End Pappus_Pascal. Section Pappus_Pascal_2. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma par__perp2 : forall A B C D P, Par A B C D -> Perp2 A B C D P. Proof. (* Goal: forall (A B C D P : @Tpoint Tn) (_ : @Par Tn A B C D), @Perp2 Tn A B C D P *) intros. (* Goal: @Perp2 Tn A B C D P *) apply par_distincts in H. (* Goal: @Perp2 Tn A B C D P *) spliter. (* Goal: @Perp2 Tn A B C D P *) unfold Perp2. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y C D)))) *) assert(HH:= perp_exists P A B H0). (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y C D)))) *) ex_and HH Q. (* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P X Y) (and (@Perp Tn X Y A B) (@Perp Tn X Y C D)))) *) exists P. (* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => and (@Col Tn P P Y) (and (@Perp Tn P Y A B) (@Perp Tn P Y C D))) *) exists Q. (* Goal: and (@Col Tn P P Q) (and (@Perp Tn P Q A B) (@Perp Tn P Q C D)) *) repeat split. (* Goal: @Perp Tn P Q C D *) (* Goal: @Perp Tn P Q A B *) (* Goal: @Col Tn P P Q *) Col. (* Goal: @Perp Tn P Q C D *) (* Goal: @Perp Tn P Q A B *) Perp. (* Goal: @Perp Tn P Q C D *) apply perp_sym. (* Goal: @Perp Tn C D P Q *) apply (par_perp__perp A B); auto. (* Goal: @Perp Tn A B P Q *) apply perp_sym; auto. Qed. Lemma l13_11 : forall A B C A' B' C' O, ~ Col O A A' -> B <> O -> C <> O -> Col O A B -> Col O B C -> B' <> O -> C' <> O -> Col O A' B' -> Col O B' C' -> Par B C' C B' -> Par C A' A C' -> Par A B' B A'. Proof. (* Goal: forall (A B C A' B' C' O : @Tpoint Tn) (_ : not (@Col Tn O A A')) (_ : not (@eq (@Tpoint Tn) B O)) (_ : not (@eq (@Tpoint Tn) C O)) (_ : @Col Tn O A B) (_ : @Col Tn O B C) (_ : not (@eq (@Tpoint Tn) B' O)) (_ : not (@eq (@Tpoint Tn) C' O)) (_ : @Col Tn O A' B') (_ : @Col Tn O B' C') (_ : @Par Tn B C' C B') (_ : @Par Tn C A' A C'), @Par Tn A B' B A' *) intros. (* Goal: @Par Tn A B' B A' *) assert(HH:=par__perp2 B C' C B' O H8). (* Goal: @Par Tn A B' B A' *) assert(HP:=par__perp2 C A' A C' O H9). (* Goal: @Par Tn A B' B A' *) assert(HQ:=perp2_par A B' B A' O). (* Goal: @Par Tn A B' B A' *) apply HQ. (* Goal: @Perp2 Tn A B' B A' O *) apply(l13_10 A B C A' B' C' O); auto. Qed. Lemma l13_14 : forall O A B C O' A' B' C', Par_strict O A O' A' -> Col O A B -> Col O B C -> Col O A C -> Col O' A' B' -> Col O' B' C' -> Col O' A' C' -> Par A C' A' C -> Par B C' B' C -> Par A B' A' B. End Pappus_Pascal_2.
Require Import Bool Arith Euclid List. Require Import BellantoniCook.Lib BellantoniCook.Bitstring BellantoniCook.BC BellantoniCook.BCLib. Fixpoint unary_preserv (e : BC) : bool := match e with | zero => true | proj n s j => true | succ b => b | pred => true | cond => true | rec g h0 h1 => unary_preserv g && unary_preserv h0 && unary_preserv h1 | comp _ _ h nl sl => unary_preserv h && forallb unary_preserv nl && forallb unary_preserv sl end. Lemma preservation : forall (e : BC) (vnl vsl : list bs), unary_preserv e = true -> forallb unary vnl = true -> forallb unary vsl = true -> unary (sem e vnl vsl) = true. Proof. (* Goal: forall (e : BC) (vnl vsl : list (list bool)) (_ : @eq bool (unary_preserv e) true) (_ : @eq bool (@forallb (list bool) unary vnl) true) (_ : @eq bool (@forallb (list bool) unary vsl) true), @eq bool (unary (sem e vnl vsl)) true *) induction e using BC_ind2; simpl; intros; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end) true *) (* Goal: @eq bool (unary (@tl bool (@hd (list bool) (@nil bool) vsl))) true *) (* Goal: @eq bool (andb (@id bool b) (unary (@hd (list bool) (@nil bool) vsl))) true *) (* Goal: @eq bool (unary (if match n with | O => false | S m' => Nat.leb i m' end then @nth (list bool) i vnl (@nil bool) else @nth (list bool) (Init.Nat.sub i n) vsl (@nil bool))) true *) case n; simpl. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end) true *) (* Goal: @eq bool (unary (@tl bool (@hd (list bool) (@nil bool) vsl))) true *) (* Goal: @eq bool (andb (@id bool b) (unary (@hd (list bool) (@nil bool) vsl))) true *) (* Goal: forall n : nat, @eq bool (unary (if Nat.leb i n then @nth (list bool) i vnl (@nil bool) else @nth (list bool) (Init.Nat.sub i (S n)) vsl (@nil bool))) true *) (* Goal: @eq bool (unary (@nth (list bool) (Init.Nat.sub i O) vsl (@nil bool))) true *) apply forallb_nth; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end) true *) (* Goal: @eq bool (unary (@tl bool (@hd (list bool) (@nil bool) vsl))) true *) (* Goal: @eq bool (andb (@id bool b) (unary (@hd (list bool) (@nil bool) vsl))) true *) (* Goal: forall n : nat, @eq bool (unary (if Nat.leb i n then @nth (list bool) i vnl (@nil bool) else @nth (list bool) (Init.Nat.sub i (S n)) vsl (@nil bool))) true *) intros; case (leb i n0); apply forallb_nth; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end) true *) (* Goal: @eq bool (unary (@tl bool (@hd (list bool) (@nil bool) vsl))) true *) (* Goal: @eq bool (andb (@id bool b) (unary (@hd (list bool) (@nil bool) vsl))) true *) subst; simpl; apply forallb_hd; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end) true *) (* Goal: @eq bool (unary (@tl bool (@hd (list bool) (@nil bool) vsl))) true *) apply forallb_tl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end) true *) (* Goal: @eq bool (@forallb bool (@id bool) (@hd (list bool) (@nil bool) vsl)) true *) apply forallb_hd; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end) true *) destruct vsl; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons b (nil as l0) => match l with | nil => b | cons b0 l => @nil bool end | cons b (cons c (nil as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => @nil bool end | cons b (cons c (cons d l2 as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => d end end) true *) simpl in H1;rewrite andb_true_iff in H1. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => @nil bool | cons b (nil as l0) => match l with | nil => b | cons b0 l => @nil bool end | cons b (cons c (nil as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => @nil bool end | cons b (cons c (cons d l2 as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => d end end) true *) destruct vsl; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => match l with | nil => l0 | cons b l => @nil bool end | cons c (nil as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => @nil bool end | cons c (cons d l2 as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => d end end) true *) simpl in H1;rewrite andb_true_iff in H1. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => match l with | nil => l0 | cons b l => @nil bool end | cons c (nil as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => @nil bool end | cons c (cons d l2 as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => d end end) true *) destruct vsl; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => @nil bool end | cons d l2 => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => d end end) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons b l => @nil bool end) true *) case l; trivial; tauto. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match vsl with | nil => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => @nil bool end | cons d l2 => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => d end end) true *) destruct vsl; simpl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => @nil bool end) true *) simpl in H1;rewrite andb_true_iff in H1. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => @nil bool end) true *) case l; trivial; intros. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end) true *) (* Goal: @eq bool (unary (if b then l1 else @nil bool)) true *) (* Goal: @eq bool (unary l0) true *) tauto. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end) true *) (* Goal: @eq bool (unary (if b then l1 else @nil bool)) true *) case b; tauto. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end) true *) simpl in H1;rewrite andb_true_iff,andb_true_iff in H1. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end) true *) case l; trivial; try tauto; intros. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary (if b then l1 else l2)) true *) case b; tauto. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) repeat rewrite andb_true_iff in H. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) assert (unary (hd nil vnl) = true). (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) (* Goal: @eq bool (unary (@hd (list bool) (@nil bool) vnl)) true *) apply forallb_hd; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl)) true *) induction (hd nil vnl); simpl in *; intros. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (if a then sem e3 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl) else sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (unary (sem e1 (@tl (list bool) vnl) vsl)) true *) apply IHe1; [ tauto | apply forallb_tl | ]; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (if a then sem e3 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl) else sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) case a. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (unary (sem e3 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) rewrite andb_true_iff in H2. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (unary (sem e3 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) apply IHe3; [ tauto | | ]; simpl. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (andb (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) (@forallb (list bool) unary vsl)) true *) (* Goal: @eq bool (andb (unary l) (@forallb (list bool) unary (@tl (list bool) vnl))) true *) rewrite andb_true_iff; split; [tauto | ]. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (andb (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) (@forallb (list bool) unary vsl)) true *) (* Goal: @eq bool (@forallb (list bool) unary (@tl (list bool) vnl)) true *) apply forallb_tl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (andb (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) (@forallb (list bool) unary vsl)) true *) rewrite andb_true_iff; split. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (@forallb (list bool) unary vsl) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) true *) apply IHl; tauto. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) (* Goal: @eq bool (@forallb (list bool) unary vsl) true *) trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) rewrite andb_true_iff in H2. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (unary (sem e2 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl) vsl))) true *) apply IHe2; [ tauto | | ]; simpl. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (andb (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) (@forallb (list bool) unary vsl)) true *) (* Goal: @eq bool (andb (unary l) (@forallb (list bool) unary (@tl (list bool) vnl))) true *) rewrite andb_true_iff; split; [tauto | ]. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (andb (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) (@forallb (list bool) unary vsl)) true *) (* Goal: @eq bool (@forallb (list bool) unary (@tl (list bool) vnl)) true *) apply forallb_tl; trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (andb (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) (@forallb (list bool) unary vsl)) true *) rewrite andb_true_iff; split. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (@forallb (list bool) unary vsl) true *) (* Goal: @eq bool (unary (sem_rec (sem e1) (sem e2) (sem e3) l (@tl (list bool) vnl) vsl)) true *) apply IHl; tauto. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) (* Goal: @eq bool (@forallb (list bool) unary vsl) true *) trivial. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) repeat rewrite andb_true_iff in H1. (* Goal: @eq bool (unary (sem e (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl))) true *) apply IHe; [ tauto | | ]. (* Goal: @eq bool (@forallb (list bool) unary (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) true *) (* Goal: @eq bool (@forallb (list bool) unary (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl)) true *) apply forallb_map; auto; intros. (* Goal: @eq bool (@forallb (list bool) unary (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) true *) (* Goal: @eq bool (unary (sem x vnl (@nil (list bool)))) true *) apply H; trivial. (* Goal: @eq bool (@forallb (list bool) unary (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) true *) (* Goal: @eq bool (unary_preserv x) true *) rewrite forallb_forall in H1. (* Goal: @eq bool (@forallb (list bool) unary (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) true *) (* Goal: @eq bool (unary_preserv x) true *) decompose [and] H1. (* Goal: @eq bool (@forallb (list bool) unary (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) true *) (* Goal: @eq bool (unary_preserv x) true *) auto. (* Goal: @eq bool (@forallb (list bool) unary (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) true *) apply forallb_map; auto; intros. (* Goal: @eq bool (unary (sem x vnl vsl)) true *) apply H0; trivial. (* Goal: @eq bool (unary_preserv x) true *) decompose [and] H1. (* Goal: @eq bool (unary_preserv x) true *) rewrite forallb_forall in H6. (* Goal: @eq bool (unary_preserv x) true *) auto. Qed. Lemma zero_correct n s l1 l2: length (sem (zero_e n s) l1 l2) = 0. Proof. (* Goal: @eq nat (@length bool (sem (zero_e n s) l1 l2)) O *) intros; simpl; trivial. Qed. Definition one_e (n s:nat) : BC := comp n s (comp 0 0 (succ true) nil (zero :: nil)) nil nil. Lemma one_correct n s l1 l2: length (sem (one_e n s) l1 l2) = 1. Proof. (* Goal: @eq nat (@length bool (sem (one_e n s) l1 l2)) (S O) *) intros; simpl; trivial. Qed. Definition succ_e : BC := succ true. Lemma succ_correct : forall n, length (sem succ_e nil [n]) = S (length n). Proof. (* Goal: forall n : list bool, @eq nat (@length bool (sem succ_e (@nil (list bool)) (@cons (list bool) n (@nil (list bool))))) (S (@length bool n)) *) intros; simpl; trivial. Qed. Fixpoint nat2BC (n s x:nat) : BC := match x with | 0 => zero_e n s | S x' => comp n s succ_e nil [nat2BC n s x'] end. Lemma nat2BC_arities : forall n s x, arities (nat2BC n s x) = ok_arities n s. Proof. (* Goal: forall n s x : nat, @eq Arities (arities (nat2BC n s x)) (ok_arities n s) *) induction x as [ | x IH]. (* Goal: @eq Arities (arities (nat2BC n s (S x))) (ok_arities n s) *) (* Goal: @eq Arities (arities (nat2BC n s O)) (ok_arities n s) *) trivial. (* Goal: @eq Arities (arities (nat2BC n s (S x))) (ok_arities n s) *) simpl nat2BC. (* Goal: @eq Arities (arities (comp n s succ_e (@nil BC) (@cons BC (nat2BC n s x) (@nil BC)))) (ok_arities n s) *) rewrite comp_arities. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n s)) (@cons BC (nat2BC n s x) (@nil BC)) *) (* Goal: @andl BC (fun ne : BC => @eq Arities (arities ne) (ok_arities n O)) (@nil BC) *) (* Goal: @eq Arities (arities succ_e) (ok_arities (@length BC (@nil BC)) (@length BC (@cons BC (nat2BC n s x) (@nil BC)))) *) (* Goal: @eq Arities (ok_arities n s) (ok_arities n s) *) trivial. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n s)) (@cons BC (nat2BC n s x) (@nil BC)) *) (* Goal: @andl BC (fun ne : BC => @eq Arities (arities ne) (ok_arities n O)) (@nil BC) *) (* Goal: @eq Arities (arities succ_e) (ok_arities (@length BC (@nil BC)) (@length BC (@cons BC (nat2BC n s x) (@nil BC)))) *) trivial. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n s)) (@cons BC (nat2BC n s x) (@nil BC)) *) (* Goal: @andl BC (fun ne : BC => @eq Arities (arities ne) (ok_arities n O)) (@nil BC) *) simpl; trivial. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n s)) (@cons BC (nat2BC n s x) (@nil BC)) *) simpl; tauto. Qed. Lemma nat2BC_correct : forall n s x nl sl, length (sem (nat2BC n s x) nl sl) = x. Proof. (* Goal: forall (n s x : nat) (nl sl : list (list bool)), @eq nat (@length bool (sem (nat2BC n s x) nl sl)) x *) induction x as [ | x IH]. (* Goal: forall nl sl : list (list bool), @eq nat (@length bool (sem (nat2BC n s (S x)) nl sl)) (S x) *) (* Goal: forall nl sl : list (list bool), @eq nat (@length bool (sem (nat2BC n s O) nl sl)) O *) trivial. (* Goal: forall nl sl : list (list bool), @eq nat (@length bool (sem (nat2BC n s (S x)) nl sl)) (S x) *) intros nl sl. (* Goal: @eq nat (@length bool (sem (nat2BC n s (S x)) nl sl)) (S x) *) simpl nat2BC. (* Goal: @eq nat (@length bool (sem (comp n s succ_e (@nil BC) (@cons BC (nat2BC n s x) (@nil BC))) nl sl)) (S x) *) rewrite sem_comp. (* Goal: @eq nat (@length bool (sem succ_e (@map BC (list bool) (fun ne : BC => sem ne nl (@nil (list bool))) (@nil BC)) (@map BC (list bool) (fun se : BC => sem se nl sl) (@cons BC (nat2BC n s x) (@nil BC))))) (S x) *) simpl. (* Goal: @eq nat (S (@length bool (sem (nat2BC n s x) nl sl))) (S x) *) rewrite IH. (* Goal: @eq nat (S x) (S x) *) trivial. Qed. Opaque succ_e. Definition plus_e : BC := rec (proj 0 1 0) (comp 1 2 succ_e nil ((proj 1 2 1) :: nil)) (comp 1 2 succ_e nil ((proj 1 2 1) :: nil)). Lemma plus_correct : forall m n, length (sem plus_e [m] [n]) = length m + length n. Proof. (* Goal: forall m n : list bool, @eq nat (@length bool (sem plus_e (@cons (list bool) m (@nil (list bool))) (@cons (list bool) n (@nil (list bool))))) (Init.Nat.add (@length bool m) (@length bool n)) *) induction m; simpl in *; intros; trivial. (* Goal: @eq nat (@length bool (if a then sem succ_e (@nil (list bool)) (@cons (list bool) (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => sem succ_e (@nil (list bool)) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) (fun _ vsl : list (list bool) => sem succ_e (@nil (list bool)) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) m (@nil (list bool)) (@cons (list bool) n (@nil (list bool)))) (@nil (list bool))) else sem succ_e (@nil (list bool)) (@cons (list bool) (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => sem succ_e (@nil (list bool)) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) (fun _ vsl : list (list bool) => sem succ_e (@nil (list bool)) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) m (@nil (list bool)) (@cons (list bool) n (@nil (list bool)))) (@nil (list bool))))) (S (Init.Nat.add (@length bool m) (@length bool n))) *) case a; simpl; rewrite succ_correct; auto. Qed. Opaque plus_e. Fixpoint plusl_e (n:nat)(el:list BC) : BC := match el with | nil => zero_e n 0 | e' :: el' => comp n 0 plus_e [e'] [plusl_e n el'] end. Lemma plusl_arities n el : andl (fun e => arities e = ok_arities n 0) el -> arities (plusl_e n el) = ok_arities n 0. Proof. (* Goal: forall _ : @andl BC (fun e : BC => @eq Arities (arities e) (ok_arities n O)) el, @eq Arities (arities (plusl_e n el)) (ok_arities n O) *) induction el as [ | e' el' IH]. (* Goal: forall _ : @andl BC (fun e : BC => @eq Arities (arities e) (ok_arities n O)) (@cons BC e' el'), @eq Arities (arities (plusl_e n (@cons BC e' el'))) (ok_arities n O) *) (* Goal: forall _ : @andl BC (fun e : BC => @eq Arities (arities e) (ok_arities n O)) (@nil BC), @eq Arities (arities (plusl_e n (@nil BC))) (ok_arities n O) *) trivial. (* Goal: forall _ : @andl BC (fun e : BC => @eq Arities (arities e) (ok_arities n O)) (@cons BC e' el'), @eq Arities (arities (plusl_e n (@cons BC e' el'))) (ok_arities n O) *) intro H. (* Goal: @eq Arities (arities (plusl_e n (@cons BC e' el'))) (ok_arities n O) *) simpl in H. (* Goal: @eq Arities (arities (plusl_e n (@cons BC e' el'))) (ok_arities n O) *) simpl plusl_e. (* Goal: @eq Arities (arities (comp n O plus_e (@cons BC e' (@nil BC)) (@cons BC (plusl_e n el') (@nil BC)))) (ok_arities n O) *) rewrite comp_arities. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n O)) (@cons BC (plusl_e n el') (@nil BC)) *) (* Goal: @andl BC (fun ne : BC => @eq Arities (arities ne) (ok_arities n O)) (@cons BC e' (@nil BC)) *) (* Goal: @eq Arities (arities plus_e) (ok_arities (@length BC (@cons BC e' (@nil BC))) (@length BC (@cons BC (plusl_e n el') (@nil BC)))) *) (* Goal: @eq Arities (ok_arities n O) (ok_arities n O) *) trivial. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n O)) (@cons BC (plusl_e n el') (@nil BC)) *) (* Goal: @andl BC (fun ne : BC => @eq Arities (arities ne) (ok_arities n O)) (@cons BC e' (@nil BC)) *) (* Goal: @eq Arities (arities plus_e) (ok_arities (@length BC (@cons BC e' (@nil BC))) (@length BC (@cons BC (plusl_e n el') (@nil BC)))) *) trivial. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n O)) (@cons BC (plusl_e n el') (@nil BC)) *) (* Goal: @andl BC (fun ne : BC => @eq Arities (arities ne) (ok_arities n O)) (@cons BC e' (@nil BC)) *) simpl; tauto. (* Goal: @andl BC (fun se : BC => @eq Arities (arities se) (ok_arities n O)) (@cons BC (plusl_e n el') (@nil BC)) *) simpl; tauto. Qed. Lemma plusl_correct : forall n nl el, length (sem (plusl_e n el) nl nil) = plusl (map (fun e => length (sem e nl nil)) el). Proof. (* Goal: forall (n : nat) (nl : list (list bool)) (el : list BC), @eq nat (@length bool (sem (plusl_e n el) nl (@nil (list bool)))) (plusl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el)) *) induction el as [ | e el IH]; simpl. (* Goal: @eq nat (@length bool (sem plus_e (@cons (list bool) (sem e nl (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (sem (plusl_e n el) nl (@nil (list bool))) (@nil (list bool))))) (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (plusl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) *) (* Goal: @eq nat O O *) trivial. (* Goal: @eq nat (@length bool (sem plus_e (@cons (list bool) (sem e nl (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (sem (plusl_e n el) nl (@nil (list bool))) (@nil (list bool))))) (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (plusl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) *) rewrite plus_correct, IH. (* Goal: @eq nat (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (plusl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (plusl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) *) trivial. Qed. Notation or_e := plus_e (only parsing). Lemma or_correct : forall b1 b2, bs2bool (sem or_e [bool2bs b1] [bool2bs b2]) = b1 || b2. Proof. (* Goal: forall b1 b2 : bool, @eq bool (bs2bool (sem plus_e (@cons (list bool) (bool2bs b1) (@nil (list bool))) (@cons (list bool) (bool2bs b2) (@nil (list bool))))) (orb b1 b2) *) intros [ | ] [ | ]; reflexivity. Qed. Definition mult_e : BC := rec (zero_e 1 0) (comp 2 1 plus_e ((proj 2 0 1) :: nil) ((proj 2 1 2) :: nil)) (comp 2 1 plus_e ((proj 2 0 1) :: nil) ((proj 2 1 2) :: nil)). Lemma mult_correct : forall m n, length (sem mult_e [m; n] nil) = (length m) * (length n). Proof. (* Goal: forall m n : list bool, @eq nat (@length bool (sem mult_e (@cons (list bool) m (@cons (list bool) n (@nil (list bool)))) (@nil (list bool)))) (Init.Nat.mul (@length bool m) (@length bool n)) *) induction m; intro n; trivial; simpl in *. (* Goal: @eq nat (@length bool (if a then sem plus_e (@cons (list bool) n (@nil (list bool))) (@cons (list bool) (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => sem plus_e (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool))) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) (fun vnl vsl : list (list bool) => sem plus_e (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool))) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) m (@cons (list bool) n (@nil (list bool))) (@nil (list bool))) (@nil (list bool))) else sem plus_e (@cons (list bool) n (@nil (list bool))) (@cons (list bool) (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => sem plus_e (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool))) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) (fun vnl vsl : list (list bool) => sem plus_e (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool))) (@cons (list bool) (@nth (list bool) O vsl (@nil bool)) (@nil (list bool)))) m (@cons (list bool) n (@nil (list bool))) (@nil (list bool))) (@nil (list bool))))) (Init.Nat.add (@length bool n) (Init.Nat.mul (@length bool m) (@length bool n))) *) case a; rewrite plus_correct; auto. Qed. Opaque mult_e. Notation and_e := mult_e (only parsing). Lemma and_correct : forall b1 b2, bs2bool (sem and_e [bool2bs b1; bool2bs b2] nil) = b1 && b2. Proof. (* Goal: forall b1 b2 : bool, @eq bool (bs2bool (sem mult_e (@cons (list bool) (bool2bs b1) (@cons (list bool) (bool2bs b2) (@nil (list bool)))) (@nil (list bool)))) (andb b1 b2) *) intros [ | ] [ | ]; reflexivity. Qed. Definition minus_rev_e : BC := rec (proj 0 1 0) (comp 1 2 pred nil ((proj 1 2 1) :: nil)) (comp 1 2 pred nil ((proj 1 2 1) :: nil)). Lemma minus_rev_correct : forall m n, length (sem minus_rev_e [n] [m]) = (length m) - (length n). Proof. (* Goal: forall m n : list bool, @eq nat (@length bool (sem minus_rev_e (@cons (list bool) n (@nil (list bool))) (@cons (list bool) m (@nil (list bool))))) (Init.Nat.sub (@length bool m) (@length bool n)) *) induction n; simpl in *; [ omega | ]. (* Goal: @eq nat (@length bool (if a then @tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) n (@nil (list bool)) (@cons (list bool) m (@nil (list bool)))) else @tl bool (sem_rec (fun _ vsl : list (list bool) => @nth (list bool) O vsl (@nil bool)) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) (fun _ vsl : list (list bool) => @tl bool (@nth (list bool) O vsl (@nil bool))) n (@nil (list bool)) (@cons (list bool) m (@nil (list bool)))))) (Init.Nat.sub (@length bool m) (S (@length bool n))) *) case a; rewrite length_tail, IHn; omega. Qed. Opaque minus_rev_e. Notation lt_e := minus_rev_e. Lemma lt_correct v1 v2: bs2bool (sem lt_e [v1] [v2]) = true -> length v1 < length v2. Proof. (* Goal: forall _ : @eq bool (bs2bool (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true, lt (@length bool v1) (@length bool v2) *) intros; simpl in *. (* Goal: lt (@length bool v1) (@length bool v2) *) apply bs_nat2bool_true in H. (* Goal: lt (@length bool v1) (@length bool v2) *) rewrite minus_rev_correct in H; omega. Qed. Lemma unary_tl l : unary l = true -> unary (tl l) = true. Proof. (* Goal: forall _ : @eq bool (unary l) true, @eq bool (unary (@tl bool l)) true *) intros. (* Goal: @eq bool (unary (@tl bool l)) true *) destruct l; simpl; trivial. (* Goal: @eq bool (unary l) true *) simpl in H. (* Goal: @eq bool (unary l) true *) rewrite andb_true_iff in H; tauto. Qed. Lemma lt_correct_conv_bool v1 v2: unary v2 = true -> length v1 < length v2 -> bs2bool (sem lt_e [v1] [v2]) = true. Lemma lt_correct_conv v1 v2 : unary v1 = true -> unary v2 = true -> bs2bool (sem lt_e [v1] [v2]) = false -> length v2 <= length v1. Proof. (* Goal: forall (_ : @eq bool (unary v1) true) (_ : @eq bool (unary v2) true) (_ : @eq bool (bs2bool (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) false), le (@length bool v2) (@length bool v1) *) intros; trivial. (* Goal: le (@length bool v2) (@length bool v1) *) apply bs_nat2bool_false in H1. (* Goal: @eq bool (unary (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: le (@length bool v2) (@length bool v1) *) rewrite minus_rev_correct in H1. (* Goal: @eq bool (unary (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: le (@length bool v2) (@length bool v1) *) omega. (* Goal: @eq bool (unary (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true *) apply preservation; simpl; try reflexivity; rewrite andb_true_iff; auto. Qed. Lemma lt_correct_conv_nil v1 v2 : unary v1 = true -> unary v2 = true -> sem lt_e [v1] [v2] = nil -> length v2 <= length v1. Proof. (* Goal: forall (_ : @eq bool (unary v1) true) (_ : @eq bool (unary v2) true) (_ : @eq (list bool) (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool)))) (@nil bool)), le (@length bool v2) (@length bool v1) *) intros; trivial. (* Goal: le (@length bool v2) (@length bool v1) *) assert (bs2bool (sem lt_e [v1] [v2]) = false). (* Goal: le (@length bool v2) (@length bool v1) *) (* Goal: @eq bool (bs2bool (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) false *) rewrite H1; simpl; trivial. (* Goal: le (@length bool v2) (@length bool v1) *) apply bs_nat2bool_false in H2. (* Goal: @eq bool (unary (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: le (@length bool v2) (@length bool v1) *) rewrite minus_rev_correct in H2. (* Goal: @eq bool (unary (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: le (@length bool v2) (@length bool v1) *) omega. (* Goal: @eq bool (unary (sem minus_rev_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true *) apply preservation; simpl; try reflexivity; rewrite andb_true_iff; auto. Qed. Definition le_e : BC := comp 1 1 lt_e (proj 1 0 0 :: nil) (comp 1 1 succ_e nil (proj 1 1 1 :: nil) :: nil). Lemma le_correct : forall v1 v2, bs2bool (sem le_e [v1] [v2]) = true -> length v1 <= length v2. Proof. (* Goal: forall (v1 v2 : list bool) (_ : @eq bool (bs2bool (sem le_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) true), le (@length bool v1) (@length bool v2) *) intros v1 v2 H; simpl in H. (* Goal: le (@length bool v1) (@length bool v2) *) apply lt_correct in H. (* Goal: le (@length bool v1) (@length bool v2) *) rewrite succ_correct in H. (* Goal: le (@length bool v1) (@length bool v2) *) omega. Qed. Lemma le_correct_conv v1 v2 : unary v1 = true -> unary v2 = true -> bs2bool (sem le_e [v1] [v2]) = false -> length v2 < length v1. Proof. (* Goal: forall (_ : @eq bool (unary v1) true) (_ : @eq bool (unary v2) true) (_ : @eq bool (bs2bool (sem le_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool))))) false), lt (@length bool v2) (@length bool v1) *) intros; trivial. (* Goal: lt (@length bool v2) (@length bool v1) *) simpl in H1. (* Goal: lt (@length bool v2) (@length bool v1) *) apply lt_correct_conv in H1. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: @eq bool (unary v1) true *) (* Goal: lt (@length bool v2) (@length bool v1) *) rewrite succ_correct in H1. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: @eq bool (unary v1) true *) (* Goal: lt (@length bool v2) (@length bool v1) *) omega. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: @eq bool (unary v1) true *) trivial. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) apply preservation; simpl; try reflexivity; rewrite andb_true_iff; auto. Qed. Lemma le_correct_conv_nil v1 v2 : unary v1 = true -> unary v2 = true -> sem le_e [v1] [v2] = nil -> S (length v2) <= length v1. Proof. (* Goal: forall (_ : @eq bool (unary v1) true) (_ : @eq bool (unary v2) true) (_ : @eq (list bool) (sem le_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool)))) (@nil bool)), le (S (@length bool v2)) (@length bool v1) *) intros; trivial. (* Goal: le (S (@length bool v2)) (@length bool v1) *) simpl in H1. (* Goal: le (S (@length bool v2)) (@length bool v1) *) apply lt_correct_conv_nil in H1. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: @eq bool (unary v1) true *) (* Goal: le (S (@length bool v2)) (@length bool v1) *) rewrite succ_correct in H1. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: @eq bool (unary v1) true *) (* Goal: le (S (@length bool v2)) (@length bool v1) *) omega. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) (* Goal: @eq bool (unary v1) true *) trivial. (* Goal: @eq bool (unary (sem succ_e (@nil (list bool)) (@cons (list bool) v2 (@nil (list bool))))) true *) apply preservation; simpl; try reflexivity; rewrite andb_true_iff; auto. Qed. Opaque le_e. Notation minus_e := (inv_e (from_11_to_20 minus_rev_e)) (only parsing). Lemma minus_correct : forall m n, length (sem minus_e [n; m] nil) = (length n) - (length m). Proof. (* Goal: forall m n : list bool, @eq nat (@length bool (sem (inv_e (from_11_to_20 minus_rev_e)) (@cons (list bool) n (@cons (list bool) m (@nil (list bool)))) (@nil (list bool)))) (Init.Nat.sub (@length bool n) (@length bool m)) *) intros; simpl; rewrite minus_rev_correct; trivial. Qed. Definition max_e : BC := comp 2 0 (rec (proj 2 0 0) (proj 3 1 2) (proj 3 1 2) ) [ P'_e; proj 2 0 0; proj 2 0 1] nil. Lemma max_correct_l v1 v2 : length v2 <= length v1 -> sem max_e [v1; v2] nil = v1. Proof. (* Goal: forall _ : le (@length bool v2) (@length bool v1), @eq (list bool) (sem max_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) v1 *) simpl; intros. (* Goal: @eq (list bool) (sem_rec (fun vnl _ : list (list bool) => @nth (list bool) O vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (sem P_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool)))) (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) v1 *) rewrite P_correct; unfold P. (* Goal: @eq (list bool) (sem_rec (fun vnl _ : list (list bool) => @nth (list bool) O vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (@skipn bool (@length bool v1) v2) (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) v1 *) rewrite skipn_nil; simpl; trivial. Qed. Lemma max_correct_r v1 v2 : length v1 < length v2 -> sem max_e [v1; v2] nil = v2. Proof. (* Goal: forall _ : lt (@length bool v1) (@length bool v2), @eq (list bool) (sem max_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) v2 *) simpl; intros. (* Goal: @eq (list bool) (sem_rec (fun vnl _ : list (list bool) => @nth (list bool) O vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (sem P_e (@cons (list bool) v1 (@nil (list bool))) (@cons (list bool) v2 (@nil (list bool)))) (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) v2 *) rewrite P_correct; unfold P. (* Goal: @eq (list bool) (sem_rec (fun vnl _ : list (list bool) => @nth (list bool) O vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (fun vnl _ : list (list bool) => @nth (list bool) (S (S O)) vnl (@nil bool)) (@skipn bool (@length bool v1) v2) (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) v2 *) case_eq ( (skipn (length v1) v2) ); simpl; intros. (* Goal: @eq (list bool) (if b then v2 else v2) v2 *) (* Goal: @eq (list bool) v1 v2 *) contradict H. (* Goal: @eq (list bool) (if b then v2 else v2) v2 *) (* Goal: not (lt (@length bool v1) (@length bool v2)) *) apply le_not_lt. (* Goal: @eq (list bool) (if b then v2 else v2) v2 *) (* Goal: le (@length bool v2) (@length bool v1) *) apply skipn_nil_length; trivial. (* Goal: @eq (list bool) (if b then v2 else v2) v2 *) case b; trivial. Qed. Fixpoint div' (q y:nat)(x:nat) : nat := match q with | 0 => 0 | S q' => if leb (q' * y) x then q' else div' q' y x end. Lemma div'_coq_correct : forall (q x y : nat) (Hy:y>0), (q > proj1_sig (quotient y Hy x) -> div' q y x = proj1_sig (quotient y Hy x)) /\ (q <= proj1_sig (quotient y Hy x) -> div' q y x = Peano.pred q). Proof. (* Goal: forall (q x y : nat) (Hy : gt y O), and (forall _ : gt q (@proj1_sig nat (fun q0 : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q0 y) r)) (gt y r))) (quotient y Hy x)), @eq nat (div' q y x) (@proj1_sig nat (fun q0 : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q0 y) r)) (gt y r))) (quotient y Hy x))) (forall _ : le q (@proj1_sig nat (fun q0 : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q0 y) r)) (gt y r))) (quotient y Hy x)), @eq nat (div' q y x) (Init.Nat.pred q)) *) intros q x y Hy. (* Goal: and (forall _ : gt q (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x)), @eq nat (div' q y x) (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x))) (forall _ : le q (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x)), @eq nat (div' q y x) (Init.Nat.pred q)) *) destruct (quotient y Hy x) as (qu & r & H1 & H2); simpl. (* Goal: and (forall _ : gt q qu, @eq nat (div' q y x) qu) (forall _ : le q qu, @eq nat (div' q y x) (Init.Nat.pred q)) *) induction q as [ | q' IH]; simpl; [ omega | ]. (* Goal: and (forall _ : gt (S q') qu, @eq nat (if Nat.leb (Init.Nat.mul q' y) x then q' else div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (if Nat.leb (Init.Nat.mul q' y) x then q' else div' q' y x) q') *) case_eq (leb (q' * y) x); intro H. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: and (forall _ : gt (S q') qu, @eq nat q' qu) (forall _ : le (S q') qu, @eq nat q' q') *) clear IH. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: and (forall _ : gt (S q') qu, @eq nat q' qu) (forall _ : le (S q') qu, @eq nat q' q') *) apply leb_complete in H; split; subst x; intros; trivial. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: @eq nat q' qu *) assert (qu <= q') as H1 by omega; clear H0. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: @eq nat q' qu *) apply le_lt_or_eq in H1. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: @eq nat q' qu *) destruct H1; auto. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: @eq nat q' qu *) contradict H. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: not (le (Init.Nat.mul q' y) (Init.Nat.add (Init.Nat.mul qu y) r)) *) apply lt_not_le. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: lt (Init.Nat.add (Init.Nat.mul qu y) r) (Init.Nat.mul q' y) *) apply lt_le_trans with (qu * y + y); [ omega | ]. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: le (Init.Nat.add (Init.Nat.mul qu y) y) (Init.Nat.mul q' y) *) rewrite <- mult_succ_l. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) (* Goal: le (Init.Nat.mul (S qu) y) (Init.Nat.mul q' y) *) apply mult_le_compat_r; omega. (* Goal: and (forall _ : gt (S q') qu, @eq nat (div' q' y x) qu) (forall _ : le (S q') qu, @eq nat (div' q' y x) q') *) apply leb_complete_conv in H; split; intros; subst. (* Goal: @eq nat (div' q' y (Init.Nat.add (Init.Nat.mul qu y) r)) q' *) (* Goal: @eq nat (div' q' y (Init.Nat.add (Init.Nat.mul qu y) r)) qu *) assert (q'=qu \/ q'>qu) as [H3 | H3]; subst; omega. (* Goal: @eq nat (div' q' y (Init.Nat.add (Init.Nat.mul qu y) r)) q' *) assert (S q' = qu \/ S q' < qu) as [H4 | H4] by omega; subst. (* Goal: @eq nat (div' q' y (Init.Nat.add (Init.Nat.mul qu y) r)) q' *) (* Goal: @eq nat (div' q' y (Init.Nat.add (Init.Nat.mul (S q') y) r)) q' *) contradict H. (* Goal: @eq nat (div' q' y (Init.Nat.add (Init.Nat.mul qu y) r)) q' *) (* Goal: not (lt (Init.Nat.add (Init.Nat.mul (S q') y) r) (Init.Nat.mul q' y)) *) apply le_not_lt; simpl; omega. (* Goal: @eq nat (div' q' y (Init.Nat.add (Init.Nat.mul qu y) r)) q' *) contradict H4. (* Goal: not (lt (S q') qu) *) apply le_not_lt. (* Goal: le qu (S q') *) apply mult_S_le_reg_l with (Peano.pred y). (* Goal: le (Init.Nat.mul (S (Init.Nat.pred y)) qu) (Init.Nat.mul (S (Init.Nat.pred y)) (S q')) *) rewrite <- S_pred with (m:=0), mult_comm, (mult_comm y (S q')). (* Goal: lt O y *) (* Goal: le (Nat.mul qu y) (Nat.mul (S q') y) *) simpl; omega. (* Goal: lt O y *) omega. Qed. Definition div (x y:nat) : nat := div' (S x) y x. Lemma div_coq_correct : forall (x y:nat) (Hy:y>0), div x y = proj1_sig (quotient y Hy x). Proof. (* Goal: forall (x y : nat) (Hy : gt y O), @eq nat (div x y) (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x)) *) unfold div; intros x y Hy. (* Goal: @eq nat (div' (S x) y x) (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x)) *) generalize (div'_coq_correct (S x) x y Hy). (* Goal: forall _ : and (forall _ : gt (S x) (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x)), @eq nat (div' (S x) y x) (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x))) (forall _ : le (S x) (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x)), @eq nat (div' (S x) y x) (Init.Nat.pred (S x))), @eq nat (div' (S x) y x) (@proj1_sig nat (fun q : nat => @ex nat (fun r : nat => and (@eq nat x (Init.Nat.add (Init.Nat.mul q y) r)) (gt y r))) (quotient y Hy x)) *) destruct (quotient y Hy x) as (q & r & H1 & H2); simpl. (* Goal: forall _ : and (forall _ : gt (S x) q, @eq nat (if Nat.leb (Init.Nat.mul x y) x then x else div' x y x) q) (forall _ : le (S x) q, @eq nat (if Nat.leb (Init.Nat.mul x y) x then x else div' x y x) x), @eq nat (if Nat.leb (Init.Nat.mul x y) x then x else div' x y x) q *) intros [H3 _]. (* Goal: @eq nat (if Nat.leb (Init.Nat.mul x y) x then x else div' x y x) q *) apply H3; subst x. (* Goal: gt (S (Init.Nat.add (Init.Nat.mul q y) r)) q *) apply le_gt_S. (* Goal: le q (Init.Nat.add (Init.Nat.mul q y) r) *) apply le_trans with (q*y); [ | omega ]. (* Goal: le q (Init.Nat.mul q y) *) rewrite <- (mult_1_r q) at 1. (* Goal: le (Nat.mul q (S O)) (Init.Nat.mul q y) *) apply mult_le_compat_l; omega. Qed. Definition div'_e : BC := rec (zero_e 1 1) (comp 2 2 cond nil [comp 2 2 le_e [comp 2 0 mult_e [proj 2 0 0; proj 2 0 1] nil] [proj 2 2 3]; proj 2 2 2; proj 2 2 0; proj 2 2 2]) (comp 2 2 cond nil [comp 2 2 le_e [comp 2 0 mult_e [proj 2 0 0; proj 2 0 1] nil] [proj 2 2 3]; proj 2 2 2; proj 2 2 0; proj 2 2 2]). Lemma hd_cons l a l' : l = a :: l' -> bs2bool l = a. Proof. (* Goal: forall _ : @eq (list bool) l (@cons bool a l'), @eq bool (bs2bool l) a *) intros; subst; trivial. Qed. Ltac elim_if := match goal with | |- context [if ?c then ?c1 else ?c2] => case_eq c end. Lemma div'_correct v1 v2 v3 : unary v1 = true -> unary v2 = true -> unary v3 = true -> length (sem div'_e [v1;v2] [v3]) = div' (length v1) (length v2) (length v3). Proof. (* Goal: forall (_ : @eq bool (unary v1) true) (_ : @eq bool (unary v2) true) (_ : @eq bool (unary v3) true), @eq nat (@length bool (sem div'_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@cons (list bool) v3 (@nil (list bool))))) (div' (@length bool v1) (@length bool v2) (@length bool v3)) *) intros; induction v1; simpl in *; intros; trivial. (* Goal: @eq nat (@length bool (if a then match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end else match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite andb_true_iff in H. (* Goal: @eq nat (@length bool (if a then match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end else match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) case a; simpl. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) case_eq ( sem le_e [sem mult_e [v1; v2] nil] [v3] ); intros. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite IHv1; trivial. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply le_correct_conv_nil in H2. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite mult_correct in H2. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite leb_correct_conv; trivial. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) apply preservation; trivial; simpl. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (andb (unary v1) (andb (unary v2) true)) true *) repeat rewrite andb_true_iff; tauto. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) trivial. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) tauto. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply hd_cons in H2. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) destruct b. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool v1) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply le_correct in H2. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool v1) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite mult_correct in H2. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool v1) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite leb_correct; trivial. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply le_correct_conv in H2; trivial. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) simpl in IHv1; rewrite IHv1; clear IHv1; try tauto. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite leb_correct_conv; trivial. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: lt (@length bool v3) (Init.Nat.mul (@length bool v1) (@length bool v2)) *) rewrite mult_correct in H2; trivial. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) apply preservation; trivial; simpl. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (andb (unary v1) (andb (unary v2) true)) true *) do 2 rewrite andb_true_iff; tauto. (* Goal: @eq nat (@length bool match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) with | nil => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) | cons (true as b) l => v1 | cons (false as b) l => sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b0) l0 => @nth (list bool) O vnl (@nil bool) | cons (false as b0) l0 => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))) end) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) case_eq ( sem le_e [sem mult_e [v1; v2] nil] [v3] ); intros. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite IHv1; trivial. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply le_correct_conv_nil in H2. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite mult_correct in H2. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite leb_correct_conv; trivial. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) apply preservation; trivial; simpl. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) (* Goal: @eq bool (andb (unary v1) (andb (unary v2) true)) true *) repeat rewrite andb_true_iff; tauto. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) (* Goal: @eq bool (unary v3) true *) trivial. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq bool (unary v1) true *) tauto. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply hd_cons in H2. (* Goal: @eq nat (@length bool (if b then v1 else sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) destruct b. (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool v1) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply le_correct in H2. (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool v1) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite mult_correct in H2. (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) (* Goal: @eq nat (@length bool v1) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite leb_correct; trivial. (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) apply le_correct_conv in H2; trivial. (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (@length bool (sem_rec (fun _ _ : list (list bool) => @nil bool) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) (fun vnl vsl : list (list bool) => match sem le_e (@cons (list bool) (sem mult_e (@cons (list bool) (@nth (list bool) O vnl (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) vnl (@nil bool)) (@nil (list bool)))) (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (@nth (list bool) (S O) vsl (@nil bool)) (@nil (list bool))) with | nil => @nth (list bool) O vsl (@nil bool) | cons (true as b) l => @nth (list bool) O vnl (@nil bool) | cons (false as b) l => @nth (list bool) O vsl (@nil bool) end) v1 (@cons (list bool) v2 (@nil (list bool))) (@cons (list bool) v3 (@nil (list bool))))) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) simpl in IHv1; rewrite IHv1; clear IHv1; try tauto. (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: @eq nat (div' (@length bool v1) (@length bool v2) (@length bool v3)) (if Nat.leb (Init.Nat.mul (@length bool v1) (@length bool v2)) (@length bool v3) then @length bool v1 else div' (@length bool v1) (@length bool v2) (@length bool v3)) *) rewrite leb_correct_conv; trivial. (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) (* Goal: lt (@length bool v3) (Init.Nat.mul (@length bool v1) (@length bool v2)) *) rewrite mult_correct in H2; trivial. (* Goal: @eq bool (unary (sem mult_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) true *) apply preservation; trivial; simpl. (* Goal: @eq bool (andb (unary v1) (andb (unary v2) true)) true *) do 2 rewrite andb_true_iff; tauto. Qed. Opaque div'_e. Definition div_e : BC := comp 2 0 div'_e [comp 2 0 succ_e nil [proj 2 0 0]; proj 2 0 1] [proj 2 0 0]. Lemma div_correct v1 v2 : unary v1 = true -> unary v2 = true -> length (sem div_e [v1; v2] nil) = div (length v1) (length v2). Proof. (* Goal: forall (_ : @eq bool (unary v1) true) (_ : @eq bool (unary v2) true), @eq nat (@length bool (sem div_e (@cons (list bool) v1 (@cons (list bool) v2 (@nil (list bool)))) (@nil (list bool)))) (div (@length bool v1) (@length bool v2)) *) intros; simpl sem. (* Goal: @eq nat (@length bool (sem div'_e (@cons (list bool) (sem succ_e (@nil (list bool)) (@cons (list bool) v1 (@nil (list bool)))) (@cons (list bool) v2 (@nil (list bool)))) (@cons (list bool) v1 (@nil (list bool))))) (div (@length bool v1) (@length bool v2)) *) rewrite div'_correct; trivial. Qed. Fixpoint scalar_e (a:nat)(n:nat)(e:BC) : BC := match a with | 0 => zero_e n 0 | S a' => comp n 0 plus_e [e] [scalar_e a' n e] end. Lemma scalar_arities : forall a n e, arities e = ok_arities n 0 -> arities (scalar_e a n e) = ok_arities n 0. Proof. (* Goal: forall (a n : nat) (e : BC) (_ : @eq Arities (arities e) (ok_arities n O)), @eq Arities (arities (scalar_e a n e)) (ok_arities n O) *) induction a as [ | a IH]; simpl. (* Goal: forall (n : nat) (e : BC) (_ : @eq Arities (arities e) (ok_arities n O)), @eq Arities match arities plus_e with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | error_comp a0 l l0 => error_comp (error_comp a0 l l0) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S O)) (Nat.eqb hs (S O))) (andb (aeq (arities e) (ok_arities n O)) true)) (andb (aeq (arities (scalar_e a n e)) (ok_arities n O)) true) then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) end (ok_arities n O) *) (* Goal: forall (n : nat) (e : BC) (_ : @eq Arities (arities e) (ok_arities n O)), @eq Arities (ok_arities n O) (ok_arities n O) *) trivial. (* Goal: forall (n : nat) (e : BC) (_ : @eq Arities (arities e) (ok_arities n O)), @eq Arities match arities plus_e with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | error_comp a0 l l0 => error_comp (error_comp a0 l l0) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S O)) (Nat.eqb hs (S O))) (andb (aeq (arities e) (ok_arities n O)) true)) (andb (aeq (arities (scalar_e a n e)) (ok_arities n O)) true) then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) end (ok_arities n O) *) intros n e H. (* Goal: @eq Arities match arities plus_e with | error_rec a0 a1 a2 => error_comp (error_rec a0 a1 a2) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | error_comp a0 l l0 => error_comp (error_comp a0 l l0) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S O)) (Nat.eqb hs (S O))) (andb (aeq (arities e) (ok_arities n O)) true)) (andb (aeq (arities (scalar_e a n e)) (ok_arities n O)) true) then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (arities e) (@nil Arities)) (@cons Arities (arities (scalar_e a n e)) (@nil Arities)) end (ok_arities n O) *) rewrite H, (IH _ _ H). (* Goal: @eq Arities match arities plus_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S O)) (Nat.eqb hs (S O))) (andb (aeq (ok_arities n O) (ok_arities n O)) true)) (andb (aeq (ok_arities n O) (ok_arities n O)) true) then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) end (ok_arities n O) *) simpl. (* Goal: @eq Arities match arities plus_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S O)) (Nat.eqb hs (S O))) (andb (andb (Nat.eqb n n) true) true)) (andb (andb (Nat.eqb n n) true) true) then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) end (ok_arities n O) *) rewrite <- beq_nat_refl. (* Goal: @eq Arities match arities plus_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S O)) (Nat.eqb hs (S O))) (andb (andb true true) true)) (andb (andb true true) true) then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@nil Arities)) (@cons Arities (ok_arities n O) (@nil Arities)) end (ok_arities n O) *) trivial. Qed. Opaque plus_e. Lemma scalar_correct : forall a n nl e, length (sem (scalar_e a n e) nl nil) = a * length (sem e nl nil). Proof. (* Goal: forall (a n : nat) (nl : list (list bool)) (e : BC), @eq nat (@length bool (sem (scalar_e a n e) nl (@nil (list bool)))) (Init.Nat.mul a (@length bool (sem e nl (@nil (list bool))))) *) induction a as [ | a IH]; simpl. (* Goal: forall (n : nat) (nl : list (list bool)) (e : BC), @eq nat (@length bool (sem plus_e (@cons (list bool) (sem e nl (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (sem (scalar_e a n e) nl (@nil (list bool))) (@nil (list bool))))) (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (Init.Nat.mul a (@length bool (sem e nl (@nil (list bool)))))) *) (* Goal: forall (_ : nat) (_ : list (list bool)) (_ : BC), @eq nat O O *) trivial. (* Goal: forall (n : nat) (nl : list (list bool)) (e : BC), @eq nat (@length bool (sem plus_e (@cons (list bool) (sem e nl (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (sem (scalar_e a n e) nl (@nil (list bool))) (@nil (list bool))))) (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (Init.Nat.mul a (@length bool (sem e nl (@nil (list bool)))))) *) intros n nl e. (* Goal: @eq nat (@length bool (sem plus_e (@cons (list bool) (sem e nl (@nil (list bool))) (@nil (list bool))) (@cons (list bool) (sem (scalar_e a n e) nl (@nil (list bool))) (@nil (list bool))))) (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (Init.Nat.mul a (@length bool (sem e nl (@nil (list bool)))))) *) rewrite plus_correct, IH. (* Goal: @eq nat (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (Init.Nat.mul a (@length bool (sem e nl (@nil (list bool)))))) (Init.Nat.add (@length bool (sem e nl (@nil (list bool)))) (Init.Nat.mul a (@length bool (sem e nl (@nil (list bool)))))) *) trivial. Qed. Fixpoint multl_e (n:nat)(el:list BC) : BC := match el with | nil => one_e n 0 | e' :: el' => comp n 0 mult_e [e'; multl_e n el'] nil end. Lemma multl_arities : forall el n, andl (fun e => arities e = ok_arities n 0) el -> arities (multl_e n el) = ok_arities n 0. Proof. (* Goal: forall (el : list BC) (n : nat) (_ : @andl BC (fun e : BC => @eq Arities (arities e) (ok_arities n O)) el), @eq Arities (arities (multl_e n el)) (ok_arities n O) *) induction el as [ | e el IH]; simpl. (* Goal: forall (n : nat) (_ : and (@eq Arities (arities e) (ok_arities n O)) (@andl BC (fun e : BC => @eq Arities (arities e) (ok_arities n O)) el)), @eq Arities match arities mult_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (S O))) (Nat.eqb hs O)) (andb (aeq (arities e) (ok_arities n O)) (andb (aeq (arities (multl_e n el)) (ok_arities n O)) true))) true then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) end (ok_arities n O) *) (* Goal: forall (n : nat) (_ : True), @eq Arities (ok_arities n O) (ok_arities n O) *) trivial. (* Goal: forall (n : nat) (_ : and (@eq Arities (arities e) (ok_arities n O)) (@andl BC (fun e : BC => @eq Arities (arities e) (ok_arities n O)) el)), @eq Arities match arities mult_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (S O))) (Nat.eqb hs O)) (andb (aeq (arities e) (ok_arities n O)) (andb (aeq (arities (multl_e n el)) (ok_arities n O)) true))) true then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) end (ok_arities n O) *) intros n [H1 H2]. (* Goal: @eq Arities match arities mult_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (S O))) (Nat.eqb hs O)) (andb (aeq (arities e) (ok_arities n O)) (andb (aeq (arities (multl_e n el)) (ok_arities n O)) true))) true then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (arities e) (@cons Arities (arities (multl_e n el)) (@nil Arities))) (@nil Arities) end (ok_arities n O) *) rewrite H1, (IH _ H2). (* Goal: @eq Arities match arities mult_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (S O))) (Nat.eqb hs O)) (andb (aeq (ok_arities n O) (ok_arities n O)) (andb (aeq (ok_arities n O) (ok_arities n O)) true))) true then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) end (ok_arities n O) *) simpl. (* Goal: @eq Arities match arities mult_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (S O))) (Nat.eqb hs O)) (andb (andb (Nat.eqb n n) true) (andb (andb (Nat.eqb n n) true) true))) true then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) end (ok_arities n O) *) rewrite <- beq_nat_refl. (* Goal: @eq Arities match arities mult_e with | error_rec a a0 a1 => error_comp (error_rec a a0 a1) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | error_comp a l l0 => error_comp (error_comp a l l0) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | error_proj n0 n1 n2 => error_comp (error_proj n0 n1 n2) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) | ok_arities hn hs => if andb (andb (andb (Nat.eqb hn (S (S O))) (Nat.eqb hs O)) (andb (andb true true) (andb (andb true true) true))) true then ok_arities n O else error_comp (ok_arities hn hs) (@cons Arities (ok_arities n O) (@cons Arities (ok_arities n O) (@nil Arities))) (@nil Arities) end (ok_arities n O) *) trivial. Qed. Opaque mult_e. Lemma multl_correct : forall n nl el, length (sem (multl_e n el) nl nil) = multl (map (fun e => length (sem e nl nil)) el). Proof. (* Goal: forall (n : nat) (nl : list (list bool)) (el : list BC), @eq nat (@length bool (sem (multl_e n el) nl (@nil (list bool)))) (multl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el)) *) induction el as [ | e el IH]; simpl. (* Goal: @eq nat (@length bool (sem mult_e (@cons (list bool) (sem e nl (@nil (list bool))) (@cons (list bool) (sem (multl_e n el) nl (@nil (list bool))) (@nil (list bool)))) (@nil (list bool)))) (Init.Nat.mul (@length bool (sem e nl (@nil (list bool)))) (multl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) *) (* Goal: @eq nat (S O) (S O) *) trivial. (* Goal: @eq nat (@length bool (sem mult_e (@cons (list bool) (sem e nl (@nil (list bool))) (@cons (list bool) (sem (multl_e n el) nl (@nil (list bool))) (@nil (list bool)))) (@nil (list bool)))) (Init.Nat.mul (@length bool (sem e nl (@nil (list bool)))) (multl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) *) rewrite mult_correct, IH. (* Goal: @eq nat (Init.Nat.mul (@length bool (sem e nl (@nil (list bool)))) (multl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) (Init.Nat.mul (@length bool (sem e nl (@nil (list bool)))) (multl (@map BC nat (fun e : BC => @length bool (sem e nl (@nil (list bool)))) el))) *) trivial. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCdistinct. Require Export GeoCoq.Elements.OriginalProofs.lemma_NChelper. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_samesidecollinear : forall A B C P Q, OS P Q A B -> Col A B C -> neq A C -> OS P Q A C. Proof. (* Goal: forall (A B C P Q : @Point Ax) (_ : @OS Ax P Q A B) (_ : @Col Ax A B C) (_ : @neq Ax A C), @OS Ax P Q A C *) intros. (* Goal: @OS Ax P Q A C *) let Tf:=fresh in assert (Tf:exists p q r, (Col A B p /\ Col A B q /\ BetS P p r /\ BetS Q q r /\ nCol A B P /\ nCol A B Q)) by (conclude_def OS );destruct Tf as [p[q[r]]];spliter. (* Goal: @OS Ax P Q A C *) assert (neq A B) by (forward_using lemma_NCdistinct). (* Goal: @OS Ax P Q A C *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @OS Ax P Q A C *) assert (Col A B A) by (conclude_def Col ). (* Goal: @OS Ax P Q A C *) assert (nCol A C P) by (conclude lemma_NChelper). (* Goal: @OS Ax P Q A C *) assert (nCol A C Q) by (conclude lemma_NChelper). (* Goal: @OS Ax P Q A C *) assert (Col B A p) by (forward_using lemma_collinearorder). (* Goal: @OS Ax P Q A C *) assert (Col B A C) by (forward_using lemma_collinearorder). (* Goal: @OS Ax P Q A C *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @OS Ax P Q A C *) assert (Col A C p) by (conclude lemma_collinear4). (* Goal: @OS Ax P Q A C *) assert (Col B A q) by (forward_using lemma_collinearorder). (* Goal: @OS Ax P Q A C *) assert (Col A C q) by (conclude lemma_collinear4). (* Goal: @OS Ax P Q A C *) assert (OS P Q A C) by (conclude_def OS ). (* Goal: @OS Ax P Q A C *) close. Qed. End Euclid.
Require Export GeoCoq.Elements.OriginalProofs.lemma_NChelper. Require Export GeoCoq.Elements.OriginalProofs.lemma_NCorder. Section Euclid. Context `{Ax:euclidean_neutral_ruler_compass}. Lemma lemma_parallelcollinear2 : forall A B C c d, TP A B c d -> BetS c C d -> TP A B C d. Proof. (* Goal: forall (A B C c d : @Point Ax0) (_ : @TP Ax0 A B c d) (_ : @BetS Ax0 c C d), @TP Ax0 A B C d *) intros. (* Goal: @TP Ax0 A B C d *) assert (BetS d C c) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) assert ((neq A B /\ neq c d /\ ~ Meet A B c d /\ OS c d A B)) by (conclude_def TP ). (* Goal: @TP Ax0 A B C d *) let Tf:=fresh in assert (Tf:exists p q r, (Col A B p /\ Col A B r /\ BetS c p q /\ BetS d r q /\ nCol A B c /\ nCol A B d)) by (conclude_def OS );destruct Tf as [p[q[r]]];spliter. (* Goal: @TP Ax0 A B C d *) assert (neq C d) by (forward_using lemma_betweennotequal). (* Goal: @TP Ax0 A B C d *) assert (BetS q p c) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) assert (BetS q r d) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) assert (BetS d C c) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) assert (BetS q p c) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) assert (Col q p c) by (conclude_def Col ). (* Goal: @TP Ax0 A B C d *) assert (~ eq p r). (* Goal: @TP Ax0 A B C d *) (* Goal: not (@eq Ax0 p r) *) { (* Goal: not (@eq Ax0 p r) *) intro. (* Goal: False *) assert (Col q r d) by (conclude_def Col ). (* Goal: False *) assert (Col q p c) by (conclude_def Col ). (* Goal: False *) assert (Col q p d) by (conclude cn_equalitysub). (* Goal: False *) assert (neq q p) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col p c d) by (conclude lemma_collinear4). (* Goal: False *) assert (Col c d p) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet A B c d) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) } (* Goal: @TP Ax0 A B C d *) assert (nCol p r c) by (conclude lemma_NChelper). (* Goal: @TP Ax0 A B C d *) assert (nCol p r d) by (conclude lemma_NChelper). (* Goal: @TP Ax0 A B C d *) assert (nCol r d p) by (forward_using lemma_NCorder). (* Goal: @TP Ax0 A B C d *) assert (Col q r d) by (conclude_def Col ). (* Goal: @TP Ax0 A B C d *) assert (Col r d q) by (forward_using lemma_collinearorder). (* Goal: @TP Ax0 A B C d *) assert (eq d d) by (conclude cn_equalityreflexive). (* Goal: @TP Ax0 A B C d *) assert (Col r d d) by (conclude_def Col ). (* Goal: @TP Ax0 A B C d *) assert (neq q d) by (forward_using lemma_betweennotequal). (* Goal: @TP Ax0 A B C d *) assert (nCol q d p) by (conclude lemma_NChelper). (* Goal: @TP Ax0 A B C d *) assert (nCol q p d) by (forward_using lemma_NCorder). (* Goal: @TP Ax0 A B C d *) assert (Col q p c) by (conclude_def Col ). (* Goal: @TP Ax0 A B C d *) assert (eq c c) by (conclude cn_equalityreflexive). (* Goal: @TP Ax0 A B C d *) assert (~ eq c p). (* Goal: @TP Ax0 A B C d *) (* Goal: not (@eq Ax0 c p) *) { (* Goal: not (@eq Ax0 c p) *) intro. (* Goal: False *) assert (eq p c) by (conclude lemma_equalitysymmetric). (* Goal: False *) assert (Col p r c) by (conclude_def Col ). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) } (* Goal: @TP Ax0 A B C d *) assert (eq p p) by (conclude cn_equalityreflexive). (* Goal: @TP Ax0 A B C d *) assert (Col q p p) by (conclude_def Col ). (* Goal: @TP Ax0 A B C d *) assert (nCol c p d) by (conclude lemma_NChelper). (* Goal: @TP Ax0 A B C d *) assert (Col c p q) by (forward_using lemma_collinearorder). (* Goal: @TP Ax0 A B C d *) assert (eq c c) by (conclude cn_equalityreflexive). (* Goal: @TP Ax0 A B C d *) assert (Col c p c) by (conclude_def Col ). (* Goal: @TP Ax0 A B C d *) assert (neq q c) by (forward_using lemma_betweennotequal). (* Goal: @TP Ax0 A B C d *) assert (nCol q c d) by (conclude lemma_NChelper). (* Goal: @TP Ax0 A B C d *) assert (BetS q p c) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) let Tf:=fresh in assert (Tf:exists E, (BetS q E C /\ BetS d E p)) by (conclude postulate_Pasch_inner);destruct Tf as [E];spliter. (* Goal: @TP Ax0 A B C d *) assert (BetS p E d) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) assert (BetS q r d) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) let Tf:=fresh in assert (Tf:exists F, (BetS q F E /\ BetS p F r)) by (conclude postulate_Pasch_inner);destruct Tf as [F];spliter. (* Goal: @TP Ax0 A B C d *) assert (Col p r F) by (conclude_def Col ). (* Goal: @TP Ax0 A B C d *) assert (Col B r p) by (conclude lemma_collinear4). (* Goal: @TP Ax0 A B C d *) assert (Col B A p) by (forward_using lemma_collinearorder). (* Goal: @TP Ax0 A B C d *) assert (Col B A r) by (forward_using lemma_collinearorder). (* Goal: @TP Ax0 A B C d *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: @TP Ax0 A B C d *) assert (Col B p r) by (forward_using lemma_collinearorder). (* Goal: @TP Ax0 A B C d *) assert (Col B p A) by (forward_using lemma_collinearorder). (* Goal: @TP Ax0 A B C d *) assert (~ Col A B C). (* Goal: @TP Ax0 A B C d *) (* Goal: not (@Col Ax0 A B C) *) { (* Goal: not (@Col Ax0 A B C) *) intro. (* Goal: False *) assert (Col c C d) by (conclude_def Col ). (* Goal: False *) assert (Col c d C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet A B c d) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) } (* Goal: @TP Ax0 A B C d *) assert (BetS q F C) by (conclude lemma_3_6b). (* Goal: @TP Ax0 A B C d *) assert (BetS C F q) by (conclude axiom_betweennesssymmetry). (* Goal: @TP Ax0 A B C d *) assert (~ ~ OS C d A B). (* Goal: @TP Ax0 A B C d *) (* Goal: not (not (@OS Ax0 C d A B)) *) { (* Goal: not (not (@OS Ax0 C d A B)) *) intro. (* Goal: False *) assert (~ neq B p). (* Goal: False *) (* Goal: not (@neq Ax0 B p) *) { (* Goal: not (@neq Ax0 B p) *) intro. (* Goal: False *) assert (Col p r A) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A p r) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A p B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (~ neq A p). (* Goal: False *) (* Goal: not (@neq Ax0 A p) *) { (* Goal: not (@neq Ax0 A p) *) intro. (* Goal: False *) assert (Col p r B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B F) by (conclude lemma_collinear5). (* Goal: False *) assert (OS C d A B) by (conclude_def OS ). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) (* BG Goal: False *) (* BG Goal: False *) } (* Goal: False *) assert (Col A r F) by (conclude cn_equalitysub). (* Goal: False *) assert (Col r A F) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col r A B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (~ eq r A). (* Goal: False *) (* Goal: not (@eq Ax0 r A) *) { (* Goal: not (@eq Ax0 r A) *) intro. (* Goal: False *) assert (eq r p) by (conclude cn_equalitysub). (* Goal: False *) assert (neq p r) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq r p) by (conclude lemma_inequalitysymmetric). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) (* BG Goal: False *) (* BG Goal: False *) } (* Goal: False *) assert (Col A F B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B F) by (forward_using lemma_collinearorder). (* Goal: False *) assert (OS C d A B) by (conclude_def OS ). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) (* BG Goal: False *) } (* Goal: False *) assert (neq A p) by (conclude cn_equalitysub). (* Goal: False *) assert (Col A p B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: False *) assert (Col B A A) by (conclude_def Col ). (* Goal: False *) assert (Col B A p) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B A r) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A p r) by (conclude lemma_collinear5). (* Goal: False *) assert (Col p B r) by (conclude lemma_collinear4). (* Goal: False *) assert (Col p r B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col p r A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col A B F) by (conclude lemma_collinear5). (* Goal: False *) assert (OS C d A B) by (conclude_def OS ). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) } (* Goal: @TP Ax0 A B C d *) assert (~ Meet A B C d). (* Goal: @TP Ax0 A B C d *) (* Goal: not (@Meet Ax0 A B C d) *) { (* Goal: not (@Meet Ax0 A B C d) *) intro. (* Goal: False *) let Tf:=fresh in assert (Tf:exists R, (neq A B /\ neq C d /\ Col A B R /\ Col C d R)) by (conclude_def Meet );destruct Tf as [R];spliter. (* Goal: False *) assert (Col c C d) by (conclude_def Col ). (* Goal: False *) assert (Col C d c) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq C d) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col d c R) by (conclude lemma_collinear4). (* Goal: False *) assert (Col c d R) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Meet A B c d) by (conclude_def Meet ). (* Goal: False *) contradict. (* BG Goal: @TP Ax0 A B C d *) } (* Goal: @TP Ax0 A B C d *) assert (TP A B C d) by (conclude_def TP ). (* Goal: @TP Ax0 A B C d *) close. Qed. End Euclid.
From Coq Require Import ssreflect ssrbool ssrfun Eqdep. From mathcomp Require Import ssrnat eqtype seq path. From fcsl Require Import axioms ordtype pcm finmap unionmap. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Inductive ptr := ptr_nat of nat. Definition null := ptr_nat 0. Definition nat_ptr (x : ptr) := let: ptr_nat y := x in y. Definition eq_ptr (x y : ptr) : bool := match x, y with ptr_nat m, ptr_nat n => m == n end. Lemma eq_ptrP : Equality.axiom eq_ptr. Proof. (* Goal: @Equality.axiom ptr eq_ptr *) by case=>x [y] /=; case: eqP=>[->|*]; constructor=>//; case. Qed. Definition ptr_eqMixin := EqMixin eq_ptrP. Canonical ptr_eqType := EqType ptr ptr_eqMixin. Definition ptr_offset x i := ptr_nat (nat_ptr x + i). Notation "x .+ i" := (ptr_offset x i) (at level 3, format "x .+ i"). Lemma ptrE x y : (x == y) = (nat_ptr x == nat_ptr y). Proof. (* Goal: @eq bool (@eq_op ptr_eqType x y) (@eq_op nat_eqType (nat_ptr x) (nat_ptr y)) *) by move: x y=>[x][y]. Qed. Lemma ptr0 x : x.+0 = x. Proof. (* Goal: @eq ptr (ptr_offset x O) x *) by case: x=>x; rewrite /ptr_offset addn0. Qed. Lemma ptrA x i j : x.+i.+j = x.+(i+j). Proof. (* Goal: @eq ptr (ptr_offset (ptr_offset x i) j) (ptr_offset x (addn i j)) *) by case: x=>x; rewrite /ptr_offset addnA. Qed. Lemma ptrK x i j : (x.+i == x.+j) = (i == j). Proof. (* Goal: @eq bool (@eq_op ptr_eqType (ptr_offset x i) (ptr_offset x j)) (@eq_op nat_eqType i j) *) by case: x=>x; rewrite ptrE eqn_add2l. Qed. Lemma ptr_null x m : (x.+m == null) = (x == null) && (m == 0). Proof. (* Goal: @eq bool (@eq_op ptr_eqType (ptr_offset x m) null) (andb (@eq_op ptr_eqType x null) (@eq_op nat_eqType m O)) *) by case: x=>x; rewrite !ptrE addn_eq0. Qed. Lemma ptrT x y : {m : nat | (x == y.+m) || (y == x.+m)}. Proof. (* Goal: @sig nat (fun m : nat => is_true (orb (@eq_op ptr_eqType x (ptr_offset y m)) (@eq_op ptr_eqType y (ptr_offset x m)))) *) case: x y=>x [y]; exists (if x <= y then (y - x) else (x - y)). (* Goal: is_true (orb (@eq_op ptr_eqType (ptr_nat x) (ptr_offset (ptr_nat y) (if leq x y then subn y x else subn x y))) (@eq_op ptr_eqType (ptr_nat y) (ptr_offset (ptr_nat x) (if leq x y then subn y x else subn x y)))) *) rewrite !ptrE leq_eqVlt /=. (* Goal: is_true (orb (@eq_op nat_eqType x (addn y (if orb (@eq_op nat_eqType x y) (leq (S x) y) then subn y x else subn x y))) (@eq_op nat_eqType y (addn x (if orb (@eq_op nat_eqType x y) (leq (S x) y) then subn y x else subn x y)))) *) by case: (ltngtP x y)=>/= E; rewrite subnKC ?(ltnW E) ?eq_refl ?orbT // E. Qed. Definition ltn_ptr (x y : ptr) := match x, y with ptr_nat m, ptr_nat n => m < n end. Lemma ltn_ptr_irr : irreflexive ltn_ptr. Proof. (* Goal: @irreflexive ptr ltn_ptr *) by case=>x /=; rewrite ltnn. Qed. Lemma ltn_ptr_trans : transitive ltn_ptr. Proof. (* Goal: @transitive ptr ltn_ptr *) by case=>x [y][z]; apply: ltn_trans. Qed. Lemma ltn_ptr_total : forall x y : ptr, [|| ltn_ptr x y, x == y | ltn_ptr y x]. Proof. (* Goal: forall x y : ptr, is_true (orb (ltn_ptr x y) (orb (@eq_op ptr_eqType x y) (ltn_ptr y x))) *) by case=>x [y]; rewrite ptrE /=; case: ltngtP. Qed. Definition ptr_ordMixin := OrdMixin ltn_ptr_irr ltn_ptr_trans ltn_ptr_total. Canonical ptr_ordType := OrdType ptr ptr_ordMixin. Module Heap. Inductive heap := Undef | Def (finmap : {finMap ptr -> dynamic id}) of null \notin supp finmap. Section NullLemmas. Variables (f g : {finMap ptr -> dynamic id}) (x : ptr) (v : dynamic id). Lemma upd_nullP : x != null -> null \notin supp f -> null \notin supp (ins x v f). Proof. (* Goal: forall (_ : is_true (negb (@eq_op ptr_eqType x null))) (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f))))), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) (@ins ptr_ordType (@dynamic Type (fun x : Type => x)) x v f))))) *) by move=>H1 H2; rewrite supp_ins negb_or /= inE /= eq_sym H1. Qed. Lemma free_nullP : null \notin supp f -> null \notin supp (rem x f). Proof. (* Goal: forall _ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f)))), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) (@rem ptr_ordType (@dynamic Type (fun x : Type => x)) x f))))) *) by move=>H; rewrite supp_rem negb_and /= H orbT. Qed. Lemma un_nullP : null \notin supp f -> null \notin supp g -> null \notin supp (fcat f g). Proof. (* Goal: forall (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f))))) (_ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) g))))), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) (@fcat ptr_ordType (@dynamic Type (fun x : Type => x)) f g))))) *) by move=>H1 H2; rewrite supp_fcat negb_or H1 H2. Qed. Lemma filt_nullP (q : pred ptr) : null \notin supp f -> null \notin supp (kfilter q f). Proof. (* Goal: forall _ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f)))), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) (@kfilter ptr_ordType (@dynamic Type (fun x : Type => x)) q f))))) *) by move=>H; rewrite supp_kfilt mem_filter negb_and H orbT. Qed. Lemma heap_base : null \notin supp f -> all (fun k => k != null) (supp f). Proof. (* Goal: forall _ : is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f)))), is_true (@all (Equality.sort ptr_eqType) (fun k : Equality.sort ptr_eqType => negb (@eq_op ptr_eqType k null)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f)) *) by move=>H; apply/allP=>k; case: eqP H=>// -> /negbTE ->. Qed. Lemma base_heap : all (fun k => k != null) (supp f) -> null \notin supp f. Proof. (* Goal: forall _ : is_true (@all (Equality.sort ptr_eqType) (fun k : Equality.sort ptr_eqType => negb (@eq_op ptr_eqType k null)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f)), is_true (negb (@in_mem ptr null (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) f)))) *) by move/allP=>H; apply: (introN idP); move/H. Qed. Lemma heapE (h1 h2 : heap) : h1 = h2 <-> match h1, h2 with Def f' pf, Def g' pg => f' = g' | Undef, Undef => true | _, _ => false end. Proof. (* Goal: iff (@eq heap h1 h2) match h1 with | Undef => match h2 with | Undef => is_true true | @Def finmap i => is_true false end | @Def f' pf => match h2 with | Undef => is_true false | @Def g' pg => @eq (@finMap_for ptr_ordType (@dynamic Type (fun x : Type => x)) (Phant (forall _ : ptr, @dynamic Type (fun x : Type => x)))) f' g' end end *) split; first by move=>->; case: h2. (* Goal: forall _ : match h1 with | Undef => match h2 with | Undef => is_true true | @Def finmap i => is_true false end | @Def f' pf => match h2 with | Undef => is_true false | @Def g' pg => @eq (@finMap_for ptr_ordType (@dynamic Type (fun x : Type => x)) (Phant (forall _ : ptr, @dynamic Type (fun x : Type => x)))) f' g' end end, @eq heap h1 h2 *) case: h1; case: h2=>// f1 pf1 f2 pf2 E. (* Goal: @eq heap (@Def f2 pf2) (@Def f1 pf1) *) rewrite {f2}E in pf1 pf2 *. by congr Def; apply: bool_irrelevance. Qed. Qed. End NullLemmas. Definition def h := if h is Def _ _ then true else false. Definition empty := @Def (finmap.nil _ _) is_true_true. Definition upd k v h := if h is Def hs ns then if decP (@idP (k != null)) is left pf then Def (@upd_nullP _ _ v pf ns) else Undef else Undef. Definition dom h : seq ptr := if h is Def f _ then supp f else [::]. Definition dom_eq h1 h2 := match h1, h2 with Def f1 _, Def f2 _ => supp f1 == supp f2 | Undef, Undef => true | _, _ => false end. Definition free x h := if h is Def hs ns then Def (free_nullP x ns) else Undef. Definition find (x : ptr) h := if h is Def hs _ then fnd x hs else None. Definition union h1 h2 := if (h1, h2) is (Def hs1 ns1, Def hs2 ns2) then if disj hs1 hs2 then Def (@un_nullP _ _ ns1 ns2) else Undef else Undef. Definition um_filter q f := if f is Def fs pf then Def (@filt_nullP fs q pf) else Undef. Definition pts (x : ptr) v := upd x v empty. Definition empb h := if h is Def hs _ then supp hs == [::] else false. Definition undefb h := if h is Undef then true else false. Definition keys_of h : seq ptr := if h is Def f _ then supp f else [::]. Local Notation base := (@UM.base ptr_ordType (dynamic id) (fun k => k != null)). Definition from (f : heap) : base := if f is Def hs ns then UM.Def (heap_base ns) else UM.Undef _ _. Definition to (b : base) : heap := if b is UM.Def hs ns then Def (base_heap ns) else Undef. Lemma ftE b : from (to b) = b. Proof. (* Goal: @eq (@UM.base ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null))) (from (to b)) b *) by case: b=>// f H; rewrite UM.umapE. Qed. Lemma tfE f : to (from f) = f. Proof. (* Goal: @eq heap (to (from f)) f *) by case: f=>// f H; rewrite heapE. Qed. Lemma undefE : Undef = to (@UM.Undef _ _ _). Proof. (* Goal: @eq heap Undef (to (@UM.Undef ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)))) *) by []. Qed. Lemma defE f : def f = UM.valid (from f). Proof. (* Goal: @eq bool (def f) (@UM.valid ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) (from f)) *) by case: f. Qed. Lemma emptyE : empty = to (@UM.empty _ _ _). Proof. (* Goal: @eq heap empty (to (@UM.empty ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)))) *) by rewrite heapE. Qed. Lemma updE k v f : upd k v f = to (UM.upd k v (from f)). Proof. (* Goal: @eq heap (upd k v f) (to (@UM.upd ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) k v (from f))) *) by case: f=>[|f H] //=; case: decP=>// H1; rewrite heapE. Qed. Lemma domE f : dom f = UM.dom (from f). Proof. (* Goal: @eq (list ptr) (dom f) (@UM.dom ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) (from f)) *) by case: f. Qed. Lemma dom_eqE f1 f2 : dom_eq f1 f2 = UM.dom_eq (from f1) (from f2). Proof. (* Goal: @eq bool (dom_eq f1 f2) (@UM.dom_eq ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) (from f1) (from f2)) *) by case: f1 f2=>[|f1 H1][|f2 H2]. Qed. Lemma freeE k f : free k f = to (UM.free k (from f)). Proof. (* Goal: @eq heap (free k f) (to (@UM.free ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) k (from f))) *) by case: f=>[|f H] //; rewrite heapE. Qed. Lemma findE k f : find k f = UM.find k (from f). Proof. (* Goal: @eq (option (@dynamic Type (fun x : Type => x))) (find k f) (@UM.find ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) k (from f)) *) by case: f. Qed. Lemma unionE f1 f2 : union f1 f2 = to (UM.union (from f1) (from f2)). Proof. (* Goal: @eq heap (union f1 f2) (to (@UM.union ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) (from f1) (from f2))) *) case: f1 f2=>[|f1 H1][|f2 H2] //; rewrite /union /UM.union /=. (* Goal: @eq heap (if @disj ptr_ordType (@dynamic Type (fun x : Type => x)) f1 f2 then @Def (@fcat ptr_ordType (@dynamic Type (fun x : Type => x)) f1 f2) (@un_nullP f1 f2 H1 H2) else Undef) (to (if @disj ptr_ordType (@dynamic Type (fun x : Type => x)) f1 f2 then @UM.Def ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : ptr => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) (@fcat ptr_ordType (@dynamic Type (fun x : Type => x)) f1 f2) (@UM.all_supp_fcatP ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : ptr => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) f1 f2 (@heap_base f1 H1) (@heap_base f2 H2)) else @UM.Undef ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : ptr => negb (@eq_op (Ordered.eqType ptr_ordType) k null)))) *) by case: ifP=>D //; rewrite heapE. Qed. Lemma umfiltE q f : um_filter q f = to (UM.um_filter q (from f)). Proof. (* Goal: @eq heap (um_filter q f) (to (@UM.um_filter ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) q (from f))) *) by case: f=>[|f H] //; rewrite heapE. Qed. Lemma empbE f : empb f = UM.empb (from f). Proof. (* Goal: @eq bool (empb f) (@UM.empb ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) (from f)) *) by case: f. Qed. Lemma undefbE f : undefb f = UM.undefb (from f). Proof. (* Goal: @eq bool (undefb f) (@UM.undefb ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) (from f)) *) by case: f. Qed. Lemma ptsE k (v : dynamic id) : pts k v = to (@UM.pts _ _ _ k v). Proof. (* Goal: @eq heap (pts k v) (to (@UM.pts ptr_ordType (@dynamic Type (fun x : Type => x)) (fun k : Ordered.sort ptr_ordType => negb (@eq_op (Ordered.eqType ptr_ordType) k null)) k v)) *) by rewrite /pts /UM.pts /UM.upd /=; case: decP=>// H; rewrite heapE. Qed. Module Exports. Definition heapUMCMix := UMCMixin ftE tfE defE undefE emptyE updE domE dom_eqE freeE findE unionE umfiltE empbE undefbE ptsE. Canonical heapUMC := Eval hnf in UMC heap heapUMCMix. Definition heapPCMMix := union_map_classPCMMix heapUMC. Canonical heapPCM := Eval hnf in PCM heap heapPCMMix. Definition heapCPCMMix := union_map_classCPCMMix heapUMC. Canonical heapCPCM := Eval hnf in CPCM heap heapCPCMMix. Definition heapTPCMMix := union_map_classTPCMMix heapUMC. Canonical heapTPCM := Eval hnf in TPCM heap heapTPCMMix. End Exports. End Heap. Export Heap.Exports. Notation heap := Heap.heap. Definition heap_pts A (x : ptr) (v : A) := @UMC.pts _ _ heapUMC x (idyn v). Notation "x :-> v" := (@heap_pts _ x v) (at level 30). Section HeapPointsToLemmas. Implicit Types (x : ptr) (h : heap). Lemma hcancelPtT A1 A2 x (v1 : A1) (v2 : A2) : valid (x :-> v1) -> x :-> v1 = x :-> v2 -> A1 = A2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A1 x v1))) (_ : @eq (@UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A1 x v1) (@heap_pts A2 x v2)), @eq Type A1 A2 *) by move=>V /(cancelPt V)/dyn_injT. Qed. Lemma hcancelPtT2 A1 A2 x1 x2 (v1 : A1) (v2 : A2) : valid (x1 :-> v1) -> x1 :-> v1 = x2 :-> v2 -> (x1, A1) = (x2, A2). Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A1 x1 v1))) (_ : @eq (@UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A1 x1 v1) (@heap_pts A2 x2 v2)), @eq (prod ptr Type) (@pair ptr Type x1 A1) (@pair ptr Type x2 A2) *) by move=>V; case/(cancelPt2 V)=>-> E _; rewrite E. Qed. Lemma hcancelPtV A x (v1 v2 : A) : valid (x :-> v1) -> x :-> v1 = x :-> v2 -> v1 = v2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1))) (_ : @eq (@UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (@heap_pts A x v2)), @eq A v1 v2 *) by move=>V; move/(cancelPt V)/dyn_inj. Qed. Lemma hcancelPtV2 A x1 x2 (v1 v2 : A) : valid (x1 :-> v1) -> x1 :-> v1 = x2 :-> v2 -> (x1, v1) = (x2, v2). Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x1 v1))) (_ : @eq (@UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x1 v1) (@heap_pts A x2 v2)), @eq (prod ptr A) (@pair ptr A x1 v1) (@pair ptr A x2 v2) *) by move=>V /(cancelPt2 V) [->] /dyn_inj ->. Qed. Lemma heap_eta x h : x \in dom h -> exists A (v : A), find x h = Some (idyn v) /\ h = x :-> v \+ free x h. Proof. (* Goal: forall _ : is_true (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h))), @ex Type (fun A : Type => @ex A (fun v : A => and (@eq (option (@dynamic Type (fun x : Type => x))) (@UMC.find ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x h) (@Some (@sigT Type (fun x : Type => x)) (@dyn Type (fun x : Type => x) A v))) (@eq Heap.heap h (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x h))))) *) by case/um_eta; case=>A v H; exists A, v. Qed. Lemma heap_eta2 A x h (v : A) : find x h = Some (idyn v) -> h = x :-> v \+ free x h. Proof. (* Goal: forall _ : @eq (option (@dynamic Type (fun x : Type => x))) (@UMC.find ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x h) (@Some (@sigT Type (fun x : Type => x)) (@dyn Type (fun x : Type => x) A v)), @eq Heap.heap h (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x h)) *) move=>E; case: (heap_eta (find_some E))=>B [w][]. (* Goal: forall (_ : @eq (option (@dynamic Type (fun x : Type => x))) (@UMC.find ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x h) (@Some (@sigT Type (fun x : Type => x)) (@dyn Type (fun x : Type => x) B w))) (_ : @eq Heap.heap h (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts B x w) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x h))), @eq Heap.heap h (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x h)) *) rewrite {}E; case=>E; rewrite -E in w *. by move/(@inj_pair2 _ _ _ _ _)=>->. Qed. Qed. Lemma hcancelT A1 A2 x (v1 : A1) (v2 : A2) h1 h2 : valid (x :-> v1 \+ h1) -> x :-> v1 \+ h1 = x :-> v2 \+ h2 -> A1 = A2. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A1 x v1) h1))) (_ : @eq (PCM.sort (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC)) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A1 x v1) h1) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A2 x v2) h2)), @eq Type A1 A2 *) by move=>V; case/(cancel V); move/dyn_injT. Qed. Lemma hcancelV A x (v1 v2 : A) h1 h2 : valid (x :-> v1 \+ h1) -> x :-> v1 \+ h1 = x :-> v2 \+ h2 -> [/\ v1 = v2, valid h1 & h1 = h2]. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) h1))) (_ : @eq (PCM.sort (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC)) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) h1) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v2) h2)), and3 (@eq A v1 v2) (is_true (@PCM.valid heapPCM h1)) (@eq Heap.heap h1 h2) *) by move=>V; case/(cancel V); move/dyn_inj. Qed. Lemma hcancel2V A x1 x2 (v1 v2 : A) h1 h2 : valid (x1 :-> v1 \+ h1) -> x1 :-> v1 \+ h1 = x2 :-> v2 \+ h2 -> if x1 == x2 then v1 = v2 /\ h1 = h2 else [/\ free x1 h2 = free x2 h1, h1 = x2 :-> v2 \+ free x1 h2 & h2 = x1 :-> v1 \+ free x2 h1]. Proof. (* Goal: forall (_ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x1 v1) h1))) (_ : @eq (PCM.sort (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC)) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x1 v1) h1) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x2 v2) h2)), if @eq_op ptr_eqType x1 x2 then and (@eq A v1 v2) (@eq Heap.heap h1 h2) else and3 (@eq (@UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x1 h2) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x2 h1)) (@eq Heap.heap h1 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x2 v2) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x1 h2))) (@eq Heap.heap h2 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x1 v1) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x2 h1))) *) by move=>V /(cancel2 V); case: ifP=>// _ [/dyn_inj]. Qed. End HeapPointsToLemmas. Prenex Implicits heap_eta2. Definition fresh (h : heap) := (if h is Heap.Def hs _ then last null (supp hs) else null) .+ 1. Definition pick (h : heap) := if h is Heap.Def hs _ then head null (supp hs) else null. Lemma path_last_nat n s x : path ord x s -> ord x (last x s).+(n+1). Proof. (* Goal: forall _ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (addn n (S O)))) *) move: n s x. (* Goal: forall (n : nat) (s : list (Ordered.sort ptr_ordType)) (x : Ordered.sort ptr_ordType) (_ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s)), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (addn n (S O)))) *) suff L: forall s x, path ord x s -> ord x (last x s).+(1). (* Goal: forall (s : list (Ordered.sort ptr_ordType)) (x : Ordered.sort ptr_ordType) (_ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s)), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (S O))) *) (* Goal: forall (n : nat) (s : list (Ordered.sort ptr_ordType)) (x : Ordered.sort ptr_ordType) (_ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s)), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (addn n (S O)))) *) - (* Goal: forall (s : list (Ordered.sort ptr_ordType)) (x : Ordered.sort ptr_ordType) (_ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s)), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (S O))) *) (* Goal: forall (n : nat) (s : list (Ordered.sort ptr_ordType)) (x : Ordered.sort ptr_ordType) (_ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s)), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (addn n (S O)))) *) elim=>[|n IH] // s x; move/IH=>E; apply: trans E _. (* Goal: forall (s : list (Ordered.sort ptr_ordType)) (x : Ordered.sort ptr_ordType) (_ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s)), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (S O))) *) (* Goal: is_true (@ord ptr_ordType (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (addn n (S O))) (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (addn (S n) (S O)))) *) by case: (last x s)=>m; rewrite /ord /= addSn (addnS m). (* Goal: forall (s : list (Ordered.sort ptr_ordType)) (x : Ordered.sort ptr_ordType) (_ : is_true (@path (Ordered.sort ptr_ordType) (@ord ptr_ordType) x s)), is_true (@ord ptr_ordType x (ptr_offset (@last (Ordered.sort ptr_ordType) x s) (S O))) *) elim=>[|y s IH x] /=; first by case=>x; rewrite /ord /= addn1. (* Goal: forall _ : is_true (andb (@ord ptr_ordType x y) (@path ptr (@ord ptr_ordType) y s)), is_true (@ord ptr_ordType x (ptr_offset (@last ptr y s) (S O))) *) by case/andP=>H1; move/IH; apply: trans H1. Qed. Lemma path_filter (A : ordType) (s : seq A) (p : pred A) x : path ord x s -> path ord x (filter p s). Proof. (* Goal: forall _ : is_true (@path (Ordered.sort A) (@ord A) x s), is_true (@path (Ordered.sort A) (@ord A) x (@filter (Ordered.sort A) p s)) *) elim: s x=>[|y s IH] x //=. (* Goal: forall _ : is_true (andb (@ord A x y) (@path (Ordered.sort A) (@ord A) y s)), is_true (@path (Ordered.sort A) (@ord A) x (if p y then @cons (Ordered.sort A) y (@filter (Ordered.sort A) p s) else @filter (Ordered.sort A) p s)) *) case/andP=>H1 H2. (* Goal: is_true (@path (Ordered.sort A) (@ord A) x (if p y then @cons (Ordered.sort A) y (@filter (Ordered.sort A) p s) else @filter (Ordered.sort A) p s)) *) case: ifP=>E; first by rewrite /= H1 IH. (* Goal: is_true (@path (Ordered.sort A) (@ord A) x (@filter (Ordered.sort A) p s)) *) apply: IH; elim: s H2=>[|z s IH] //=. (* Goal: forall _ : is_true (andb (@ord A y z) (@path (Ordered.sort A) (@ord A) z s)), is_true (andb (@ord A x z) (@path (Ordered.sort A) (@ord A) z s)) *) by case/andP=>H2 H3; rewrite (@trans _ y). Qed. Lemma dom_fresh h n : (fresh h).+n \notin dom h. Proof. (* Goal: is_true (negb (@in_mem ptr (ptr_offset (fresh h) n) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h)))) *) suff L2: forall h x, x \in dom h -> ord x (fresh h). (* Goal: forall (h : @UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (x : Equality.sort (Ordered.eqType ptr_ordType)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x0 : Type => x0)) heapUMC h)))), is_true (@ord ptr_ordType x (fresh h)) *) (* Goal: is_true (negb (@in_mem ptr (ptr_offset (fresh h) n) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h)))) *) - (* Goal: forall (h : @UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (x : Equality.sort (Ordered.eqType ptr_ordType)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x0 : Type => x0)) heapUMC h)))), is_true (@ord ptr_ordType x (fresh h)) *) (* Goal: is_true (negb (@in_mem ptr (ptr_offset (fresh h) n) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h)))) *) by apply: (contra (L2 _ _)); rewrite -leqNgt leq_addr. (* Goal: forall (h : @UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (x : Equality.sort (Ordered.eqType ptr_ordType)) (_ : is_true (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x0 : Type => x0)) heapUMC h)))), is_true (@ord ptr_ordType x (fresh h)) *) case=>[|[s H1]] //; rewrite /supp => /= H2 x. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@Heap.Def (@FinMap ptr_ordType (@dynamic Type (fun x : Type => x)) s H1) H2)))), is_true (@ord ptr_ordType x (fresh (@Heap.Def (@FinMap ptr_ordType (@dynamic Type (fun x : Type => x)) s H1) H2))) *) rewrite /dom /fresh /supp /=. (* Goal: forall _ : is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) (@FinMap ptr_ordType (@dynamic Type (fun x : Type => x)) s H1)))), is_true (@ord ptr_ordType x (ptr_offset (@last ptr null (@map (prod ptr (@dynamic Type (fun x : Type => x))) ptr (@key ptr_ordType (@dynamic Type (fun x : Type => x))) s)) (S O))) *) elim: s H1 null H2 x=>[|[y d] s IH] //= H1 x. (* Goal: forall (_ : is_true (negb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr y (@map (prod ptr (@dynamic Type (fun x : Type => x))) ptr (@key ptr_ordType (@dynamic Type (fun x : Type => x))) s)))))) (x : ptr) (_ : is_true (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x0 : Type => x0)) (@FinMap ptr_ordType (@dynamic Type (fun x0 : Type => x0)) (@cons (prod ptr (@dynamic Type (fun x0 : Type => x0))) (@pair ptr (@dynamic Type (fun x0 : Type => x0)) y d) s) H1))))), is_true (@ord ptr_ordType x (ptr_offset (@last ptr y (@map (prod ptr (@dynamic Type (fun x0 : Type => x0))) ptr (@key ptr_ordType (@dynamic Type (fun x0 : Type => x0))) s)) (S O))) *) rewrite inE negb_or; case/andP=>H3 H4 z; rewrite inE. (* Goal: forall _ : is_true (orb (@eq_op ptr_eqType z (@key ptr_ordType (@dynamic Type (fun x : Type => x)) (@pair ptr (@dynamic Type (fun x : Type => x)) y d))) (@in_mem (Equality.sort ptr_eqType) z (@mem (Equality.sort ptr_eqType) (seq_predType ptr_eqType) ((fix map (s : list (prod (Ordered.sort ptr_ordType) (@dynamic Type (fun x : Type => x)))) : list (Ordered.sort ptr_ordType) := match s with | Datatypes.nil => @Datatypes.nil (Ordered.sort ptr_ordType) | cons x s' => @cons (Ordered.sort ptr_ordType) (@key ptr_ordType (@dynamic Type (fun x0 : Type => x0)) x) (map s') end) s)))), is_true (@ord ptr_ordType z (ptr_offset (@last ptr y (@map (prod ptr (@dynamic Type (fun x : Type => x))) ptr (@key ptr_ordType (@dynamic Type (fun x : Type => x))) s)) (S O))) *) case/orP; first by move/eqP=>->{z}; apply: (path_last_nat 0). (* Goal: forall _ : is_true (@in_mem (Equality.sort ptr_eqType) z (@mem (Equality.sort ptr_eqType) (seq_predType ptr_eqType) ((fix map (s : list (prod (Ordered.sort ptr_ordType) (@dynamic Type (fun x : Type => x)))) : list (Ordered.sort ptr_ordType) := match s with | Datatypes.nil => @Datatypes.nil (Ordered.sort ptr_ordType) | cons x s' => @cons (Ordered.sort ptr_ordType) (@key ptr_ordType (@dynamic Type (fun x0 : Type => x0)) x) (map s') end) s))), is_true (@ord ptr_ordType z (ptr_offset (@last ptr y (@map (prod ptr (@dynamic Type (fun x : Type => x))) ptr (@key ptr_ordType (@dynamic Type (fun x : Type => x))) s)) (S O))) *) by apply: IH; [apply: path_sorted H1 | apply: notin_path H1]. Qed. Lemma fresh_null h : fresh h != null. Proof. (* Goal: is_true (negb (@eq_op ptr_eqType (fresh h) null)) *) by rewrite -lt0n addn1. Qed. Opaque fresh. Hint Resolve dom_fresh fresh_null : core. Lemma emp_pick (h : heap) : (pick h == null) = (~~ valid h || empb h). Proof. (* Goal: @eq bool (@eq_op ptr_eqType (pick h) null) (orb (negb (@PCM.valid heapPCM h)) (@UMC.empb ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h)) *) rewrite /empb; case: h=>[|h] //=; case: (supp h)=>[|x xs] //=. (* Goal: forall _ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@cons ptr x xs)))), @eq bool (@eq_op ptr_eqType x null) (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@cons ptr x xs) (@Datatypes.nil ptr)) *) by rewrite inE negb_or eq_sym; case/andP; move/negbTE=>->. Qed. Lemma pickP h : valid h && ~~ empb h = (pick h \in dom h). Proof. (* Goal: @eq bool (andb (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) h) (negb (@UMC.empb ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h))) (@in_mem ptr (pick h) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h))) *) rewrite /dom /empb; case: h=>[|h] //=. (* Goal: forall _ : is_true (negb (@in_mem ptr null (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) h)))), @eq bool (negb (@eq_op (seq_eqType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) h) (@Datatypes.nil ptr))) (@in_mem ptr (@head ptr null (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) h)) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@supp ptr_ordType (@dynamic Type (fun x : Type => x)) h))) *) by case: (supp h)=>// *; rewrite inE eq_refl. Qed. Lemma domPtUnX A (v : A) x i : valid (x :-> v \+ i) -> x \in dom (x :-> v \+ i). Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) i)), is_true (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) i)))) *) by move=>D; rewrite domPtUn inE /= D eq_refl. Qed. Lemma domPtX A (v : A) x : valid (x :-> v) -> x \in dom (x :-> v). Proof. (* Goal: forall _ : is_true (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v)), is_true (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@heap_pts A x v)))) *) by move=>D; rewrite -(unitR (x :-> v)) domPtUnX // unitR. Qed. Section BlockUpdate. Variable (A : Type). Fixpoint updi x (vs : seq A) {struct vs} : heap := if vs is v'::vs' then x :-> v' \+ updi (x .+ 1) vs' else Unit. Lemma updiS x v vs : updi x (v :: vs) = x :-> v \+ updi (x .+ 1) vs. Proof. (* Goal: @eq Heap.heap (updi x (@cons A v vs)) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) vs)) *) by []. Qed. Lemma updi_last x v vs : updi x (rcons vs v) = updi x vs \+ x.+(size vs) :-> v. Proof. (* Goal: @eq Heap.heap (updi x (@rcons A vs v)) (@PCM.join heapPCM (updi x vs) (@heap_pts A (ptr_offset x (@size A vs)) v)) *) elim: vs x v=>[|w vs IH] x v /=. (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x w) (updi (ptr_offset x (S O)) (@rcons A vs v))) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x w) (updi (ptr_offset x (S O)) vs)) (@heap_pts A (ptr_offset x (S (@size A vs))) v)) *) (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (@PCM.unit heapPCM)) (@PCM.join heapPCM (@PCM.unit heapPCM) (@heap_pts A (ptr_offset x O) v)) *) - (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x w) (updi (ptr_offset x (S O)) (@rcons A vs v))) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x w) (updi (ptr_offset x (S O)) vs)) (@heap_pts A (ptr_offset x (S (@size A vs))) v)) *) (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (@PCM.unit heapPCM)) (@PCM.join heapPCM (@PCM.unit heapPCM) (@heap_pts A (ptr_offset x O) v)) *) by rewrite ptr0 unitR unitL. (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x w) (updi (ptr_offset x (S O)) (@rcons A vs v))) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x w) (updi (ptr_offset x (S O)) vs)) (@heap_pts A (ptr_offset x (S (@size A vs))) v)) *) by rewrite -(addn1 (size vs)) addnC -ptrA IH joinA. Qed. Lemma updi_cat x vs1 vs2 : updi x (vs1 ++ vs2) = updi x vs1 \+ updi x.+(size vs1) vs2. Proof. (* Goal: @eq Heap.heap (updi x (@cat A vs1 vs2)) (@PCM.join heapPCM (updi x vs1) (updi (ptr_offset x (@size A vs1)) vs2)) *) elim: vs1 x vs2=>[|v vs1 IH] x vs2 /=. (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) (@cat A vs1 vs2))) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) vs1)) (updi (ptr_offset x (S (@size A vs1))) vs2)) *) (* Goal: @eq Heap.heap (updi x vs2) (@PCM.join heapPCM (@PCM.unit heapPCM) (updi (ptr_offset x O) vs2)) *) - (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) (@cat A vs1 vs2))) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) vs1)) (updi (ptr_offset x (S (@size A vs1))) vs2)) *) (* Goal: @eq Heap.heap (updi x vs2) (@PCM.join heapPCM (@PCM.unit heapPCM) (updi (ptr_offset x O) vs2)) *) by rewrite ptr0 unitL. (* Goal: @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) (@cat A vs1 vs2))) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) vs1)) (updi (ptr_offset x (S (@size A vs1))) vs2)) *) by rewrite -(addn1 (size vs1)) addnC -ptrA IH joinA. Qed. Lemma updi_catI x y vs1 vs2 : y = x.+(size vs1) -> updi x vs1 \+ updi y vs2 = updi x (vs1 ++ vs2). Proof. (* Goal: forall _ : @eq ptr y (ptr_offset x (@size A vs1)), @eq (PCM.sort heapPCM) (@PCM.join heapPCM (updi x vs1) (updi y vs2)) (updi x (@cat A vs1 vs2)) *) by move=>->; rewrite updi_cat. Qed. Lemma updiVm' x m xs : m > 0 -> x \notin dom (updi x.+m xs). Proof. (* Goal: forall _ : is_true (leq (S O) m), is_true (negb (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x m) xs))))) *) elim: xs x m=>[|v vs IH] x m //= H. (* Goal: is_true (negb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A (ptr_offset x m) v) (updi (ptr_offset (ptr_offset x m) (S O)) vs)))))) *) rewrite ptrA domPtUn inE /= negb_and negb_or -{4}(ptr0 x) ptrK -lt0n H /=. (* Goal: is_true (orb (negb (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@UMC.pts ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (ptr_offset x m) (@dyn Type (fun x : Type => x) A v)) (updi (ptr_offset x (addn m (S O))) vs)))) (negb (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x (addn m (S O))) vs)))))) *) by rewrite orbC IH // addn1. Qed. Lemma updiD x xs : valid (updi x xs) = (x != null) || (size xs == 0). Proof. (* Goal: @eq bool (@PCM.valid heapPCM (updi x xs)) (orb (negb (@eq_op ptr_eqType x null)) (@eq_op nat_eqType (@size A xs) O)) *) elim: xs x=>[|v xs IH] x //=; first by rewrite orbC. (* Goal: @eq bool (@PCM.valid heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) xs))) (orb (negb (@eq_op ptr_eqType x null)) (@eq_op nat_eqType (S (@size A xs)) O)) *) by rewrite validPtUn updiVm' // orbF IH ptr_null andbF andbC. Qed. Lemma updiVm x m xs : x \in dom (updi x.+m xs) = [&& x != null, m == 0 & size xs > 0]. Proof. (* Goal: @eq bool (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x m) xs)))) (andb (negb (@eq_op ptr_eqType x null)) (andb (@eq_op nat_eqType m O) (leq (S O) (@size A xs)))) *) case: m=>[|m] /=; last first. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x O) xs)))) (andb (negb (@eq_op ptr_eqType x null)) (leq (S O) (@size A xs))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x (S m)) xs)))) (andb (negb (@eq_op ptr_eqType x null)) false) *) - (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x O) xs)))) (andb (negb (@eq_op ptr_eqType x null)) (leq (S O) (@size A xs))) *) (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x (S m)) xs)))) (andb (negb (@eq_op ptr_eqType x null)) false) *) by rewrite andbF; apply/negbTE/updiVm'. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x O) xs)))) (andb (negb (@eq_op ptr_eqType x null)) (leq (S O) (@size A xs))) *) case: xs=>[|v xs]; rewrite ptr0 ?andbF ?andbT //=. (* Goal: @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v) (updi (ptr_offset x (S O)) xs))))) (negb (@eq_op ptr_eqType x null)) *) by rewrite domPtUn inE /= eq_refl -updiS updiD orbF andbT /=. Qed. Lemma updimV x m xs : x.+m \in dom (updi x xs) = (x != null) && (m < size xs). Proof. (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x xs)))) (andb (negb (@eq_op ptr_eqType x null)) (leq (S m) (@size A xs))) *) case H: (x == null)=>/=. (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x xs)))) (leq (S m) (@size A xs)) *) (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x xs)))) false *) - (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x xs)))) (leq (S m) (@size A xs)) *) (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x xs)))) false *) by case: xs=>// a s; rewrite (eqP H). (* Goal: @eq bool (@in_mem ptr (ptr_offset x m) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x xs)))) (leq (S m) (@size A xs)) *) elim: xs x m H=>[|v vs IH] x m H //; case: m=>[|m]. (* Goal: @eq bool (@in_mem ptr (ptr_offset x (S m)) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x (@cons A v vs))))) (leq (S (S m)) (@size A (@cons A v vs))) *) (* Goal: @eq bool (@in_mem ptr (ptr_offset x O) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x (@cons A v vs))))) (leq (S O) (@size A (@cons A v vs))) *) - (* Goal: @eq bool (@in_mem ptr (ptr_offset x (S m)) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x (@cons A v vs))))) (leq (S (S m)) (@size A (@cons A v vs))) *) (* Goal: @eq bool (@in_mem ptr (ptr_offset x O) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x (@cons A v vs))))) (leq (S O) (@size A (@cons A v vs))) *) by rewrite ptr0 /= domPtUn inE /= eq_refl andbT -updiS updiD H. (* Goal: @eq bool (@in_mem ptr (ptr_offset x (S m)) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi x (@cons A v vs))))) (leq (S (S m)) (@size A (@cons A v vs))) *) rewrite -addn1 addnC -ptrA updiS domPtUn inE /= IH; last first. (* Goal: @eq bool (andb (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@UMC.pts ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x (@dyn Type (fun x : Type => x) A v)) (updi (ptr_offset x (S O)) vs))) (orb (@eq_op (Ordered.eqType ptr_ordType) x (ptr_offset (ptr_offset x (S O)) m)) (leq (S m) (@size A vs)))) (leq (S (addn (S O) m)) (S (@size A vs))) *) (* Goal: @eq bool (@eq_op ptr_eqType (ptr_offset x (S O)) null) false *) - (* Goal: @eq bool (andb (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@UMC.pts ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x (@dyn Type (fun x : Type => x) A v)) (updi (ptr_offset x (S O)) vs))) (orb (@eq_op (Ordered.eqType ptr_ordType) x (ptr_offset (ptr_offset x (S O)) m)) (leq (S m) (@size A vs)))) (leq (S (addn (S O) m)) (S (@size A vs))) *) (* Goal: @eq bool (@eq_op ptr_eqType (ptr_offset x (S O)) null) false *) by rewrite ptrE /= addn1. (* Goal: @eq bool (andb (@PCM.valid (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@UMC.pts ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x (@dyn Type (fun x : Type => x) A v)) (updi (ptr_offset x (S O)) vs))) (orb (@eq_op (Ordered.eqType ptr_ordType) x (ptr_offset (ptr_offset x (S O)) m)) (leq (S m) (@size A vs)))) (leq (S (addn (S O) m)) (S (@size A vs))) *) by rewrite -updiS updiD H /= -{1}(ptr0 x) ptrA ptrK. Qed. Lemma updiP x y xs : reflect (y != null /\ exists m, x = y.+m /\ m < size xs) Proof. (* Goal: Bool.reflect (and (is_true (negb (@eq_op ptr_eqType y null))) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) *) case H: (y == null)=>/=. (* Goal: Bool.reflect (and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) *) (* Goal: Bool.reflect (and (is_true false) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) *) - (* Goal: Bool.reflect (and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) *) (* Goal: Bool.reflect (and (is_true false) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) *) by rewrite (eqP H); elim: xs=>[|z xs IH] //=; constructor; case. (* Goal: Bool.reflect (and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) *) case E: (x \in _); constructor; last first. (* Goal: and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs))))) *) (* Goal: not (and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) *) - (* Goal: and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs))))) *) (* Goal: not (and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs)))))) *) by move=>[_][m][H1] H2; rewrite H1 updimV H2 H in E. (* Goal: and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset y m)) (is_true (leq (S m) (@size A xs))))) *) case: (ptrT x y) E=>m; case/orP; move/eqP=>->. (* Goal: forall _ : @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x m) xs)))) true, and (is_true true) (@ex nat (fun m0 : nat => and (@eq ptr x (ptr_offset (ptr_offset x m) m0)) (is_true (leq (S m0) (@size A xs))))) *) (* Goal: forall _ : @eq bool (@in_mem ptr (ptr_offset y m) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) true, and (is_true true) (@ex nat (fun m0 : nat => and (@eq ptr (ptr_offset y m) (ptr_offset y m0)) (is_true (leq (S m0) (@size A xs))))) *) - (* Goal: forall _ : @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x m) xs)))) true, and (is_true true) (@ex nat (fun m0 : nat => and (@eq ptr x (ptr_offset (ptr_offset x m) m0)) (is_true (leq (S m0) (@size A xs))))) *) (* Goal: forall _ : @eq bool (@in_mem ptr (ptr_offset y m) (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi y xs)))) true, and (is_true true) (@ex nat (fun m0 : nat => and (@eq ptr (ptr_offset y m) (ptr_offset y m0)) (is_true (leq (S m0) (@size A xs))))) *) by rewrite updimV H /= => H1; split=>//; exists m. (* Goal: forall _ : @eq bool (@in_mem ptr x (@mem ptr (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (updi (ptr_offset x m) xs)))) true, and (is_true true) (@ex nat (fun m0 : nat => and (@eq ptr x (ptr_offset (ptr_offset x m) m0)) (is_true (leq (S m0) (@size A xs))))) *) rewrite updiVm; case/and3P=>H1; move/eqP=>-> H2. (* Goal: and (is_true true) (@ex nat (fun m : nat => and (@eq ptr x (ptr_offset (ptr_offset x O) m)) (is_true (leq (S m) (@size A xs))))) *) by split=>//; exists 0; rewrite ptrA addn0 ptr0. Qed. Lemma updi_inv x xs1 xs2 : valid (updi x xs1) -> updi x xs1 = updi x xs2 -> xs1 = xs2. Proof. (* Goal: forall (_ : is_true (@PCM.valid heapPCM (updi x xs1))) (_ : @eq Heap.heap (updi x xs1) (updi x xs2)), @eq (list A) xs1 xs2 *) elim: xs1 x xs2 =>[|v1 xs1 IH] x /=; case=>[|v2 xs2] //= D; [move/esym| |]; try by rewrite empbE empbUn empbPt. (* Goal: forall _ : @eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (updi (ptr_offset x (S O)) xs1)) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v2) (updi (ptr_offset x (S O)) xs2)), @eq (list A) (@cons A v1 xs1) (@cons A v2 xs2) *) by case/(hcancelV D)=><- {D} D /(IH _ _ D) <-. Qed. Lemma updi_iinv x xs1 xs2 h1 h2 : size xs1 = size xs2 -> valid (updi x xs1 \+ h1) -> updi x xs1 \+ h1 = updi x xs2 \+ h2 -> xs1 = xs2 /\ h1 = h2. Proof. (* Goal: forall (_ : @eq nat (@size A xs1) (@size A xs2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (updi x xs1) h1))) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM (updi x xs1) h1) (@PCM.join heapPCM (updi x xs2) h2)), and (@eq (list A) xs1 xs2) (@eq (PCM.sort heapPCM) h1 h2) *) elim: xs1 x xs2 h1 h2=>[|v1 xs1 IH] x /=; case=>[|v2 xs2] //= h1 h2. (* Goal: forall (_ : @eq nat (S (@size A xs1)) (S (@size A xs2))) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v2) (updi (ptr_offset x (S O)) xs2)) h2)), and (@eq (list A) (@cons A v1 xs1) (@cons A v2 xs2)) (@eq Heap.heap h1 h2) *) (* Goal: forall (_ : @eq nat O O) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.unit heapPCM) h1))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.unit heapPCM) h1) (@PCM.join heapPCM (@PCM.unit heapPCM) h2)), and (@eq (list A) (@Datatypes.nil A) (@Datatypes.nil A)) (@eq Heap.heap h1 h2) *) - (* Goal: forall (_ : @eq nat (S (@size A xs1)) (S (@size A xs2))) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v2) (updi (ptr_offset x (S O)) xs2)) h2)), and (@eq (list A) (@cons A v1 xs1) (@cons A v2 xs2)) (@eq Heap.heap h1 h2) *) (* Goal: forall (_ : @eq nat O O) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.unit heapPCM) h1))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.unit heapPCM) h1) (@PCM.join heapPCM (@PCM.unit heapPCM) h2)), and (@eq (list A) (@Datatypes.nil A) (@Datatypes.nil A)) (@eq Heap.heap h1 h2) *) by rewrite !unitL. (* Goal: forall (_ : @eq nat (S (@size A xs1)) (S (@size A xs2))) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v1) (updi (ptr_offset x (S O)) xs1)) h1) (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts A x v2) (updi (ptr_offset x (S O)) xs2)) h2)), and (@eq (list A) (@cons A v1 xs1) (@cons A v2 xs2)) (@eq Heap.heap h1 h2) *) move=>[E]; rewrite -!joinA=>D; case/(hcancelV D)=><- {D} D. (* Goal: forall _ : @eq Heap.heap (@PCM.join heapPCM (updi (ptr_offset x (S O)) xs1) h1) (@PCM.join heapPCM (updi (ptr_offset x (S O)) xs2) h2), and (@eq (list A) (@cons A v1 xs1) (@cons A v1 xs2)) (@eq Heap.heap h1 h2) *) by case/(IH _ _ _ _ E D)=>->->. Qed. End BlockUpdate. Lemma domeqUP A1 A2 x (xs1 : seq A1) (xs2 : seq A2) : size xs1 = size xs2 -> dom_eq (updi x xs1) (updi x xs2). Proof. (* Goal: forall _ : @eq nat (@size A1 xs1) (@size A2 xs2), is_true (@UMC.dom_eq ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@updi A1 x xs1) (@updi A2 x xs2)) *) move=>E; apply/domeqP; split; first by rewrite !updiD E. (* Goal: @eq_mem (Equality.sort (Ordered.eqType ptr_ordType)) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@updi A1 x xs1))) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@updi A2 x xs2))) *) move=>z; case: updiP=>[[H][m][->]|X]; first by rewrite updimV H E. (* Goal: @eq bool false (@in_mem (Equality.sort (Ordered.eqType ptr_ordType)) z (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (@updi A2 x xs2)))) *) by case: updiP=>// [[H]][m][Ez S]; elim: X; split=>//; exists m; rewrite Ez E. Qed. Structure tagged_heap := Tag {untag :> heap}. Definition right_tag := Tag. Definition left_tag := right_tag. Canonical found_tag i := left_tag i. Definition partition_axiom k r (h : tagged_heap) := untag h = k \+ r. Structure partition (k r : heap) := Partition {heap_of :> tagged_heap; _ : partition_axiom k r heap_of}. Lemma partitionE r k (f : partition k r) : untag f = k \+ r. Proof. (* Goal: @eq Heap.heap (untag (@heap_of k r f)) (@PCM.join heapPCM k r) *) by case: f=>[[j]] /=; rewrite /partition_axiom /= => ->. Qed. Lemma found_pf k : partition_axiom k Unit (found_tag k). Proof. (* Goal: partition_axiom k (@PCM.unit heapPCM) (found_tag k) *) by rewrite /partition_axiom unitR. Qed. Canonical found_struct k := Partition (found_pf k). Lemma left_pf h r (f : forall k, partition k r) k : partition_axiom k (r \+ h) (left_tag (untag (f k) \+ h)). Proof. (* Goal: partition_axiom k (@PCM.join heapPCM r h) (left_tag (@PCM.join heapPCM (untag (@heap_of k r (f k))) h)) *) by rewrite partitionE /partition_axiom /= joinA. Qed. Canonical left_struct h r (f : forall k, partition k r) k := Partition (left_pf h f k). Lemma right_pf h r (f : forall k, partition k r) k : partition_axiom k (h \+ r) (right_tag (h \+ f k)). Proof. (* Goal: partition_axiom k (@PCM.join heapPCM h r) (right_tag (@PCM.join heapPCM h (untag (@heap_of k r (f k))))) *) by rewrite partitionE /partition_axiom /= joinCA. Qed. Canonical right_struct h r (f : forall k, partition k r) k := Partition (right_pf h f k). Lemma defPtUnO A h x (v : A) (f : partition (x :-> v) h) : valid (untag f) = [&& x != null, valid h & x \notin dom h]. Proof. (* Goal: @eq bool (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) h f))) (andb (negb (@eq_op ptr_eqType x null)) (andb (@PCM.valid heapPCM h) (negb (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h)))))) *) by rewrite partitionE validPtUn. Qed. Arguments defPtUnO [A][h] x [v][f]. Lemma defPt_nullO A h x (v : A) (f : partition (x :-> v) h) : valid (untag f) -> x != null. Proof. (* Goal: forall _ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) h f))), is_true (negb (@eq_op ptr_eqType x null)) *) by rewrite partitionE; apply: validPtUn_cond. Qed. Arguments defPt_nullO [A h x v f] _. Lemma defPt_defO A h x (v : A) (f : partition (x :-> v) h) : valid (untag f) -> valid h. Proof. (* Goal: forall _ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) h f))), is_true (@PCM.valid heapPCM h) *) by rewrite partitionE; apply: validPtUnV. Qed. Arguments defPt_defO [A][h] x [v][f] _. Lemma defPt_domO A h x (v : A) (f : partition (x :-> v) h) : valid (untag f) -> x \notin dom h. Proof. (* Goal: forall _ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) h f))), is_true (negb (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h)))) *) by rewrite partitionE; apply: validPtUnD. Qed. Arguments defPt_domO [A][h] x [v][f] _. Lemma domPtUnO A h x (v : A) (f : partition (x :-> v) h) : dom (untag f) =i [pred y | valid (untag f) & (x == y) || (y \in dom h)]. Proof. (* Goal: @eq_mem (Equality.sort (Ordered.eqType ptr_ordType)) (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (untag (@heap_of (@heap_pts A x v) h f)))) (@mem (Equality.sort ptr_eqType) (simplPredType (Equality.sort ptr_eqType)) (@SimplPred (Equality.sort ptr_eqType) (fun y : Equality.sort ptr_eqType => andb (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) h f))) (orb (@eq_op ptr_eqType x y) (@in_mem (Equality.sort ptr_eqType) y (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC h))))))) *) by rewrite partitionE; apply: domPtUn. Qed. Arguments domPtUnO [A][h] x [v][f] _. Lemma lookPtUnO A h x (v : A) (f : partition (x :-> v) h) : valid (untag f) -> find x (untag f) = Some (idyn v). Proof. (* Goal: forall _ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) h f))), @eq (option (@dynamic Type (fun x : Type => x))) (@UMC.find ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x (untag (@heap_of (@heap_pts A x v) h f))) (@Some (@sigT Type (fun x : Type => x)) (@dyn Type (fun x : Type => x) A v)) *) by rewrite partitionE; apply: findPtUn. Qed. Arguments lookPtUnO [A h x v f] _. Lemma freePtUnO A h x (v : A) (f : partition (x :-> v) h) : valid (untag f) -> free x (untag f) = h. Proof. (* Goal: forall _ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) h f))), @eq (@UMC.sort ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@UMC.free ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC x (untag (@heap_of (@heap_pts A x v) h f))) h *) by rewrite partitionE; apply: freePtUn. Qed. Arguments freePtUnO [A h x v f] _. Lemma updPtUnO A1 A2 x i (v1 : A1) (v2 : A2) (f : forall k, partition k i) : upd x (idyn v2) (untag (f (x :-> v1))) = f (x :-> v2). Proof. (* Goal: @eq (@UMC.sort ptr_ordType (@sigT Type (fun x : Type => x)) heapUMC) (@UMC.upd ptr_ordType (@sigT Type (fun x : Type => x)) heapUMC x (@dyn Type (fun x : Type => x) A2 v2) (untag (@heap_of (@heap_pts A1 x v1) i (f (@heap_pts A1 x v1))))) (untag (@heap_of (@heap_pts A2 x v2) i (f (@heap_pts A2 x v2)))) *) by rewrite !partitionE; apply: updPtUn. Qed. Arguments updPtUnO [A1 A2 x i v1 v2] f. Lemma cancelTO A1 A2 h1 h2 x (v1 : A1) (v2 : A2) (f1 : partition (x :-> v1) h1) (f2 : partition (x :-> v2) h2) : valid (untag f1) -> f1 = f2 :> heap -> A1 = A2. Proof. (* Goal: forall (_ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A1 x v1) h1 f1)))) (_ : @eq Heap.heap (untag (@heap_of (@heap_pts A1 x v1) h1 f1)) (untag (@heap_of (@heap_pts A2 x v2) h2 f2))), @eq Type A1 A2 *) by rewrite !partitionE; apply: hcancelT. Qed. Arguments cancelTO [A1 A2 h1 h2] x [v1 v2 f1 f2] _ _. Lemma cancelO A h1 h2 x (v1 v2 : A) (f1 : partition (x :-> v1) h1) (f2 : partition (x :-> v2) h2) : valid (untag f1) -> f1 = f2 :> heap -> [/\ v1 = v2, valid h1 & h1 = h2]. Proof. (* Goal: forall (_ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v1) h1 f1)))) (_ : @eq Heap.heap (untag (@heap_of (@heap_pts A x v1) h1 f1)) (untag (@heap_of (@heap_pts A x v2) h2 f2))), and3 (@eq A v1 v2) (is_true (@PCM.valid heapPCM h1)) (@eq Heap.heap h1 h2) *) by rewrite !partitionE; apply: hcancelV. Qed. Arguments cancelO [A h1 h2] x [v1 v2 f1 f2] _ _. Lemma domPtUnXO A (v : A) x i (f : partition (x :-> v) i) : valid (untag f) -> x \in dom (untag f). Proof. (* Goal: forall _ : is_true (@PCM.valid heapPCM (untag (@heap_of (@heap_pts A x v) i f))), is_true (@in_mem ptr x (@mem (Equality.sort (Ordered.eqType ptr_ordType)) (seq_predType (Ordered.eqType ptr_ordType)) (@UMC.dom ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC (untag (@heap_of (@heap_pts A x v) i f))))) *) by rewrite partitionE; apply: domPtUnX. Qed. Fixpoint llist A p (xs : seq A) {struct xs} := if xs is x::xt then fun h => exists r h', h = p :-> (x, r) \+ h' /\ llist r xt h' else fun h : heap => p = null /\ h = Unit. Lemma llist_prec A p (l1 l2 : seq A) h1 h2 g1 g2 : valid (h1 \+ g1) -> llist p l1 h1 -> llist p l2 h2 -> h1 \+ g1 = h2 \+ g2 -> [/\ l1 = l2, h1 = h2 & g1 = g2]. Proof. (* Goal: forall (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))) (_ : @llist A p l1 h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)), and3 (@eq (list A) l1 l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) move=>V H1 H2 E; elim: l1 l2 h1 h2 p H1 H2 E V=>[|a1 l1 IH]. (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@cons A a1 l1) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@cons A a1 l1) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@Datatypes.nil A) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@Datatypes.nil A) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) - (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@cons A a1 l1) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@cons A a1 l1) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@Datatypes.nil A) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@Datatypes.nil A) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) case=>[|a2 l2] h1 h2 p /= [->->]. (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@cons A a1 l1) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@cons A a1 l1) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) (* Goal: forall (_ : @ex ptr (fun r : ptr => @ex Heap.heap (fun h' : Heap.heap => and (@eq Heap.heap h2 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) null (@pair A ptr a2 r)) h')) (@llist A r l2 h')))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.unit heapPCM) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.unit heapPCM) g1))), and3 (@eq (list A) (@Datatypes.nil A) (@cons A a2 l2)) (@eq Heap.heap (@PCM.unit heapPCM) h2) (@eq Heap.heap g1 g2) *) (* Goal: forall (_ : and (@eq ptr null null) (@eq Heap.heap h2 (@PCM.unit heapPCM))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.unit heapPCM) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.unit heapPCM) g1))), and3 (@eq (list A) (@Datatypes.nil A) (@Datatypes.nil A)) (@eq Heap.heap (@PCM.unit heapPCM) h2) (@eq Heap.heap g1 g2) *) - (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@cons A a1 l1) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@cons A a1 l1) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) (* Goal: forall (_ : @ex ptr (fun r : ptr => @ex Heap.heap (fun h' : Heap.heap => and (@eq Heap.heap h2 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) null (@pair A ptr a2 r)) h')) (@llist A r l2 h')))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.unit heapPCM) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.unit heapPCM) g1))), and3 (@eq (list A) (@Datatypes.nil A) (@cons A a2 l2)) (@eq Heap.heap (@PCM.unit heapPCM) h2) (@eq Heap.heap g1 g2) *) (* Goal: forall (_ : and (@eq ptr null null) (@eq Heap.heap h2 (@PCM.unit heapPCM))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.unit heapPCM) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.unit heapPCM) g1))), and3 (@eq (list A) (@Datatypes.nil A) (@Datatypes.nil A)) (@eq Heap.heap (@PCM.unit heapPCM) h2) (@eq Heap.heap g1 g2) *) by case=>_ ->; rewrite !unitL. (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@cons A a1 l1) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@cons A a1 l1) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) (* Goal: forall (_ : @ex ptr (fun r : ptr => @ex Heap.heap (fun h' : Heap.heap => and (@eq Heap.heap h2 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) null (@pair A ptr a2 r)) h')) (@llist A r l2 h')))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.unit heapPCM) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.unit heapPCM) g1))), and3 (@eq (list A) (@Datatypes.nil A) (@cons A a2 l2)) (@eq Heap.heap (@PCM.unit heapPCM) h2) (@eq Heap.heap g1 g2) *) by case=>r [h'][-> _ ->] /validL /validPtUn_cond. (* Goal: forall (l2 : list A) (h1 : PCM.sort heapPCM) (h2 : Heap.heap) (p : ptr) (_ : @llist A p (@cons A a1 l1) h1) (_ : @llist A p l2 h2) (_ : @eq (PCM.sort heapPCM) (@PCM.join heapPCM h1 g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM h1 g1))), and3 (@eq (list A) (@cons A a1 l1) l2) (@eq (PCM.sort heapPCM) h1 h2) (@eq (PCM.sort heapPCM) g1 g2) *) case=>[|a2 l2] h1 h2 p /= [p1][k1][-> H1]. (* Goal: forall (_ : @ex ptr (fun r : ptr => @ex Heap.heap (fun h' : Heap.heap => and (@eq Heap.heap h2 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a2 r)) h')) (@llist A r l2 h')))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1))), and3 (@eq (list A) (@cons A a1 l1) (@cons A a2 l2)) (@eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) h2) (@eq Heap.heap g1 g2) *) (* Goal: forall (_ : and (@eq ptr p null) (@eq Heap.heap h2 (@PCM.unit heapPCM))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1))), and3 (@eq (list A) (@cons A a1 l1) (@Datatypes.nil A)) (@eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) h2) (@eq Heap.heap g1 g2) *) - (* Goal: forall (_ : @ex ptr (fun r : ptr => @ex Heap.heap (fun h' : Heap.heap => and (@eq Heap.heap h2 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a2 r)) h')) (@llist A r l2 h')))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1))), and3 (@eq (list A) (@cons A a1 l1) (@cons A a2 l2)) (@eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) h2) (@eq Heap.heap g1 g2) *) (* Goal: forall (_ : and (@eq ptr p null) (@eq Heap.heap h2 (@PCM.unit heapPCM))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1))), and3 (@eq (list A) (@cons A a1 l1) (@Datatypes.nil A)) (@eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) h2) (@eq Heap.heap g1 g2) *) by case=>->-> _ /validL /validPtUn_cond. (* Goal: forall (_ : @ex ptr (fun r : ptr => @ex Heap.heap (fun h' : Heap.heap => and (@eq Heap.heap h2 (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a2 r)) h')) (@llist A r l2 h')))) (_ : @eq Heap.heap (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1) (@PCM.join heapPCM h2 g2)) (_ : is_true (@PCM.valid heapPCM (@PCM.join heapPCM (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) g1))), and3 (@eq (list A) (@cons A a1 l1) (@cons A a2 l2)) (@eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) h2) (@eq Heap.heap g1 g2) *) case=>p2 [k2][-> H2]; rewrite -!joinA => E V. (* Goal: and3 (@eq (list A) (@cons A a1 l1) (@cons A a2 l2)) (@eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a1 p1)) k1) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a2 p2)) k2)) (@eq Heap.heap g1 g2) *) case: {E V} (hcancelV V E) H1 H2; case=>->-> V E H1 H2. (* Goal: and3 (@eq (list A) (@cons A a2 l1) (@cons A a2 l2)) (@eq Heap.heap (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a2 p2)) k1) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a2 p2)) k2)) (@eq Heap.heap g1 g2) *) by case: (IH _ _ _ _ H1 H2 E V)=>->->->. Qed. Lemma first_exists A p h (ls : seq A) : p != null -> llist p ls h -> exists x r h', [/\ ls = x :: behead ls, h = p :-> (x, r) \+ h' & llist r (behead ls) h']. Proof. (* Goal: forall (_ : is_true (negb (@eq_op ptr_eqType p null))) (_ : @llist A p ls h), @ex A (fun x : A => @ex ptr (fun r : ptr => @ex (PCM.sort (@union_map_classPCM ptr_ordType (@dynamic Type (fun x0 : Type => x0)) heapUMC)) (fun h' : PCM.sort (@union_map_classPCM ptr_ordType (@dynamic Type (fun x0 : Type => x0)) heapUMC) => and3 (@eq (list A) ls (@cons A x (@behead A ls))) (@eq Heap.heap h (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x0 : Type => x0)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr x r)) h')) (@llist A r (@behead A ls) h')))) *) case: ls=>[|a ls] /= H []; first by case: eqP H. (* Goal: forall (x : ptr) (_ : @ex Heap.heap (fun h' : Heap.heap => and (@eq Heap.heap h (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x0 : Type => x0)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr a x)) h')) (@llist A x ls h'))), @ex A (fun x0 : A => @ex ptr (fun r : ptr => @ex Heap.heap (fun h' : Heap.heap => and3 (@eq (list A) (@cons A a ls) (@cons A x0 ls)) (@eq Heap.heap h (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x1 : Type => x1)) heapUMC) (@heap_pts (prod A ptr) p (@pair A ptr x0 r)) h')) (@llist A r ls h')))) *) by move=>r [h'][-> H1]; eexists a, r, h'. Qed. Lemma llist_null A (xs : seq A) h : valid h -> llist null xs h -> xs = [::] /\ h = Unit. Proof. (* Goal: forall (_ : is_true (@PCM.valid heapPCM h)) (_ : @llist A null xs h), and (@eq (list A) xs (@Datatypes.nil A)) (@eq (PCM.sort heapPCM) h (@PCM.unit heapPCM)) *) case: xs=>[|x xs] /= V H; first by case: H. (* Goal: and (@eq (list A) (@cons A x xs) (@Datatypes.nil A)) (@eq Heap.heap h (@PCM.unit heapPCM)) *) by case: H V=>p [h'][-> _] /validPtUn_cond. Qed. From mathcomp Require Import fintype tuple finfun. Definition indx {I : finType} (x : I) := index x (enum I). Prenex Implicits indx. Section Array. Variables (p : ptr) (I : finType). Lemma enum_split k : enum I = take (indx k) (enum I) ++ k :: drop (indx k).+1 (enum I). Proof. (* Goal: @eq (list (Finite.sort I)) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) (@cat (Finite.sort I) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I))))))) (@cons (Finite.sort I) k (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I))))))))) *) rewrite -{2}(@nth_index I k k (enum I)) ?mem_enum //. (* Goal: @eq (list (Finite.sort I)) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) (@cat (Finite.sort I) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I))))))) (@cons (Finite.sort I) (@nth (Equality.sort (Finite.eqType I)) k (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) (@index (Finite.eqType I) k (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))))) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I))))))))) *) by rewrite -drop_nth ?index_mem ?mem_enum // cat_take_drop. Qed. Lemma updi_split T k (f : {ffun I -> T}) : updi p (fgraph f) = updi p (take (indx k) (fgraph f)) \+ p.+(indx k) :-> f k \+ Proof. (* Goal: @eq Heap.heap (@updi T p (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) (@PCM.join heapPCM (@PCM.join heapPCM (@updi T p (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f)))) (@heap_pts T (ptr_offset p (@indx I k)) (@FunFinfun.fun_of_fin I T f k))) (@updi T (ptr_offset p (S (@indx I k))) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))))) *) rewrite fgraph_codom /= codomE {1}(enum_split k) map_cat updi_cat /=. (* Goal: @eq Heap.heap (@PCM.join heapPCM (@updi T p (@map (Finite.sort I) T (@FunFinfun.fun_of_fin I T f) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I)))))))) (@PCM.join (@union_map_classPCM ptr_ordType (@dynamic Type (fun x : Type => x)) heapUMC) (@heap_pts T (ptr_offset p (@size T (@map (Finite.sort I) T (@FunFinfun.fun_of_fin I T f) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) (@FunFinfun.fun_of_fin I T f k)) (@updi T (ptr_offset (ptr_offset p (@size T (@map (Finite.sort I) T (@FunFinfun.fun_of_fin I T f) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) (S O)) (@map (Finite.sort I) T (@FunFinfun.fun_of_fin I T f) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I)))))))))) (@PCM.join heapPCM (@PCM.join heapPCM (@updi T p (@take T (@indx I k) (@map (Finite.sort I) T (@FunFinfun.fun_of_fin I T f) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I)))))))) (@heap_pts T (ptr_offset p (@indx I k)) (@FunFinfun.fun_of_fin I T f k))) (@updi T (ptr_offset p (S (@indx I k))) (@drop T (S (@indx I k)) (@map (Finite.sort I) T (@FunFinfun.fun_of_fin I T f) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) *) rewrite map_take map_drop size_takel ?joinA ?ptrA ?addn1 //. (* Goal: is_true (leq (@indx I k) (@size T (@map (Finite.sort I) T (@FunFinfun.fun_of_fin I T f) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I)))))))) *) by rewrite size_map index_size. Qed. Lemma takeord T k x (f : {ffun I -> T}) : take (indx k) (fgraph [ffun y => [eta f with k |-> x] y]) = take (indx k) (fgraph f). Proof. (* Goal: @eq (list T) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T (@FunFinfun.finfun I T (fun y : Finite.sort I => @fun_of_simpl (Equality.sort (Finite.eqType I)) T (@SimplFunDelta (Equality.sort (Finite.eqType I)) T (fun _ : Equality.sort (Finite.eqType I) => @app_fdelta (Finite.eqType I) T (@FunDelta (Finite.eqType I) T k x) (@FunFinfun.fun_of_fin I T f))) y))))) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) set f' := (finfun _). (* Goal: @eq (list T) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f'))) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) suff E: {in take (indx k) (enum I), f =1 f'}. (* Goal: @prop_in1 (Equality.sort (Finite.eqType I)) (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) (* Goal: @eq (list T) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f'))) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) - (* Goal: @prop_in1 (Equality.sort (Finite.eqType I)) (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) (* Goal: @eq (list T) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f'))) (@take T (@indx I k) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) by rewrite !fgraph_codom /= !codomE -2!map_take; move/eq_in_map: E. (* Goal: @prop_in1 (Equality.sort (Finite.eqType I)) (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) move: (enum_uniq I); rewrite {1}(enum_split k) cat_uniq /= =>H4. (* Goal: @prop_in1 (Finite.sort I) (@mem (Finite.sort I) (seq_predType (Finite.eqType I)) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) move=>y H5; rewrite /f' /= !ffunE /=; case: eqP H5 H4=>// -> ->. (* Goal: forall _ : is_true (andb (@uniq (Finite.eqType I) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))) (andb (negb (orb true (@has (Finite.sort I) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (seq_predType (Finite.eqType I)) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) (andb (negb (@in_mem (Finite.sort I) k (@mem (Finite.sort I) (seq_predType (Finite.eqType I)) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) (@uniq (Finite.eqType I) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I)))))))))), @eq T (@FunFinfun.fun_of_fin I T f k) x *) by rewrite andbF. Qed. Lemma dropord T k x (f : {ffun I -> T}) : drop (indx k).+1 (fgraph [ffun y => [eta f with k |->x] y]) = Proof. (* Goal: @eq (list T) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T (@FunFinfun.finfun I T (fun y : Finite.sort I => @fun_of_simpl (Equality.sort (Finite.eqType I)) T (@SimplFunDelta (Equality.sort (Finite.eqType I)) T (fun _ : Equality.sort (Finite.eqType I) => @app_fdelta (Finite.eqType I) T (@FunDelta (Finite.eqType I) T k x) (@FunFinfun.fun_of_fin I T f))) y))))) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) set f' := (finfun _). (* Goal: @eq (list T) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f'))) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) suff E: {in drop (indx k).+1 (enum I), f =1 f'}. (* Goal: @prop_in1 (Equality.sort (Finite.eqType I)) (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) (* Goal: @eq (list T) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f'))) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) - (* Goal: @prop_in1 (Equality.sort (Finite.eqType I)) (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) (* Goal: @eq (list T) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f'))) (@drop T (S (@indx I k)) (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T (@fgraph I T f))) *) by rewrite !fgraph_codom /= !codomE -2!map_drop; move/eq_in_map: E. (* Goal: @prop_in1 (Equality.sort (Finite.eqType I)) (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) move: (enum_uniq I); rewrite {1}(enum_split k) cat_uniq /= => H4. (* Goal: @prop_in1 (Finite.sort I) (@mem (Finite.sort I) (seq_predType (Finite.eqType I)) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))) (fun x : Finite.sort I => @eq T (@FunFinfun.fun_of_fin I T f x) (@FunFinfun.fun_of_fin I T f' x)) (inPhantom (@eqfun T (Finite.sort I) (@FunFinfun.fun_of_fin I T f) (@FunFinfun.fun_of_fin I T f'))) *) move=>y H5; rewrite /f' /= !ffunE /=; case: eqP H5 H4=>// -> ->. (* Goal: forall _ : is_true (andb (@uniq (Finite.eqType I) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))) (andb (negb (orb (@in_mem (Finite.sort I) k (@mem (Finite.sort I) (seq_predType (Finite.eqType I)) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I)))))))) (@has (Finite.sort I) (@pred_of_simpl (Finite.sort I) (@pred_of_mem_pred (Finite.sort I) (@mem (Finite.sort I) (seq_predType (Finite.eqType I)) (@take (Finite.sort I) (@indx I k) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I))))))))) (andb (negb true) (@uniq (Finite.eqType I) (@drop (Finite.sort I) (S (@indx I k)) (@enum_mem I (@mem (Finite.sort I) (predPredType (Finite.sort I)) (@sort_of_simpl_pred (Finite.sort I) (pred_of_argType (Finite.sort I)))))))))), @eq T (@FunFinfun.fun_of_fin I T f k) x *) by rewrite !andbF. Qed. Lemma size_fgraph T1 T2 (r1 : {ffun I -> T1}) (r2 : {ffun I -> T2}) : size (fgraph r1) = size (fgraph r2). Proof. (* Goal: @eq nat (@size T1 (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T1 (@fgraph I T1 r1))) (@size T2 (@tval (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T2 (@fgraph I T2 r2))) *) by rewrite !fgraph_codom /= !codomE !size_map. Qed. Lemma fgraphE T (r1 r2 : {ffun I -> T}) : fgraph r1 = fgraph r2 -> r1 = r2. Proof. (* Goal: forall _ : @eq (tuple_of (@card I (@mem (Equality.sort (Finite.eqType I)) (predPredType (Equality.sort (Finite.eqType I))) (@sort_of_simpl_pred (Equality.sort (Finite.eqType I)) (pred_of_argType (Equality.sort (Finite.eqType I)))))) T) (@fgraph I T r1) (@fgraph I T r2), @eq (@finfun_of I T (Phant (forall _ : Finite.sort I, T))) r1 r2 *) by case: r1; case=>r1 H1; case: r2; case=>r2 H2 /= ->. Qed. End Array.
Require Export GeoCoq.Elements.OriginalProofs.lemma_extension. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_samesidereflexive : forall A B P, nCol A B P -> OS P P A B. Proof. (* Goal: forall (A B P : @Point Ax) (_ : @nCol Ax A B P), @OS Ax P P A B *) intros. (* Goal: @OS Ax P P A B *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: @OS Ax P P A B *) assert (~ eq P A). (* Goal: @OS Ax P P A B *) (* Goal: not (@eq Ax P A) *) { (* Goal: not (@eq Ax P A) *) intro. (* Goal: False *) assert (Col A B A) by (conclude_def Col ). (* Goal: False *) assert (Col A B P) by (conclude cn_equalitysub). (* Goal: False *) contradict. (* BG Goal: @OS Ax P P A B *) } (* Goal: @OS Ax P P A B *) assert (neq A P) by (conclude lemma_inequalitysymmetric). (* Goal: @OS Ax P P A B *) let Tf:=fresh in assert (Tf:exists C, (BetS P A C /\ Cong A C A P)) by (conclude lemma_extension);destruct Tf as [C];spliter. (* Goal: @OS Ax P P A B *) assert (Col A B A) by (conclude_def Col ). (* Goal: @OS Ax P P A B *) assert (OS P P A B) by (conclude_def OS ). (* Goal: @OS Ax P P A B *) close. Qed. End Euclid.
Require Import Coq.NArith.NArith. Local Open Scope N_scope. Definition Nlt_dec: forall (l r : N), {l < r} + {l >= r}. Proof. (* Goal: forall l r : N, sumbool (N.lt l r) (N.ge l r) *) refine (fun l r => match N.compare l r as k return N.compare l r = k -> _ with | Lt => fun pf => left _ _ | _ => fun pf => right _ _ end (refl_equal _)); abstract congruence. Qed.
Require Export GeoCoq.Elements.OriginalProofs.lemma_squareparallelogram. Require Export GeoCoq.Elements.OriginalProofs.lemma_PGrectangle. Section Euclid. Context `{Ax1:euclidean_euclidean}. Lemma lemma_squarerectangle : forall A B C D, SQ A B C D -> RE A B C D. Proof. (* Goal: forall (A B C D : @Point Ax0) (_ : @SQ Ax0 A B C D), @RE Ax0 A B C D *) intros. (* Goal: @RE Ax0 A B C D *) assert (PG A B C D) by (conclude lemma_squareparallelogram). (* Goal: @RE Ax0 A B C D *) assert (Per D A B) by (conclude_def SQ ). (* Goal: @RE Ax0 A B C D *) assert (RE A B C D) by (conclude lemma_PGrectangle). (* Goal: @RE Ax0 A B C D *) close. Qed. End Euclid.
Require Export GeoCoq.Meta_theory.Continuity.elementary_continuity_props. Require Export GeoCoq.Tarski_dev.Ch16_coordinates_with_functions. Section Book_1_prop_1_euclidean. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma prop_1_euclidean : forall A B, exists C, Cong A B A C /\ Cong A B B C. Proof. (* Goal: forall A B : @Tpoint Tn, @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Cong Tn A B A C) (@Cong Tn A B B C)) *) destruct exists_grid_spec as [SS [U1 [U2 Hgrid]]]. (* Goal: forall A B : @Tpoint Tn, @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Cong Tn A B A C) (@Cong Tn A B B C)) *) apply (exists_equilateral_triangle SS U1 U2 Hgrid). Qed. End Book_1_prop_1_euclidean. Section Book_1_prop_1_circle_circle. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma prop_1_circle_circle : circle_circle -> forall A B, exists C, Cong A B A C /\ Cong A B B C. Proof. (* Goal: forall (_ : @circle_circle Tn) (A B : @Tpoint Tn), @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Cong Tn A B A C) (@Cong Tn A B B C)) *) intros cc A B. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Cong Tn A B A C) (@Cong Tn A B B C)) *) apply circle_circle__circle_circle_bis in cc. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Cong Tn A B A C) (@Cong Tn A B B C)) *) destruct (cc A B B A A B) as [C [HC1 HC2]]; Circle. (* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => and (@Cong Tn A B A C) (@Cong Tn A B B C)) *) exists C. (* Goal: and (@Cong Tn A B A C) (@Cong Tn A B B C) *) split;Cong. Qed. End Book_1_prop_1_circle_circle. Section Book_1_part_2. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma prop_2 : forall A B C, exists L, Cong A L B C. Proof. (* Goal: forall A B C : @Tpoint Tn, @ex (@Tpoint Tn) (fun L : @Tpoint Tn => @Cong Tn A L B C) *) intros. (* Goal: @ex (@Tpoint Tn) (fun L : @Tpoint Tn => @Cong Tn A L B C) *) apply segment_construction_0. Qed. Lemma prop_3 : forall A B C1 C2, Le C1 C2 A B -> exists E, Bet A E B /\ Cong C1 C2 A E. Proof. (* Goal: forall (A B C1 C2 : @Tpoint Tn) (_ : @Le Tn C1 C2 A B), @ex (@Tpoint Tn) (fun E : @Tpoint Tn => and (@Bet Tn A E B) (@Cong Tn C1 C2 A E)) *) auto. Qed. Lemma prop_4 : forall A B C D E F, CongA C A B F D E -> Cong A C D F -> Cong A B D E -> Cong C B F E /\ (C <> B -> CongA A C B D F E /\ CongA A B C D E F). Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @CongA Tn C A B F D E) (_ : @Cong Tn A C D F) (_ : @Cong Tn A B D E), and (@Cong Tn C B F E) (forall _ : not (@eq (@Tpoint Tn) C B), and (@CongA Tn A C B D F E) (@CongA Tn A B C D E F)) *) intros A B C D E F. (* Goal: forall (_ : @CongA Tn C A B F D E) (_ : @Cong Tn A C D F) (_ : @Cong Tn A B D E), and (@Cong Tn C B F E) (forall _ : not (@eq (@Tpoint Tn) C B), and (@CongA Tn A C B D F E) (@CongA Tn A B C D E F)) *) apply l11_49. Qed. Lemma prop_5_1 : forall A B C, A <> B -> B <> C -> Cong A B A C -> CongA A B C A C B. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Cong Tn A B A C), @CongA Tn A B C A C B *) intros. (* Goal: @CongA Tn A B C A C B *) apply l11_44_1_a; auto. Qed. Lemma prop_5_2 : forall A B C F G, A <> B -> B <> C -> Cong A B A C -> Bet A B F -> B <> F -> Bet A C G -> C <> G -> CongA F B C G C B. Proof. (* Goal: forall (A B C F G : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Cong Tn A B A C) (_ : @Bet Tn A B F) (_ : not (@eq (@Tpoint Tn) B F)) (_ : @Bet Tn A C G) (_ : not (@eq (@Tpoint Tn) C G)), @CongA Tn F B C G C B *) intros A B C F G. (* Goal: forall (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Cong Tn A B A C) (_ : @Bet Tn A B F) (_ : not (@eq (@Tpoint Tn) B F)) (_ : @Bet Tn A C G) (_ : not (@eq (@Tpoint Tn) C G)), @CongA Tn F B C G C B *) intros. (* Goal: @CongA Tn F B C G C B *) apply l11_13 with A A; auto. (* Goal: @CongA Tn A B C A C B *) apply l11_44_1_a; auto. Qed. Lemma prop_6 : forall A B C, ~ Col A B C -> CongA A B C A C B -> Cong A B A C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @CongA Tn A B C A C B), @Cong Tn A B A C *) intros A B C H. (* Goal: forall _ : @CongA Tn A B C A C B, @Cong Tn A B A C *) apply l11_44_1_b; Col. Qed. Lemma prop_7 : forall A B C C', Cong A C A C' -> Cong B C B C' -> OS A B C C' -> C = C'. Proof. (* Goal: forall (A B C C' : @Tpoint Tn) (_ : @Cong Tn A C A C') (_ : @Cong Tn B C B C') (_ : @OS Tn A B C C'), @eq (@Tpoint Tn) C C' *) intros A B C C' HCongA HCongB HOS. (* Goal: @eq (@Tpoint Tn) C C' *) assert (HNCol := one_side_not_col123 A B C C' HOS). (* Goal: @eq (@Tpoint Tn) C C' *) assert_diffs. (* Goal: @eq (@Tpoint Tn) C C' *) destruct (l11_51 A B C A B C') as [HCongAA [HCongAB HCongAC]]; Cong. (* Goal: @eq (@Tpoint Tn) C C' *) assert (HCop := os__coplanar A B C C' HOS). (* Goal: @eq (@Tpoint Tn) C C' *) apply l9_9_bis in HOS. (* Goal: @eq (@Tpoint Tn) C C' *) destruct (conga_cop__or_out_ts B A C C') as [HOutA|Habs]; Cop; [|exfalso; apply HOS; Side]. (* Goal: @eq (@Tpoint Tn) C C' *) destruct (conga_cop__or_out_ts A B C C' HCop HCongAB) as [HOutB|Habs]. (* Goal: @eq (@Tpoint Tn) C C' *) (* Goal: @eq (@Tpoint Tn) C C' *) apply (l6_21 A C B C); Col. (* Goal: @eq (@Tpoint Tn) C C' *) exfalso; apply HOS, Habs. Qed. Lemma prop_8 : forall A B C D E F, A <> B -> A <> C -> B <> C -> Cong A B D E -> Cong A C D F -> Cong B C E F -> CongA B A C E D F /\ CongA A B C D E F /\ CongA B C A E F D. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A C)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Cong Tn A B D E) (_ : @Cong Tn A C D F) (_ : @Cong Tn B C E F), and (@CongA Tn B A C E D F) (and (@CongA Tn A B C D E F) (@CongA Tn B C A E F D)) *) apply l11_51. Qed. Lemma prop_9 : forall A B C, A <> B -> A <> C -> exists F, InAngle F B A C /\ CongA F A B F A C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A C)), @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@InAngle Tn F B A C) (@CongA Tn F A B F A C)) *) intros. (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => and (@InAngle Tn F B A C) (@CongA Tn F A B F A C)) *) apply angle_bisector; auto. Qed. Lemma prop_10 : forall A B, exists D, Midpoint D A B. Proof. (* Goal: forall A B : @Tpoint Tn, @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Midpoint Tn D A B) *) apply midpoint_existence. Qed. Lemma prop_11 : forall A B C, A <> B -> Col A B C -> exists F, Perp C F A B. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Col Tn A B C), @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @Perp Tn C F A B) *) intros. (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @Perp Tn C F A B) *) apply perp_exists; assumption. Qed. Lemma prop_12 : forall A B C, ~ Col A B C -> exists H, Col A B H /\ Perp A B C H. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Col Tn A B C)), @ex (@Tpoint Tn) (fun H : @Tpoint Tn => and (@Col Tn A B H) (@Perp Tn A B C H)) *) apply l8_18_existence. Qed. Lemma prop_13 : forall A B C D P Q R, A <> B -> B <> C -> B <> D -> Bet C B D -> P <> Q -> Q <> R -> Per P Q R -> SumA C B A A B D C B D /\ SumA P Q R P Q R C B D. Proof. (* Goal: forall (A B C D P Q R : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) B D)) (_ : @Bet Tn C B D) (_ : not (@eq (@Tpoint Tn) P Q)) (_ : not (@eq (@Tpoint Tn) Q R)) (_ : @Per Tn P Q R), and (@SumA Tn C B A A B D C B D) (@SumA Tn P Q R P Q R C B D) *) intros. (* Goal: and (@SumA Tn C B A A B D C B D) (@SumA Tn P Q R P Q R C B D) *) split. (* Goal: @SumA Tn P Q R P Q R C B D *) (* Goal: @SumA Tn C B A A B D C B D *) - (* Goal: @SumA Tn C B A A B D C B D *) apply bet__suma; auto. (* BG Goal: @SumA Tn P Q R P Q R C B D *) - (* Goal: @SumA Tn P Q R P Q R C B D *) apply bet_per2__suma; auto. Qed. Lemma prop_14 : forall A B C D P Q R S T U, TS A B C D -> Per P Q R -> SumA A B C A B D S T U -> SumA P Q R P Q R S T U -> Bet C B D. Proof. (* Goal: forall (A B C D P Q R S T U : @Tpoint Tn) (_ : @TS Tn A B C D) (_ : @Per Tn P Q R) (_ : @SumA Tn A B C A B D S T U) (_ : @SumA Tn P Q R P Q R S T U), @Bet Tn C B D *) intros A B C D P Q R S T U HTS HP HSuma1 HSuma2. (* Goal: @Bet Tn C B D *) apply (bet_conga__bet S T U). (* Goal: @CongA Tn S T U C B D *) (* Goal: @Bet Tn S T U *) apply (per2_suma__bet P Q R P Q R); assumption. (* Goal: @CongA Tn S T U C B D *) apply (suma2__conga A B C A B D). (* Goal: @SumA Tn A B C A B D C B D *) (* Goal: @SumA Tn A B C A B D S T U *) assumption. (* Goal: @SumA Tn A B C A B D C B D *) apply suma_left_comm, ts__suma, HTS. Qed. Lemma prop_15 : forall A B C D E, Bet A E B -> A <> E -> B <> E -> Bet C E D -> C <> E -> D <> E -> CongA A E C B E D. Proof. (* Goal: forall (A B C D E : @Tpoint Tn) (_ : @Bet Tn A E B) (_ : not (@eq (@Tpoint Tn) A E)) (_ : not (@eq (@Tpoint Tn) B E)) (_ : @Bet Tn C E D) (_ : not (@eq (@Tpoint Tn) C E)) (_ : not (@eq (@Tpoint Tn) D E)), @CongA Tn A E C B E D *) intros. (* Goal: @CongA Tn A E C B E D *) apply l11_14; auto. Qed. Lemma prop_16 : forall A B C D, ~ Col A B C -> Bet B C D -> C <> D -> LtA C A B A C D /\ LtA C B A A C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Bet Tn B C D) (_ : not (@eq (@Tpoint Tn) C D)), and (@LtA Tn C A B A C D) (@LtA Tn C B A A C D) *) intros. (* Goal: and (@LtA Tn C A B A C D) (@LtA Tn C B A A C D) *) apply l11_41; Col. Qed. Lemma prop_17 : forall A B C P Q R, ~ Col A B C -> SumA A B C B C A P Q R -> SAMS A B C B C A /\ ~ Bet P Q R. Proof. (* Goal: forall (A B C P Q R : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @SumA Tn A B C B C A P Q R), and (@SAMS Tn A B C B C A) (not (@Bet Tn P Q R)) *) intros A B C P Q R HNCol HSuma. (* Goal: and (@SAMS Tn A B C B C A) (not (@Bet Tn P Q R)) *) split. (* Goal: not (@Bet Tn P Q R) *) (* Goal: @SAMS Tn A B C B C A *) - (* Goal: @SAMS Tn A B C B C A *) assert_diffs. (* Goal: @SAMS Tn A B C B C A *) apply sams123231; auto. (* BG Goal: not (@Bet Tn P Q R) *) - (* Goal: not (@Bet Tn P Q R) *) intro HBet. (* Goal: False *) apply HNCol, col_suma__col with P Q R; Col. Qed. Lemma prop_18 : forall A B C, ~ Col A B C -> Lt A B A C -> Lt B C A C -> LtA B C A A B C /\ LtA C A B A B C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Lt Tn A B A C) (_ : @Lt Tn B C A C), and (@LtA Tn B C A A B C) (@LtA Tn C A B A B C) *) intros. (* Goal: and (@LtA Tn B C A A B C) (@LtA Tn C A B A B C) *) split. (* Goal: @LtA Tn C A B A B C *) (* Goal: @LtA Tn B C A A B C *) - (* Goal: @LtA Tn B C A A B C *) apply lta_left_comm, l11_44_2_a; Col. (* BG Goal: @LtA Tn C A B A B C *) - (* Goal: @LtA Tn C A B A B C *) apply lta_right_comm, l11_44_2_a. (* Goal: @Lt Tn C B C A *) (* Goal: not (@Col Tn B C A) *) Col. (* Goal: @Lt Tn C B C A *) apply lt_comm; assumption. Qed. Lemma prop_19 : forall A B C, ~ Col A B C -> LtA B C A A B C -> LtA C A B A B C -> Lt A B A C /\ Lt B C A C. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @LtA Tn B C A A B C) (_ : @LtA Tn C A B A B C), and (@Lt Tn A B A C) (@Lt Tn B C A C) *) intros. (* Goal: and (@Lt Tn A B A C) (@Lt Tn B C A C) *) split. (* Goal: @Lt Tn B C A C *) (* Goal: @Lt Tn A B A C *) - (* Goal: @Lt Tn A B A C *) apply l11_44_2_b. (* Goal: @LtA Tn A C B A B C *) Col. (* Goal: @LtA Tn A C B A B C *) apply lta_left_comm; assumption. (* BG Goal: @Lt Tn B C A C *) - (* Goal: @Lt Tn B C A C *) apply lt_comm, l11_44_2_b. (* Goal: @LtA Tn C A B C B A *) Col. (* Goal: @LtA Tn C A B C B A *) apply lta_right_comm; assumption. Qed. Lemma prop_20 : forall A B C P Q, ~ Bet B A C -> SumS A B A C P Q -> Lt B C P Q. Proof. (* Goal: forall (A B C P Q : @Tpoint Tn) (_ : not (@Bet Tn B A C)) (_ : @SumS Tn A B A C P Q), @Lt Tn B C P Q *) intros A B C P Q HNBet HSum. (* Goal: @Lt Tn B C P Q *) destruct (segment_construction B A A C) as [D [HBet HCong]]. (* Goal: @Lt Tn B C P Q *) apply (cong2_lt__lt B C B D); Cong. (* Goal: @Cong Tn B D P Q *) (* Goal: @Lt Tn B C B D *) apply triangle_strict_inequality with A; Cong. (* Goal: @Cong Tn B D P Q *) apply (sums2__cong56 A B A C); trivial. (* Goal: @SumS Tn A B A C B D *) exists B, A, D; repeat split; Cong. Qed. Lemma prop_21_1 : forall A B C D, OS A B C D -> OS B C A D -> OS A C B D -> LtA B A C B D C. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @OS Tn A B C D) (_ : @OS Tn B C A D) (_ : @OS Tn A C B D), @LtA Tn B A C B D C *) apply os3__lta. Qed. Lemma prop_21_2 : forall A B C D A1 A2 D1 D2, OS A B C D -> OS B C A D -> OS A C B D -> SumS A B A C A1 A2 -> SumS D B D C D1 D2 -> Lt D1 D2 A1 A2. Proof. (* Goal: forall (A B C D A1 A2 D1 D2 : @Tpoint Tn) (_ : @OS Tn A B C D) (_ : @OS Tn B C A D) (_ : @OS Tn A C B D) (_ : @SumS Tn A B A C A1 A2) (_ : @SumS Tn D B D C D1 D2), @Lt Tn D1 D2 A1 A2 *) intros A B C D A1 A2 D1 D2; intros. (* Goal: @Lt Tn D1 D2 A1 A2 *) assert (HNCol : ~ Col A B C) by (apply one_side_not_col123 with D; assumption). (* Goal: @Lt Tn D1 D2 A1 A2 *) destruct (os2__inangle A B C D) as [HAB [HCB [HDB [E [HBet [Heq|HOut]]]]]]; Side. (* Goal: @Lt Tn D1 D2 A1 A2 *) (* Goal: @Lt Tn D1 D2 A1 A2 *) subst; exfalso; apply HNCol; ColR. (* Goal: @Lt Tn D1 D2 A1 A2 *) assert_diffs. (* Goal: @Lt Tn D1 D2 A1 A2 *) assert (A <> E) by (intro; subst E; apply (one_side_not_col124 A B C D); Col). (* Goal: @Lt Tn D1 D2 A1 A2 *) assert (C <> E) by (intro; subst E; apply (one_side_not_col124 B C A D); Col). (* Goal: @Lt Tn D1 D2 A1 A2 *) assert (D <> E) by (intro; subst E; apply (one_side_not_col124 A C B D); Col). (* Goal: @Lt Tn D1 D2 A1 A2 *) assert (Bet B D E). (* Goal: @Lt Tn D1 D2 A1 A2 *) (* Goal: @Bet Tn B D E *) apply out2__bet; [apply l6_6, HOut|]. (* Goal: @Lt Tn D1 D2 A1 A2 *) (* Goal: @Out Tn E B D *) apply col_one_side_out with A; Col. (* Goal: @Lt Tn D1 D2 A1 A2 *) (* Goal: @OS Tn E A B D *) apply invert_one_side, col_one_side with C; Col. (* Goal: @Lt Tn D1 D2 A1 A2 *) destruct (ex_sums E B E C) as [P [Q]]. (* Goal: @Lt Tn D1 D2 A1 A2 *) apply lt_transitivity with P Q. (* Goal: @Lt Tn P Q A1 A2 *) (* Goal: @Lt Tn D1 D2 P Q *) - (* Goal: @Lt Tn D1 D2 P Q *) destruct (ex_sums E C E D) as [R [S]]. (* Goal: @Lt Tn D1 D2 P Q *) apply le_lt34_sums2__lt with D B D C D B R S; Le. (* Goal: @SumS Tn D B R S P Q *) (* Goal: @Lt Tn D C R S *) apply prop_20 with E; Sums. (* Goal: @SumS Tn D B R S P Q *) (* Goal: not (@Bet Tn D E C) *) intro; apply HNCol; ColR. (* Goal: @SumS Tn D B R S P Q *) apply sums_assoc_1 with E D E C E B; Sums. (* BG Goal: @Lt Tn P Q A1 A2 *) - (* Goal: @Lt Tn P Q A1 A2 *) destruct (ex_sums A B A E) as [R [S]]. (* Goal: @Lt Tn P Q A1 A2 *) apply le_lt12_sums2__lt with E B E C R S E C; Le. (* Goal: @SumS Tn R S E C A1 A2 *) (* Goal: @Lt Tn E B R S *) apply prop_20 with A; Sums. (* Goal: @SumS Tn R S E C A1 A2 *) (* Goal: not (@Bet Tn E A B) *) intro; apply HNCol; ColR. (* Goal: @SumS Tn R S E C A1 A2 *) apply sums_assoc_2 with A B A E A C; Sums. Qed. Lemma prop_22 : circle_circle -> forall A1 A2 B1 B2 C1 C2 A1' A2' B1' B2' C1' C2', SumS A1 A2 B1 B2 C1' C2' -> SumS A1 A2 C1 C2 B1' B2' -> SumS B1 B2 C1 C2 A1' A2' -> Le C1 C2 C1' C2' -> Le B1 B2 B1' B2' -> Le A1 A2 A1' A2' -> exists F G K, Cong F G A1 A2 /\ Cong F K B1 B2 /\ Cong G K C1 C2. Proof. (* Goal: forall (_ : @circle_circle Tn) (A1 A2 B1 B2 C1 C2 A1' A2' B1' B2' C1' C2' : @Tpoint Tn) (_ : @SumS Tn A1 A2 B1 B2 C1' C2') (_ : @SumS Tn A1 A2 C1 C2 B1' B2') (_ : @SumS Tn B1 B2 C1 C2 A1' A2') (_ : @Le Tn C1 C2 C1' C2') (_ : @Le Tn B1 B2 B1' B2') (_ : @Le Tn A1 A2 A1' A2'), @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @ex (@Tpoint Tn) (fun G : @Tpoint Tn => @ex (@Tpoint Tn) (fun K : @Tpoint Tn => and (@Cong Tn F G A1 A2) (and (@Cong Tn F K B1 B2) (@Cong Tn G K C1 C2))))) *) intro cc. (* Goal: forall (A1 A2 B1 B2 C1 C2 A1' A2' B1' B2' C1' C2' : @Tpoint Tn) (_ : @SumS Tn A1 A2 B1 B2 C1' C2') (_ : @SumS Tn A1 A2 C1 C2 B1' B2') (_ : @SumS Tn B1 B2 C1 C2 A1' A2') (_ : @Le Tn C1 C2 C1' C2') (_ : @Le Tn B1 B2 B1' B2') (_ : @Le Tn A1 A2 A1' A2'), @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @ex (@Tpoint Tn) (fun G : @Tpoint Tn => @ex (@Tpoint Tn) (fun K : @Tpoint Tn => and (@Cong Tn F G A1 A2) (and (@Cong Tn F K B1 B2) (@Cong Tn G K C1 C2))))) *) apply circle_circle__circle_circle_bis in cc. (* Goal: forall (A1 A2 B1 B2 C1 C2 A1' A2' B1' B2' C1' C2' : @Tpoint Tn) (_ : @SumS Tn A1 A2 B1 B2 C1' C2') (_ : @SumS Tn A1 A2 C1 C2 B1' B2') (_ : @SumS Tn B1 B2 C1 C2 A1' A2') (_ : @Le Tn C1 C2 C1' C2') (_ : @Le Tn B1 B2 B1' B2') (_ : @Le Tn A1 A2 A1' A2'), @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @ex (@Tpoint Tn) (fun G : @Tpoint Tn => @ex (@Tpoint Tn) (fun K : @Tpoint Tn => and (@Cong Tn F G A1 A2) (and (@Cong Tn F K B1 B2) (@Cong Tn G K C1 C2))))) *) apply (circle_circle_bis__euclid_22 cc). Qed. Lemma prop_23 : forall A B C D E, A <> B -> C <> D -> C <> E -> exists F, CongA D C E B A F. Proof. (* Goal: forall (A B C D E : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) C D)) (_ : not (@eq (@Tpoint Tn) C E)), @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @CongA Tn D C E B A F) *) intros. (* Goal: @ex (@Tpoint Tn) (fun F : @Tpoint Tn => @CongA Tn D C E B A F) *) apply angle_construction_3; auto. Qed. Lemma prop_24 : forall A B C D E F, Cong A B D E -> Cong A C D F -> LtA F D E C A B -> Lt E F B C. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Cong Tn A B D E) (_ : @Cong Tn A C D F) (_ : @LtA Tn F D E C A B), @Lt Tn E F B C *) apply t18_18. Qed. Lemma prop_25 : forall A B C D E F, A <> B -> A <> C -> Cong A B D E -> Cong A C D F -> Lt E F B C -> LtA F D E C A B. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A C)) (_ : @Cong Tn A B D E) (_ : @Cong Tn A C D F) (_ : @Lt Tn E F B C), @LtA Tn F D E C A B *) apply t18_19. Qed. Lemma prop_26_1 : forall A B C D E F, ~ Col A B C -> CongA B A C E D F -> CongA A B C D E F -> Cong A B D E -> Cong A C D F /\ Cong B C E F /\ CongA A C B D F E. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @CongA Tn B A C E D F) (_ : @CongA Tn A B C D E F) (_ : @Cong Tn A B D E), and (@Cong Tn A C D F) (and (@Cong Tn B C E F) (@CongA Tn A C B D F E)) *) apply l11_50_1. Qed. Lemma prop_26_2 : forall A B C D E F, ~ Col A B C -> CongA B C A E F D -> CongA A B C D E F -> Cong A B D E -> Cong A C D F /\ Cong B C E F /\ CongA C A B F D E. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @CongA Tn B C A E F D) (_ : @CongA Tn A B C D E F) (_ : @Cong Tn A B D E), and (@Cong Tn A C D F) (and (@Cong Tn B C E F) (@CongA Tn C A B F D E)) *) apply l11_50_2. Qed. Lemma prop_27 : forall A D E F, TS E F A D -> CongA A E F D F E -> Par E A F D. Proof. (* Goal: forall (A D E F : @Tpoint Tn) (_ : @TS Tn E F A D) (_ : @CongA Tn A E F D F E), @Par Tn E A F D *) intros A D E F. (* Goal: forall (_ : @TS Tn E F A D) (_ : @CongA Tn A E F D F E), @Par Tn E A F D *) apply l12_21_b. Qed. Lemma prop_28_1 : forall B D E G H, Out E G H -> OS E G B D -> CongA B G E D H E -> Par G B H D. Proof. (* Goal: forall (B D E G H : @Tpoint Tn) (_ : @Out Tn E G H) (_ : @OS Tn E G B D) (_ : @CongA Tn B G E D H E), @Par Tn G B H D *) intros B D E G H. (* Goal: forall (_ : @Out Tn E G H) (_ : @OS Tn E G B D) (_ : @CongA Tn B G E D H E), @Par Tn G B H D *) apply l12_22_b. Qed. Lemma prop_28_2 : forall A C G H P Q R, OS G H A C -> SumA A G H G H C P Q R -> Bet P Q R -> Par A G C H. Proof. (* Goal: forall (A C G H P Q R : @Tpoint Tn) (_ : @OS Tn G H A C) (_ : @SumA Tn A G H G H C P Q R) (_ : @Bet Tn P Q R), @Par Tn A G C H *) intros A C G H P Q R HOS HSumA HBet. (* Goal: @Par Tn A G C H *) destruct (segment_construction C H C H) as [D [HBet1 HCong]]. (* Goal: @Par Tn A G C H *) apply par_comm. (* Goal: @Par Tn G A H C *) assert_diffs. (* Goal: @Par Tn G A H C *) apply par_col_par with D; Col. (* Goal: @Par Tn G A H D *) apply l12_21_b. (* Goal: @CongA Tn A G H D H G *) (* Goal: @TS Tn G H A D *) - (* Goal: @TS Tn G H A D *) apply l9_8_2 with C; Side. (* Goal: @TS Tn G H C D *) assert (HNCol := one_side_not_col124 G H A C HOS). (* Goal: @TS Tn G H C D *) repeat split; Col. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T G H) (@Bet Tn C T D)) *) (* Goal: not (@Col Tn D G H) *) intro; apply HNCol; ColR. (* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Col Tn T G H) (@Bet Tn C T D)) *) exists H; Col. (* BG Goal: @CongA Tn A G H D H G *) - (* Goal: @CongA Tn A G H D H G *) apply suppa2__conga123 with G H C. (* Goal: @SuppA Tn D H G G H C *) (* Goal: @SuppA Tn A G H G H C *) apply bet_suma__suppa with P Q R; assumption. (* Goal: @SuppA Tn D H G G H C *) split; auto; exists C; split; [Between|CongA]. Qed. End Book_1_part_2. Section Book_1_part_3. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma prop_29_1 : forall A D G H, TS G H A D -> Par G A H D -> CongA A G H D H G. Proof. (* Goal: forall (A D G H : @Tpoint Tn) (_ : @TS Tn G H A D) (_ : @Par Tn G A H D), @CongA Tn A G H D H G *) intros A D G H. (* Goal: forall (_ : @TS Tn G H A D) (_ : @Par Tn G A H D), @CongA Tn A G H D H G *) apply l12_21_a. Qed. Lemma prop_29_2 : forall B D E G H, Out E G H -> OS E G B D -> Par G B H D -> CongA B G E D H E. Proof. (* Goal: forall (B D E G H : @Tpoint Tn) (_ : @Out Tn E G H) (_ : @OS Tn E G B D) (_ : @Par Tn G B H D), @CongA Tn B G E D H E *) intros B D E G H. (* Goal: forall (_ : @Out Tn E G H) (_ : @OS Tn E G B D) (_ : @Par Tn G B H D), @CongA Tn B G E D H E *) apply l12_22_a. Qed. Lemma prop_29_3 : forall A C G H P Q R, OS G H A C -> Par A G H C -> SumA A G H G H C P Q R -> Bet P Q R. Proof. (* Goal: forall (A C G H P Q R : @Tpoint Tn) (_ : @OS Tn G H A C) (_ : @Par Tn A G H C) (_ : @SumA Tn A G H G H C P Q R), @Bet Tn P Q R *) intros A C G H P Q R HOS HPar. (* Goal: forall _ : @SumA Tn A G H G H C P Q R, @Bet Tn P Q R *) apply (suma_suppa__bet). (* Goal: @SuppA Tn A G H G H C *) apply alternate_interior__consecutive_interior; trivial. (* Goal: @alternate_interior_angles_postulate Tn *) unfold alternate_interior_angles_postulate. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @TS Tn A C B D) (_ : @Par Tn A B C D), @CongA Tn B A C D C A *) apply l12_21_a. Qed. Lemma prop_30 : forall A B C D E F, Par A B C D -> Par C D E F -> Par A B E F. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @Par Tn A B C D) (_ : @Par Tn C D E F), @Par Tn A B E F *) apply par_trans. Qed. End Book_1_part_3. Section Book_1_part_4. Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}. Lemma prop_31 : forall A B C, B <> C -> exists E, Par B C A E. Proof. (* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) B C)), @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @Par Tn B C A E) *) intros A B C. (* Goal: forall _ : not (@eq (@Tpoint Tn) B C), @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @Par Tn B C A E) *) apply parallel_existence1. Qed. End Book_1_part_4. Section Book_1_part_5. Context `{T2D:Tarski_2D}. Context `{TE:@Tarski_euclidean Tn TnEQD}. Lemma prop_32_1 : forall A B C D E F, TriSumA A B C D E F -> Bet D E F. Proof. (* Goal: forall (A B C D E F : @Tpoint Tn) (_ : @TriSumA Tn A B C D E F), @Bet Tn D E F *) apply alternate_interior__triangle. (* Goal: @alternate_interior_angles_postulate Tn *) unfold alternate_interior_angles_postulate. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @TS Tn A C B D) (_ : @Par Tn A B C D), @CongA Tn B A C D C A *) apply l12_21_a. Qed. Lemma prop_32_2 : forall A B C D, A <> B -> B <> C -> A <> C -> Bet B C D -> C <> D -> SumA C A B A B C A C D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) A C)) (_ : @Bet Tn B C D) (_ : not (@eq (@Tpoint Tn) C D)), @SumA Tn C A B A B C A C D *) intros A B C D HAB HBC HAC HBet HAD. (* Goal: @SumA Tn C A B A B C A C D *) destruct (ex_trisuma C A B) as [P [Q [R HTri]]]; auto. (* Goal: @SumA Tn C A B A B C A C D *) assert (Bet P Q R) by (apply (prop_32_1 C A B), HTri). (* Goal: @SumA Tn C A B A B C A C D *) destruct HTri as [S [T [U [HSuma1 HSumA2]]]]. (* Goal: @SumA Tn C A B A B C A C D *) apply conga3_suma__suma with C A B A B C S T U; try (apply conga_refl); auto. (* Goal: @CongA Tn S T U A C D *) assert_diffs. (* Goal: @CongA Tn S T U A C D *) assert (HCongA : CongA B C D P Q R) by (apply conga_line; auto). (* Goal: @CongA Tn S T U A C D *) assert (HSumA' : SumA A C D B C A P Q R). (* Goal: @CongA Tn S T U A C D *) (* Goal: @SumA Tn A C D B C A P Q R *) apply conga3_suma__suma with A C D B C A B C D; CongA. (* Goal: @CongA Tn S T U A C D *) (* Goal: @SumA Tn A C D B C A B C D *) apply suma_sym, bet__suma; auto. (* Goal: @CongA Tn S T U A C D *) apply sams2_suma2__conga123 with B C A P Q R; trivial; apply bet_suma__sams with P Q R; assumption. Qed. Lemma prop_33 : forall A B C D, TS B C A D -> Par A B C D -> Cong A B C D -> Cong A C B D /\ Par A C B D. Proof. (* Goal: forall (A B C D : @Tpoint Tn) (_ : @TS Tn B C A D) (_ : @Par Tn A B C D) (_ : @Cong Tn A B C D), and (@Cong Tn A C B D) (@Par Tn A C B D) *) intros A B C D HTS HPAR HC. (* Goal: and (@Cong Tn A C B D) (@Par Tn A C B D) *) assert (HPara:Parallelogram B A C D) by (unfold Parallelogram;left;unfold Parallelogram_strict;finish). (* Goal: and (@Cong Tn A C B D) (@Par Tn A C B D) *) destruct (plg_cong B A C D HPara). (* Goal: and (@Cong Tn A C B D) (@Par Tn A C B D) *) assert_diffs. (* Goal: and (@Cong Tn A C B D) (@Par Tn A C B D) *) destruct (plg_par B A C D); auto. (* Goal: and (@Cong Tn A C B D) (@Par Tn A C B D) *) split; finish. Qed. Lemma prop_34_1 : forall A B D C, A <> B /\ A <> D /\ B <> D -> Parallelogram A B D C -> (CongA A B D D C A /\ CongA B D C C A B) /\ (Cong A B D C /\ Cong A C B D). Proof. (* Goal: forall (A B D C : @Tpoint Tn) (_ : and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) A D)) (not (@eq (@Tpoint Tn) B D)))) (_ : @Parallelogram Tn A B D C), and (and (@CongA Tn A B D D C A) (@CongA Tn B D C C A B)) (and (@Cong Tn A B D C) (@Cong Tn A C B D)) *) intros; split. (* Goal: and (@Cong Tn A B D C) (@Cong Tn A C B D) *) (* Goal: and (@CongA Tn A B D D C A) (@CongA Tn B D C C A B) *) - (* Goal: and (@CongA Tn A B D D C A) (@CongA Tn B D C C A B) *) apply plg_conga; auto. (* BG Goal: and (@Cong Tn A B D C) (@Cong Tn A C B D) *) - (* Goal: and (@Cong Tn A B D C) (@Cong Tn A C B D) *) apply plg_cong; auto. Qed. Lemma prop_46 : forall A B, A<>B -> exists E D, Square A B E D. Proof. (* Goal: forall (A B : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)), @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun D : @Tpoint Tn => @Square Tn A B E D)) *) exact exists_square. Qed. Lemma prop_47 : forall O E E' A B C AC BC AB AC2 BC2 AB2, O <> E -> Per B A C -> Length O E E' A B AB -> Length O E E' A C AC -> Length O E E' B C BC -> Prod O E E' AC AC AC2 -> Prod O E E' BC BC BC2 -> Prod O E E' AB AB AB2 -> Sum O E E' AB2 AC2 BC2. Proof. (* Goal: forall (O E E' A B C AC BC AB AC2 BC2 AB2 : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) O E)) (_ : @Per Tn B A C) (_ : @Length Tn O E E' A B AB) (_ : @Length Tn O E E' A C AC) (_ : @Length Tn O E E' B C BC) (_ : @Prod Tn O E E' AC AC AC2) (_ : @Prod Tn O E E' BC BC BC2) (_ : @Prod Tn O E E' AB AB AB2), @Sum Tn O E E' AB2 AC2 BC2 *) intros O E E' A B C AC BC AB AC2 BC2 AB2. (* Goal: forall (_ : not (@eq (@Tpoint Tn) O E)) (_ : @Per Tn B A C) (_ : @Length Tn O E E' A B AB) (_ : @Length Tn O E E' A C AC) (_ : @Length Tn O E E' B C BC) (_ : @Prod Tn O E E' AC AC AC2) (_ : @Prod Tn O E E' BC BC BC2) (_ : @Prod Tn O E E' AB AB AB2), @Sum Tn O E E' AB2 AC2 BC2 *) intros. (* Goal: @Sum Tn O E E' AB2 AC2 BC2 *) apply pythagoras with B C A AB AC BC; trivial; apply length_sym; assumption. Qed. End Book_1_part_5.
From Coq Require Import ssreflect ssrbool ssrfun. From mathcomp Require Import ssrnat eqtype. From fcsl Require Import prelude pcm. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Module GeneralizedMutex. Section GeneralizedMutex. Variable T : Type. Inductive mutex := undef | nown | own | mx of T. Definition join x y := match x, y with undef, _ => undef | _, undef => undef | nown, x => x | x, nown => x | own, _ => undef | _, own => undef | mx _, mx _ => undef end. Definition valid x := if x is undef then false else true. Lemma joinC : commutative join. Proof. (* Goal: @commutative mutex mutex join *) by case=>[|||x]; case=>[|||y]. Qed. Lemma joinA : associative join. Proof. (* Goal: @associative mutex join *) by case=>[|||x]; case=>[|||y]; case=>[|||z]. Qed. Lemma unitL : left_id nown join. Proof. (* Goal: @left_id mutex mutex nown join *) by case. Qed. Lemma validL x y : valid (join x y) -> valid x. Proof. (* Goal: forall _ : is_true (valid (join x y)), is_true (valid x) *) by case: x. Qed. Lemma valid_unit : valid nown. Proof. (* Goal: is_true (valid nown) *) by []. Qed. Definition mutexPCMMix := PCMMixin joinC joinA unitL validL valid_unit. Canonical mutexPCM := Eval hnf in PCM mutex mutexPCMMix. Lemma joinmK m1 m2 m : valid (m1 \+ m) -> m1 \+ m = m2 \+ m -> m1 = m2. Proof. (* Goal: forall (_ : is_true (valid (@PCM.join mutexPCM m1 m))) (_ : @eq (PCM.sort mutexPCM) (@PCM.join mutexPCM m1 m) (@PCM.join mutexPCM m2 m)), @eq (PCM.sort mutexPCM) m1 m2 *) by case: m m1 m2=>[|||m][|||m1][|||m2]. Qed. Definition mutexCPCMMix := CPCMMixin joinmK. Canonical mutexCPCM := Eval hnf in CPCM mutex mutexCPCMMix. Lemma unitb (x : mutex) : reflect (x = Unit) (if x is nown then true else false). Proof. (* Goal: Bool.reflect (@eq mutex x (@PCM.unit mutexPCM)) match x with | undef => false | nown => true | own => false | mx t => false end *) by case: x; constructor. Qed. Lemma join0E (x y : mutex) : x \+ y = Unit -> x = Unit /\ y = Unit. Proof. (* Goal: forall _ : @eq (PCM.sort mutexPCM) (@PCM.join mutexPCM x y) (@PCM.unit mutexPCM), and (@eq mutex x (@PCM.unit mutexPCM)) (@eq mutex y (@PCM.unit mutexPCM)) *) by case: x y=>[|||x][|||y]. Qed. Lemma valid3 (x y z : mutex) : valid (x \+ y \+ z) = [&& valid (x \+ y), valid (y \+ z) & valid (x \+ z)]. Proof. (* Goal: @eq bool (valid (@PCM.join mutexPCM (@PCM.join mutexPCM x y) z)) (andb (valid (@PCM.join mutexPCM x y)) (andb (valid (@PCM.join mutexPCM y z)) (valid (@PCM.join mutexPCM x z)))) *) by case: x y z=>[|||x][|||y][|||z]. Qed. Lemma valid_undef : ~~ valid undef. Proof. (* Goal: is_true (negb (valid undef)) *) by []. Qed. Lemma undef_join x : undef \+ x = undef. Proof. (* Goal: @eq (PCM.sort mutexPCM) (@PCM.join mutexPCM undef x) undef *) by []. Qed. Definition mutexTPCMMix := TPCMMixin unitb join0E valid_undef undef_join. Canonical mutexTPCM := Eval hnf in TPCM mutex mutexTPCMMix. End GeneralizedMutex. Section Equality. Variable T : eqType. Definition mutex_eq (x y : mutex T) := match x, y with undef, undef => true | nown, nown => true | own, own => true | mx x', mx y' => x' == y' | _, _ => false end. Lemma mutex_eqP : Equality.axiom mutex_eq. Proof. (* Goal: @Equality.axiom (mutex (Equality.sort T)) mutex_eq *) case=>[|||x]; case=>[|||y] /=; try by constructor. (* Goal: Bool.reflect (@eq (mutex (Equality.sort T)) (@mx (Equality.sort T) x) (@mx (Equality.sort T) y)) (@eq_op T x y) *) by case: eqP=>[->|H]; constructor=>//; case=>/H. Qed. Definition mutexEqMix := EqMixin mutex_eqP. Canonical mutexEqType := Eval hnf in EqType (mutex T) mutexEqMix. End Equality. Module Exports. Canonical mutexPCM. Canonical mutexCPCM. Canonical mutexEqType. Canonical mutexTPCM. Notation mutex := mutex. Notation mx := mx. Notation mx_undef := undef. Notation nown := nown. Notation own := own. Notation mutexPCM := mutexPCM. Notation mutexTPCM := mutexTPCM. Arguments mx_undef [T]. Arguments nown [T]. Arguments own [T]. Notation mtx := (mutex Empty_set). End Exports. End GeneralizedMutex. Export GeneralizedMutex.Exports. Section MutexLemmas. Variable T : Type. Implicit Types (t : T) (x y : mutex T). CoInductive mutex_spec x : mutex T -> Type := | mutex_undef of x = mx_undef : mutex_spec x mx_undef | mutex_nown of x = Unit : mutex_spec x Unit | mutex_own of x = own : mutex_spec x own | mutex_mx t of x = mx t : mutex_spec x (mx t). Lemma mxP x : mutex_spec x x. Proof. (* Goal: mutex_spec x x *) by case: x=>[|||t]; constructor. Qed. Lemma mxE0 x y : x \+ y = Unit -> (x = Unit) * (y = Unit). Proof. (* Goal: forall _ : @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x y) (@PCM.unit (GeneralizedMutex.mutexPCM T)), prod (@eq (GeneralizedMutex.mutex T) x (@PCM.unit (GeneralizedMutex.mutexPCM T))) (@eq (GeneralizedMutex.mutex T) y (@PCM.unit (GeneralizedMutex.mutexPCM T))) *) by case: x=>[|||t1]; case: y=>[|||t2]. Qed. Lemma cancelMx t1 t2 x : (mx t1 \+ x = mx t2) <-> (t1 = t2) * (x = Unit). Proof. (* Goal: iff (@eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) (@GeneralizedMutex.mx T t1) x) (@GeneralizedMutex.mx T t2)) (prod (@eq T t1 t2) (@eq (GeneralizedMutex.mutex T) x (@PCM.unit (GeneralizedMutex.mutexPCM T)))) *) by case: x=>[|||x] //=; split=>//; case=>->. Qed. Lemma cancelxM t1 t2 x : (x \+ mx t1 = mx t2) <-> (t1 = t2) * (x = Unit). Proof. (* Goal: iff (@eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x (@GeneralizedMutex.mx T t1)) (@GeneralizedMutex.mx T t2)) (prod (@eq T t1 t2) (@eq (GeneralizedMutex.mutex T) x (@PCM.unit (GeneralizedMutex.mutexPCM T)))) *) by rewrite joinC cancelMx. Qed. Lemma mxMx t x : valid (mx t \+ x) -> x = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@GeneralizedMutex.mx T t) x)), @eq (GeneralizedMutex.mutex T) x (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by case: x. Qed. Lemma mxxM t x : valid (x \+ mx t) -> x = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) x (@GeneralizedMutex.mx T t))), @eq (GeneralizedMutex.mutex T) x (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinC=>/mxMx. Qed. Lemma mxxyM t x y : valid (x \+ (y \+ mx t)) -> x \+ y = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) x (@PCM.join (GeneralizedMutex.mutexPCM T) y (@GeneralizedMutex.mx T t)))), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x y) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinC joinAC=>/mxMx; rewrite joinC. Qed. Lemma mxMxy t x y : valid (mx t \+ x \+ y) -> x \+ y = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@GeneralizedMutex.mx T t) x) y)), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x y) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite -joinA=>/mxMx. Qed. Lemma mxxMy t x y : valid (x \+ (mx t \+ y)) -> x \+ y = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) x (@PCM.join (GeneralizedMutex.mutexPCM T) (@GeneralizedMutex.mx T t) y))), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x y) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinCA=>/mxMx. Qed. Lemma mxyMx t x y : valid (y \+ mx t \+ x) -> y \+ x = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) y (@GeneralizedMutex.mx T t)) x)), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) y x) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinAC=>/mxMx. Qed. Lemma mxOx x : valid (own \+ x) -> x = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@GeneralizedMutex.own T) x)), @eq (GeneralizedMutex.mutex T) x (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by case: x. Qed. Lemma mxxO x : valid (x \+ own) -> x = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) x (@GeneralizedMutex.own T))), @eq (GeneralizedMutex.mutex T) x (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinC=>/mxOx. Qed. Lemma mxxyO x y : valid (x \+ (y \+ own)) -> x \+ y = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) x (@PCM.join (GeneralizedMutex.mutexPCM T) y (@GeneralizedMutex.own T)))), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x y) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinC joinAC=>/mxOx; rewrite joinC. Qed. Lemma mxOxy x y : valid (own \+ x \+ y) -> x \+ y = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@GeneralizedMutex.own T) x) y)), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x y) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite -joinA=>/mxOx. Qed. Lemma mxxOy x y : valid (x \+ (own \+ y)) -> x \+ y = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) x (@PCM.join (GeneralizedMutex.mutexPCM T) (@GeneralizedMutex.own T) y))), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) x y) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinCA=>/mxOx. Qed. Lemma mxyOx x y : valid (y \+ own \+ x) -> y \+ x = Unit. Proof. (* Goal: forall _ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) (@PCM.join (GeneralizedMutex.mutexPCM T) y (@GeneralizedMutex.own T)) x)), @eq (PCM.sort (GeneralizedMutex.mutexPCM T)) (@PCM.join (GeneralizedMutex.mutexPCM T) y x) (@PCM.unit (GeneralizedMutex.mutexPCM T)) *) by rewrite joinAC=>/mxOx. Qed. CoInductive mxjoin_spec (x y : mutex T) : mutex T -> mutex T -> mutex T -> Type := | bothnown of x = nown & y = nown : mxjoin_spec x y nown nown nown | leftown of x = own & y = nown : mxjoin_spec x y own own nown | rightown of x = nown & y = own : mxjoin_spec x y own nown own | leftmx t of x = mx t & y = nown : mxjoin_spec x y (mx t) (mx t) nown | rightmx t of x = nown & y = mx t : mxjoin_spec x y (mx t) nown (mx t) | invalid of ~~ valid (x \+ y) : mxjoin_spec x y undef x y. Lemma mxPJ x y : mxjoin_spec x y (x \+ y) x y. Proof. (* Goal: mxjoin_spec x y (@PCM.join (GeneralizedMutex.mutexPCM T) x y) x y *) by case: x y=>[|||x][|||y]; constructor. Qed. End MutexLemmas. Prenex Implicits mxMx mxxM mxxyM mxMxy mxxMy mxyMx mxOx mxxO mxxyO mxOxy mxxOy mxyOx. Lemma mxON (x : mtx) : valid x -> x != own -> x = nown. Proof. (* Goal: forall (_ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM Empty_set) x)) (_ : is_true (negb (@eq_op (GeneralizedMutex.mutexEqType emptysetEqType) x (@GeneralizedMutex.own (Equality.sort emptysetEqType))))), @eq (GeneralizedMutex.mutex Empty_set) x (@GeneralizedMutex.nown Empty_set) *) by case: x. Qed. Lemma mxNN (x : mtx) : valid x -> x != nown -> x = own. Proof. (* Goal: forall (_ : is_true (@PCM.valid (GeneralizedMutex.mutexPCM Empty_set) x)) (_ : is_true (negb (@eq_op (GeneralizedMutex.mutexEqType emptysetEqType) x (@GeneralizedMutex.nown (Equality.sort emptysetEqType))))), @eq (GeneralizedMutex.mutex Empty_set) x (@GeneralizedMutex.own Empty_set) *) by case: x. Qed. Section MutexRewriting. Variable T : eqType. Implicit Types (t : T) (x : mutex T). Lemma mxE1 : ((@mx_undef T == nown) = false) * ((@nown T == mx_undef) = false) * ((@mx_undef T == own) = false) * ((@own T == mx_undef) = false) * ((@nown T == own) = false) * ((@own T == nown) = false). Proof. (* Goal: prod (prod (prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.undef (Equality.sort T)) (@GeneralizedMutex.nown (Equality.sort T))) false) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.nown (Equality.sort T)) (@GeneralizedMutex.undef (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.undef (Equality.sort T)) (@GeneralizedMutex.own (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.own (Equality.sort T)) (@GeneralizedMutex.undef (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.nown (Equality.sort T)) (@GeneralizedMutex.own (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.own (Equality.sort T)) (@GeneralizedMutex.nown (Equality.sort T))) false) *) by []. Qed. Lemma mxE2 t : ((mx t == nown) = false) * ((nown == mx t) = false) * ((mx t == mx_undef) = false) * ((mx_undef == mx t) = false) * ((mx t == own) = false) * ((own == mx t) = false). Proof. (* Goal: prod (prod (prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t) (@GeneralizedMutex.nown (Equality.sort T))) false) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.nown (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t)) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t) (@GeneralizedMutex.undef (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.undef (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t)) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t) (@GeneralizedMutex.own (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.own (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t)) false) *) by []. Qed. Lemma mxE3 t x : ((mx t \+ x == nown) = false) * ((x \+ mx t == nown) = false) * ((nown == mx t \+ x) = false) * ((nown == x \+ mx t) = false) * ((mx t \+ x == own) = false) * ((x \+ mx t == own) = false) * ((own \+ x == mx t) = false) * ((x \+ own == mx t) = false). Proof. (* Goal: prod (prod (prod (prod (prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t) x) (@GeneralizedMutex.nown (Equality.sort T))) false) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t)) (@GeneralizedMutex.nown (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.nown (Equality.sort T)) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t) x)) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.nown (Equality.sort T)) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t) x) (@GeneralizedMutex.own (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t)) (@GeneralizedMutex.own (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.own (Equality.sort T)) x) (@GeneralizedMutex.mx (Equality.sort T) t)) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.own (Equality.sort T))) (@GeneralizedMutex.mx (Equality.sort T) t)) false) *) by case: x. Qed. Lemma mxE4 x : ((own \+ x == nown) = false) * ((x \+ own == nown) = false) * ((own \+ x == own) = (x == Unit)) * ((x \+ own == own) = (x == Unit)). Proof. (* Goal: prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.own (Equality.sort T)) x) (@GeneralizedMutex.nown (Equality.sort T))) false) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.own (Equality.sort T))) (@GeneralizedMutex.nown (Equality.sort T))) false)) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.own (Equality.sort T)) x) (@GeneralizedMutex.own (Equality.sort T))) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.own (Equality.sort T))) (@GeneralizedMutex.own (Equality.sort T))) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))) *) by case: x. Qed. Lemma mxE5 t1 t2 x : ((mx t1 \+ x == mx t2) = (t1 == t2) && (x == Unit)) * ((x \+ mx t1 == mx t2) = (t1 == t2) && (x == Unit)) * ((mx t1 == mx t2 \+ x) = (t1 == t2) && (x == Unit)) * ((mx t1 == x \+ mx t2) = (t1 == t2) && (x == Unit)). Proof. (* Goal: prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t1) x) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t1)) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t2) x)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t2))) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) *) have L : forall t1 t2 x, (mx t1 \+ x == mx t2) = (t1 == t2) && (x == Unit). (* Goal: prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t1) x) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t1)) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t2) x)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t2))) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) *) (* Goal: forall (t1 t2 : Equality.sort T) (x : GeneralizedMutex.mutex (Equality.sort T)), @eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t1) x) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))) *) - (* Goal: prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t1) x) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t1)) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t2) x)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t2))) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) *) (* Goal: forall (t1 t2 : Equality.sort T) (x : GeneralizedMutex.mutex (Equality.sort T)), @eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t1) x) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))) *) by move=>*; apply/idP/andP; [case/eqP/cancelMx=>->->|case=>/eqP->/eqP->]. (* Goal: prod (prod (prod (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t1) x) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t1)) (@GeneralizedMutex.mx (Equality.sort T) t2)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t2) x)) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T))))))) (@eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@PCM.join (GeneralizedMutex.mutexPCM (Equality.sort T)) x (@GeneralizedMutex.mx (Equality.sort T) t2))) (andb (@eq_op T t1 t2) (@eq_op (GeneralizedMutex.mutexEqType T) x (@PCM.unit (GeneralizedMutex.mutexPCM (Equality.sort T)))))) *) by do !split=>//; rewrite ?L // eq_sym L eq_sym. Qed. Lemma mx_valid t : valid (mx t). Proof. (* Goal: is_true (@PCM.valid (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.mx (Equality.sort T) t)) *) by []. Qed. Lemma mx_valid_own : valid (@own T). Proof. (* Goal: is_true (@PCM.valid (GeneralizedMutex.mutexPCM (Equality.sort T)) (@GeneralizedMutex.own (Equality.sort T))) *) by []. Qed. Lemma mx_injE t1 t2 : (mx t1 == mx t2) = (t1 == t2). Proof. (* Goal: @eq bool (@eq_op (GeneralizedMutex.mutexEqType T) (@GeneralizedMutex.mx (Equality.sort T) t1) (@GeneralizedMutex.mx (Equality.sort T) t2)) (@eq_op T t1 t2) *) by []. Qed. Definition mxE := (mxE1, mxE2, mxE3, mxE4, mxE5, mx_injE, mx_valid, mx_valid_own, unitL, unitR, valid_unit, eq_refl, valid_undef, undef_join, join_undef). End MutexRewriting.
Set Automatic Coercions Import. Set Implicit Arguments. Unset Strict Implicit. Require Export Module_util. Require Export Module_facts. Section Free_Module_def. Variable R : RING. Variable V : SET. Inductive FMd : Type := | Var : V -> FMd | Law : FMd -> FMd -> FMd | Unit : FMd | Inv : FMd -> FMd | Op : R -> FMd -> FMd. Inductive eqFMd : FMd -> FMd -> Prop := | eqFMd_Var : forall x y : V, Equal x y -> (eqFMd (Var x) (Var y):Prop) | eqFMd_law : forall x x' y y' : FMd, eqFMd x x' -> eqFMd y y' -> (eqFMd (Law x y) (Law x' y'):Prop) | eqFMd_law_assoc : forall x y z : FMd, eqFMd (Law (Law x y) z) (Law x (Law y z)):Prop | eqFMd_law0r : forall x : FMd, eqFMd (Law x Unit) x:Prop | eqFMd_inv : forall x y : FMd, eqFMd x y -> eqFMd (Inv x) (Inv y) | eqFMd_invr : forall x : FMd, eqFMd (Law x (Inv x)) Unit | eqFMd_refl : forall x : FMd, eqFMd x x:Prop | eqFMd_sym : forall x y : FMd, eqFMd x y -> (eqFMd y x:Prop) | eqFMd_trans : forall x y z : FMd, eqFMd x y -> eqFMd y z -> (eqFMd x z:Prop) | eqFMd_com : forall x y : FMd, eqFMd (Law x y) (Law y x) | eqFMd_op_comp : forall (a b : R) (x y : FMd), Equal a b -> eqFMd x y -> (eqFMd (Op a x) (Op b y):Prop) | eqFMd_oplin_l : forall (a b : R) (x : FMd), eqFMd (Op (sgroup_law R a b) x) (Law (Op a x) (Op b x)) | eqFMd_oplin_r : forall (a : R) (x y : FMd), eqFMd (Op a (Law x y)) (Law (Op a x) (Op a y)) | eqFMd_op_assoc : forall (a b : R) (x : FMd), eqFMd (Op a (Op b x)) (Op (ring_mult a b) x) | eqFMd_op_unit : forall x : FMd, eqFMd (Op (ring_unit R) x) x. Hint Resolve eqFMd_Var eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_invr eqFMd_refl: algebra. Hint Immediate eqFMd_sym: algebra. Lemma eqFMd_Equiv : equivalence eqFMd. Proof. (* Goal: @equivalence FMd eqFMd *) red in |- *. (* Goal: and (@reflexive FMd eqFMd) (@partial_equivalence FMd eqFMd) *) split; [ try assumption | idtac ]. (* Goal: @partial_equivalence FMd eqFMd *) (* Goal: @reflexive FMd eqFMd *) exact eqFMd_refl. (* Goal: @partial_equivalence FMd eqFMd *) red in |- *. (* Goal: and (@transitive FMd eqFMd) (@symmetric FMd eqFMd) *) split; [ try assumption | idtac ]. (* Goal: @symmetric FMd eqFMd *) (* Goal: @transitive FMd eqFMd *) exact eqFMd_trans. (* Goal: @symmetric FMd eqFMd *) exact eqFMd_sym. Qed. Definition FMd_set := Build_Setoid eqFMd_Equiv. Definition FreeModule : MODULE R. Proof. (* Goal: Ob (MODULE R) *) apply (BUILD_MODULE (R:=R) (E:=FMd_set) (genlaw:=Law) (e:=Unit) (geninv:=Inv) (gen_module_op:=Op)). (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x Unit) x *) (* Goal: forall x y z : Carrier FMd_set, @Equal FMd_set (Law (Law x y) z) (Law x (Law y z)) *) (* Goal: forall (x x' y y' : Carrier FMd_set) (_ : @Equal FMd_set x x') (_ : @Equal FMd_set y y'), @Equal FMd_set (Law x y) (Law x' y') *) exact eqFMd_law. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x Unit) x *) (* Goal: forall x y z : Carrier FMd_set, @Equal FMd_set (Law (Law x y) z) (Law x (Law y z)) *) exact eqFMd_law_assoc. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x Unit) x *) exact eqFMd_law0r. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) (* Goal: forall (x y : Carrier FMd_set) (_ : @Equal FMd_set x y), @Equal FMd_set (Inv x) (Inv y) *) exact eqFMd_inv. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Law x (Inv x)) Unit *) exact eqFMd_invr. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) (* Goal: forall x y : Carrier FMd_set, @Equal FMd_set (Law x y) (Law y x) *) exact eqFMd_com. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : @Equal FMd_set x y), @Equal FMd_set (Op a x) (Op b y) *) exact eqFMd_op_comp. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))) a b) x) (Law (Op a x) (Op b x)) *) exact eqFMd_oplin_l. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x y : Carrier FMd_set), @Equal FMd_set (Op a (Law x y)) (Law (Op a x) (Op a y)) *) exact eqFMd_oplin_r. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) (* Goal: forall (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier FMd_set), @Equal FMd_set (Op a (Op b x)) (Op (@ring_mult R a b) x) *) exact eqFMd_op_assoc. (* Goal: forall x : Carrier FMd_set, @Equal FMd_set (Op (ring_unit R) x) x *) exact eqFMd_op_unit. Qed. Section Universal_prop. Variable Mod : MODULE R. Variable f : Hom V Mod. Fixpoint FMd_lift_fun (p : FreeModule) : Mod := match p with | Var v => f v | Law p1 p2 => sgroup_law Mod (FMd_lift_fun p1) (FMd_lift_fun p2) | Unit => monoid_unit Mod | Inv p1 => group_inverse Mod (FMd_lift_fun p1) | Op a p1 => module_mult a (FMd_lift_fun p1) end. Definition FMd_lift : Hom FreeModule Mod. Proof. (* Goal: Carrier (@Hom (MODULE R) FreeModule Mod) *) apply (BUILD_HOM_MODULE (R:=R) (Mod:=FreeModule) (Mod':=Mod) (ff:=FMd_lift_fun)). (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun y) *) intros x y H'; try assumption. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun y) *) elim H'; simpl in |- *; auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: forall (x y z : FMd) (_ : eqFMd x y) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun y)) (_ : eqFMd y z) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y) (FMd_lift_fun z)), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x) (FMd_lift_fun z) *) intros x0 y0 z H'0 H'1 H'2 H'3; try assumption. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun z) *) apply Trans with (FMd_lift_fun y0); auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) (* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) x y)) (sgroup_law (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x) (FMd_lift_fun y)) *) simpl in |- *; auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) (* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))) *) simpl in |- *; auto with algebra. (* Goal: forall (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun (@module_mult R FreeModule a x)) (@module_mult R Mod a (FMd_lift_fun x)) *) simpl in |- *; auto with algebra. Qed. Definition FMd_var : Hom V FreeModule. Proof. (* Goal: Carrier (@Hom SET V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))))) *) apply (Build_Map (A:=V) (B:=FreeModule) (Ap:=Var)). (* Goal: @fun_compatible V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) Var *) red in |- *. (* Goal: forall (x y : Carrier V) (_ : @Equal V x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) (Var x) (Var y) *) simpl in |- *; auto with algebra. Qed. Lemma FMd_comp_prop : Equal f (comp_hom (FMd_lift:Hom (FreeModule:SET) Mod) FMd_var). Proof. (* Goal: @Equal (@Hom SET V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f (@comp_hom SET V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R FreeModule))) (group_monoid (abelian_group_group (@module_carrier R Mod))) (@module_monoid_hom R FreeModule Mod FMd_lift)) : Carrier (@Hom SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R FreeModule)))) : Ob SET) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) FMd_var) *) simpl in |- *. (* Goal: @Map_eq V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x y : FMd) (H' : eqFMd x y) => @eqFMd_ind (fun x0 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun y0)) (fun (x0 y0 : Carrier V) (H : @Equal V x0 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x0 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x0 x' y0 y' : FMd) (_ : eqFMd x0 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x0) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x0 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x0) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x0 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x0)) (fun (x0 y0 : FMd) (_ : eqFMd x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x0) (FMd_lift_fun y0) H0) (fun x0 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x0)) (fun x0 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0)) (fun (x0 y0 : FMd) (_ : eqFMd x0 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun y0) H0) (fun (x0 y0 z : FMd) (_ : eqFMd x0 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x0 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x0) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x0 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x0 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x0) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x0) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x0 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x0)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x0 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x0) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x0 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x0)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x0))) (@MODULE_assoc R Mod a b (FMd_lift_fun x0))) (fun x0 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x0)) x y H')) FMd_var) *) red in |- *. (* Goal: forall x : Carrier V, @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) red in |- *. (* Goal: forall x : Carrier V, (let (Carrier, Equal, _) as s return (relation (Carrier s)) := sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) in Equal) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@comp_hom SET V FMd_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@f2 (@G FMd_set Law Unit Inv eqFMd_law eqFMd_law_assoc eqFMd_law0r eqFMd_inv eqFMd_invr) (abelian_group_group (@module_carrier R Mod)) FMd_lift_fun (fun (x0 y : FMd) (H' : eqFMd x0 y) => @eqFMd_ind (fun x1 y0 : FMd => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (x1 y0 : Carrier V) (H : @Equal V x1 y0) => @Ap_comp V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f f x1 y0 H (@Refl (MAP V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) f)) (fun (x1 x' y0 y' : FMd) (_ : eqFMd x1 x') (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun x')) (_ : eqFMd y0 y') (H2 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun y')) => @SGROUP_comp (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun x') (FMd_lift_fun y0) (FMd_lift_fun y') H0 H2) (fun x1 y0 z : FMd => @SGROUP_assoc (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z)) (fun x1 : FMd => @MONOID_unit_r (group_monoid (abelian_group_group (@module_carrier R Mod))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @GROUP_comp (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun x1 : FMd => @GROUP_inverse_r (abelian_group_group (@module_carrier R Mod)) (FMd_lift_fun x1)) (fun x1 : FMd => @Refl (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1)) (fun (x1 y0 : FMd) (_ : eqFMd x1 y0) (H0 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) H0) (fun (x1 y0 z : FMd) (_ : eqFMd x1 y0) (H'1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) (_ : eqFMd y0 z) (H'3 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun y0) (FMd_lift_fun z)) => @Trans (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0) (FMd_lift_fun z) H'1 H'3) (fun x1 y0 : FMd => @ABELIAN_GROUP_com (@module_carrier R Mod) (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) (H : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))) a b) (_ : eqFMd x1 y0) (H1 : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (FMd_lift_fun x1) (FMd_lift_fun y0)) => @MODULE_comp R Mod a b (FMd_lift_fun x1) (FMd_lift_fun y0) H H1) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @MODULE_dist_r R Mod a b (FMd_lift_fun x1)) (fun (a : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 y0 : FMd) => @MODULE_dist_l R Mod a (FMd_lift_fun x1) (FMd_lift_fun y0)) (fun (a b : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (x1 : FMd) => @Sym (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@module_mult R Mod (@ring_mult R a b) (FMd_lift_fun x1)) (@module_mult R Mod a (@module_mult R Mod b (FMd_lift_fun x1))) (@MODULE_assoc R Mod a b (FMd_lift_fun x1))) (fun x1 : FMd => @MODULE_unit_l R Mod (FMd_lift_fun x1)) x0 y H')) FMd_var) x) *) simpl in |- *. (* Goal: forall x : Carrier V, (let (Carrier, Equal, _) as s return (relation (Carrier s)) := sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) in Equal) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) *) intros x; try assumption. (* Goal: (let (Carrier, Equal, _) as s return (relation (Carrier s)) := sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) in Equal) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) (@Ap V (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) f x) *) exact (Refl (f x)). Qed. End Universal_prop. End Free_Module_def. Hint Resolve FMd_comp_prop: algebra.
Require Import Q_ordered_field_properties. Require Import R_addenda. Require Import Raxioms. Require Import RIneq. Definition Q_to_R (q:Q) : R := ((IZR (numerator q))/(IZR (denominator q)))%R. Coercion Q_to_R : Q>->R. Lemma Q_to_Req: forall x y, @eq Q x y -> ((Q_to_R x)=(Q_to_R y))%R. Proof. (* Goal: forall (x y : Q) (_ : @eq Q x y), @eq R (Q_to_R x) (Q_to_R y) *) exact (f_equal Q_to_R). Qed. Lemma Q_to_R_Zero: (Q_to_R Zero=0)%R. Proof. (* Goal: @eq R (Q_to_R Zero) (IZR Z0) *) unfold Q_to_R, numerator, denominator, decode_Q; simpl; field; apply R1_neq_R0. Qed. Lemma Q_to_R_Qone: (Q_to_R Qone=1)%R. Proof. (* Goal: @eq R (Q_to_R Qone) (IZR (Zpos xH)) *) unfold Q_to_R, numerator, denominator, decode_Q; simpl; field; apply R1_neq_R0. Qed. Lemma Q_to_R_Qneg_One: (Q_to_R (Qneg One)=(-1))%R. Proof. (* Goal: @eq R (Q_to_R (Qneg One)) (IZR (Zneg xH)) *) unfold Q_to_R, numerator, denominator, decode_Q; simpl; field; apply R1_neq_R0. Qed. Lemma Q_to_Ropp: forall x, Q_to_R (Qopp x) = Ropp (Q_to_R x). Proof. (* Goal: forall x : Q, @eq R (Q_to_R (Qopp x)) (Ropp (Q_to_R x)) *) intros [ |p|p]. (* Goal: @eq R (Q_to_R (Qopp (Qneg p))) (Ropp (Q_to_R (Qneg p))) *) (* Goal: @eq R (Q_to_R (Qopp (Qpos p))) (Ropp (Q_to_R (Qpos p))) *) (* Goal: @eq R (Q_to_R (Qopp Zero)) (Ropp (Q_to_R Zero)) *) simpl; rewrite Q_to_R_Zero; ring. (* Goal: @eq R (Q_to_R (Qopp (Qneg p))) (Ropp (Q_to_R (Qneg p))) *) (* Goal: @eq R (Q_to_R (Qopp (Qpos p))) (Ropp (Q_to_R (Qpos p))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qopp, fst, snd. (* Goal: @eq R (Q_to_R (Qopp (Qneg p))) (Ropp (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Ropp (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Q_to_R (Qopp (Qneg p))) (Ropp (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Ropp (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) rewrite H. (* Goal: @eq R (Q_to_R (Qopp (Qneg p))) (Ropp (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Ropp (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qopp (Qneg p))) (Ropp (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Ropp (Rdiv (INR (S p0)) (INR (S q0)))) *) field; auto. (* Goal: @eq R (Q_to_R (Qopp (Qneg p))) (Ropp (Q_to_R (Qneg p))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qopp, fst, snd. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Ropp (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Ropp (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) rewrite H. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Ropp (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Rdiv (INR (S p0)) (INR (S q0))) (Ropp (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) field; auto. Qed. Lemma Q_to_Rplus: forall x y, Q_to_R (Qplus x y) = (Rplus (Q_to_R x) (Q_to_R y)). Proof. (* Goal: forall x y : Q, @eq R (Q_to_R (Qplus x y)) (Rplus (Q_to_R x) (Q_to_R y)) *) intros [ |p|p] [ |p'|p']; try rewrite Q_to_R_Zero; try rewrite Qplus_zero_left; try rewrite Qplus_zero_right; try rewrite Rplus_0_r; try rewrite Rplus_0_l; trivial. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R Zero) (IZR Z0) *) unfold Q_to_R, numerator, denominator, decode_Q; simpl; field; apply R1_neq_R0... unfold Q_to_R, numerator, denominator, decode_Q, Qplus, fst, snd; unfold Qpositive_plus. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) destruct (interp_non_zero p) as [p0 [q0 H]]. destruct (interp_non_zero p') as [p0' [q0' H']]. rewrite H; rewrite H'. replace (S p0 * S q0' + S p0' * S q0)%nat with (S (q0'+p0*(S q0')+S (q0+p0'*(S q0))))%nat; auto with arith. replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; auto with arith. set (m:=((q0' + p0 * S q0') + S (q0 + p0' * S q0))%nat). set (n:=(q0' + q0 * S q0')%nat). destruct (construct_correct2 (S m+S n) m n (le_n _)) as [factor [H_factor1 H_factor2]]. generalize H_factor1 H_factor2; clear H_factor1 H_factor2. set (P:=(Qpositive_c (S m) (S n) (S m + S n))). destruct (interp_non_zero P) as [P0 [Q0 H'']]. rewrite H''. unfold fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) intros H_factor1 H_factor2. repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite Rplus_Rdiv; auto. rewrite <- (Rdiv_Rmult_simplify (INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. do 2 rewrite <- mult_INR. rewrite <- H_factor1; rewrite <- H_factor2. apply Rmult_Rdiv; auto. subst m n. repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) ring. unfold Q_to_R at 1, numerator, denominator, decode_Q, Qplus, fst, snd. destruct (Qpositive_le_dec p p') as [H_le_dec|H_le_dec]. destruct (Qpositive_eq_dec p p') as [H_eq_dec|H_eq_dec]. subst p; rewrite Qopp_Qpos; rewrite Q_to_Ropp; rewrite Rplus_opp_r; simpl; field; auto. unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) unfold Qpositive_sub. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) generalize (Qpositive_le_to_Qpositive_le' p p' H_le_dec); unfold Qpositive_le'. generalize (Qpositive_le_noneq_explicit p p' H_le_dec H_eq_dec). destruct (interp_non_zero p) as [p0 [q0 H]]. destruct (interp_non_zero p') as [p0' [q0' H']]. rewrite H; rewrite H'; intros H_le_dec_unfolded H_let. assert (H_le_unfold: (S q0' + p0 * S q0' <= q0 + p0' * S q0)%nat); auto with arith. replace (S p0' * S q0 - S p0 * S q0')%nat with (S (q0+p0'*(S q0)- (S q0'+p0*(S q0'))))%nat; [| rewrite (minus_Sn_m _ _ H_le_unfold); auto with arith ]. replace (S q0' * S q0)%nat with (S (q0+q0'*(S q0)))%nat; auto with arith. replace (S p0' * S q0 + S p0 * S q0')%nat with (S (q0+p0'*(S q0)+S (q0'+p0*(S q0'))))%nat; auto with arith. set (m':=((q0 + p0' * S q0) + S (q0' + p0 * S q0'))%nat). set (m:=((q0 + p0' * S q0) - (S q0' + p0 * S q0'))%nat). set (n:=(q0 + q0' * S q0)%nat). assert (H_m':(S m + S n <= S m' + S n)%nat); [ subst m m' n; apply plus_le_compat_r; apply le_n_S; apply le_trans with (q0 + p0' * S q0)%nat; auto with arith; apply le_minus |]. destruct (construct_correct2 (S m'+S n) m n H_m') as [factor [H_factor1 H_factor2]]. generalize H_factor1 H_factor2; clear H_factor1 H_factor2. set (P:=(Qpositive_c (S m) (S n) (S m' + S n))). destruct (interp_non_zero P) as [P0 [Q0 H'']]. rewrite H''. unfold fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) intros H_factor1 H_factor2. repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite Rplus_Rdiv; auto. rewrite <- (Rdiv_Rmult_simplify (- INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. rewrite <- H_factor1; rewrite <- H_factor2. apply Rmult_Rdiv; auto. subst m n. repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite minus_INR; trivial. repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) ring. unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) unfold Qpositive_sub. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) generalize (sym_not_eq (not_Qpositive_le_not_eq _ _ H_le_dec)). generalize (not_Qpositive_le_Qpositive_le' _ _ H_le_dec); clear H_le_dec; intros H_le_dec H_eq_dec. generalize (Qpositive_le_to_Qpositive_le' p' p H_le_dec); unfold Qpositive_le'. generalize (Qpositive_le_noneq_explicit p' p H_le_dec H_eq_dec). destruct (interp_non_zero p) as [p0 [q0 H]]. destruct (interp_non_zero p') as [p0' [q0' H']]. rewrite H; rewrite H'; intros H_le_dec_unfolded H_lt. assert (H_le_unfold: (S q0 + p0' * S q0 <= q0' + p0 * S q0')%nat); auto with arith. replace (S p0 * S q0' - S p0' * S q0)%nat with (S (q0'+p0*(S q0')- (S q0+p0'*(S q0))))%nat; [| rewrite (minus_Sn_m _ _ H_le_unfold); auto with arith ]. replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; auto with arith. replace (S p0 * S q0' + S p0' * S q0)%nat with (S (q0'+p0*(S q0')+S (q0+p0'*(S q0))))%nat; auto with arith. set (m':=((q0' + p0 * S q0') + S (q0 + p0' * S q0))%nat). set (m:=((q0' + p0 * S q0') - (S q0 + p0' * S q0))%nat). set (n:=(q0' + q0 * S q0')%nat). assert (H_m':(S m + S n <= S m' + S n)%nat); [ subst m m' n; apply plus_le_compat_r; apply le_n_S; apply le_trans with (q0' + p0 * S q0')%nat; auto with arith; apply le_minus |]. destruct (construct_correct2 (S m'+S n) m n H_m') as [factor [H_factor1 H_factor2]]. generalize H_factor1 H_factor2; clear H_factor1 H_factor2. set (P:=(Qpositive_c (S m) (S n) (S m' + S n))). destruct (interp_non_zero P) as [P0 [Q0 H'']]. rewrite H''. unfold fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) intros H_factor1 H_factor2. repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite Rplus_Rdiv; auto. rewrite <- (Rdiv_Rmult_simplify (INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. rewrite <- H_factor1; rewrite <- H_factor2. apply Rmult_Rdiv; auto. subst m n. repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite minus_INR; trivial. repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) ring. unfold Q_to_R at 1, numerator, denominator, decode_Q, Qplus, fst, snd. destruct (Qpositive_le_dec p p') as [H_le_dec|H_le_dec]. destruct (Qpositive_eq_dec p p') as [H_eq_dec|H_eq_dec]. subst p; rewrite Qopp_Qpos; rewrite Q_to_Ropp; rewrite Rplus_opp_l; simpl; field; auto. unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) unfold Qpositive_sub. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) generalize (Qpositive_le_to_Qpositive_le' p p' H_le_dec); unfold Qpositive_le'. generalize (Qpositive_le_noneq_explicit p p' H_le_dec H_eq_dec). destruct (interp_non_zero p) as [p0 [q0 H]]. destruct (interp_non_zero p') as [p0' [q0' H']]. rewrite H; rewrite H'; intros H_le_dec_unfolded H_let. assert (H_le_unfold: (S q0' + p0 * S q0' <= q0 + p0' * S q0)%nat); auto with arith. replace (S p0' * S q0 - S p0 * S q0')%nat with (S (q0+p0'*(S q0)- (S q0'+p0*(S q0'))))%nat; [| rewrite (minus_Sn_m _ _ H_le_unfold); auto with arith ]. replace (S q0' * S q0)%nat with (S (q0+q0'*(S q0)))%nat; auto with arith. replace (S p0' * S q0 + S p0 * S q0')%nat with (S (q0+p0'*(S q0)+S (q0'+p0*(S q0'))))%nat; auto with arith. set (m':=((q0 + p0' * S q0) + S (q0' + p0 * S q0'))%nat). set (m:=((q0 + p0' * S q0) - (S q0' + p0 * S q0'))%nat). set (n:=(q0 + q0' * S q0)%nat). assert (H_m':(S m + S n <= S m' + S n)%nat); [ subst m m' n; apply plus_le_compat_r; apply le_n_S; apply le_trans with (q0 + p0' * S q0)%nat; auto with arith; apply le_minus |]. destruct (construct_correct2 (S m'+S n) m n H_m') as [factor [H_factor1 H_factor2]]. generalize H_factor1 H_factor2; clear H_factor1 H_factor2. set (P:=(Qpositive_c (S m) (S n) (S m' + S n))). destruct (interp_non_zero P) as [P0 [Q0 H'']]. rewrite H''. unfold fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) intros H_factor1 H_factor2. repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite Rplus_Rdiv; auto. rewrite <- (Rdiv_Rmult_simplify (INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. rewrite <- H_factor1; rewrite <- H_factor2. apply Rmult_Rdiv; auto. subst m n. repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite minus_INR; trivial. repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) ring. unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) unfold Qpositive_sub. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) generalize (sym_not_eq (not_Qpositive_le_not_eq _ _ H_le_dec)). generalize (not_Qpositive_le_Qpositive_le' _ _ H_le_dec); clear H_le_dec; intros H_le_dec H_eq_dec. generalize (Qpositive_le_to_Qpositive_le' p' p H_le_dec); unfold Qpositive_le'. generalize (Qpositive_le_noneq_explicit p' p H_le_dec H_eq_dec). destruct (interp_non_zero p) as [p0 [q0 H]]. destruct (interp_non_zero p') as [p0' [q0' H']]. rewrite H; rewrite H'; intros H_le_dec_unfolded H_lt. assert (H_le_unfold: (S q0 + p0' * S q0 <= q0' + p0 * S q0')%nat); auto with arith. replace (S p0 * S q0' - S p0' * S q0)%nat with (S (q0'+p0*(S q0')- (S q0+p0'*(S q0))))%nat; [| rewrite (minus_Sn_m _ _ H_le_unfold); auto with arith ]. replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; auto with arith. replace (S p0 * S q0' + S p0' * S q0)%nat with (S (q0'+p0*(S q0')+S (q0+p0'*(S q0))))%nat; auto with arith. set (m':=((q0' + p0 * S q0') + S (q0 + p0' * S q0))%nat). set (m:=((q0' + p0 * S q0') - (S q0 + p0' * S q0))%nat). set (n:=(q0' + q0 * S q0')%nat). assert (H_m':(S m + S n <= S m' + S n)%nat); [ subst m m' n; apply plus_le_compat_r; apply le_n_S; apply le_trans with (q0' + p0 * S q0')%nat; auto with arith; apply le_minus |]. destruct (construct_correct2 (S m'+S n) m n H_m') as [factor [H_factor1 H_factor2]]. generalize H_factor1 H_factor2; clear H_factor1 H_factor2. set (P:=(Qpositive_c (S m) (S n) (S m' + S n))). destruct (interp_non_zero P) as [P0 [Q0 H'']]. rewrite H''. unfold fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) intros H_factor1 H_factor2. repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite Rplus_Rdiv; auto. rewrite <- (Rdiv_Rmult_simplify (-INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. rewrite <- H_factor1; rewrite <- H_factor2. apply Rmult_Rdiv; auto. subst m n. repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite minus_INR; trivial. repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) ring. unfold Q_to_R, numerator, denominator, decode_Q, Qplus, fst, snd; unfold Qpositive_plus. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) destruct (interp_non_zero p) as [p0 [q0 H]]. destruct (interp_non_zero p') as [p0' [q0' H']]. rewrite H; rewrite H'. replace (S p0 * S q0' + S p0' * S q0)%nat with (S (q0'+p0*(S q0')+S (q0+p0'*(S q0))))%nat; auto with arith. replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; auto with arith. set (m:=((q0' + p0 * S q0') + S (q0 + p0' * S q0))%nat). set (n:=(q0' + q0 * S q0')%nat). destruct (construct_correct2 (S m+S n) m n (le_n _)) as [factor [H_factor1 H_factor2]]. generalize H_factor1 H_factor2; clear H_factor1 H_factor2. set (P:=(Qpositive_c (S m) (S n) (S m + S n))). destruct (interp_non_zero P) as [P0 [Q0 H'']]. rewrite H''. unfold fst, snd. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) intros H_factor1 H_factor2. repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) rewrite Rplus_Rdiv; auto. rewrite <- (Rdiv_Rmult_simplify (-INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. rewrite <- H_factor1; rewrite <- H_factor2. apply Rmult_Rdiv; auto. subst m n. repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qneg p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qneg p) (Qpos p'))) (Rplus (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qneg p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qplus (Qpos p) (Qpos p'))) (Rplus (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (IZR Z0) *) ring. Qed. Qed. Lemma Q_to_Rmult: forall x y, Q_to_R (Qmult x y) = (Rmult (Q_to_R x) (Q_to_R y)). Proof. (* Goal: forall x y : Q, @eq R (Q_to_R (Qmult x y)) (Rmult (Q_to_R x) (Q_to_R y)) *) intros [ |p|p] [ |p'|p']; try rewrite Q_to_R_Zero; try rewrite Qmult_zero; try rewrite Qmult_zero_right; try rewrite Rmult_0_r; try rewrite Rmult_0_l; try rewrite Q_to_R_Zero; trivial. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qpos p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qmult, fst, snd; unfold Qpositive_mult. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H; rewrite H'. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) replace (S p0 * S p0')%nat with (S (p0'+p0*(S p0')))%nat; trivial. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; trivial. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) set (m:=((p0' + p0 * S p0')%nat)). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) set (n:=((q0' + q0 * S q0')%nat)). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) destruct (construct_correct2 (S m+S n) m n (le_n _)) as [factor [H_factor1 H_factor2]]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) generalize H_factor1 H_factor2; clear H_factor1 H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) set (P:=(Qpositive_c (S m) (S n) (S m + S n))). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i P in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) destruct (interp_non_zero P) as [P0 [Q0 H'']]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i P in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) rewrite H''. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (@pair nat nat (S P0) (S Q0))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (@pair nat nat (S P0) (S Q0))) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (S P0))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) unfold fst, snd. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (S P0) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (S Q0) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (S P0))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) intros H_factor1 H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (S P0))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (INR (S P0)) (INR (S Q0))) (Rmult (Rdiv (INR (S p0)) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0')))) *) rewrite Rdiv_Rmult_numerator_denominator; auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (INR (S P0)) (INR (S Q0))) (Rdiv (Rmult (INR (S p0)) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- (Rdiv_Rmult_simplify (INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (Rmult (INR (S P0)) (INR (S factor))) (Rmult (INR (S Q0)) (INR (S factor)))) (Rdiv (Rmult (INR (S p0)) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) do 2 rewrite <- mult_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (INR (Init.Nat.mul (S P0) (S factor))) (INR (Init.Nat.mul (S Q0) (S factor)))) (Rdiv (Rmult (INR (S p0)) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- H_factor1; rewrite <- H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (INR (S m)) (INR (S n))) (Rdiv (Rmult (INR (S p0)) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) apply Rmult_Rdiv; auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (INR (S m)) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Rmult (INR (S p0)) (INR (S p0'))) (INR (S n))) *) subst m n. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (INR (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0'))))) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Rmult (INR (S p0)) (INR (S p0'))) (INR (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Rplus (INR (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (INR (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Rplus (Rplus (INR p0') (INR (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (Rplus (INR q0') (INR (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Rplus (Rplus (INR p0') (Rmult (INR p0) (INR (S p0')))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (INR (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Rplus (Rplus (INR p0') (Rmult (INR p0) (Rplus (INR p0') (IZR (Zpos xH))))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (Rplus (INR q0') (IZR (Zpos xH))))) (IZR (Zpos xH)))) *) ring. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qpos p) (Qneg p'))) (Rmult (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qmult, fst, snd; unfold Qpositive_mult. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H; rewrite H'. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) replace (S p0 * S p0')%nat with (S (p0'+p0*(S p0')))%nat; trivial. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; trivial. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) set (m:=((p0' + p0 * S p0')%nat)). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) set (n:=((q0' + q0 * S q0')%nat)). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) destruct (construct_correct2 (S m+S n) m n (le_n _)) as [factor [H_factor1 H_factor2]]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) generalize H_factor1 H_factor2; clear H_factor1 H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) set (P:=(Qpositive_c (S m) (S n) (S m + S n))). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i P in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) destruct (interp_non_zero P) as [P0 [Q0 H'']]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i P in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) rewrite H''. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (@pair nat nat (S P0) (S Q0))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (@pair nat nat (S P0) (S Q0))) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S P0)))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) unfold fst, snd. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (S P0) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (S Q0) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S P0)))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) intros H_factor1 H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S P0)))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (S P0))) (INR (S Q0))) (Rmult (Rdiv (INR (S p0)) (INR (S q0))) (Rdiv (Ropp (INR (S p0'))) (INR (S q0')))) *) rewrite Rdiv_Rmult_numerator_denominator; auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (S P0))) (INR (S Q0))) (Rdiv (Rmult (INR (S p0)) (Ropp (INR (S p0')))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- (Rdiv_Rmult_simplify (- INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (Rmult (Ropp (INR (S P0))) (INR (S factor))) (Rmult (INR (S Q0)) (INR (S factor)))) (Rdiv (Rmult (INR (S p0)) (Ropp (INR (S p0')))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (Init.Nat.mul (S P0) (S factor)))) (INR (Init.Nat.mul (S Q0) (S factor)))) (Rdiv (Rmult (INR (S p0)) (Ropp (INR (S p0')))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- H_factor1; rewrite <- H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (S m))) (INR (S n))) (Rdiv (Rmult (INR (S p0)) (Ropp (INR (S p0')))) (Rmult (INR (S q0)) (INR (S q0')))) *) apply Rmult_Rdiv; auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rmult (Ropp (INR (S m))) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Rmult (INR (S p0)) (Ropp (INR (S p0')))) (INR (S n))) *) subst m n. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rmult (Ropp (INR (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))))) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Rmult (INR (S p0)) (Ropp (INR (S p0')))) (INR (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (INR (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH))))) (Rplus (INR (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (Rplus (INR p0') (INR (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH))))) (Rplus (Rplus (INR q0') (INR (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (Rplus (INR p0') (Rmult (INR p0) (INR (S p0')))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH))))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (INR (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (Rplus (INR p0') (Rmult (INR p0) (Rplus (INR p0') (IZR (Zpos xH))))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH))))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (Rplus (INR q0') (IZR (Zpos xH))))) (IZR (Zpos xH)))) *) ring. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qpos p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qmult, fst, snd; unfold Qpositive_mult. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H; rewrite H'. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) replace (S p0 * S p0')%nat with (S (p0'+p0*(S p0')))%nat; trivial. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; trivial. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) set (m:=((p0' + p0 * S p0')%nat)). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) set (n:=((q0' + q0 * S q0')%nat)). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) destruct (construct_correct2 (S m+S n) m n (le_n _)) as [factor [H_factor1 H_factor2]]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) generalize H_factor1 H_factor2; clear H_factor1 H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) set (P:=(Qpositive_c (S m) (S n) (S m + S n))). (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i P in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) destruct (interp_non_zero P) as [P0 [Q0 H'']]. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i P in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) rewrite H''. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (@pair nat nat (S P0) (S Q0))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (@pair nat nat (S P0) (S Q0))) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S P0)))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) unfold fst, snd. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (S P0) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (S Q0) (S factor))), @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S P0)))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) intros H_factor1 H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S P0)))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (S P0))) (INR (S Q0))) (Rmult (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0')))) *) rewrite Rdiv_Rmult_numerator_denominator; auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (S P0))) (INR (S Q0))) (Rdiv (Rmult (Ropp (INR (S p0))) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- (Rdiv_Rmult_simplify (- INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (Rmult (Ropp (INR (S P0))) (INR (S factor))) (Rmult (INR (S Q0)) (INR (S factor)))) (Rdiv (Rmult (Ropp (INR (S p0))) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (Init.Nat.mul (S P0) (S factor)))) (INR (Init.Nat.mul (S Q0) (S factor)))) (Rdiv (Rmult (Ropp (INR (S p0))) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- H_factor1; rewrite <- H_factor2. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rdiv (Ropp (INR (S m))) (INR (S n))) (Rdiv (Rmult (Ropp (INR (S p0))) (INR (S p0'))) (Rmult (INR (S q0)) (INR (S q0')))) *) apply Rmult_Rdiv; auto. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Ropp (INR (S m))) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Rmult (Ropp (INR (S p0))) (INR (S p0'))) (INR (S n))) *) subst m n. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Ropp (INR (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))))) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Rmult (Ropp (INR (S p0))) (INR (S p0'))) (INR (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (INR (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Ropp (Rplus (INR p0) (IZR (Zpos xH)))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (INR (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite plus_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (Rplus (INR p0') (INR (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Ropp (Rplus (INR p0) (IZR (Zpos xH)))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (Rplus (INR q0') (INR (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite mult_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (Rplus (INR p0') (Rmult (INR p0) (INR (S p0')))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Ropp (Rplus (INR p0) (IZR (Zpos xH)))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (INR (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite S_INR. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: @eq R (Rmult (Ropp (Rplus (Rplus (INR p0') (Rmult (INR p0) (Rplus (INR p0') (IZR (Zpos xH))))) (IZR (Zpos xH)))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Rmult (Ropp (Rplus (INR p0) (IZR (Zpos xH)))) (Rplus (INR p0') (IZR (Zpos xH)))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (Rplus (INR q0') (IZR (Zpos xH))))) (IZR (Zpos xH)))) *) ring. (* Goal: @eq R (Q_to_R (Qmult (Qneg p) (Qneg p'))) (Rmult (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qmult, fst, snd; unfold Qpositive_mult. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in Qpositive_c (Init.Nat.mul p p') (Init.Nat.mul q q') (Init.Nat.add (Init.Nat.mul p p') (Init.Nat.mul q q'))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H; rewrite H'. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (Init.Nat.mul (S p0) (S p0')) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) replace (S p0 * S p0')%nat with (S (p0'+p0*(S p0')))%nat; trivial. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (Init.Nat.mul (S q0) (S q0')))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) replace (S q0 * S q0')%nat with (S (q0'+q0*(S q0')))%nat; trivial. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) set (m:=((p0' + p0 * S p0')%nat)). (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (Init.Nat.add (S m) (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) set (n:=((q0' + q0 * S q0')%nat)). (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) destruct (construct_correct2 (S m+S n) m n (le_n _)) as [factor [H_factor1 H_factor2]]. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) generalize H_factor1 H_factor2; clear H_factor1 H_factor2. (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))))) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (S m) (S n) (Init.Nat.add (S m) (S n))) in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) set (P:=(Qpositive_c (S m) (S n) (S m + S n))). (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i P in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) destruct (interp_non_zero P) as [P0 [Q0 H'']]. (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (Qpositive_i P)) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (Qpositive_i P)) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i P in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i P in y)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) rewrite H''. (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (@fst nat nat (@pair nat nat (S P0) (S Q0))) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (@snd nat nat (@pair nat nat (S P0) (S Q0))) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (S P0))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) unfold fst, snd. (* Goal: forall (_ : @eq nat (S m) (Init.Nat.mul (S P0) (S factor))) (_ : @eq nat (S n) (Init.Nat.mul (S Q0) (S factor))), @eq R (Rdiv (IZR (Z.of_nat (S P0))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) intros H_factor1 H_factor2. (* Goal: @eq R (Rdiv (IZR (Z.of_nat (S P0))) (IZR (Z.of_nat (S Q0)))) (Rmult (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Rdiv (INR (S P0)) (INR (S Q0))) (Rmult (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (Ropp (INR (S p0'))) (INR (S q0')))) *) rewrite Rdiv_Rmult_numerator_denominator; auto. (* Goal: @eq R (Rdiv (INR (S P0)) (INR (S Q0))) (Rdiv (Rmult (Ropp (INR (S p0))) (Ropp (INR (S p0')))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- (Rdiv_Rmult_simplify (INR (S P0)) (INR (S Q0)) (INR (S factor))); auto. (* Goal: @eq R (Rdiv (Rmult (INR (S P0)) (INR (S factor))) (Rmult (INR (S Q0)) (INR (S factor)))) (Rdiv (Rmult (Ropp (INR (S p0))) (Ropp (INR (S p0')))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite Ropp_mult_distr_l_reverse; do 2 rewrite <- mult_INR. (* Goal: @eq R (Rdiv (INR (Init.Nat.mul (S P0) (S factor))) (INR (Init.Nat.mul (S Q0) (S factor)))) (Rdiv (Ropp (Rmult (INR (S p0)) (Ropp (INR (S p0'))))) (Rmult (INR (S q0)) (INR (S q0')))) *) rewrite <- H_factor1; rewrite <- H_factor2. (* Goal: @eq R (Rdiv (INR (S m)) (INR (S n))) (Rdiv (Ropp (Rmult (INR (S p0)) (Ropp (INR (S p0'))))) (Rmult (INR (S q0)) (INR (S q0')))) *) apply Rmult_Rdiv; auto. (* Goal: @eq R (Rmult (INR (S m)) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Ropp (Rmult (INR (S p0)) (Ropp (INR (S p0'))))) (INR (S n))) *) subst m n. (* Goal: @eq R (Rmult (INR (S (Init.Nat.add p0' (Init.Nat.mul p0 (S p0'))))) (Rmult (INR (S q0)) (INR (S q0')))) (Rmult (Ropp (Rmult (INR (S p0)) (Ropp (INR (S p0'))))) (INR (S (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))))) *) repeat rewrite S_INR. (* Goal: @eq R (Rmult (Rplus (INR (Init.Nat.add p0' (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Ropp (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH)))))) (Rplus (INR (Init.Nat.add q0' (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite plus_INR. (* Goal: @eq R (Rmult (Rplus (Rplus (INR p0') (INR (Init.Nat.mul p0 (S p0')))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Ropp (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH)))))) (Rplus (Rplus (INR q0') (INR (Init.Nat.mul q0 (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite mult_INR. (* Goal: @eq R (Rmult (Rplus (Rplus (INR p0') (Rmult (INR p0) (INR (S p0')))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Ropp (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH)))))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (INR (S q0')))) (IZR (Zpos xH)))) *) repeat rewrite S_INR. (* Goal: @eq R (Rmult (Rplus (Rplus (INR p0') (Rmult (INR p0) (Rplus (INR p0') (IZR (Zpos xH))))) (IZR (Zpos xH))) (Rmult (Rplus (INR q0) (IZR (Zpos xH))) (Rplus (INR q0') (IZR (Zpos xH))))) (Rmult (Ropp (Rmult (Rplus (INR p0) (IZR (Zpos xH))) (Ropp (Rplus (INR p0') (IZR (Zpos xH)))))) (Rplus (Rplus (INR q0') (Rmult (INR q0) (Rplus (INR q0') (IZR (Zpos xH))))) (IZR (Zpos xH)))) *) ring. Qed. Lemma Q_to_Rinv: forall x, ~(x=Zero) -> Q_to_R (Qinv x) = Rinv (Q_to_R x). Proof. (* Goal: forall (x : Q) (_ : not (@eq Q x Zero)), @eq R (Q_to_R (Qinv x)) (Rinv (Q_to_R x)) *) intros [ |p|p] H_zero. (* Goal: @eq R (Q_to_R (Qinv (Qneg p))) (Rinv (Q_to_R (Qneg p))) *) (* Goal: @eq R (Q_to_R (Qinv (Qpos p))) (Rinv (Q_to_R (Qpos p))) *) (* Goal: @eq R (Q_to_R (Qinv Zero)) (Rinv (Q_to_R Zero)) *) apply False_ind; auto. (* Goal: @eq R (Q_to_R (Qinv (Qneg p))) (Rinv (Q_to_R (Qneg p))) *) (* Goal: @eq R (Q_to_R (Qinv (Qpos p))) (Rinv (Q_to_R (Qpos p))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qinv, fst, snd. (* Goal: @eq R (Q_to_R (Qinv (Qneg p))) (Rinv (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_inv p) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_inv p) in y)))) (Rinv (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Q_to_R (Qinv (Qneg p))) (Rinv (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_inv p) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_inv p) in y)))) (Rinv (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) rewrite (inv_correct p _ _ H); rewrite H. (* Goal: @eq R (Q_to_R (Qinv (Qneg p))) (Rinv (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (S q0))) (IZR (Z.of_nat (S p0)))) (Rinv (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0))))) *) repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Q_to_R (Qinv (Qneg p))) (Rinv (Q_to_R (Qneg p))) *) (* Goal: @eq R (Rdiv (INR (S q0)) (INR (S p0))) (Rinv (Rdiv (INR (S p0)) (INR (S q0)))) *) rewrite Rpower.Rinv_Rdiv; auto. (* Goal: @eq R (Q_to_R (Qinv (Qneg p))) (Rinv (Q_to_R (Qneg p))) *) unfold Q_to_R, numerator, denominator, decode_Q, Qinv, fst, snd. (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_inv p) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_inv p) in y)))) (Rinv (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_inv p) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_inv p) in y)))) (Rinv (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y))))) *) rewrite (inv_correct p _ _ H); rewrite H. (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (S q0)))) (IZR (Z.of_nat (S p0)))) (Rinv (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: @eq R (Rdiv (Ropp (INR (S q0))) (INR (S p0))) (Rinv (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) rewrite Rpower.Rinv_Rdiv; auto. (* Goal: @eq R (Rdiv (Ropp (INR (S q0))) (INR (S p0))) (Rdiv (INR (S q0)) (Ropp (INR (S p0)))) *) unfold Rdiv; rewrite <- Rmult_opp_opp; rewrite Ropp_involutive; rewrite Ropp_inv_permute; auto. Qed. Lemma Q_to_Rminus: forall x y, Q_to_R (Qminus x y) = (Rminus (Q_to_R x) (Q_to_R y)). Proof. (* Goal: forall x y : Q, @eq R (Q_to_R (Qminus x y)) (Rminus (Q_to_R x) (Q_to_R y)) *) intros x y; unfold Qminus; rewrite Q_to_Rplus; rewrite Q_to_Ropp; trivial. Qed. Lemma Q_to_Rdiv: forall x y, ~(y=Zero) -> Q_to_R (Qdiv x y) = (Rdiv (Q_to_R x) (Q_to_R y)). Proof. (* Goal: forall (x y : Q) (_ : not (@eq Q y Zero)), @eq R (Q_to_R (Qdiv x y)) (Rdiv (Q_to_R x) (Q_to_R y)) *) intros x y Hy; unfold Qdiv; rewrite Q_to_Rmult; rewrite Q_to_Rinv; trivial. Qed. Lemma not_Qlt:forall x y, ~(Qlt y x) -> (Qle x y). Lemma Q_to_Rle: forall x y, Qle x y -> Rle (Q_to_R x) (Q_to_R y). Proof. (* Goal: forall (x y : Q) (_ : Qle x y), Rle (Q_to_R x) (Q_to_R y) *) intros [ |p|p] [ |p'|p'] H_Q_le; try solve [ apply Rle_refl | apply False_ind; apply (Qlt_irreflexive Zero); apply Qle_lt_trans with (Qneg p'); trivial | apply False_ind; apply (Qlt_irreflexive Zero); apply Qlt_le_trans with (Qpos p); trivial | apply False_ind; apply (Qlt_irreflexive (Qpos p)); apply Qle_lt_trans with (Qneg p'); trivial ]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R Zero) (Q_to_R (Qpos p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) simpl; destruct (interp_non_zero p') as [p0 [q0 H]]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; repeat rewrite <- INR_IZR_INZ. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (INR (S p0)) (INR (S q0))) *) stepl R0; try field; auto. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rle R0 (Rdiv (INR (S p0)) (INR (S q0))) *) unfold Rdiv; apply Fourier_util.Rle_mult_inv_pos; auto. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (Qpositive_le_to_Qpositive_le' _ _ (Qle_Qpositive_le_pos _ _ H_Q_le)); unfold Qpositive_le'. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall _ : let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in le (Init.Nat.mul p q') (Init.Nat.mul p' q), Rle (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall _ : let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in le (Init.Nat.mul p q') (Init.Nat.mul p' q), Rle (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall _ : let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in le (Init.Nat.mul p q') (Init.Nat.mul p' q), Rle (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; rewrite H'; intro H_Q_le_unfold. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0')))) *) repeat rewrite <- INR_IZR_INZ. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Rdiv (INR (S p0)) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0'))) *) apply Rmult_Rdiv_pos_Rle; auto. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (Rmult (INR (S p0)) (INR (S q0'))) (Rmult (INR (S p0')) (INR (S q0))) *) repeat rewrite <- mult_INR. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rle (INR (Init.Nat.mul (S p0) (S q0'))) (INR (Init.Nat.mul (S p0') (S q0))) *) apply le_INR; trivial. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R Zero) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) simpl; destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) rewrite H. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) apply Ropp_le_cancel. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle (Ropp (Rdiv (IZR Z0) (IZR (Zpos xH)))) (Ropp (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) stepl R0; try field; auto. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle R0 (Ropp (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) stepr (INR (S p0) / INR (S q0))%R; [|field; auto]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rle R0 (Rdiv (INR (S p0)) (INR (S q0))) *) unfold Rdiv; apply Fourier_util.Rle_mult_inv_pos; auto. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; rewrite H'. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0')))) *) rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0'))) *) apply Rle_trans with R0. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle R0 (Rdiv (INR (S p0')) (INR (S q0'))) *) (* Goal: Rle (Rdiv (Ropp (INR (S p0))) (INR (S q0))) R0 *) apply Ropp_le_cancel; stepl R0; try field; auto; stepr (INR (S p0) / INR (S q0))%R; [|field; auto]; unfold Rdiv; apply Fourier_util.Rle_mult_inv_pos; auto. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rle R0 (Rdiv (INR (S p0')) (INR (S q0'))) *) stepl R0; try field; auto; unfold Rdiv; apply Fourier_util.Rle_mult_inv_pos; auto. (* Goal: Rle (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (Qpositive_le_to_Qpositive_le' _ _ (Qle_Qpositive_le_neg _ _ H_Q_le)); unfold Qpositive_le'. (* Goal: forall _ : let (p0, q) := Qpositive_i p' in let (p', q') := Qpositive_i p in le (Init.Nat.mul p0 q') (Init.Nat.mul p' q), Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: forall _ : let (p0, q) := Qpositive_i p' in let (p', q') := Qpositive_i p in le (Init.Nat.mul p0 q') (Init.Nat.mul p' q), Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: forall _ : let (p0, q) := Qpositive_i p' in let (p', q') := Qpositive_i p in le (Init.Nat.mul p0 q') (Init.Nat.mul p' q), Rle (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; rewrite H'; intro H_Q_le_unfold. (* Goal: Rle (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0')))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: Rle (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (Ropp (INR (S p0'))) (INR (S q0'))) *) apply Rmult_Rdiv_pos_Rle; auto. (* Goal: Rle (Rmult (Ropp (INR (S p0))) (INR (S q0'))) (Rmult (Ropp (INR (S p0'))) (INR (S q0))) *) apply Ropp_le_cancel. (* Goal: Rle (Ropp (Rmult (Ropp (INR (S p0'))) (INR (S q0)))) (Ropp (Rmult (Ropp (INR (S p0))) (INR (S q0')))) *) stepr (INR (S p0) * INR (S q0'))%R; [|field; auto]. (* Goal: Rle (Ropp (Rmult (Ropp (INR (S p0'))) (INR (S q0)))) (Rmult (INR (S p0)) (INR (S q0'))) *) stepl (INR (S p0') * INR (S q0))%R; [|field; auto]. (* Goal: Rle (Rmult (INR (S p0')) (INR (S q0))) (Rmult (INR (S p0)) (INR (S q0'))) *) repeat rewrite <- mult_INR. (* Goal: Rle (INR (Init.Nat.mul (S p0') (S q0))) (INR (Init.Nat.mul (S p0) (S q0'))) *) apply le_INR; trivial. Qed. Lemma Q_to_Rlt: forall x y, Qlt x y -> Rlt (Q_to_R x) (Q_to_R y). Proof. (* Goal: forall (x y : Q) (_ : Qlt x y), Rlt (Q_to_R x) (Q_to_R y) *) intros [ |p|p] [ |p'|p'] H_Q_lt; try solve [ apply False_ind; apply (Qlt_irreflexive Zero); trivial | apply False_ind; apply (Qlt_irreflexive Zero); apply Qlt_transitive with (Qneg p'); trivial | apply False_ind; apply (Qlt_irreflexive Zero); apply Qlt_transitive with (Qpos p); trivial | apply False_ind; apply (Qlt_irreflexive (Qpos p)); apply Qlt_transitive with (Qneg p'); trivial ]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R Zero) (Q_to_R (Qpos p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) simpl; destruct (interp_non_zero p') as [p0 [q0 H]]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; repeat rewrite <- INR_IZR_INZ. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (INR (S p0)) (INR (S q0))) *) stepl R0; try field; auto. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt R0 (Rdiv (INR (S p0)) (INR (S q0))) *) unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Q_to_R (Qpos p)) (Q_to_R (Qpos p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) inversion_clear H_Q_lt as [x y H_not_le| | | | ]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (sym_not_eq (not_Qpositive_le_not_eq _ _ H_not_le)). (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall _ : not (@eq Qpositive p p'), Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (not_Qpositive_le_Qpositive_le' _ _ H_not_le). (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall (_ : Qpositive_le p p') (_ : not (@eq Qpositive p p')), Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) intros H_Q_le H_neq. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (Qpositive_le_noneq_explicit _ _ H_Q_le H_neq). (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall _ : let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in lt (Init.Nat.mul p q') (Init.Nat.mul p' q), Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall _ : let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in lt (Init.Nat.mul p q') (Init.Nat.mul p' q), Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: forall _ : let (p, q) := Qpositive_i p in let (p', q') := Qpositive_i p' in lt (Init.Nat.mul p q') (Init.Nat.mul p' q), Rlt (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; rewrite H'; intro H_Q_lt_unfold. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0')))) *) repeat rewrite <- INR_IZR_INZ. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Rdiv (INR (S p0)) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0'))) *) apply Rmult_Rdiv_pos_Rlt; auto. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (Rmult (INR (S p0)) (INR (S q0'))) (Rmult (INR (S p0')) (INR (S q0))) *) repeat rewrite <- mult_INR. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) (* Goal: Rlt (INR (Init.Nat.mul (S p0) (S q0'))) (INR (Init.Nat.mul (S p0') (S q0))) *) apply lt_INR; trivial. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R Zero) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) simpl; destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) rewrite H; rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) apply Ropp_lt_cancel. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt (Ropp (Rdiv (IZR Z0) (IZR (Zpos xH)))) (Ropp (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) stepl R0; try field; auto. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt R0 (Ropp (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) stepr (INR (S p0) / INR (S q0))%R; [|field; auto]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) (* Goal: Rlt R0 (Rdiv (INR (S p0)) (INR (S q0))) *) unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qpos p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; rewrite H'. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0')))) *) rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0'))) *) apply Rlt_trans with R0. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt R0 (Rdiv (INR (S p0')) (INR (S q0'))) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) R0 *) apply Ropp_lt_cancel; stepl R0; try field; auto; stepr (INR (S p0) / INR (S q0))%R; [|field; auto]; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) (* Goal: Rlt R0 (Rdiv (INR (S p0')) (INR (S q0'))) *) stepl R0; try field; auto; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: Rlt (Q_to_R (Qneg p)) (Q_to_R (Qneg p')) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) inversion_clear H_Q_lt as [ |x y H_not_le| | | ]. (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (sym_not_eq (not_Qpositive_le_not_eq _ _ H_not_le)). (* Goal: forall _ : not (@eq Qpositive p' p), Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (not_Qpositive_le_Qpositive_le' _ _ H_not_le). (* Goal: forall (_ : Qpositive_le p' p) (_ : not (@eq Qpositive p' p)), Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) intros H_Q_le H_neq. (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) generalize (Qpositive_le_noneq_explicit _ _ H_Q_le H_neq). (* Goal: forall _ : let (p0, q) := Qpositive_i p' in let (p', q') := Qpositive_i p in lt (Init.Nat.mul p0 q') (Init.Nat.mul p' q), Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: forall _ : let (p0, q) := Qpositive_i p' in let (p', q') := Qpositive_i p in lt (Init.Nat.mul p0 q') (Init.Nat.mul p' q), Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: forall _ : let (p0, q) := Qpositive_i p' in let (p', q') := Qpositive_i p in lt (Init.Nat.mul p0 q') (Init.Nat.mul p' q), Rlt (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y)))) *) rewrite H; rewrite H'; intro H_Q_lt_unfold. (* Goal: Rlt (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0')))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (Ropp (INR (S p0'))) (INR (S q0'))) *) apply Rmult_Rdiv_pos_Rlt; auto. (* Goal: Rlt (Rmult (Ropp (INR (S p0))) (INR (S q0'))) (Rmult (Ropp (INR (S p0'))) (INR (S q0))) *) apply Ropp_lt_cancel. (* Goal: Rlt (Ropp (Rmult (Ropp (INR (S p0'))) (INR (S q0)))) (Ropp (Rmult (Ropp (INR (S p0))) (INR (S q0')))) *) stepr (INR (S p0) * INR (S q0'))%R; [|field; auto]. (* Goal: Rlt (Ropp (Rmult (Ropp (INR (S p0'))) (INR (S q0)))) (Rmult (INR (S p0)) (INR (S q0'))) *) stepl (INR (S p0') * INR (S q0))%R; [|field; auto]. (* Goal: Rlt (Rmult (INR (S p0')) (INR (S q0))) (Rmult (INR (S p0)) (INR (S q0'))) *) repeat rewrite <- mult_INR. (* Goal: Rlt (INR (Init.Nat.mul (S p0') (S q0))) (INR (Init.Nat.mul (S p0) (S q0'))) *) apply lt_INR; trivial. Qed. Lemma Q_to_R_not_eq: forall x y, ~(x=y)->~(Q_to_R x = Q_to_R y). Proof. (* Goal: forall (x y : Q) (_ : not (@eq Q x y)), not (@eq R (Q_to_R x) (Q_to_R y)) *) intros [ |p|p] [ |p'|p'] H_not_eq. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R Zero)) *) apply False_ind; apply H_not_eq; trivial. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qpos p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0 [q0 H]]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0))))) *) repeat rewrite <- INR_IZR_INZ. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (INR (S p0)) (INR (S q0)))) *) apply Rlt_not_eq; stepl R0; [|simpl; field]; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R Zero) (Q_to_R (Qneg p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0 [q0 H]]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) apply Rlt_not_eq'. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) apply Ropp_lt_cancel. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: Rlt (Ropp (Rdiv (IZR Z0) (IZR (Zpos xH)))) (Ropp (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) stepl R0; [|simpl; field]; stepr (INR (S p0) / INR (S q0))%R; [|field; auto]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) (* Goal: Rlt R0 (Rdiv (INR (S p0)) (INR (S q0))) *) unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R Zero)) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) rewrite H. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) repeat rewrite <- INR_IZR_INZ. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (INR (S p0)) (INR (S q0))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) apply Rlt_not_eq'. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) (* Goal: Rlt (Rdiv (IZR Z0) (IZR (Zpos xH))) (Rdiv (INR (S p0)) (INR (S q0))) *) stepl R0; [|simpl; field]; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qpos p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (not_Qeq_inf _ _ H_not_eq) as [H_Q_lt|H_Q_lt]; inversion_clear H_Q_lt as [x y H_not_le| | | | ]; generalize (sym_not_eq (not_Qpositive_le_not_eq _ _ H_not_le)); generalize (not_Qpositive_le_Qpositive_le' _ _ H_not_le); intros H_Q_le H_neq; generalize (Qpositive_le_noneq_explicit _ _ H_Q_le H_neq); destruct (interp_non_zero p) as [p0 [q0 H]]; destruct (interp_non_zero p') as [p0' [q0' H']]; rewrite H; rewrite H'; intro H_Q_lt_unfold; [ apply Rlt_not_eq | apply Rlt_not_eq']; repeat rewrite <- INR_IZR_INZ; apply Rmult_Rdiv_pos_Rlt; auto; repeat rewrite <- mult_INR; apply lt_INR; trivial. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Q_to_R (Qpos p)) (Q_to_R (Qneg p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H; rewrite H'. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (IZR (Z.of_nat (S p0))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.opp (Z.of_nat (S p0')))) (IZR (Z.of_nat (S q0'))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: not (@eq R (Rdiv (INR (S p0)) (INR (S q0))) (Rdiv (Ropp (INR (S p0'))) (INR (S q0')))) *) apply Rlt_not_eq'. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0'))) (INR (S q0'))) (Rdiv (INR (S p0)) (INR (S q0))) *) apply Rlt_trans with R0. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: Rlt R0 (Rdiv (INR (S p0)) (INR (S q0))) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0'))) (INR (S q0'))) R0 *) apply Ropp_lt_cancel; stepl R0; try field; auto; stepr (INR (S p0') / INR (S q0'))%R; [|field; auto]; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) (* Goal: Rlt R0 (Rdiv (INR (S p0)) (INR (S q0))) *) stepl R0; try field; auto; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R Zero)) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) rewrite H. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: not (@eq R (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (IZR Z0) (IZR (Zpos xH)))) *) apply Rlt_not_eq. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (IZR Z0) (IZR (Zpos xH))) *) apply Ropp_lt_cancel. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: Rlt (Ropp (Rdiv (IZR Z0) (IZR (Zpos xH)))) (Ropp (Rdiv (Ropp (INR (S p0))) (INR (S q0)))) *) stepl R0; [|simpl; field]; stepr (INR (S p0) / INR (S q0))%R; [|field; auto]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) (* Goal: Rlt R0 (Rdiv (INR (S p0)) (INR (S q0))) *) unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qpos p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p) as [p0 [q0 H]]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (interp_non_zero p') as [p0' [q0' H']]. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i p' in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) rewrite H; rewrite H'. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (S p0)))) (IZR (Z.of_nat (S q0)))) (Rdiv (IZR (Z.of_nat (S p0'))) (IZR (Z.of_nat (S q0'))))) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: not (@eq R (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0')))) *) apply Rlt_not_eq. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) (Rdiv (INR (S p0')) (INR (S q0'))) *) apply Rlt_trans with R0. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: Rlt R0 (Rdiv (INR (S p0')) (INR (S q0'))) *) (* Goal: Rlt (Rdiv (Ropp (INR (S p0))) (INR (S q0))) R0 *) apply Ropp_lt_cancel; stepl R0; try field; auto; stepr (INR (S p0) / INR (S q0))%R; [|field; auto]; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) (* Goal: Rlt R0 (Rdiv (INR (S p0')) (INR (S q0'))) *) stepl R0; try field; auto; unfold Rdiv; apply Fourier_util.Rlt_mult_inv_pos; auto. (* Goal: not (@eq R (Q_to_R (Qneg p)) (Q_to_R (Qneg p'))) *) unfold Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: not (@eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p in y)))) (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i p' in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i p' in y))))) *) destruct (not_Qeq_inf _ _ H_not_eq) as [H_Q_lt|H_Q_lt]; inversion_clear H_Q_lt as [ |x y H_not_le| | | ]; generalize (sym_not_eq (not_Qpositive_le_not_eq _ _ H_not_le)); generalize (not_Qpositive_le_Qpositive_le' _ _ H_not_le); intros H_Q_le H_neq; generalize (Qpositive_le_noneq_explicit _ _ H_Q_le H_neq); destruct (interp_non_zero p) as [p0 [q0 H]]; destruct (interp_non_zero p') as [p0' [q0' H']]; rewrite H; rewrite H'; intro H_Q_lt_unfold; [ apply Rlt_not_eq | apply Rlt_not_eq']; repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ; apply Rmult_Rdiv_pos_Rlt; auto; apply Ropp_lt_cancel. (* Goal: Rlt (Ropp (Rmult (Ropp (INR (S p0))) (INR (S q0')))) (Ropp (Rmult (Ropp (INR (S p0'))) (INR (S q0)))) *) (* Goal: Rlt (Ropp (Rmult (Ropp (INR (S p0'))) (INR (S q0)))) (Ropp (Rmult (Ropp (INR (S p0))) (INR (S q0')))) *) stepr (INR (S p0) * INR (S q0'))%R; [|field; auto]; stepl (INR (S p0') * INR (S q0))%R; [|field; auto]; repeat rewrite <- mult_INR; apply lt_INR; trivial... stepr (INR (S p0') * INR (S q0))%R; [|field; auto]; stepl (INR (S p0) * INR (S q0'))%R; [|field; auto]; repeat rewrite <- mult_INR; apply lt_INR; trivial... Qed. Qed. Lemma Q_to_R_Qle:forall x y : Q, Rle (Q_to_R x) (Q_to_R y) -> Qle x y. Lemma Q_to_R_Qlt:forall x y : Q, Rlt (Q_to_R x) (Q_to_R y) -> Qlt x y. Lemma Q_to_R_Qneq:forall x y : Q, (Q_to_R x)<>(Q_to_R y) -> x<>y. Lemma Q_to_R_Qeq:forall x y : Q, (Q_to_R x)=(Q_to_R y) -> x=y. Lemma Z_to_Q_to_R_IZR: forall z, Q_to_R (Z_to_Q z) = IZR z. Proof. (* Goal: forall z : Z, @eq R (Q_to_R (Z_to_Q z)) (IZR z) *) intros [|p|p]. (* Goal: @eq R (Q_to_R (Z_to_Q (Zneg p))) (IZR (Zneg p)) *) (* Goal: @eq R (Q_to_R (Z_to_Q (Zpos p))) (IZR (Zpos p)) *) (* Goal: @eq R (Q_to_R (Z_to_Q Z0)) (IZR Z0) *) simpl; rewrite <- Q_to_R_Zero; trivial. (* Goal: @eq R (Q_to_R (Z_to_Q (Zneg p))) (IZR (Zneg p)) *) (* Goal: @eq R (Q_to_R (Z_to_Q (Zpos p))) (IZR (Zpos p)) *) unfold Z_to_Q, Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: @eq R (Q_to_R (Z_to_Q (Zneg p))) (IZR (Zneg p)) *) (* Goal: @eq R (Rdiv (IZR (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (Pos.to_nat p) (S O) (S (Pos.to_nat p))) in x))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (Pos.to_nat p) (S O) (S (Pos.to_nat p))) in y)))) (IZR (Zpos p)) *) rewrite (Qpositive_i_c (nat_of_P p) (S (nat_of_P p)) (lt_O_nat_of_P _)); trivial; repeat rewrite <- INR_IZR_INZ; unfold IZR, INR at 2; rewrite <- INR_IPR; field; auto. (* Goal: @eq R (Q_to_R (Z_to_Q (Zneg p))) (IZR (Zneg p)) *) unfold Z_to_Q, Q_to_R, numerator, denominator, decode_Q, fst, snd. (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (let (x, _) := Qpositive_i (Qpositive_c (Pos.to_nat p) (S O) (S (Pos.to_nat p))) in x)))) (IZR (Z.of_nat (let (_, y) := Qpositive_i (Qpositive_c (Pos.to_nat p) (S O) (S (Pos.to_nat p))) in y)))) (IZR (Zneg p)) *) rewrite (Qpositive_i_c (nat_of_P p) (S (nat_of_P p)) (lt_O_nat_of_P _)); trivial. (* Goal: @eq R (Rdiv (IZR (Z.opp (Z.of_nat (Pos.to_nat p)))) (IZR (Z.of_nat (S O)))) (IZR (Zneg p)) *) repeat rewrite Ropp_Ropp_IZR; repeat rewrite <- INR_IZR_INZ; unfold IZR, INR at 2; rewrite <- INR_IPR; field; auto. Qed. Ltac realify_Q_assumptions := repeat match goal with | [ id : (Qlt ?X1 ?X2) |- _ ] => generalize (Q_to_Rlt _ _ id); clear id; try unfold fst, snd | [ id : (Qle ?Xe ?X2) |- _ ] => generalize (Q_to_Rle _ _ id); clear id; try unfold fst, snd | [ id : (@eq Q ?Xe ?X2) |- _ ] => generalize (Q_to_Req _ _ id); clear id; try unfold fst, snd | [ id : ~(@eq Q ?Xe ?X2) |- _ ] => generalize (Q_to_R_not_eq _ _ id); clear id; try unfold fst, snd end. Ltac realify_Q_goal := match goal with | [ |- context [(Q_to_R (Qplus ?X1 ?X2))] ] => rewrite Q_to_Rplus; realify_Q_goal | [ |- context [(Q_to_R (Qminus ?X1 ?X2))] ] => rewrite Q_to_Rminus; realify_Q_goal | [ |- context [(Q_to_R (Qmult ?X1 ?X2))] ] => rewrite Q_to_Rmult; realify_Q_goal | [ |- context [(Q_to_R (Qdiv ?X1 ?X2))] ] => rewrite Q_to_Rdiv; realify_Q_goal | [ |- context [(Q_to_R (Qopp ?X1))] ] => rewrite Q_to_Ropp; realify_Q_goal | [ |- context [(Q_to_R (Qinv ?X1))] ] => rewrite Q_to_Rinv; realify_Q_goal | [ |- context [(Q_to_R Zero)] ] => rewrite Q_to_R_Zero; realify_Q_goal | [ |- context [(Q_to_R Qone)] ] => rewrite Q_to_R_Qone; realify_Q_goal | [ |- context [(Q_to_R (Qneg One))] ] => rewrite Q_to_R_Qneg_One; realify_Q_goal | [ |- context [(Q_to_R (Z_to_Q ?X1))] ] => rewrite Z_to_Q_to_R_IZR; realify_Q_goal | [ |- _ ] => idtac end. Ltac realify_Q := try realify_Q_assumptions; realify_Q_goal. Ltac rationalify_R_goal := match goal with | [ |- context [(Rplus (Q_to_R ?X1) (Q_to_R ?X2))] ] => rewrite <- Q_to_Rplus; rationalify_R_goal | [ |- context [(Rminus (Q_to_R ?X1) (Q_to_R ?X2))] ] => rewrite <- Q_to_Rminus; rationalify_R_goal | [ |- context [(Rmult (Q_to_R ?X1) (Q_to_R ?X2))] ] => rewrite <- Q_to_Rmult; rationalify_R_goal | [ |- context [(Rdiv (Q_to_R ?X1) (Q_to_R ?X2))] ] => rewrite <- Q_to_Rdiv; auto; rationalify_R_goal | [ |- context [(Ropp (Q_to_R ?X1)) ]] => rewrite <- Q_to_Ropp; rationalify_R_goal | [ |- context [(Rinv (Q_to_R ?X1))] ] => rewrite <- Q_to_Rinv; auto; rationalify_R_goal | [ |- context [R0] ] => rewrite <- Q_to_R_Zero; rationalify_R_goal | [ |- context [R1] ] => rewrite <- Q_to_R_Qone; rationalify_R_goal | [ |- context [(IZR ?X1)] ] => rewrite <- Z_to_Q_to_R_IZR; realify_Q_goal | [ |- _ ] => idtac end. Ltac rationalify_R := rationalify_R_goal; match goal with | [ |- Rlt (Q_to_R ?X1) (Q_to_R ?X2)] => apply Q_to_Rlt | [ |- Rle (Q_to_R ?X1) (Q_to_R ?X2)] => apply Q_to_Rle | [ |- @eq Q (Q_to_R ?X1) (Q_to_R ?X2)] => apply (f_equal Q_to_R) | [ |- ~(@eq Q (Q_to_R ?X1) (Q_to_R ?X2))] => apply Q_to_R_not_eq | [ |- ~(@eq Q ?X1 Zero)] => idtac | [ |- _ ] => fail 1 end.
Require Import mathcomp.ssreflect.ssreflect. From mathcomp Require Import ssrfun ssrbool. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Module Equality. Definition axiom T (e : rel T) := forall x y, reflect (x = y) (e x y). Structure mixin_of T := Mixin {op : rel T; _ : axiom op}. Notation class_of := mixin_of (only parsing). Section ClassDef. Structure type := Pack {sort; _ : class_of sort}. Local Coercion sort : type >-> Sortclass. Variables (T : Type) (cT : type). Definition class := let: Pack _ c := cT return class_of cT in c. Definition clone := fun c & cT -> T & phant_id (@Pack T c) cT => Pack c. End ClassDef. Module Exports. Coercion sort : type >-> Sortclass. Notation eqType := type. Notation EqMixin := Mixin. Notation EqType T m := (@Pack T m). Notation "[ 'eqMixin' 'of' T ]" := (class _ : mixin_of T) (at level 0, format "[ 'eqMixin' 'of' T ]") : form_scope. Notation "[ 'eqType' 'of' T 'for' C ]" := (@clone T C _ idfun id) (at level 0, format "[ 'eqType' 'of' T 'for' C ]") : form_scope. Notation "[ 'eqType' 'of' T ]" := (@clone T _ _ id id) (at level 0, format "[ 'eqType' 'of' T ]") : form_scope. End Exports. End Equality. Export Equality.Exports. Definition eq_op T := Equality.op (Equality.class T). Lemma eqE T x : eq_op x = Equality.op (Equality.class T) x. Proof. (* Goal: @eq (pred (Equality.sort T)) (@eq_op T x) (@Equality.op (Equality.sort T) (Equality.class T) x) *) by []. Qed. Lemma eqP T : Equality.axiom (@eq_op T). Proof. (* Goal: @Equality.axiom (Equality.sort T) (@eq_op T) *) by case: T => ? []. Qed. Notation eqxx := eq_refl. Lemma eq_sym (T : eqType) (x y : T) : (x == y) = (y == x). Proof. (* Goal: @eq bool (@eq_op T x y) (@eq_op T y x) *) exact/eqP/eqP. Qed. Hint Resolve eq_refl eq_sym : core. Section Contrapositives. Variables (T1 T2 : eqType). Implicit Types (A : pred T1) (b : bool) (x : T1) (z : T2). Lemma contraTeq b x y : (x != y -> ~~ b) -> b -> x = y. Proof. (* Goal: forall (_ : forall _ : is_true (negb (@eq_op T1 x y)), is_true (negb b)) (_ : is_true b), @eq (Equality.sort T1) x y *) by move=> imp hyp; apply/eqP; apply: contraTT hyp. Qed. Lemma contraNeq b x y : (x != y -> b) -> ~~ b -> x = y. Proof. (* Goal: forall (_ : forall _ : is_true (negb (@eq_op T1 x y)), is_true b) (_ : is_true (negb b)), @eq (Equality.sort T1) x y *) by move=> imp hyp; apply/eqP; apply: contraNT hyp. Qed. Lemma contraFeq b x y : (x != y -> b) -> b = false -> x = y. Proof. (* Goal: forall (_ : forall _ : is_true (negb (@eq_op T1 x y)), is_true b) (_ : @eq bool b false), @eq (Equality.sort T1) x y *) by move=> imp /negbT; apply: contraNeq. Qed. Lemma contraTneq b x y : (x = y -> ~~ b) -> b -> x != y. Proof. (* Goal: forall (_ : forall _ : @eq (Equality.sort T1) x y, is_true (negb b)) (_ : is_true b), is_true (negb (@eq_op T1 x y)) *) by move=> imp; apply: contraTN => /eqP. Qed. Lemma contraNneq b x y : (x = y -> b) -> ~~ b -> x != y. Proof. (* Goal: forall (_ : forall _ : @eq (Equality.sort T1) x y, is_true b) (_ : is_true (negb b)), is_true (negb (@eq_op T1 x y)) *) by move=> imp; apply: contraNN => /eqP. Qed. Lemma contraFneq b x y : (x = y -> b) -> b = false -> x != y. Proof. (* Goal: forall (_ : forall _ : @eq (Equality.sort T1) x y, is_true b) (_ : @eq bool b false), is_true (negb (@eq_op T1 x y)) *) by move=> imp /negbT; apply: contraNneq. Qed. Lemma contra_eqN b x y : (b -> x != y) -> x = y -> ~~ b. Proof. (* Goal: forall (_ : forall _ : is_true b, is_true (negb (@eq_op T1 x y))) (_ : @eq (Equality.sort T1) x y), is_true (negb b) *) by move=> imp /eqP; apply: contraL. Qed. Lemma contra_eqF b x y : (b -> x != y) -> x = y -> b = false. Proof. (* Goal: forall (_ : forall _ : is_true b, is_true (negb (@eq_op T1 x y))) (_ : @eq (Equality.sort T1) x y), @eq bool b false *) by move=> imp /eqP; apply: contraTF. Qed. Lemma contra_eqT b x y : (~~ b -> x != y) -> x = y -> b. Proof. (* Goal: forall (_ : forall _ : is_true (negb b), is_true (negb (@eq_op T1 x y))) (_ : @eq (Equality.sort T1) x y), is_true b *) by move=> imp /eqP; apply: contraLR. Qed. Lemma contra_neqN b x y : (b -> x = y) -> x != y -> ~~ b. Proof. (* Goal: forall (_ : forall _ : is_true b, @eq (Equality.sort T1) x y) (_ : is_true (negb (@eq_op T1 x y))), is_true (negb b) *) by move=> imp; apply: contraNN => /imp->. Qed. Lemma contra_neqF b x y : (b -> x = y) -> x != y -> b = false. Proof. (* Goal: forall (_ : forall _ : is_true b, @eq (Equality.sort T1) x y) (_ : is_true (negb (@eq_op T1 x y))), @eq bool b false *) by move=> imp; apply: contraNF => /imp->. Qed. Lemma contra_neqT b x y : (~~ b -> x = y) -> x != y -> b. Proof. (* Goal: forall (_ : forall _ : is_true (negb b), @eq (Equality.sort T1) x y) (_ : is_true (negb (@eq_op T1 x y))), is_true b *) by move=> imp; apply: contraNT => /imp->. Qed. Lemma contra_eq z1 z2 x1 x2 : (x1 != x2 -> z1 != z2) -> z1 = z2 -> x1 = x2. Proof. (* Goal: forall (_ : forall _ : is_true (negb (@eq_op T1 x1 x2)), is_true (negb (@eq_op T2 z1 z2))) (_ : @eq (Equality.sort T2) z1 z2), @eq (Equality.sort T1) x1 x2 *) by move=> imp /eqP; apply: contraTeq. Qed. Lemma contra_neq z1 z2 x1 x2 : (x1 = x2 -> z1 = z2) -> z1 != z2 -> x1 != x2. Proof. (* Goal: forall (_ : forall _ : @eq (Equality.sort T1) x1 x2, @eq (Equality.sort T2) z1 z2) (_ : is_true (negb (@eq_op T2 z1 z2))), is_true (negb (@eq_op T1 x1 x2)) *) by move=> imp; apply: contraNneq => /imp->. Qed. Lemma contra_neq_eq z1 z2 x1 x2 : (x1 != x2 -> z1 = z2) -> z1 != z2 -> x1 = x2. Proof. (* Goal: forall (_ : forall _ : is_true (negb (@eq_op T1 x1 x2)), @eq (Equality.sort T2) z1 z2) (_ : is_true (negb (@eq_op T2 z1 z2))), @eq (Equality.sort T1) x1 x2 *) by move=> imp; apply: contraNeq => /imp->. Qed. Lemma contra_eq_neq z1 z2 x1 x2 : (z1 = z2 -> x1 != x2) -> x1 = x2 -> z1 != z2. Proof. (* Goal: forall (_ : forall _ : @eq (Equality.sort T2) z1 z2, is_true (negb (@eq_op T1 x1 x2))) (_ : @eq (Equality.sort T1) x1 x2), is_true (negb (@eq_op T2 z1 z2)) *) by move=> imp; apply: contra_eqN => /eqP /imp. Qed. Lemma memPn A x : reflect {in A, forall y, y != x} (x \notin A). Proof. (* Goal: Bool.reflect (@prop_in1 (Equality.sort T1) (@mem (Equality.sort T1) (predPredType (Equality.sort T1)) A) (fun y : Equality.sort T1 => is_true (negb (@eq_op T1 y x))) (inPhantom (forall y : Equality.sort T1, is_true (negb (@eq_op T1 y x))))) (negb (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (predPredType (Equality.sort T1)) A))) *) apply: (iffP idP) => [notDx y | notDx]; first by apply: contraTneq => ->. (* Goal: is_true (negb (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (predPredType (Equality.sort T1)) A))) *) exact: contraL (notDx x) _. Qed. Lemma memPnC A x : reflect {in A, forall y, x != y} (x \notin A). Proof. (* Goal: Bool.reflect (@prop_in1 (Equality.sort T1) (@mem (Equality.sort T1) (predPredType (Equality.sort T1)) A) (fun y : Equality.sort T1 => is_true (negb (@eq_op T1 x y))) (inPhantom (forall y : Equality.sort T1, is_true (negb (@eq_op T1 x y))))) (negb (@in_mem (Equality.sort T1) x (@mem (Equality.sort T1) (predPredType (Equality.sort T1)) A))) *) by apply: (iffP (memPn A x)) => A'x y /A'x; rewrite eq_sym. Qed. Lemma ifN_eq R x y vT vF : x != y -> (if x == y then vT else vF) = vF :> R. Proof. (* Goal: forall _ : is_true (negb (@eq_op T1 x y)), @eq R (if @eq_op T1 x y then vT else vF) vF *) exact: ifN. Qed. Lemma ifN_eqC R x y vT vF : x != y -> (if y == x then vT else vF) = vF :> R. Proof. (* Goal: forall _ : is_true (negb (@eq_op T1 x y)), @eq R (if @eq_op T1 y x then vT else vF) vF *) by rewrite eq_sym; apply: ifN. Qed. End Contrapositives. Arguments memPn {T1 A x}. Arguments memPnC {T1 A x}. Theorem eq_irrelevance (T : eqType) x y : forall e1 e2 : x = y :> T, e1 = e2. Corollary eq_axiomK (T : eqType) (x : T) : all_equal_to (erefl x). Proof. (* Goal: @all_equal_to (@eq (Equality.sort T) x x) (@Logic.eq_refl (Equality.sort T) x) *) by move=> eq_x_x; apply: eq_irrelevance. Qed. Module Type EqTypePredSig. Parameter sort : eqType -> predArgType. End EqTypePredSig. Module MakeEqTypePred (eqmod : EqTypePredSig). Coercion eqmod.sort : eqType >-> predArgType. End MakeEqTypePred. Module Export EqTypePred := MakeEqTypePred Equality. Lemma unit_eqP : Equality.axiom (fun _ _ : unit => true). Proof. (* Goal: @Equality.axiom unit (fun _ _ : unit => true) *) by do 2!case; left. Qed. Definition unit_eqMixin := EqMixin unit_eqP. Canonical unit_eqType := Eval hnf in EqType unit unit_eqMixin. Definition eqb b := addb (~~ b). Lemma eqbP : Equality.axiom eqb. Proof. (* Goal: @Equality.axiom bool eqb *) by do 2!case; constructor. Qed. Lemma bool_irrelevance (b : bool) (p1 p2 : b) : p1 = p2. Proof. (* Goal: @eq (is_true b) p1 p2 *) exact: eq_irrelevance. Qed. Lemma negb_add b1 b2 : ~~ (b1 (+) b2) = (b1 == b2). Proof. (* Goal: @eq bool (negb (addb b1 b2)) (@eq_op bool_eqType b1 b2) *) by rewrite -addNb. Qed. Lemma negb_eqb b1 b2 : (b1 != b2) = b1 (+) b2. Proof. (* Goal: @eq bool (negb (@eq_op bool_eqType b1 b2)) (addb b1 b2) *) by rewrite -addNb negbK. Qed. Lemma eqb_id b : (b == true) = b. Proof. (* Goal: @eq bool (@eq_op bool_eqType b true) b *) by case: b. Qed. Lemma eqbF_neg b : (b == false) = ~~ b. Proof. (* Goal: @eq bool (@eq_op bool_eqType b false) (negb b) *) by case: b. Qed. Lemma eqb_negLR b1 b2 : (~~ b1 == b2) = (b1 == ~~ b2). Proof. (* Goal: @eq bool (@eq_op bool_eqType (negb b1) b2) (@eq_op bool_eqType b1 (negb b2)) *) by case: b1; case: b2. Qed. Notation xpred1 := (fun a1 x => x == a1). Notation xpred2 := (fun a1 a2 x => (x == a1) || (x == a2)). Notation xpred3 := (fun a1 a2 a3 x => [|| x == a1, x == a2 | x == a3]). Notation xpred4 := (fun a1 a2 a3 a4 x => [|| x == a1, x == a2, x == a3 | x == a4]). Notation xpredU1 := (fun a1 (p : pred _) x => (x == a1) || p x). Notation xpredC1 := (fun a1 x => x != a1). Notation xpredD1 := (fun (p : pred _) a1 x => (x != a1) && p x). Section EqPred. Variable T : eqType. Definition pred1 (a1 : T) := SimplPred (xpred1 a1). Definition pred2 (a1 a2 : T) := SimplPred (xpred2 a1 a2). Definition pred3 (a1 a2 a3 : T) := SimplPred (xpred3 a1 a2 a3). Definition pred4 (a1 a2 a3 a4 : T) := SimplPred (xpred4 a1 a2 a3 a4). Definition predU1 (a1 : T) p := SimplPred (xpredU1 a1 p). Definition predC1 (a1 : T) := SimplPred (xpredC1 a1). Definition predD1 p (a1 : T) := SimplPred (xpredD1 p a1). Variables (T2 : eqType) (x y : T) (z u : T2) (b : bool). Lemma predU1P : reflect (x = y \/ b) ((x == y) || b). Proof. (* Goal: Bool.reflect (or (@eq (Equality.sort T) x y) (is_true b)) (orb (@eq_op T x y) b) *) by apply: (iffP orP); do [case=> [/eqP|]; [left | right]]. Qed. Lemma pred2P : reflect (x = y \/ z = u) ((x == y) || (z == u)). Proof. (* Goal: Bool.reflect (or (@eq (Equality.sort T) x y) (@eq (Equality.sort T2) z u)) (orb (@eq_op T x y) (@eq_op T2 z u)) *) by apply: (iffP orP); do [case=> /eqP; [left | right]]. Qed. Lemma predD1P : reflect (x <> y /\ b) ((x != y) && b). Proof. (* Goal: Bool.reflect (and (not (@eq (Equality.sort T) x y)) (is_true b)) (andb (negb (@eq_op T x y)) b) *) by apply: (iffP andP)=> [] [] // /eqP. Qed. Lemma predU1l : x = y -> (x == y) || b. Proof. (* Goal: forall _ : @eq (Equality.sort T) x y, is_true (orb (@eq_op T x y) b) *) by move->; rewrite eqxx. Qed. Lemma predU1r : b -> (x == y) || b. Proof. (* Goal: forall _ : is_true b, is_true (orb (@eq_op T x y) b) *) by move->; rewrite orbT. Qed. Lemma eqVneq : {x = y} + {x != y}. Proof. (* Goal: sumbool (@eq (Equality.sort T) x y) (is_true (negb (@eq_op T x y))) *) by case: eqP; [left | right]. Qed. End EqPred. Arguments predU1P {T x y b}. Arguments pred2P {T T2 x y z u}. Arguments predD1P {T x y b}. Prenex Implicits pred1 pred2 pred3 pred4 predU1 predC1 predD1. Notation "[ 'predU1' x & A ]" := (predU1 x [mem A]) (at level 0, format "[ 'predU1' x & A ]") : fun_scope. Notation "[ 'predD1' A & x ]" := (predD1 [mem A] x) (at level 0, format "[ 'predD1' A & x ]") : fun_scope. Section EqFun. Section Exo. Variables (aT rT : eqType) (D : pred aT) (f : aT -> rT) (g : rT -> aT). Lemma inj_eq : injective f -> forall x y, (f x == f y) = (x == y). Proof. (* Goal: forall (_ : @injective (Equality.sort rT) (Equality.sort aT) f) (x y : Equality.sort aT), @eq bool (@eq_op rT (f x) (f y)) (@eq_op aT x y) *) by move=> inj_f x y; apply/eqP/eqP=> [|-> //]; apply: inj_f. Qed. Lemma can_eq : cancel f g -> forall x y, (f x == f y) = (x == y). Proof. (* Goal: forall (_ : @cancel (Equality.sort rT) (Equality.sort aT) f g) (x y : Equality.sort aT), @eq bool (@eq_op rT (f x) (f y)) (@eq_op aT x y) *) by move/can_inj; apply: inj_eq. Qed. Lemma bij_eq : bijective f -> forall x y, (f x == f y) = (x == y). Proof. (* Goal: forall (_ : @bijective (Equality.sort rT) (Equality.sort aT) f) (x y : Equality.sort aT), @eq bool (@eq_op rT (f x) (f y)) (@eq_op aT x y) *) by move/bij_inj; apply: inj_eq. Qed. Lemma can2_eq : cancel f g -> cancel g f -> forall x y, (f x == y) = (x == g y). Proof. (* Goal: forall (_ : @cancel (Equality.sort rT) (Equality.sort aT) f g) (_ : @cancel (Equality.sort aT) (Equality.sort rT) g f) (x : Equality.sort aT) (y : Equality.sort rT), @eq bool (@eq_op rT (f x) y) (@eq_op aT x (g y)) *) by move=> fK gK x y; rewrite -{1}[y]gK; apply: can_eq. Qed. Lemma inj_in_eq : {in D &, injective f} -> {in D &, forall x y, (f x == f y) = (x == y)}. Proof. (* Goal: forall _ : @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x1 x2 : Equality.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Equality.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Equality.sort aT) f)), @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x y : Equality.sort aT => @eq bool (@eq_op rT (f x) (f y)) (@eq_op aT x y)) (inPhantom (forall x y : Equality.sort aT, @eq bool (@eq_op rT (f x) (f y)) (@eq_op aT x y))) *) by move=> inj_f x y Dx Dy; apply/eqP/eqP=> [|-> //]; apply: inj_f. Qed. Lemma can_in_eq : {in D, cancel f g} -> {in D &, forall x y, (f x == f y) = (x == y)}. Proof. (* Goal: forall _ : @prop_in1 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x : Equality.sort aT => @eq (Equality.sort aT) (g (f x)) x) (inPhantom (@cancel (Equality.sort rT) (Equality.sort aT) f g)), @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x y : Equality.sort aT => @eq bool (@eq_op rT (f x) (f y)) (@eq_op aT x y)) (inPhantom (forall x y : Equality.sort aT, @eq bool (@eq_op rT (f x) (f y)) (@eq_op aT x y))) *) by move/can_in_inj; apply: inj_in_eq. Qed. End Exo. Section Endo. Variable T : eqType. Definition frel f := [rel x y : T | f x == y]. Lemma inv_eq f : involutive f -> forall x y : T, (f x == y) = (x == f y). Proof. (* Goal: forall (_ : @involutive (Equality.sort T) f) (x y : Equality.sort T), @eq bool (@eq_op T (f x) y) (@eq_op T x (f y)) *) by move=> fK; apply: can2_eq. Qed. Lemma eq_frel f f' : f =1 f' -> frel f =2 frel f'. Proof. (* Goal: forall _ : @eqfun (Equality.sort T) (Equality.sort T) f f', @eqrel bool (Equality.sort T) (Equality.sort T) (@rel_of_simpl_rel (Equality.sort T) (frel f)) (@rel_of_simpl_rel (Equality.sort T) (frel f')) *) by move=> eq_f x y; rewrite /= eq_f. Qed. End Endo. Variable aT : Type. Definition invariant (rT : eqType) f (k : aT -> rT) := [pred x | k (f x) == k x]. Variables (rT1 rT2 : eqType) (f : aT -> aT) (h : rT1 -> rT2) (k : aT -> rT1). Lemma invariant_comp : subpred (invariant f k) (invariant f (h \o k)). Proof. (* Goal: @subpred aT (@pred_of_simpl aT (@invariant rT1 f k)) (@pred_of_simpl aT (@invariant rT2 f (@funcomp (Equality.sort rT2) (Equality.sort rT1) aT tt h k))) *) by move=> x eq_kfx; rewrite /= (eqP eq_kfx). Qed. Lemma invariant_inj : injective h -> invariant f (h \o k) =1 invariant f k. Proof. (* Goal: forall _ : @injective (Equality.sort rT2) (Equality.sort rT1) h, @eqfun bool aT (@pred_of_simpl aT (@invariant rT2 f (@funcomp (Equality.sort rT2) (Equality.sort rT1) aT tt h k))) (@pred_of_simpl aT (@invariant rT1 f k)) *) by move=> inj_h x; apply: (inj_eq inj_h). Qed. End EqFun. Prenex Implicits frel. Notation coerced_frel f := (rel_of_simpl_rel (frel f)) (only parsing). Section FunWith. Variables (aT : eqType) (rT : Type). Variant fun_delta : Type := FunDelta of aT & rT. Definition fwith x y (f : aT -> rT) := [fun z => if z == x then y else f z]. Definition app_fdelta df f z := let: FunDelta x y := df in if z == x then y else f z. End FunWith. Prenex Implicits fwith. Notation "x |-> y" := (FunDelta x y) (at level 190, no associativity, format "'[hv' x '/ ' |-> y ']'") : fun_delta_scope. Delimit Scope fun_delta_scope with FUN_DELTA. Arguments app_fdelta {aT rT%type} df%FUN_DELTA f z. Notation "[ 'fun' z : T => F 'with' d1 , .. , dn ]" := (SimplFunDelta (fun z : T => app_fdelta d1%FUN_DELTA .. (app_fdelta dn%FUN_DELTA (fun _ => F)) ..)) (at level 0, z ident, only parsing) : fun_scope. Notation "[ 'fun' z => F 'with' d1 , .. , dn ]" := (SimplFunDelta (fun z => app_fdelta d1%FUN_DELTA .. (app_fdelta dn%FUN_DELTA (fun _ => F)) ..)) (at level 0, z ident, format "'[hv' [ '[' 'fun' z => '/ ' F ']' '/' 'with' '[' d1 , '/' .. , '/' dn ']' ] ']'" ) : fun_scope. Notation "[ 'eta' f 'with' d1 , .. , dn ]" := (SimplFunDelta (fun _ => app_fdelta d1%FUN_DELTA .. (app_fdelta dn%FUN_DELTA f) ..)) (at level 0, format "'[hv' [ '[' 'eta' '/ ' f ']' '/' 'with' '[' d1 , '/' .. , '/' dn ']' ] ']'" ) : fun_scope. Section ComparableType. Variable T : Type. Definition comparable := forall x y : T, decidable (x = y). Hypothesis compare_T : comparable. Definition compareb x y : bool := compare_T x y. Lemma compareP : Equality.axiom compareb. Proof. (* Goal: @Equality.axiom T compareb *) by move=> x y; apply: sumboolP. Qed. Definition comparableMixin := EqMixin compareP. End ComparableType. Definition eq_comparable (T : eqType) : comparable T := fun x y => decP (x =P y). Definition vrefl_rect := vrefl. Definition clone_subType U v := fun sT & sub_sort sT -> U => fun c Urec cK (sT' := @SubType U v c Urec cK) & phant_id sT' sT => sT'. Section Theory. Variable sT : subType. Local Notation val := (@val sT). Local Notation Sub x Px := (@Sub sT x Px). Variant Sub_spec : sT -> Type := SubSpec x Px : Sub_spec (Sub x Px). Lemma SubP u : Sub_spec u. Proof. (* Goal: Sub_spec u *) by case: sT Sub_spec SubSpec u => /= U _ mkU rec _. Qed. Definition insub x := if idP is ReflectT Px then Some (Sub x Px) else None. Definition insubd u0 x := odflt u0 (insub x). Variant insub_spec x : option sT -> Type := | InsubSome u of P x & val u = x : insub_spec x (Some u) | InsubNone of ~~ P x : insub_spec x None. Lemma insubP x : insub_spec x (insub x). Proof. (* Goal: insub_spec x (insub x) *) by rewrite /insub; case: {-}_ / idP; [left; rewrite ?SubK | right; apply/negP]. Qed. Lemma insubT x Px : insub x = Some (Sub x Px). Proof. (* Goal: @eq (option (sub_sort sT)) (insub x) (@Some (sub_sort sT) (@SubType.Sub sT x Px)) *) do [case: insubP => [/SubP[y Py] _ <- | /negP// ]; rewrite SubK] in Px *. by rewrite (bool_irrelevance Px Py). Qed. Qed. Lemma insubF x : P x = false -> insub x = None. Proof. (* Goal: forall _ : @eq bool (P x) false, @eq (option (sub_sort sT)) (insub x) (@None (sub_sort sT)) *) by move/idP; case: insubP. Qed. Lemma insubN x : ~~ P x -> insub x = None. Proof. (* Goal: forall _ : is_true (negb (P x)), @eq (option (sub_sort sT)) (insub x) (@None (sub_sort sT)) *) by move/negPf/insubF. Qed. Lemma isSome_insub : ([eta insub] : pred T) =1 P. Proof. (* Goal: @eqfun bool T ((fun x : T => @isSome (sub_sort sT) (insub x)) : pred T) P *) by apply: fsym => x; case: insubP => // /negPf. Qed. Lemma insubK : ocancel insub val. Proof. (* Goal: @ocancel (sub_sort sT) T insub (@SubType.val sT) *) by move=> x; case: insubP. Qed. Lemma valP u : P (val u). Proof. (* Goal: is_true (P (@SubType.val sT u)) *) by case/SubP: u => x Px; rewrite SubK. Qed. Lemma valK : pcancel val insub. Proof. (* Goal: @pcancel T (sub_sort sT) (@SubType.val sT) insub *) by case/SubP=> x Px; rewrite SubK; apply: insubT. Qed. Lemma val_inj : injective val. Proof. (* Goal: @injective T (sub_sort sT) (@SubType.val sT) *) exact: pcan_inj valK. Qed. Lemma valKd u0 : cancel val (insubd u0). Proof. (* Goal: @cancel T (sub_sort sT) (@SubType.val sT) (insubd u0) *) by move=> u; rewrite /insubd valK. Qed. Lemma val_insubd u0 x : val (insubd u0 x) = if P x then x else val u0. Proof. (* Goal: @eq T (@SubType.val sT (insubd u0 x)) (if P x then x else @SubType.val sT u0) *) by rewrite /insubd; case: insubP => [u -> | /negPf->]. Qed. Lemma insubdK u0 : {in P, cancel (insubd u0) val}. Proof. (* Goal: @prop_in1 T (@mem T (predPredType T) P) (fun x : T => @eq T (@SubType.val sT (insubd u0 x)) x) (inPhantom (@cancel (sub_sort sT) T (insubd u0) (@SubType.val sT))) *) by move=> x Px; rewrite /= val_insubd [P x]Px. Qed. Let insub_eq_aux x isPx : P x = isPx -> option sT := if isPx as b return _ = b -> _ then fun Px => Some (Sub x Px) else fun=> None. Definition insub_eq x := insub_eq_aux (erefl (P x)). Lemma insub_eqE : insub_eq =1 insub. Proof. (* Goal: @eqfun (option (sub_sort sT)) T insub_eq insub *) rewrite /insub_eq => x; set b := P x; rewrite [in LHS]/b in (Db := erefl b) *. by case: b in Db *; [rewrite insubT | rewrite insubF]. Qed. Qed. End Theory. End SubType. Arguments SubType {T P} sub_sort val Sub rec SubK. Arguments val {T P sT} u : rename. Arguments Sub {T P sT} x Px : rename. Arguments vrefl {T P} x Px. Arguments vrefl_rect {T P} x Px. Arguments clone_subType [T P] U v [sT] _ [c Urec cK]. Arguments insub {T P sT} x. Arguments insubd {T P sT} u0 x. Arguments insubT [T] P [sT x]. Arguments val_inj {T P sT} [u1 u2] eq_u12 : rename. Arguments valK {T P sT} u : rename. Arguments valKd {T P sT} u0 u : rename. Arguments insubK {T P} sT x. Arguments insubdK {T P sT} u0 [x] Px. Local Notation inlined_sub_rect := (fun K K_S u => let (x, Px) as u return K u := u in K_S x Px). Local Notation inlined_new_rect := (fun K K_S u => let (x) as u return K u := u in K_S x). Notation "[ 'subType' 'for' v ]" := (SubType _ v _ inlined_sub_rect vrefl_rect) (at level 0, only parsing) : form_scope. Notation "[ 'sub' 'Type' 'for' v ]" := (SubType _ v _ _ vrefl_rect) (at level 0, format "[ 'sub' 'Type' 'for' v ]") : form_scope. Notation "[ 'subType' 'for' v 'by' rec ]" := (SubType _ v _ rec vrefl) (at level 0, format "[ 'subType' 'for' v 'by' rec ]") : form_scope. Notation "[ 'subType' 'of' U 'for' v ]" := (clone_subType U v id idfun) (at level 0, format "[ 'subType' 'of' U 'for' v ]") : form_scope. Notation "[ 'subType' 'of' U ]" := (clone_subType U _ id id) (at level 0, format "[ 'subType' 'of' U ]") : form_scope. Definition NewType T U v c Urec := let Urec' P IH := Urec P (fun x : T => IH x isT : P _) in SubType U v (fun x _ => c x) Urec'. Arguments NewType [T U]. Notation "[ 'newType' 'for' v ]" := (NewType v _ inlined_new_rect vrefl_rect) (at level 0, only parsing) : form_scope. Notation "[ 'new' 'Type' 'for' v ]" := (NewType v _ _ vrefl_rect) (at level 0, format "[ 'new' 'Type' 'for' v ]") : form_scope. Notation "[ 'newType' 'for' v 'by' rec ]" := (NewType v _ rec vrefl) (at level 0, format "[ 'newType' 'for' v 'by' rec ]") : form_scope. Definition innew T nT x := @Sub T predT nT x (erefl true). Arguments innew {T nT}. Lemma innew_val T nT : cancel val (@innew T nT). Proof. (* Goal: @cancel T (@sub_sort T (@pred_of_simpl T (@predT T)) nT) (@val T (@pred_of_simpl T (@predT T)) nT) (@innew T nT) *) by move=> u; apply: val_inj; apply: SubK. Qed. Definition s2val (u : sig2 P Q) := let: exist2 x _ _ := u in x. Lemma s2valP u : P (s2val u). Proof. by case: u. Qed. Proof. (* Goal: P (s2val u) *) by case: u. Qed. End SigProj. Prenex Implicits svalP s2val s2valP s2valP'. Canonical sig_subType T (P : pred T) : subType [eta P] := Eval hnf in [subType for @sval T [eta [eta P]]]. Notation "{ x 'in' A }" := {x | x \in A} (at level 0, x at level 99, format "{ x 'in' A }") : type_scope. Notation "{ x 'in' A | P }" := {x | (x \in A) && P} (at level 0, x at level 99, format "{ x 'in' A | P }") : type_scope. Notation "{ ? x : T | P }" := (option {x : T | is_true P}) (at level 0, x at level 99, only parsing) : type_scope. Notation "{ ? x | P }" := {? x : _ | P} (at level 0, x at level 99, format "{ ? x | P }") : type_scope. Notation "{ ? x 'in' A }" := {? x | x \in A} (at level 0, x at level 99, format "{ ? x 'in' A }") : type_scope. Notation "{ ? x 'in' A | P }" := {? x | (x \in A) && P} (at level 0, x at level 99, format "{ ? x 'in' A | P }") : type_scope. Definition insigd T (A : mem_pred T) x (Ax : in_mem x A) := insubd (exist [eta A] x Ax). Section TransferEqType. Variables (T : Type) (eT : eqType) (f : T -> eT). Lemma inj_eqAxiom : injective f -> Equality.axiom (fun x y => f x == f y). Proof. (* Goal: forall _ : @injective (Equality.sort eT) T f, @Equality.axiom T (fun x y : T => @eq_op eT (f x) (f y)) *) by move=> f_inj x y; apply: (iffP eqP) => [|-> //]; apply: f_inj. Qed. Definition InjEqMixin f_inj := EqMixin (inj_eqAxiom f_inj). Definition PcanEqMixin g (fK : pcancel f g) := InjEqMixin (pcan_inj fK). Definition CanEqMixin g (fK : cancel f g) := InjEqMixin (can_inj fK). Definition sub_eqMixin := EqMixin val_eqP. Canonical sub_eqType := Eval hnf in EqType sT sub_eqMixin. Definition SubEqMixin := (let: SubType _ v _ _ _ as sT' := sT return ev_ax sT' val -> Equality.class_of sT' in fun vP : ev_ax _ v => EqMixin vP ) val_eqP. Lemma val_eqE (u v : sT) : (val u == val v) = (u == v). Proof. (* Goal: @eq bool (@eq_op T (@val (Equality.sort T) P sT u) (@val (Equality.sort T) P sT v)) (@eq_op sub_eqType u v) *) by []. Qed. End SubEqType. Arguments val_eqP {T P sT x y}. Notation "[ 'eqMixin' 'of' T 'by' <: ]" := (SubEqMixin _ : Equality.class_of T) (at level 0, format "[ 'eqMixin' 'of' T 'by' <: ]") : form_scope. Section SigEqType. Variables (T : eqType) (P : pred T). Definition sig_eqMixin := Eval hnf in [eqMixin of {x | P x} by <:]. Canonical sig_eqType := Eval hnf in EqType {x | P x} sig_eqMixin. End SigEqType. Section ProdEqType. Variable T1 T2 : eqType. Definition pair_eq : rel (T1 * T2) := fun u v => (u.1 == v.1) && (u.2 == v.2). Lemma pair_eqP : Equality.axiom pair_eq. Proof. (* Goal: @Equality.axiom (prod (Equality.sort T1) (Equality.sort T2)) pair_eq *) move=> [x1 x2] [y1 y2] /=; apply: (iffP andP) => [[]|[<- <-]] //=. (* Goal: forall (_ : is_true (@eq_op T1 x1 y1)) (_ : is_true (@eq_op T2 x2 y2)), @eq (prod (Equality.sort T1) (Equality.sort T2)) (@pair (Equality.sort T1) (Equality.sort T2) x1 x2) (@pair (Equality.sort T1) (Equality.sort T2) y1 y2) *) by do 2!move/eqP->. Qed. Lemma xpair_eqE (x1 y1 : T1) (x2 y2 : T2) : ((x1, x2) == (y1, y2)) = ((x1 == y1) && (x2 == y2)). Proof. (* Goal: @eq bool (@eq_op prod_eqType (@pair (Equality.sort T1) (Equality.sort T2) x1 x2) (@pair (Equality.sort T1) (Equality.sort T2) y1 y2)) (andb (@eq_op T1 x1 y1) (@eq_op T2 x2 y2)) *) by []. Qed. Lemma pair_eq1 (u v : T1 * T2) : u == v -> u.1 == v.1. Proof. (* Goal: forall _ : is_true (@eq_op prod_eqType u v), is_true (@eq_op T1 (@fst (Equality.sort T1) (Equality.sort T2) u) (@fst (Equality.sort T1) (Equality.sort T2) v)) *) by case/andP. Qed. Lemma pair_eq2 (u v : T1 * T2) : u == v -> u.2 == v.2. Proof. (* Goal: forall _ : is_true (@eq_op prod_eqType u v), is_true (@eq_op T2 (@snd (Equality.sort T1) (Equality.sort T2) u) (@snd (Equality.sort T1) (Equality.sort T2) v)) *) by case/andP. Qed. End ProdEqType. Arguments pair_eq {T1 T2} u v /. Arguments pair_eqP {T1 T2}. Definition predX T1 T2 (p1 : pred T1) (p2 : pred T2) := [pred z | p1 z.1 & p2 z.2]. Notation "[ 'predX' A1 & A2 ]" := (predX [mem A1] [mem A2]) (at level 0, format "[ 'predX' A1 & A2 ]") : fun_scope. Section OptionEqType. Variable T : eqType. Definition opt_eq (u v : option T) : bool := oapp (fun x => oapp (eq_op x) false v) (~~ v) u. Lemma opt_eqP : Equality.axiom opt_eq. Proof. (* Goal: @Equality.axiom (option (Equality.sort T)) opt_eq *) case=> [x|] [y|] /=; by [constructor | apply: (iffP eqP) => [|[]] ->]. Qed. Canonical option_eqMixin := EqMixin opt_eqP. Canonical option_eqType := Eval hnf in EqType (option T) option_eqMixin. End OptionEqType. Arguments opt_eq {T} !u !v. Section TaggedAs. Variables (I : eqType) (T_ : I -> Type). Implicit Types u v : {i : I & T_ i}. Definition tagged_as u v := if tag u =P tag v is ReflectT eq_uv then eq_rect_r T_ (tagged v) eq_uv else tagged u. Lemma tagged_asE u x : tagged_as u (Tagged T_ x) = x. Proof. (* Goal: @eq (T_ (@tag (Equality.sort I) (fun i : Equality.sort I => T_ i) u)) (tagged_as u (@Tagged (Equality.sort I) (@tag (Equality.sort I) (fun i : Equality.sort I => T_ i) u) T_ x)) x *) by rewrite /tagged_as /=; case: eqP => // eq_uu; rewrite [eq_uu]eq_axiomK. Qed. End TaggedAs. Section TagEqType. Variables (I : eqType) (T_ : I -> eqType). Implicit Types u v : {i : I & T_ i}. Definition tag_eq u v := (tag u == tag v) && (tagged u == tagged_as u v). Lemma tag_eqP : Equality.axiom tag_eq. Proof. (* Goal: @Equality.axiom (@sigT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i))) tag_eq *) rewrite /tag_eq => [] [i x] [j] /=. (* Goal: forall p : Equality.sort (T_ j), Bool.reflect (@eq (@sigT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i))) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) i x) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) j p)) (andb (@eq_op I i j) (@eq_op (T_ i) x (@tagged_as I (fun i : Equality.sort I => Equality.sort (T_ i)) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) i x) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) j p)))) *) case: eqP => [<-|Hij] y; last by right; case. (* Goal: Bool.reflect (@eq (@sigT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i))) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) i x) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) i y)) (andb true (@eq_op (T_ i) x (@tagged_as I (fun i : Equality.sort I => Equality.sort (T_ i)) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) i x) (@existT (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) i y)))) *) by apply: (iffP eqP) => [->|<-]; rewrite tagged_asE. Qed. Lemma eq_tag u v : u == v -> tag u = tag v. Proof. (* Goal: forall _ : is_true (@eq_op tag_eqType u v), @eq (Equality.sort I) (@tag (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) u) (@tag (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) v) *) by move/eqP->. Qed. Lemma eq_Tagged u x :(u == Tagged _ x) = (tagged u == x). Proof. (* Goal: @eq bool (@eq_op tag_eqType u (@Tagged (Equality.sort I) (@tag (Equality.sort I) (fun x : Equality.sort I => (fun i : Equality.sort I => Equality.sort (T_ i)) x) u) (fun x : Equality.sort I => Equality.sort (T_ x)) x)) (@eq_op (T_ (@tag (Equality.sort I) (fun x : Equality.sort I => (fun i : Equality.sort I => Equality.sort (T_ i)) x) u)) (@tagged (Equality.sort I) (fun i : Equality.sort I => Equality.sort (T_ i)) u) x) *) by rewrite -tag_eqE /tag_eq eqxx tagged_asE. Qed. End TagEqType. Arguments tag_eq {I T_} !u !v. Arguments tag_eqP {I T_ x y}. Section SumEqType. Variables T1 T2 : eqType. Implicit Types u v : T1 + T2. Definition sum_eq u v := match u, v with | inl x, inl y | inr x, inr y => x == y | _, _ => false end. Lemma sum_eqP : Equality.axiom sum_eq. Proof. (* Goal: @Equality.axiom (sum (Equality.sort T1) (Equality.sort T2)) sum_eq *) case=> x [] y /=; by [right | apply: (iffP eqP) => [->|[->]]]. Qed. End SumEqType. Arguments sum_eq {T1 T2} !u !v. Arguments sum_eqP {T1 T2 x y}. Section MonoHomoTheory. Variables (aT rT : eqType) (f : aT -> rT). Variables (aR aR' : rel aT) (rR rR' : rel rT). Hypothesis aR_refl : reflexive aR. Hypothesis rR_refl : reflexive rR. Hypothesis aR'E : forall x y, aR' x y = (x != y) && (aR x y). Hypothesis rR'E : forall x y, rR' x y = (x != y) && (rR x y). Let aRE x y : aR x y = (x == y) || (aR' x y). Proof. (* Goal: @eq bool (aR x y) (orb (@eq_op aT x y) (aR' x y)) *) by rewrite aR'E; case: (altP eqP) => //= ->; apply: aR_refl. Qed. Let rRE x y : rR x y = (x == y) || (rR' x y). Proof. (* Goal: @eq bool (rR x y) (orb (@eq_op rT x y) (rR' x y)) *) by rewrite rR'E; case: (altP eqP) => //= ->; apply: rR_refl. Qed. Section InDom. Variable D : pred aT. Section DifferentDom. Variable D' : pred aT. Lemma homoW_in : {in D & D', {homo f : x y / aR' x y >-> rR' x y}} -> {in D & D', {homo f : x y / aR x y >-> rR x y}}. Proof. (* Goal: forall _ : @prop_in11 (Equality.sort aT) (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D') (fun x y : Equality.sort aT => forall _ : (fun x0 y0 : Equality.sort aT => is_true (aR' x0 y0)) x y, (fun x0 y0 : Equality.sort rT => is_true (rR' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR' x y)) (fun x y : Equality.sort rT => is_true (rR' x y)))), @prop_in11 (Equality.sort aT) (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D') (fun x y : Equality.sort aT => forall _ : (fun x0 y0 : Equality.sort aT => is_true (aR x0 y0)) x y, (fun x0 y0 : Equality.sort rT => is_true (rR x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR x y)) (fun x y : Equality.sort rT => is_true (rR x y)))) *) move=> mf x y xD yD /=; rewrite aRE => /orP[/eqP->|/mf]; by rewrite rRE ?eqxx // orbC => ->. Qed. Lemma inj_homo_in : {in D & D', injective f} -> {in D & D', {homo f : x y / aR x y >-> rR x y}} -> {in D & D', {homo f : x y / aR' x y >-> rR' x y}}. Proof. (* Goal: forall (_ : @prop_in11 (Equality.sort aT) (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D') (fun x1 x2 : Equality.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Equality.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Equality.sort aT) f))) (_ : @prop_in11 (Equality.sort aT) (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D') (fun x y : Equality.sort aT => forall _ : (fun x0 y0 : Equality.sort aT => is_true (aR x0 y0)) x y, (fun x0 y0 : Equality.sort rT => is_true (rR x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR x y)) (fun x y : Equality.sort rT => is_true (rR x y))))), @prop_in11 (Equality.sort aT) (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D') (fun x y : Equality.sort aT => forall _ : (fun x0 y0 : Equality.sort aT => is_true (aR' x0 y0)) x y, (fun x0 y0 : Equality.sort rT => is_true (rR' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR' x y)) (fun x y : Equality.sort rT => is_true (rR' x y)))) *) move=> fI mf x y xD yD /=; rewrite aR'E rR'E => /andP[neq_xy xy]. (* Goal: is_true (andb (negb (@eq_op rT (f x) (f y))) (rR (f x) (f y))) *) by rewrite mf ?andbT //; apply: contra_neq neq_xy => /fI; apply. Qed. End DifferentDom. Hypothesis aR_anti : antisymmetric aR. Hypothesis rR_anti : antisymmetric rR. Lemma mono_inj_in : {in D &, {mono f : x y / aR x y >-> rR x y}} -> {in D &, injective f}. Proof. (* Goal: forall _ : @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x y : Equality.sort aT => @eq bool ((fun x0 y0 : Equality.sort rT => rR x0 y0) (f x) (f y)) ((fun x0 y0 : Equality.sort aT => aR x0 y0) x y)) (inPhantom (@monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR x y) (fun x y : Equality.sort rT => rR x y))), @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x1 x2 : Equality.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Equality.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Equality.sort aT) f)) *) by move=> mf x y ?? eqf; apply/aR_anti; rewrite -!mf// eqf rR_refl. Qed. Lemma anti_mono_in : {in D &, {mono f : x y / aR x y >-> rR x y}} -> {in D &, {mono f : x y / aR' x y >-> rR' x y}}. Proof. (* Goal: forall _ : @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x y : Equality.sort aT => @eq bool ((fun x0 y0 : Equality.sort rT => rR x0 y0) (f x) (f y)) ((fun x0 y0 : Equality.sort aT => aR x0 y0) x y)) (inPhantom (@monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR x y) (fun x y : Equality.sort rT => rR x y))), @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x y : Equality.sort aT => @eq bool ((fun x0 y0 : Equality.sort rT => rR' x0 y0) (f x) (f y)) ((fun x0 y0 : Equality.sort aT => aR' x0 y0) x y)) (inPhantom (@monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR' x y) (fun x y : Equality.sort rT => rR' x y))) *) move=> mf x y ??; rewrite rR'E aR'E mf// (@inj_in_eq _ _ D)//. (* Goal: @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x1 x2 : Equality.sort aT => forall _ : @eq (Equality.sort rT) (f x1) (f x2), @eq (Equality.sort aT) x1 x2) (inPhantom (@injective (Equality.sort rT) (Equality.sort aT) f)) *) exact: mono_inj_in. Qed. Lemma total_homo_mono_in : total aR -> {in D &, {homo f : x y / aR' x y >-> rR' x y}} -> {in D &, {mono f : x y / aR x y >-> rR x y}}. Proof. (* Goal: forall (_ : @total (Equality.sort aT) aR) (_ : @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x y : Equality.sort aT => forall _ : (fun x0 y0 : Equality.sort aT => is_true (aR' x0 y0)) x y, (fun x0 y0 : Equality.sort rT => is_true (rR' x0 y0)) (f x) (f y)) (inPhantom (@homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR' x y)) (fun x y : Equality.sort rT => is_true (rR' x y))))), @prop_in2 (Equality.sort aT) (@mem (Equality.sort aT) (predPredType (Equality.sort aT)) D) (fun x y : Equality.sort aT => @eq bool ((fun x0 y0 : Equality.sort rT => rR x0 y0) (f x) (f y)) ((fun x0 y0 : Equality.sort aT => aR x0 y0) x y)) (inPhantom (@monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR x y) (fun x y : Equality.sort rT => rR x y))) *) move=> aR_tot mf x y xD yD. (* Goal: @eq bool (rR (f x) (f y)) (aR x y) *) have [->|neq_xy] := altP (x =P y); first by rewrite ?eqxx ?aR_refl ?rR_refl. (* Goal: @eq bool (rR (f x) (f y)) (aR x y) *) have [xy|] := (boolP (aR x y)); first by rewrite rRE mf ?orbT// aR'E neq_xy. (* Goal: forall _ : is_true (negb (aR x y)), @eq bool (rR (f x) (f y)) false *) have /orP [->//|] := aR_tot x y. (* Goal: forall (_ : is_true (aR y x)) (_ : is_true (negb (aR x y))), @eq bool (rR (f x) (f y)) false *) rewrite aRE eq_sym (negPf neq_xy) /= => /mf -/(_ yD xD). (* Goal: forall (_ : is_true (rR' (f y) (f x))) (_ : is_true (negb (aR x y))), @eq bool (rR (f x) (f y)) false *) rewrite rR'E => /andP[Nfxfy fyfx] _; apply: contra_neqF Nfxfy => fxfy. (* Goal: @eq (Equality.sort rT) (f y) (f x) *) by apply/rR_anti; rewrite fyfx fxfy. Qed. End InDom. Let D := @predT aT. Lemma homoW : {homo f : x y / aR' x y >-> rR' x y} -> {homo f : x y / aR x y >-> rR x y}. Proof. (* Goal: forall _ : @homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR' x y)) (fun x y : Equality.sort rT => is_true (rR' x y)), @homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR x y)) (fun x y : Equality.sort rT => is_true (rR x y)) *) by move=> mf ???; apply: (@homoW_in D D) => // ????; apply: mf. Qed. Lemma inj_homo : injective f -> {homo f : x y / aR x y >-> rR x y} -> {homo f : x y / aR' x y >-> rR' x y}. Proof. (* Goal: forall (_ : @injective (Equality.sort rT) (Equality.sort aT) f) (_ : @homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR x y)) (fun x y : Equality.sort rT => is_true (rR x y))), @homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR' x y)) (fun x y : Equality.sort rT => is_true (rR' x y)) *) by move=> fI mf ???; apply: (@inj_homo_in D D) => //????; [apply: fI|apply: mf]. Qed. Hypothesis aR_anti : antisymmetric aR. Hypothesis rR_anti : antisymmetric rR. Lemma mono_inj : {mono f : x y / aR x y >-> rR x y} -> injective f. Proof. (* Goal: forall _ : @monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR x y) (fun x y : Equality.sort rT => rR x y), @injective (Equality.sort rT) (Equality.sort aT) f *) by move=> mf x y eqf; apply/aR_anti; rewrite -!mf eqf rR_refl. Qed. Lemma anti_mono : {mono f : x y / aR x y >-> rR x y} -> {mono f : x y / aR' x y >-> rR' x y}. Proof. (* Goal: forall _ : @monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR x y) (fun x y : Equality.sort rT => rR x y), @monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR' x y) (fun x y : Equality.sort rT => rR' x y) *) by move=> mf x y; rewrite rR'E aR'E mf inj_eq //; apply: mono_inj. Qed. Lemma total_homo_mono : total aR -> {homo f : x y / aR' x y >-> rR' x y} -> {mono f : x y / aR x y >-> rR x y}. Proof. (* Goal: forall (_ : @total (Equality.sort aT) aR) (_ : @homomorphism_2 (Equality.sort aT) (Equality.sort rT) f (fun x y : Equality.sort aT => is_true (aR' x y)) (fun x y : Equality.sort rT => is_true (rR' x y))), @monomorphism_2 (Equality.sort aT) (Equality.sort rT) bool f (fun x y : Equality.sort aT => aR x y) (fun x y : Equality.sort rT => rR x y) *) move=> /(@total_homo_mono_in D rR_anti) hmf hf => x y. (* Goal: @eq bool (rR (f x) (f y)) (aR x y) *) by apply: hmf => // ?? _ _; apply: hf. Qed. End MonoHomoTheory.
Require Import Arith List. Require Import BellantoniCook.Lib BellantoniCook.BC BellantoniCook.BCI BellantoniCook.BCI_to_BC. Fixpoint convI (e : BC) : BCI := match e with | zero => zeroI | proj n s i => if leb (S i) n then projIn i else projIs (i - n) | succ b => succI b | pred => predI | cond => condI | rec g h0 h1 => recI (convI g) (convI h0) (convI h1) | comp n s g ln ls => compI (convI g) (map convI ln) (map convI ls) end. Opaque maxl. Lemma convI_inf_correct : forall (e : BC) n s, arities e = ok_arities n s -> exists n', exists s', n' <= n /\ s' <= s /\ inf (convI e) = I n' s'. Lemma convI_correct : forall e n s, arities e = ok_arities n s -> forall vnl vsl, semI (convI e) vnl vsl = sem e vnl vsl. Proof. (* Goal: forall (e : BC) (n s : nat) (_ : @eq Arities (arities e) (ok_arities n s)) (vnl vsl : list (list bool)), @eq (list bool) (semI (convI e) vnl vsl) (sem e vnl vsl) *) refine (BC_ind_inf _ _ _ _ _ _ _ _); simpl; intros; trivial. (* Goal: @eq (list bool) (semI (convI h) (@map BCI (list bool) (fun ne : BCI => semI ne vnl (@nil (list bool))) (@map BC BCI convI rl)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl))) (sem h (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) *) (* Goal: @eq (list bool) (sem_rec (semI (convI g)) (semI (convI h0)) (semI (convI h1)) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl) *) (* Goal: @eq (list bool) (semI (if match n with | Datatypes.O => false | S m' => Nat.leb i m' end then projIn i else projIs (Init.Nat.sub i n)) vnl vsl) (if match n with | Datatypes.O => false | S m' => Nat.leb i m' end then @nth (list bool) i vnl (@nil bool) else @nth (list bool) (Init.Nat.sub i n) vsl (@nil bool)) *) destruct n; simpl; trivial. (* Goal: @eq (list bool) (semI (convI h) (@map BCI (list bool) (fun ne : BCI => semI ne vnl (@nil (list bool))) (@map BC BCI convI rl)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl))) (sem h (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) *) (* Goal: @eq (list bool) (sem_rec (semI (convI g)) (semI (convI h0)) (semI (convI h1)) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl) *) (* Goal: @eq (list bool) (semI (if Nat.leb i n then projIn i else projIs (Init.Nat.sub i (S n))) vnl vsl) (if Nat.leb i n then @nth (list bool) i vnl (@nil bool) else @nth (list bool) (Init.Nat.sub i (S n)) vsl (@nil bool)) *) case_eq (leb i n); intros; simpl; trivial. (* Goal: @eq (list bool) (semI (convI h) (@map BCI (list bool) (fun ne : BCI => semI ne vnl (@nil (list bool))) (@map BC BCI convI rl)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl))) (sem h (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) *) (* Goal: @eq (list bool) (sem_rec (semI (convI g)) (semI (convI h0)) (semI (convI h1)) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) vnl) (@tl (list bool) vnl) vsl) *) induction (hd nil vnl); simpl; intros; auto. (* Goal: @eq (list bool) (semI (convI h) (@map BCI (list bool) (fun ne : BCI => semI ne vnl (@nil (list bool))) (@map BC BCI convI rl)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl))) (sem h (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) *) (* Goal: @eq (list bool) (if a then semI (convI h1) (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (semI (convI g)) (semI (convI h0)) (semI (convI h1)) l (@tl (list bool) vnl) vsl) vsl) else semI (convI h0) (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (semI (convI g)) (semI (convI h0)) (semI (convI h1)) l (@tl (list bool) vnl) vsl) vsl)) (if a then sem h1 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) vnl) vsl) vsl) else sem h0 (@cons (list bool) l (@tl (list bool) vnl)) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l (@tl (list bool) vnl) vsl) vsl)) *) rewrite IHl; case a; auto. (* Goal: @eq (list bool) (semI (convI h) (@map BCI (list bool) (fun ne : BCI => semI ne vnl (@nil (list bool))) (@map BC BCI convI rl)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl))) (sem h (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) *) rewrite H2. (* Goal: @eq (list bool) (sem h (@map BCI (list bool) (fun ne : BCI => semI ne vnl (@nil (list bool))) (@map BC BCI convI rl)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl))) (sem h (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl)) *) f_equal. (* Goal: @eq (list (list bool)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl) *) (* Goal: @eq (list (list bool)) (@map BCI (list bool) (fun ne : BCI => semI ne vnl (@nil (list bool))) (@map BC BCI convI rl)) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) *) rewrite map_map. (* Goal: @eq (list (list bool)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl) *) (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun x : BC => semI (convI x) vnl (@nil (list bool))) rl) (@map BC (list bool) (fun ne : BC => sem ne vnl (@nil (list bool))) rl) *) apply map_ext2; auto. (* Goal: @eq (list (list bool)) (@map BCI (list bool) (fun se : BCI => semI se vnl vsl) (@map BC BCI convI tl)) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl) *) rewrite map_map. (* Goal: @eq (list (list bool)) (@map BC (list bool) (fun x : BC => semI (convI x) vnl vsl) tl) (@map BC (list bool) (fun se : BC => sem se vnl vsl) tl) *) apply map_ext2; auto. Qed.
Require Export GeoCoq.Elements.OriginalProofs.proposition_16. Require Export GeoCoq.Elements.OriginalProofs.lemma_angletrichotomy. Section Euclid. Context `{Ax1:euclidean_neutral_ruler_compass}. Lemma lemma_26helper : forall A B C D E F, Triangle A B C -> CongA A B C D E F -> CongA B C A E F D -> Cong A B D E -> ~ Lt E F B C. Proof. (* Goal: forall (A B C D E F : @Point Ax) (_ : @Triangle Ax A B C) (_ : @CongA Ax A B C D E F) (_ : @CongA Ax B C A E F D) (_ : @Cong Ax A B D E), not (@Lt Ax E F B C) *) intros. (* Goal: not (@Lt Ax E F B C) *) assert (nCol A B C) by (conclude_def Triangle ). (* Goal: not (@Lt Ax E F B C) *) assert (CongA A B C A B C) by (conclude lemma_equalanglesreflexive). (* Goal: not (@Lt Ax E F B C) *) assert (neq A B) by (forward_using lemma_angledistinct). (* Goal: not (@Lt Ax E F B C) *) assert (neq B A) by (conclude lemma_inequalitysymmetric). (* Goal: not (@Lt Ax E F B C) *) assert (neq B C) by (forward_using lemma_angledistinct). (* Goal: not (@Lt Ax E F B C) *) assert (neq C B) by (conclude lemma_inequalitysymmetric). (* Goal: not (@Lt Ax E F B C) *) assert (neq A C) by (forward_using lemma_angledistinct). (* Goal: not (@Lt Ax E F B C) *) assert (neq C A) by (conclude lemma_inequalitysymmetric). (* Goal: not (@Lt Ax E F B C) *) assert (~ Lt E F B C). (* Goal: not (@Lt Ax E F B C) *) (* Goal: not (@Lt Ax E F B C) *) { (* Goal: not (@Lt Ax E F B C) *) intro. (* Goal: False *) rename_H H;let Tf:=fresh in assert (Tf:exists H, (BetS B H C /\ Cong B H E F)) by (conclude_def Lt );destruct Tf as [H];spliter. (* Goal: False *) assert (CongA A B C A B C) by (conclude lemma_equalanglesreflexive). (* Goal: False *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: False *) assert (Out B A A) by (conclude lemma_ray4). (* Goal: False *) assert (Out B C H) by (conclude lemma_ray4). (* Goal: False *) assert (CongA A B C A B H) by (conclude lemma_equalangleshelper). (* Goal: False *) assert (CongA A B H A B C) by (conclude lemma_equalanglessymmetric). (* Goal: False *) assert (CongA A B H D E F) by (conclude lemma_equalanglestransitive). (* Goal: False *) assert (Cong B A E D) by (forward_using lemma_congruenceflip). (* Goal: False *) assert ((Cong A H D F /\ CongA B A H E D F /\ CongA B H A E F D)) by (conclude proposition_04). (* Goal: False *) assert (CongA E F D B C A) by (conclude lemma_equalanglessymmetric). (* Goal: False *) assert (~ Col A C H). (* Goal: False *) (* Goal: not (@Col Ax A C H) *) { (* Goal: not (@Col Ax A C H) *) intro. (* Goal: False *) assert (Col H C A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B H C) by (conclude_def Col ). (* Goal: False *) assert (Col H C B) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq H C) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (Col C A B) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@Lt Ax E F B C) *) (* BG Goal: False *) } (* Goal: False *) assert (Triangle A C H) by (conclude_def Triangle ). (* Goal: False *) assert (BetS C H B) by (conclude axiom_betweennesssymmetry). (* Goal: False *) assert (LtA H C A A H B) by (conclude proposition_16). (* Goal: False *) assert (Out C B H) by (conclude lemma_ray4). (* Goal: False *) assert (eq A A) by (conclude cn_equalityreflexive). (* Goal: False *) assert (Out C A A) by (conclude lemma_ray4). (* Goal: False *) assert (~ Col B C A). (* Goal: False *) (* Goal: not (@Col Ax B C A) *) { (* Goal: not (@Col Ax B C A) *) intro. (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@Lt Ax E F B C) *) (* BG Goal: False *) } (* Goal: False *) assert (CongA B C A B C A) by (conclude lemma_equalanglesreflexive). (* Goal: False *) assert (CongA B C A H C A) by (conclude lemma_equalangleshelper). (* Goal: False *) assert (CongA H C A B C A) by (conclude lemma_equalanglessymmetric). (* Goal: False *) assert (LtA B C A A H B) by (conclude lemma_angleorderrespectscongruence2). (* Goal: False *) assert (LtA E F D A H B) by (conclude lemma_angleorderrespectscongruence2). (* Goal: False *) assert (~ Col A H B). (* Goal: False *) (* Goal: not (@Col Ax A H B) *) { (* Goal: not (@Col Ax A H B) *) intro. (* Goal: False *) assert (Col H B A) by (forward_using lemma_collinearorder). (* Goal: False *) assert (Col B H C) by (conclude_def Col ). (* Goal: False *) assert (Col H B C) by (forward_using lemma_collinearorder). (* Goal: False *) assert (neq B H) by (forward_using lemma_betweennotequal). (* Goal: False *) assert (neq H B) by (conclude lemma_inequalitysymmetric). (* Goal: False *) assert (Col B A C) by (conclude lemma_collinear4). (* Goal: False *) assert (Col A B C) by (forward_using lemma_collinearorder). (* Goal: False *) contradict. (* BG Goal: not (@Lt Ax E F B C) *) (* BG Goal: False *) } (* Goal: False *) assert (CongA A H B B H A) by (conclude lemma_ABCequalsCBA). (* Goal: False *) assert (CongA A H B E F D) by (conclude lemma_equalanglestransitive). (* Goal: False *) assert (LtA A H B A H B) by (conclude lemma_angleorderrespectscongruence2). (* Goal: False *) assert (~ LtA A H B A H B) by (conclude lemma_angletrichotomy). (* Goal: False *) contradict. (* BG Goal: not (@Lt Ax E F B C) *) } (* Goal: not (@Lt Ax E F B C) *) close. Qed. End Euclid.
Require Export Lib_Mult. Inductive even (n : nat) : Prop := even_intro : forall q : nat, n = 2 * q -> even n. Inductive odd (n : nat) : Prop := odd_intro : forall q : nat, n = 2 * q + 1 -> odd n. Lemma no_zero_div : forall n m : nat, 0 < n -> forall q : nat, n = m * q -> 0 < q. Proof. (* Goal: forall (n m : nat) (_ : lt O n) (q : nat) (_ : @eq nat n (Init.Nat.mul m q)), lt O q *) simple induction q. (* Goal: forall (n0 : nat) (_ : forall _ : @eq nat n (Init.Nat.mul m n0), lt O n0) (_ : @eq nat n (Init.Nat.mul m (S n0))), lt O (S n0) *) (* Goal: forall _ : @eq nat n (Init.Nat.mul m O), lt O O *) intro. (* Goal: forall (n0 : nat) (_ : forall _ : @eq nat n (Init.Nat.mul m n0), lt O n0) (_ : @eq nat n (Init.Nat.mul m (S n0))), lt O (S n0) *) (* Goal: lt O O *) absurd (0 = n). (* Goal: forall (n0 : nat) (_ : forall _ : @eq nat n (Init.Nat.mul m n0), lt O n0) (_ : @eq nat n (Init.Nat.mul m (S n0))), lt O (S n0) *) (* Goal: @eq nat O n *) (* Goal: not (@eq nat O n) *) apply lt_O_neq; auto with arith. (* Goal: forall (n0 : nat) (_ : forall _ : @eq nat n (Init.Nat.mul m n0), lt O n0) (_ : @eq nat n (Init.Nat.mul m (S n0))), lt O (S n0) *) (* Goal: @eq nat O n *) rewrite (mult_n_O m); auto with arith. (* Goal: forall (n0 : nat) (_ : forall _ : @eq nat n (Init.Nat.mul m n0), lt O n0) (_ : @eq nat n (Init.Nat.mul m (S n0))), lt O (S n0) *) auto with arith. Qed. Lemma lt_quotient2_n : forall n : nat, 0 < n -> forall q : nat, n = 2 * q -> q < n. Proof. (* Goal: forall (n : nat) (_ : lt O n) (q : nat) (_ : @eq nat n (Init.Nat.mul (S (S O)) q)), lt q n *) intros. (* Goal: lt q n *) rewrite (plus_n_O q). (* Goal: lt (Init.Nat.add q O) n *) rewrite H0. (* Goal: lt (Init.Nat.add q O) (Init.Nat.mul (S (S O)) q) *) elim plus_mult. (* Goal: lt (Init.Nat.add q O) (Init.Nat.add q q) *) apply plus_lt_compat_l. (* Goal: lt O q *) apply (no_zero_div n 2 H q H0). Qed. Hint Resolve lt_quotient2_n. Lemma less_div : forall n a b : nat, 0 < n -> n = a * b -> b <= n. Proof. (* Goal: forall (n a b : nat) (_ : lt O n) (_ : @eq nat n (Init.Nat.mul a b)), le b n *) intros. (* Goal: le b n *) rewrite H0. (* Goal: le b (Init.Nat.mul a b) *) elim (mult_O_le b a); auto with arith. (* Goal: forall _ : @eq nat a O, le b (Init.Nat.mul a b) *) intro. (* Goal: le b (Init.Nat.mul a b) *) absurd (n = 0). (* Goal: @eq nat n O *) (* Goal: not (@eq nat n O) *) unfold not in |- *; intro. (* Goal: @eq nat n O *) (* Goal: False *) elim (lt_irrefl n). (* Goal: @eq nat n O *) (* Goal: lt n n *) pattern n at 1 in |- *. (* Goal: @eq nat n O *) (* Goal: (fun n0 : nat => lt n0 n) n *) rewrite H2; auto with arith. (* Goal: @eq nat n O *) rewrite H0. (* Goal: @eq nat (Init.Nat.mul a b) O *) rewrite H1; auto with arith. Qed. Lemma even_or_odd : forall n : nat, {even n} + {odd n}. Proof. (* Goal: forall n : nat, sumbool (even n) (odd n) *) simple induction n. (* Goal: forall (n : nat) (_ : sumbool (even n) (odd n)), sumbool (even (S n)) (odd (S n)) *) (* Goal: sumbool (even O) (odd O) *) left; apply (even_intro 0 0); auto with arith. (* Goal: forall (n : nat) (_ : sumbool (even n) (odd n)), sumbool (even (S n)) (odd (S n)) *) intros y hrec. (* Goal: sumbool (even (S y)) (odd (S y)) *) elim hrec. (* Goal: forall _ : odd y, sumbool (even (S y)) (odd (S y)) *) (* Goal: forall _ : even y, sumbool (even (S y)) (odd (S y)) *) intro eveny. (* Goal: forall _ : odd y, sumbool (even (S y)) (odd (S y)) *) (* Goal: sumbool (even (S y)) (odd (S y)) *) right; elim eveny. (* Goal: forall _ : odd y, sumbool (even (S y)) (odd (S y)) *) (* Goal: forall (q : nat) (_ : @eq nat y (Init.Nat.mul (S (S O)) q)), odd (S y) *) intros q hy; apply (odd_intro (S y) q). (* Goal: forall _ : odd y, sumbool (even (S y)) (odd (S y)) *) (* Goal: @eq nat (S y) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O)) *) elim hy. (* Goal: forall _ : odd y, sumbool (even (S y)) (odd (S y)) *) (* Goal: @eq nat (S y) (Init.Nat.add y (S O)) *) elim plus_n_Sm. (* Goal: forall _ : odd y, sumbool (even (S y)) (odd (S y)) *) (* Goal: @eq nat (S y) (S (Init.Nat.add y O)) *) auto with arith. (* Goal: forall _ : odd y, sumbool (even (S y)) (odd (S y)) *) intro oddy; left. (* Goal: even (S y) *) elim oddy. (* Goal: forall (q : nat) (_ : @eq nat y (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))), even (S y) *) intros q hy; apply (even_intro (S y) (S q)). (* Goal: @eq nat (S y) (Init.Nat.mul (S (S O)) (S q)) *) rewrite hy. (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) (Init.Nat.mul (S (S O)) (S q)) *) rewrite plus_n_Sm. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S (S O))) (Init.Nat.mul (S (S O)) (S q)) *) elim (mult_comm (S q) 2). (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S (S O))) (Nat.mul (S q) (S (S O))) *) elim (mult_comm q 2). (* Goal: @eq nat (Init.Nat.add (Nat.mul q (S (S O))) (S (S O))) (Nat.mul (S q) (S (S O))) *) elim plus_comm. (* Goal: @eq nat (Nat.add (S (S O)) (Nat.mul q (S (S O)))) (Nat.mul (S q) (S (S O))) *) auto with arith. Qed. Lemma even_odd : forall a : nat, even a -> ~ odd a. Lemma odd_even : forall a : nat, odd a -> ~ even a. Proof. (* Goal: forall (a : nat) (_ : odd a), not (even a) *) unfold not in |- *; intros. (* Goal: False *) apply (even_odd a H0). (* Goal: odd a *) auto with arith. Qed. Lemma plus_even_even : forall a b : nat, even a -> even b -> even (a + b). Proof. (* Goal: forall (a b : nat) (_ : even a) (_ : even b), even (Init.Nat.add a b) *) intros. (* Goal: even (Init.Nat.add a b) *) elim H0; elim H. (* Goal: forall (q : nat) (_ : @eq nat a (Init.Nat.mul (S (S O)) q)) (q0 : nat) (_ : @eq nat b (Init.Nat.mul (S (S O)) q0)), even (Init.Nat.add a b) *) intros. (* Goal: even (Init.Nat.add a b) *) rewrite H2; rewrite H1. (* Goal: even (Init.Nat.add (Init.Nat.mul (S (S O)) q) (Init.Nat.mul (S (S O)) q0)) *) elim (mult_plus_distr_left q q0 2). (* Goal: even (Init.Nat.mul (S (S O)) (Init.Nat.add q q0)) *) apply (even_intro (2 * (q + q0)) (q + q0)). (* Goal: @eq nat (Init.Nat.mul (S (S O)) (Init.Nat.add q q0)) (Init.Nat.mul (S (S O)) (Init.Nat.add q q0)) *) auto with arith. Qed. Lemma S_odd_even : forall a : nat, odd a -> even (S a). Proof. (* Goal: forall (a : nat) (_ : odd a), even (S a) *) intros. (* Goal: even (S a) *) elim H; intros. (* Goal: even (S a) *) rewrite H0. (* Goal: even (S (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) *) rewrite (plus_n_Sm (2 * q) 1). (* Goal: even (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S (S O))) *) apply (plus_even_even (2 * q) 2). (* Goal: even (S (S O)) *) (* Goal: even (Init.Nat.mul (S (S O)) q) *) apply (even_intro (2 * q) q); auto with arith. (* Goal: even (S (S O)) *) apply (even_intro 2 1). (* Goal: @eq nat (S (S O)) (Init.Nat.mul (S (S O)) (S O)) *) auto with arith. Qed. Lemma pred_odd_even : forall a : nat, odd a -> even (pred a). Proof. (* Goal: forall (a : nat) (_ : odd a), even (Init.Nat.pred a) *) intros. (* Goal: even (Init.Nat.pred a) *) elim H; intros. (* Goal: even (Init.Nat.pred a) *) rewrite H0. (* Goal: even (Init.Nat.pred (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) *) elim (plus_n_Sm (2 * q) 0). (* Goal: even (Init.Nat.pred (S (Init.Nat.add (Init.Nat.mul (S (S O)) q) O))) *) elim (pred_Sn (2 * q + 0)). (* Goal: even (Init.Nat.add (Init.Nat.mul (S (S O)) q) O) *) elim (plus_n_O (2 * q)). (* Goal: even (Init.Nat.mul (S (S O)) q) *) apply (even_intro (2 * q) q); auto with arith. Qed. Lemma plus_even_odd : forall a b : nat, even a -> odd b -> odd (a + b). Proof. (* Goal: forall (a b : nat) (_ : even a) (_ : odd b), odd (Init.Nat.add a b) *) intros. (* Goal: odd (Init.Nat.add a b) *) elim H0; elim H; intros. (* Goal: odd (Init.Nat.add a b) *) rewrite H2; rewrite H1. (* Goal: odd (Init.Nat.add (Init.Nat.mul (S (S O)) q) (Init.Nat.add (Init.Nat.mul (S (S O)) q0) (S O))) *) rewrite (plus_assoc (2 * q) (2 * q0) 1). (* Goal: odd (Nat.add (Nat.add (Init.Nat.mul (S (S O)) q) (Init.Nat.mul (S (S O)) q0)) (S O)) *) elim (mult_plus_distr_left q q0 2). (* Goal: odd (Nat.add (Init.Nat.mul (S (S O)) (Init.Nat.add q q0)) (S O)) *) apply (odd_intro (2 * (q + q0) + 1) (q + q0)). (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (S (S O)) (Init.Nat.add q q0)) (S O)) (Init.Nat.add (Init.Nat.mul (S (S O)) (Init.Nat.add q q0)) (S O)) *) auto with arith. Qed. Hint Resolve plus_even_odd. Lemma plus_odd_even : forall a b : nat, odd a -> even b -> odd (a + b). Proof. (* Goal: forall (a b : nat) (_ : odd a) (_ : even b), odd (Init.Nat.add a b) *) intros. (* Goal: odd (Init.Nat.add a b) *) rewrite plus_comm. (* Goal: odd (Nat.add b a) *) auto with arith. Qed. Lemma S_even_odd : forall a : nat, even a -> odd (S a). Proof. (* Goal: forall (a : nat) (_ : even a), odd (S a) *) intros. (* Goal: odd (S a) *) elim H; intros. (* Goal: odd (S a) *) rewrite H0. (* Goal: odd (S (Init.Nat.mul (S (S O)) q)) *) apply (odd_intro (S (2 * q)) q). (* Goal: @eq nat (S (Init.Nat.mul (S (S O)) q)) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O)) *) elim (plus_n_Sm (2 * q) 0). (* Goal: @eq nat (S (Init.Nat.mul (S (S O)) q)) (S (Init.Nat.add (Init.Nat.mul (S (S O)) q) O)) *) auto with arith. Qed. Lemma plus_odd_odd : forall a b : nat, odd a -> odd b -> even (a + b). Proof. (* Goal: forall (a b : nat) (_ : odd a) (_ : odd b), even (Init.Nat.add a b) *) intros. (* Goal: even (Init.Nat.add a b) *) elim H0; elim H; intros. (* Goal: even (Init.Nat.add a b) *) rewrite H2; rewrite H1; intros. (* Goal: even (Init.Nat.add (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O)) (Init.Nat.add (Init.Nat.mul (S (S O)) q0) (S O))) *) rewrite (plus_comm (2 * q0) 1). (* Goal: even (Init.Nat.add (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O)) (Nat.add (S O) (Init.Nat.mul (S (S O)) q0))) *) rewrite (plus_assoc (2 * q + 1) 1 (2 * q0)). (* Goal: even (Nat.add (Nat.add (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O)) (S O)) (Init.Nat.mul (S (S O)) q0)) *) rewrite (plus_assoc_reverse (2 * q) 1 1). (* Goal: even (Nat.add (Init.Nat.add (Init.Nat.mul (S (S O)) q) (Init.Nat.add (S O) (S O))) (Init.Nat.mul (S (S O)) q0)) *) apply (plus_even_even (2 * q + (1 + 1)) (2 * q0)). (* Goal: even (Init.Nat.mul (S (S O)) q0) *) (* Goal: even (Init.Nat.add (Init.Nat.mul (S (S O)) q) (Init.Nat.add (S O) (S O))) *) apply (plus_even_even (2 * q) (1 + 1)). (* Goal: even (Init.Nat.mul (S (S O)) q0) *) (* Goal: even (Init.Nat.add (S O) (S O)) *) (* Goal: even (Init.Nat.mul (S (S O)) q) *) apply (even_intro (2 * q) q); auto with arith. (* Goal: even (Init.Nat.mul (S (S O)) q0) *) (* Goal: even (Init.Nat.add (S O) (S O)) *) apply (even_intro (1 + 1) 1); auto with arith. (* Goal: even (Init.Nat.mul (S (S O)) q0) *) apply (even_intro (2 * q0) q0); auto with arith. Qed. Lemma mult_even : forall a b : nat, even a -> even (a * b). Proof. (* Goal: forall (a b : nat) (_ : even a), even (Init.Nat.mul a b) *) intros. (* Goal: even (Init.Nat.mul a b) *) elim H. (* Goal: forall (q : nat) (_ : @eq nat a (Init.Nat.mul (S (S O)) q)), even (Init.Nat.mul a b) *) intros. (* Goal: even (Init.Nat.mul a b) *) apply (even_intro (a * b) (q * b)). (* Goal: @eq nat (Init.Nat.mul a b) (Init.Nat.mul (S (S O)) (Init.Nat.mul q b)) *) rewrite H0. (* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul (S (S O)) q) b) (Init.Nat.mul (S (S O)) (Init.Nat.mul q b)) *) auto with arith. Qed. Lemma mult_odd_odd : forall a b : nat, odd a -> odd b -> odd (a * b). Proof. (* Goal: forall (a b : nat) (_ : odd a) (_ : odd b), odd (Init.Nat.mul a b) *) intros. (* Goal: odd (Init.Nat.mul a b) *) elim H0; intros. (* Goal: odd (Init.Nat.mul a b) *) elim H; intros. (* Goal: odd (Init.Nat.mul a b) *) clear H0; clear H. (* Goal: odd (Init.Nat.mul a b) *) rewrite H2; rewrite H1. (* Goal: odd (Init.Nat.mul (Init.Nat.add (Init.Nat.mul (S (S O)) q0) (S O)) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) *) rewrite (mult_plus_distr_r (2 * q0) 1 (2 * q + 1)). (* Goal: odd (Nat.add (Nat.mul (Init.Nat.mul (S (S O)) q0) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) (Nat.mul (S O) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O)))) *) apply (plus_even_odd (2 * q0 * (2 * q + 1)) (1 * (2 * q + 1))). (* Goal: odd (Init.Nat.mul (S O) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) *) (* Goal: even (Init.Nat.mul (Init.Nat.mul (S (S O)) q0) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) *) apply (mult_even (2 * q0) (2 * q + 1)). (* Goal: odd (Init.Nat.mul (S O) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) *) (* Goal: even (Init.Nat.mul (S (S O)) q0) *) apply (even_intro (2 * q0) q0); auto with arith. (* Goal: odd (Init.Nat.mul (S O) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) *) apply (odd_intro (1 * (2 * q + 1)) q); auto with arith. Qed. Definition div (d a : nat) := exists k : nat, a = d * k. Lemma div_odd_even : forall n d : nat, div d (2 * n) -> odd d -> div d n. Proof. (* Goal: forall (n d : nat) (_ : div d (Init.Nat.mul (S (S O)) n)) (_ : odd d), div d n *) intros. (* Goal: div d n *) elim H. (* Goal: forall (x : nat) (_ : @eq nat (Init.Nat.mul (S (S O)) n) (Init.Nat.mul d x)), div d n *) intros. (* Goal: div d n *) cut (even x). (* Goal: even x *) (* Goal: forall _ : even x, div d n *) intro. (* Goal: even x *) (* Goal: div d n *) elim H2. (* Goal: even x *) (* Goal: forall (q : nat) (_ : @eq nat x (Init.Nat.mul (S (S O)) q)), div d n *) intros q evenx. (* Goal: even x *) (* Goal: div d n *) unfold div in |- *. (* Goal: even x *) (* Goal: @ex nat (fun k : nat => @eq nat n (Init.Nat.mul d k)) *) exists q. (* Goal: even x *) (* Goal: @eq nat n (Init.Nat.mul d q) *) apply (mult_reg_l_bis n (d * q) 2). (* Goal: even x *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) n) (Init.Nat.mul (S (S O)) (Init.Nat.mul d q)) *) (* Goal: lt O (S (S O)) *) auto with arith. (* Goal: even x *) (* Goal: @eq nat (Init.Nat.mul (S (S O)) n) (Init.Nat.mul (S (S O)) (Init.Nat.mul d q)) *) rewrite H1. (* Goal: even x *) (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.mul (S (S O)) (Init.Nat.mul d q)) *) rewrite evenx. (* Goal: even x *) (* Goal: @eq nat (Init.Nat.mul d (Init.Nat.mul (S (S O)) q)) (Init.Nat.mul (S (S O)) (Init.Nat.mul d q)) *) elim (mult_assoc_reverse 2 d q). (* Goal: even x *) (* Goal: @eq nat (Init.Nat.mul d (Init.Nat.mul (S (S O)) q)) (Init.Nat.mul (Init.Nat.mul (S (S O)) d) q) *) rewrite (mult_comm 2 d). (* Goal: even x *) (* Goal: @eq nat (Init.Nat.mul d (Init.Nat.mul (S (S O)) q)) (Init.Nat.mul (Nat.mul d (S (S O))) q) *) auto with arith. (* Goal: even x *) elim (even_or_odd x). (* Goal: forall _ : odd x, even x *) (* Goal: forall _ : even x, even x *) auto with arith. (* Goal: forall _ : odd x, even x *) intros. (* Goal: even x *) absurd (even (d * x)). (* Goal: even (Init.Nat.mul d x) *) (* Goal: not (even (Init.Nat.mul d x)) *) apply odd_even. (* Goal: even (Init.Nat.mul d x) *) (* Goal: odd (Init.Nat.mul d x) *) apply mult_odd_odd; auto with arith. (* Goal: even (Init.Nat.mul d x) *) cut (d * x = 2 * n); auto with arith. (* Goal: forall _ : @eq nat (Init.Nat.mul d x) (Init.Nat.mul (S (S O)) n), even (Init.Nat.mul d x) *) intro. (* Goal: even (Init.Nat.mul d x) *) apply (even_intro (d * x) n). (* Goal: @eq nat (Init.Nat.mul d x) (Init.Nat.mul (S (S O)) n) *) auto with arith. Qed. Lemma div_odd_odd : forall n : nat, odd n -> forall d : nat, div d n -> odd d. Proof. (* Goal: forall (n : nat) (_ : odd n) (d : nat) (_ : div d n), odd d *) intros n oddn d divdn. (* Goal: odd d *) elim divdn. (* Goal: forall (x : nat) (_ : @eq nat n (Init.Nat.mul d x)), odd d *) intros. (* Goal: odd d *) elim (even_or_odd d); auto with arith. (* Goal: forall _ : even d, odd d *) intros evend. (* Goal: odd d *) absurd (even n). (* Goal: even n *) (* Goal: not (even n) *) apply odd_even; auto with arith. (* Goal: even n *) rewrite H. (* Goal: even (Init.Nat.mul d x) *) apply mult_even; auto with arith. Qed. Lemma div_plus : forall n m d : nat, div d n -> div d m -> div d (n + m). Proof. (* Goal: forall (n m d : nat) (_ : div d n) (_ : div d m), div d (Init.Nat.add n m) *) intros n m d divdn divdm. (* Goal: div d (Init.Nat.add n m) *) elim divdm; intros; elim divdn; intros. (* Goal: div d (Init.Nat.add n m) *) rewrite H0; rewrite H. (* Goal: div d (Init.Nat.add (Init.Nat.mul d x0) (Init.Nat.mul d x)) *) elim mult_plus_distr_left. (* Goal: div d (Init.Nat.mul d (Init.Nat.add x0 x)) *) unfold div in |- *. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.mul d (Init.Nat.add x0 x)) (Init.Nat.mul d k)) *) exists (x0 + x); auto with arith. Qed. Hint Resolve div_plus. Lemma div_minus : forall n m d : nat, div d n -> div d m -> div d (n - m). Proof. (* Goal: forall (n m d : nat) (_ : div d n) (_ : div d m), div d (Init.Nat.sub n m) *) intros n m d divdn divdm. (* Goal: div d (Init.Nat.sub n m) *) elim divdm; intros; elim divdn; intros. (* Goal: div d (Init.Nat.sub n m) *) rewrite H0; rewrite H. (* Goal: div d (Init.Nat.sub (Init.Nat.mul d x0) (Init.Nat.mul d x)) *) elim (mult_minus_distr_left x0 x d). (* Goal: div d (Init.Nat.mul d (Init.Nat.sub x0 x)) *) unfold div in |- *. (* Goal: @ex nat (fun k : nat => @eq nat (Init.Nat.mul d (Init.Nat.sub x0 x)) (Init.Nat.mul d k)) *) exists (x0 - x); auto with arith. Qed. Hint Resolve div_minus. Inductive Even (n : nat) : Set := Even_intro : forall q : nat, n = 2 * q -> Even n. Inductive Odd (n : nat) : Set := Odd_intro : forall q : nat, n = 2 * q + 1 -> Odd n. Lemma Even_or_Odd : forall n : nat, Even n + Odd n. Proof. (* Goal: forall n : nat, sum (Even n) (Odd n) *) simple induction n. (* Goal: forall (n : nat) (_ : sum (Even n) (Odd n)), sum (Even (S n)) (Odd (S n)) *) (* Goal: sum (Even O) (Odd O) *) left; apply (Even_intro 0 0); auto with arith. (* Goal: forall (n : nat) (_ : sum (Even n) (Odd n)), sum (Even (S n)) (Odd (S n)) *) intros y hrec. (* Goal: sum (Even (S y)) (Odd (S y)) *) elim hrec. (* Goal: forall _ : Odd y, sum (Even (S y)) (Odd (S y)) *) (* Goal: forall _ : Even y, sum (Even (S y)) (Odd (S y)) *) intro eveny. (* Goal: forall _ : Odd y, sum (Even (S y)) (Odd (S y)) *) (* Goal: sum (Even (S y)) (Odd (S y)) *) right; elim eveny. (* Goal: forall _ : Odd y, sum (Even (S y)) (Odd (S y)) *) (* Goal: forall (q : nat) (_ : @eq nat y (Init.Nat.mul (S (S O)) q)), Odd (S y) *) intros q hy; apply (Odd_intro (S y) q). (* Goal: forall _ : Odd y, sum (Even (S y)) (Odd (S y)) *) (* Goal: @eq nat (S y) (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O)) *) elim hy. (* Goal: forall _ : Odd y, sum (Even (S y)) (Odd (S y)) *) (* Goal: @eq nat (S y) (Init.Nat.add y (S O)) *) elim plus_n_Sm. (* Goal: forall _ : Odd y, sum (Even (S y)) (Odd (S y)) *) (* Goal: @eq nat (S y) (S (Init.Nat.add y O)) *) auto with arith. (* Goal: forall _ : Odd y, sum (Even (S y)) (Odd (S y)) *) intro oddy; left. (* Goal: Even (S y) *) elim oddy. (* Goal: forall (q : nat) (_ : @eq nat y (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))), Even (S y) *) intros q hy; apply (Even_intro (S y) (S q)). (* Goal: @eq nat (S y) (Init.Nat.mul (S (S O)) (S q)) *) rewrite hy. (* Goal: @eq nat (S (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))) (Init.Nat.mul (S (S O)) (S q)) *) rewrite plus_n_Sm. (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S (S O))) (Init.Nat.mul (S (S O)) (S q)) *) elim (mult_comm (S q) 2). (* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S (S O))) (Nat.mul (S q) (S (S O))) *) elim (mult_comm q 2). (* Goal: @eq nat (Init.Nat.add (Nat.mul q (S (S O))) (S (S O))) (Nat.mul (S q) (S (S O))) *) elim plus_comm. (* Goal: @eq nat (Nat.add (S (S O)) (Nat.mul q (S (S O)))) (Nat.mul (S q) (S (S O))) *) auto with arith. Qed. Lemma Odd_odd : forall n : nat, Odd n -> odd n. Proof. (* Goal: forall (n : nat) (_ : Odd n), odd n *) intros. (* Goal: odd n *) elim H. (* Goal: forall (q : nat) (_ : @eq nat n (Init.Nat.add (Init.Nat.mul (S (S O)) q) (S O))), odd n *) intros. (* Goal: odd n *) apply (odd_intro n q e). Qed. Hint Resolve Odd_odd.